管理端注释添加完成

This commit is contained in:
mabo
2021-07-27 15:59:34 +08:00
parent 59e1aedbf3
commit eb4a5e4fdc
44 changed files with 485 additions and 996 deletions

View File

@@ -59,7 +59,6 @@ import {
} from "@/api/index";
export default {
name: "customWords",
components: {},
data() {
return {
loading: true, // 表单加载状态
@@ -83,7 +82,7 @@ export default {
name: [
{
required: true,
message: "请输入敏感词",
message: "请输入自定义分词",
trigger: "blur",
},
],
@@ -180,37 +179,23 @@ export default {
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
// 重新加载数据
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
// 选中状态变更
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
// 获取列表数据
getDataList() {
this.loading = true;
@@ -224,13 +209,13 @@ export default {
this.total = this.data.length;
this.loading = false;
},
// 提交数据
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
if (this.modalType == 0) {
// 添加 避免编辑后传入id等数据 记得删除
delete this.form.id;
insertCustomWords(this.form).then((res) => {
this.submitLoading = false;
@@ -255,6 +240,7 @@ export default {
}
});
},
// 添加
add() {
this.modalType = 0;
this.modalTitle = "添加";
@@ -263,6 +249,7 @@ export default {
this.modalVisible = true;
},
// 修改
detail(v) {
this.modalType = 1;
this.id = v.id;
@@ -270,6 +257,7 @@ export default {
this.modalVisible = true;
this.form.name = v.name;
},
// 删除
remove(v) {
this.$Modal.confirm({
title: "确认删除",
@@ -288,6 +276,7 @@ export default {
},
});
},
// 批量删除
delAll() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要删除的数据");