| | |
| | | </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" |
| | |
| | | |
| | | <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: { |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | }, |
| | | 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; |
| | |
| | | }, |
| | | rowClick(row) { |
| | | this.itemForm.itemData = row; |
| | | this.selectRow = row.$index; |
| | | this.selectRow = row; |
| | | this.attribute = row; |
| | | |
| | | this.$refs.crud.toggleSelection(); |
| | |
| | | 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'; |