| | |
| | | |
| | | <script> |
| | | import { |
| | | insertDict, |
| | | CountDict, |
| | | SelectDict, |
| | | DeletestDict, |
| | | UpdateDict, |
| | | QueryNamesDict, |
| | | |
| | | |
| | | |
| | | |
| | | } from "../../api/api"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | export default { |
| | |
| | | }) |
| | | .then(() => { |
| | | this.dialogFormVisible = false; |
| | | UpdateDict(this.upform).then((res) => { |
| | | console.log(res); |
| | | }); |
| | | |
| | | this.$message({ |
| | | message: "修改成功", |
| | | type: "success", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | DeletestDict([row.id]); |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | |
| | | .then(() => { |
| | | this.InsertFormdialog = false; |
| | | |
| | | insertDict(this.insertform).then((res) => { |
| | | if ((res.statusText = "OK" && res.data > 0)) { |
| | | this.$message({ |
| | | message: "添加成功", |
| | | type: "success", |
| | | }); |
| | | this.startFromData(); |
| | | this.insertform = {}; |
| | | } else { |
| | | this.$message({ |
| | | message: "添加失败", |
| | | type: "error", |
| | | }); |
| | | this.insertform = {}; |
| | | } |
| | | }); |
| | | |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | countFromData(name) { |
| | | CountDict(name).then((res) => { |
| | | this.count = res.data; |
| | | }); |
| | | |
| | | }, |
| | | selectFromData(size, index, name) { |
| | | SelectDict(size, index, name).then((res) => { |
| | | this.tableData = res.data; |
| | | }); |
| | | |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val; |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | DeletestDict(std); |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | |
| | | this.countFromData(this.searchName); |
| | | }, |
| | | startQueryNameData() { |
| | | QueryNamesDict().then((res) => { |
| | | console.log(res); |
| | | for (var i in res.data) { |
| | | this.selectName.push({ |
| | | value: res.data[i].name, |
| | | label: res.data[i].name, |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | changeQueryName(val) { |
| | | this.searchName = val; |