|
@ -1,44 +1,45 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
<el-form |
|
|
<el-form |
|
|
ref="queryForm" |
|
|
|
|
|
:model="listQuery" |
|
|
|
|
|
:inline="true" |
|
|
|
|
|
label-width="68px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form-item label="专题" prop="special_id"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="listQuery.special_id" |
|
|
|
|
|
placeholder="专题" |
|
|
|
|
|
clearable |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="width: 160px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in subject" |
|
|
|
|
|
:key="dict.special_id" |
|
|
|
|
|
:label="dict.title" |
|
|
|
|
|
:value="dict.special_id" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
icon="el-icon-search" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="getList" |
|
|
|
|
|
>搜索</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
ref="queryForm" |
|
|
|
|
|
:model="listQuery" |
|
|
|
|
|
:inline="true" |
|
|
|
|
|
label-width="68px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form-item label="专题" prop="special_id"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="listQuery.special_id" |
|
|
|
|
|
placeholder="专题" |
|
|
|
|
|
clearable |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="width: 160px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in subject" |
|
|
|
|
|
:key="dict.special_id" |
|
|
|
|
|
:label="dict.title" |
|
|
|
|
|
:value="dict.special_id" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
icon="el-icon-search" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="getList" |
|
|
|
|
|
>搜索</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
<div class="filter-container"> |
|
|
<div class="filter-container"> |
|
|
<el-button |
|
|
<el-button |
|
|
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="handleCreate" |
|
|
@click="handleCreate" |
|
|
>添加文章</el-button> |
|
|
|
|
|
|
|
|
>添加文章</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<el-table |
|
|
<el-table |
|
|
:key="tableKey" |
|
|
:key="tableKey" |
|
@ -163,9 +164,7 @@ import { |
|
|
delSubjectArticle, |
|
|
delSubjectArticle, |
|
|
} from "@/api/subject"; |
|
|
} from "@/api/subject"; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
searchArticle, |
|
|
|
|
|
} from "@/api/ad"; |
|
|
|
|
|
|
|
|
import { searchArticle } from "@/api/ad"; |
|
|
|
|
|
|
|
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|
|
|
|
|
|
|
@ -181,7 +180,7 @@ export default { |
|
|
listQuery: { |
|
|
listQuery: { |
|
|
page: 1, |
|
|
page: 1, |
|
|
limit: 20, |
|
|
limit: 20, |
|
|
special_id: undefined |
|
|
|
|
|
|
|
|
special_id: undefined, |
|
|
}, |
|
|
}, |
|
|
subject: [], |
|
|
subject: [], |
|
|
uploadAction: process.env.VUE_APP_BASE_API + "/files/uploadFile", |
|
|
uploadAction: process.env.VUE_APP_BASE_API + "/files/uploadFile", |
|
@ -208,7 +207,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.getSubjectList() |
|
|
|
|
|
|
|
|
this.getSubjectList(); |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
}, |
|
|
}, |
|
|
filters: { |
|
|
filters: { |
|
@ -253,9 +252,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
resetTemp() { |
|
|
resetTemp() { |
|
|
this.temp = { |
|
|
this.temp = { |
|
|
id: undefined, |
|
|
|
|
|
special_id: undefined, |
|
|
|
|
|
article_id: undefined, |
|
|
|
|
|
|
|
|
id: undefined, |
|
|
|
|
|
special_id: undefined, |
|
|
|
|
|
article_id: undefined, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
submitForm() { |
|
|
submitForm() { |
|
@ -285,33 +284,33 @@ export default { |
|
|
// } |
|
|
// } |
|
|
// }) |
|
|
// }) |
|
|
}, |
|
|
}, |
|
|
handleDelete({ article_title, article_id, special_id }) { |
|
|
|
|
|
this.$confirm('是否确认删除名称为"' + article_title + '"的数据项?', "警告", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}) |
|
|
|
|
|
.then(function () { |
|
|
|
|
|
return delSubjectArticle({ article_id, special_id }); |
|
|
|
|
|
}) |
|
|
|
|
|
.then((response) => { |
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: "删除成功", |
|
|
|
|
|
type: "success", |
|
|
|
|
|
duration: 2 * 1000, |
|
|
|
|
|
}); |
|
|
|
|
|
this.open = false; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: "删除失败", |
|
|
|
|
|
type: "error", |
|
|
|
|
|
duration: 2 * 1000, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(function () {}); |
|
|
|
|
|
|
|
|
async handleDelete({ article_title, article_id, special_id }) { |
|
|
|
|
|
let confirm = this.$confirm( |
|
|
|
|
|
'是否确认删除名称为"' + article_title + '"的数据项?', |
|
|
|
|
|
"警告", |
|
|
|
|
|
{ |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
console.log(1); |
|
|
|
|
|
let r = await delSubjectArticle({ article_id, special_id }); |
|
|
|
|
|
if (r.code === 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: "删除成功", |
|
|
|
|
|
type: "success", |
|
|
|
|
|
duration: 2 * 1000, |
|
|
|
|
|
}); |
|
|
|
|
|
this.open = false; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: "删除失败", |
|
|
|
|
|
type: "error", |
|
|
|
|
|
duration: 2 * 1000, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSelectBranch(item) { |
|
|
handleSelectBranch(item) { |
|
|