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