|
|
@ -22,7 +22,7 @@ |
|
|
|
<el-form> |
|
|
|
<el-form-item label="文章标题" prop="title"> |
|
|
|
<el-input |
|
|
|
v-model="article_title" |
|
|
|
v-model="listQuery.article_title" |
|
|
|
placeholder="请输入文章标题" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
@ -33,6 +33,7 @@ |
|
|
|
class="filter-item el-button el-button--primary el-button--mini" |
|
|
|
type="primary" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="getList('search')" |
|
|
|
>搜索</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
@ -62,7 +63,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="专题" align="center"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<span>{{ row.special_id | getSubjectName(subject) }}</span> |
|
|
|
<span>{{ row.title }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="标题" align="center"> |
|
|
@ -106,6 +107,7 @@ |
|
|
|
:limit.sync="listQuery.limit" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
<div style="display: block; height: 20px"></div> |
|
|
|
<!-- 添加或修改分类对话框 --> |
|
|
|
<el-drawer |
|
|
|
ref="drawer" |
|
|
@ -182,6 +184,7 @@ export default { |
|
|
|
page: 1, |
|
|
|
limit: 20, |
|
|
|
special_id: undefined, |
|
|
|
article_title: "", |
|
|
|
}, |
|
|
|
subject: [], |
|
|
|
temp: { |
|
|
@ -206,20 +209,11 @@ export default { |
|
|
|
this.getSubjectList(); |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
getSubjectName(id, subject) { |
|
|
|
for (var i = 0; i < subject.length; i++) { |
|
|
|
if (id == subject[i].special_id) { |
|
|
|
return subject[i].title; |
|
|
|
} |
|
|
|
} |
|
|
|
return ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 点击树形结构 |
|
|
|
handleNodeClick(data) { |
|
|
|
this.listQuery.special_id = data.id; |
|
|
|
this.listQuery.article_title = ""; |
|
|
|
this.defaultProps = data; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
@ -239,12 +233,14 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
getList(id) { |
|
|
|
if (id == "search") { |
|
|
|
this.listQuery.page = 1; |
|
|
|
} |
|
|
|
this.listLoading = true; |
|
|
|
listSubjectArticle(this.listQuery).then((response) => { |
|
|
|
this.list = response.data.list; |
|
|
|
this.total = response.data.count; |
|
|
|
|
|
|
|
// Just to simulate the time of the request |
|
|
|
setTimeout(() => { |
|
|
|
this.listLoading = false; |
|
|
@ -332,8 +328,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectBranch(item) { |
|
|
|
console.log("远程搜索选中后返回的item:::::即value的值"); |
|
|
|
console.log(item); |
|
|
|
//如果要获取选择的 id或者名字 从item中取值 |
|
|
|
this.$set(this.temp, "article_id", item); |
|
|
|
}, |
|
|
|