From 9cc440df58642761cd7361786351e91b9fa62a79 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 22 八月 2023 11:16:20 +0800 Subject: [PATCH] 接口配置页面 --- Source/UBCS-WEB/src/views/docking/info.vue | 64 +++++++++++++++++++++++-------- 1 files changed, 47 insertions(+), 17 deletions(-) diff --git a/Source/UBCS-WEB/src/views/docking/info.vue b/Source/UBCS-WEB/src/views/docking/info.vue index 538f1e0..238b5f3 100644 --- a/Source/UBCS-WEB/src/views/docking/info.vue +++ b/Source/UBCS-WEB/src/views/docking/info.vue @@ -26,7 +26,7 @@ </avue-crud> </basic-container> </el-main> - <originalAdd ref="originalAdd" @refreshTable="refreshChange" :attribute="editAttribute"></originalAdd> + <infoForm ref="infoForm" @refreshTable="refreshChange" :formData="editAttribute"></infoForm> <!-- 楂樼骇鏌ヨ瀵硅瘽妗� --> <advanced-query :ref="advancedQueryParam.ref" @@ -39,16 +39,14 @@ <script> import { - getList, - remove, - add, - update, getPage, getApplyRange -} from "@/api/omd/OmdAttribute"; + getList,add,edit,del,push,updateStatus +} from "@/api/docking/info"; import {getDictionary} from "@/api/omd/enum"; -import {mapGetters} from "vuex"; +import infoForm from "./infoForm.vue"; export default { name: "info", + components:{infoForm}, data() { return { page: { @@ -223,22 +221,22 @@ this.onLoad(this.page, this.query); }, addSave() { - this.$refs.originalAdd.showSubmitDialog = true; + this.$refs.infoForm.showSubmitDialog = true; const newAttr = {}; newAttr.nullable = true; - this.$refs.originalAdd.attribute = newAttr; + this.$refs.infoForm.formData = newAttr; }, updateSave(row,index) { this.selectRow = index; var json = JSON.stringify(row); this.editAttribute = JSON.parse(json); this.editAttribute.nullable = row.nullable == 'true' ? true : false; - this.$refs.originalAdd.attribute = this.editAttribute; - this.$refs.originalAdd.showSubmitDialog = true; + this.$refs.infoForm.attribute = this.editAttribute; + this.$refs.infoForm.showSubmitDialog = true; this.checkUsingReferDict(row); - this.$refs.originalAdd.activeName = this.itemForm.activeName; - this.$refs.originalAdd.enumInitFlag = this.itemForm.enumInitFlag; - this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag; + this.$refs.infoForm.activeName = this.itemForm.activeName; + this.$refs.infoForm.enumInitFlag = this.itemForm.enumInitFlag; + this.$refs.infoForm.referInitFlag = this.itemForm.referInitFlag; // this.refreshChange() }, deleteSave(row,index) { @@ -254,6 +252,38 @@ this.refreshChange(); }); }); + }, + ENABLE(row,index){ + //鍚敤 + this.updateStatus("enable"); + }, + DISABLE(row,index){ + //鍋滅敤 + this.updateStatus("disable"); + }, + updateStatus(able){ + var that = this; + var paramTemp = { + update:able, + oid:this.selectRow.oid, + ts:this.selectRow.ts + }; + this.$confirm("鏄惁瑕�"+(able == "enbale" ? "鍚敤" : (able == "disable" ? "鍋滅敤": "鍙戝竷")) +"杩欐潯鏁版嵁锛�", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + return updateStatus(paramTemp); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message:(able == "enbale" ? "鍚敤鎴愬姛" : (able == "disable" ? "鍋滅敤鎴愬姛": "鍙戝竷鎴愬姛")) + }); + this.$refs.crud.toggleSelection(); + }); }, PUSH(){ if (this.selectionList.length != 1) { @@ -279,7 +309,7 @@ }, onLoad(page, params = {}) { this.loading = true; - getPage(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => { + getList(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => { const data = res.data.data; this.page.total = data.total; this.data = data.records; @@ -290,7 +320,7 @@ }, rowClick(row) { this.itemForm.itemData = row; - this.selectRow = row.$index; + this.selectRow = row; this.attribute = row; this.$refs.crud.toggleSelection(); @@ -309,7 +339,7 @@ getDictionary({code: row.dictCode}).then(res => { this.editAttribute.dictValue = res.data.data[0].label; this.itemForm.itemData.dictValue = this.editAttribute.dictValue; - this.$refs.originalAdd.dictEnums = res.data.data; + this.$refs.infoForm.dictEnums = res.data.data; }) }else { this.itemForm.activeName = 'referTab'; -- Gitblit v1.9.3