| | |
| | | this.option.column = [{ |
| | | prop: 'id', |
| | | label: 'è±æåç§°', |
| | | sort: true, |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
| | | prop: 'name', |
| | | label: '䏿åç§°', |
| | | sort: true, |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud v-model="form" ref="crud" :option="option" :data="data" @on-load="onLoad" :page.sync="page" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @row-click="rowClick"> |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave(row,index)">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave(row,index)">å é¤</el-button> |
| | | <el-button v-if="row.usedflag=='false'" icon="el-icon-position" size="small" type="text" @click="ENABLE(row,index)">å¯ç¨</el-button> |
| | | <el-button v-else icon="el-icon-finished" size="small" type="text" @click="DISABLE(row,index)">åç¨</el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave">æ° å¢ |
| | | </el-button> |
| | | <el-button size="small" icon="el-icon-share" @click="PUSH">å æ¥ |
| | | </el-button> |
| | | <el-button size="small" icon="el-icon-search" @click="openAdvancedQuery">æ¥ è¯¢ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <originalAdd ref="originalAdd" @refreshTable="refreshChange" :attribute="editAttribute"></originalAdd> |
| | | <!-- é«çº§æ¥è¯¢å¯¹è¯æ¡ --> |
| | | <advanced-query |
| | | :ref="advancedQueryParam.ref" |
| | | :options="advancedQueryParam.options" |
| | | :visible.sync="advancedQueryParam.advancedQuerySettingBox" |
| | | @echoContion="echoSeniorContionMap"> |
| | | </advanced-query> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getList, |
| | | remove, |
| | | add, |
| | | update, getPage, getApplyRange |
| | | } from "@/api/omd/OmdAttribute"; |
| | | import {getDictionary} from "@/api/omd/enum"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "info", |
| | | data() { |
| | | return { |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 100 |
| | | }, |
| | | selectRow: "", |
| | | data: [], |
| | | form: {}, |
| | | attribute: { |
| | | nullable: true |
| | | }, |
| | | editAttribute: {}, |
| | | applyRangeData: [], |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 20, |
| | | tip: false, |
| | | headerAlign: "center", |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | searchShow: false, |
| | | searchMenuSpan: 6, |
| | | rowKey: "id", |
| | | tabs: true, |
| | | stripe: true, |
| | | indexFixed: false, |
| | | menuWidth: 300, |
| | | highlightCurrentRow: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | columnBtn: false, |
| | | column: [{ |
| | | label: 'æ¨éç±»å', |
| | | field: 'pushTypeText', |
| | | sortable: true, |
| | | width: 150, |
| | | type: 'select', |
| | | dicData: this.pushType, |
| | | props: { |
| | | label: "value", |
| | | value: "key" |
| | | }, |
| | | }, { |
| | | label: 'ç³»ç»åç§°', |
| | | prop: 'sysbasename', |
| | | sortable: true, |
| | | search: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'ç³»ç»ç¼å·', |
| | | prop: 'sysbaseid', |
| | | sortable: true, |
| | | search: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'æ¥å£å½æ°', |
| | | prop: 'interfaceFunction', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'å½å空é´', |
| | | prop: 'namespace', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'soapAction', |
| | | prop: 'soapaction', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'åæ°åç§°', |
| | | prop: 'targName', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'è°ç¨æ¹å¼', |
| | | prop: 'cxfaxis', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: '请æ±å°å', |
| | | prop: 'requesturl', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'åæ°ç±»å', |
| | | prop: 'paramtype', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | | label: 'è¿åå¼ç±»å', |
| | | prop: 'returntype', |
| | | sortable: true, |
| | | width: 150 |
| | | }] |
| | | }, |
| | | itemForm: { |
| | | itemData: {}, |
| | | activeName: "referTab", |
| | | enumInitFlag: false, |
| | | referInitFlag: false, |
| | | form: {} |
| | | }, |
| | | pushType: [{key: '1', value: 'æ°æ®æ¨é'}, |
| | | {key: '2', value: 'åç±»æ¨é'}, |
| | | {key: '3', value: 'ç¼ç ç³è¯·'}, |
| | | {key: '4', value: 'ç¼ç æ´æ¹ï¼ç¶æãåæ¶ï¼'}, |
| | | {key: '5', value: 'åç±»æ¥è¯¢'}, |
| | | {key: '6', value: 'å«è§åä¿¡æ¯çåç±»æ¥è¯¢'}, |
| | | {key: '7', value: 'æ°æ®æ¥è¯¢'}], |
| | | // é«çº§æ¥è¯¢å¯¹è¯æ¡ç¸å
³åæ° |
| | | advancedQueryParam: { |
| | | ref: 'advancedQuery', |
| | | advancedQuerySettingBox: false, |
| | | options: [], |
| | | currentOpen: '', //å½åæå¼é«çº§æ¥è¯¢ççªå£æ¯ |
| | | //conditionMapParams: {}, |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | oids() { |
| | | let oids = []; |
| | | this.selectionList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | if(this.selectionList.length <= 0){ |
| | | this.itemForm.itemData = null |
| | | this.selectRow = null |
| | | this.attribute = null |
| | | } |
| | | if (this.selectionList.length > 0) { |
| | | this.itemForm.itemData = this.selectionList[list.length-1]; |
| | | this.selectRow = this.selectionList[list.length-1].$index; |
| | | this.attribute = this.selectionList[list.length-1]; |
| | | } |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | addSave() { |
| | | this.$refs.originalAdd.showSubmitDialog = true; |
| | | const newAttr = {}; |
| | | newAttr.nullable = true; |
| | | this.$refs.originalAdd.attribute = 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.checkUsingReferDict(row); |
| | | this.$refs.originalAdd.activeName = this.itemForm.activeName; |
| | | this.$refs.originalAdd.enumInitFlag = this.itemForm.enumInitFlag; |
| | | this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag; |
| | | // this.refreshChange() |
| | | }, |
| | | deleteSave(row,index) { |
| | | this.$confirm("å é¤å
æ°æ®å°æ æ³è¢«æ¢å¤, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | iconClass: 'el-icon-question', |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | showClose: true, |
| | | type: "warning" |
| | | }).then(() => { |
| | | remove(row.oid).then(res => { |
| | | this.$message.success("å 餿å"); |
| | | this.refreshChange(); |
| | | }); |
| | | }); |
| | | }, |
| | | PUSH(){ |
| | | if (this.selectionList.length != 1) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®') |
| | | return false; |
| | | } |
| | | this.$confirm("æ¯å¦è¦"+ (this.selectionList[0].pushType == "1" ? "æ¨éæ°æ®" : "æ¨éåç±»"), { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return push(this.oids.split(',')); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getPage(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; |
| | | this.loading = false; |
| | | this.data = res.data.data.records; |
| | | this.itemData = this.data[0]; |
| | | }); |
| | | }, |
| | | rowClick(row) { |
| | | this.itemForm.itemData = row; |
| | | this.selectRow = row.$index; |
| | | this.attribute = row; |
| | | |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | //this.checkUsingReferDict(row); |
| | | }, |
| | | checkUsingReferDict(row){ |
| | | if (row.referToId !== null && row.referToId !== ""){ |
| | | this.itemForm.activeName = 'referTab'; |
| | | this.itemForm.referInitFlag = true; |
| | | this.itemForm.enumInitFlag = false; |
| | | }else if (row.usingDict === 'true'){ |
| | | this.itemForm.activeName = 'enumTab'; |
| | | this.itemForm.referInitFlag = false; |
| | | this.itemForm.enumInitFlag = true; |
| | | 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; |
| | | }) |
| | | }else { |
| | | this.itemForm.activeName = 'referTab'; |
| | | this.itemForm.referInitFlag = true; |
| | | this.itemForm.enumInitFlag = false; |
| | | } |
| | | }, |
| | | selectBtmType() { |
| | | this.referType.display = true; |
| | | this.referType.title = "è¯·éæ©" + this.referType.value; |
| | | }, |
| | | applyRangeOpen() { |
| | | if (!this.selectRow && this.selectRow != 0) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请å
鿩屿§" |
| | | }); |
| | | } |
| | | var oid = this.data[this.selectRow].oid; |
| | | getApplyRange(oid).then(res => { |
| | | this.applyRangeData = res.data.data; |
| | | this.$refs.applyRange.rangeData = this.applyRangeData; |
| | | this.$refs.applyRange.showDialog = true; |
| | | |
| | | }); |
| | | }, |
| | | /** é«çº§æ¥è¯¢å¯¹è¯æ¡ç»ä»¶,ç»ä»¶è¿åç弿¯condtionMap[field]å½¢å¼çæ¥è¯¢æ¡ä»¶ï¼ä¿çäºåä¹å䏿 ·çæ¹å¼ */ |
| | | echoSeniorContionMap(conditionMaps){ |
| | | if(JSON.stringify(conditionMaps)!='{}'){ |
| | | this.query = conditionMaps; |
| | | this.onLoad(this.page); |
| | | } |
| | | }, |
| | | openAdvancedQuery(){ |
| | | this.advancedQueryParam.options = [ |
| | | { |
| | | data: [], |
| | | title: 'ç¼å·', |
| | | fieldType: 'text', |
| | | queryField: 'id', |
| | | },{ |
| | | data: [], |
| | | title: 'åç§°', |
| | | fieldType: 'text', |
| | | queryField: 'name', |
| | | },{ |
| | | data: [], |
| | | title: 'æè¿°', |
| | | fieldType: 'text', |
| | | queryField: 'description', |
| | | },{ |
| | | data: [ |
| | | // { |
| | | // key: 'ç¼è¾ä¸', |
| | | // value: 'Editing', |
| | | // }, |
| | | // { |
| | | // key: 'å·²åå¸', |
| | | // value: 'Released', |
| | | // }, |
| | | // { |
| | | // key: 'åç¨', |
| | | // value: 'Disabled', |
| | | // }, |
| | | ], |
| | | title: 'ç¶æ', |
| | | fieldType: 'combox', |
| | | queryField: 'lcStatus', |
| | | comboxKey: 'codeSearchLCStatus', |
| | | }, |
| | | ] |
| | | |
| | | this.advancedQueryParam.currentOpen = 'info'; |
| | | this.advancedQueryParam.advancedQuerySettingBox = true; |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .applyRangeTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | </style> |