pzy 3 years ago
parent
commit
dc3f7788e6
  1. 31
      src/views/article/subject/article.vue

31
src/views/article/subject/article.vue

@ -38,7 +38,8 @@
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: {
@ -285,17 +284,19 @@ export default {
// } // }
// }) // })
}, },
handleDelete({ article_title, article_id, special_id }) {
this.$confirm('是否确认删除名称为"' + article_title + '"的数据项?', "警告", {
async handleDelete({ article_title, article_id, special_id }) {
let confirm = this.$confirm(
'是否确认删除名称为"' + article_title + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
})
.then(function () {
return delSubjectArticle({ article_id, special_id });
})
.then((response) => {
if (response.code === 200) {
}
);
console.log(1);
let r = await delSubjectArticle({ article_id, special_id });
if (r.code === 200) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
type: "success", type: "success",
@ -310,8 +311,6 @@ export default {
duration: 2 * 1000, duration: 2 * 1000,
}); });
} }
})
.catch(function () {});
}, },
handleSelectBranch(item) { handleSelectBranch(item) {

Loading…
Cancel
Save