From 153a4048e410a789a0da4eda0af09b2ca645bec3 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 12 十月 2023 10:24:08 +0800 Subject: [PATCH] 系统管理-取消列显隐 --- Source/UBCS-WEB/src/views/system/tenant.vue | 292 ++++++++++++++++++++++++++++++---------------------------- 1 files changed, 150 insertions(+), 142 deletions(-) diff --git a/Source/UBCS-WEB/src/views/system/tenant.vue b/Source/UBCS-WEB/src/views/system/tenant.vue index be50ba3..5effe12 100644 --- a/Source/UBCS-WEB/src/views/system/tenant.vue +++ b/Source/UBCS-WEB/src/views/system/tenant.vue @@ -1,6 +1,6 @@ <template> <basic-container> - <avue-crud :option="option" + <avue-crud :option="this.option" :table-loading="loading" :data="data" ref="crud" @@ -13,6 +13,7 @@ @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" + @row-click="clickRowChange" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @@ -26,14 +27,6 @@ plain @click="handleDelete">鍒� 闄� </el-button> - <el-tooltip class="item" effect="dark" content="缁欑鎴烽厤缃处鍙烽搴︺�佽繃鏈熸椂闂寸瓑鎺堟潈淇℃伅" placement="top"> - <el-button size="small" - plain - v-if="userInfo.role_name.includes('administrator')" - icon="el-icon-setting" - @click="handleSetting">鎺堟潈閰嶇疆 - </el-button> - </el-tooltip> <el-tooltip class="item" effect="dark" content="缁欑鎴烽厤缃嫭绔嬫暟鎹簮浠ュ疄鐜版暟鎹簱闅旂" placement="top"> <el-button size="small" plain @@ -97,7 +90,7 @@ remove, update, add, - setting, + // setting, datasource, packageInfo, packageSetting @@ -122,117 +115,6 @@ pageSize: 10, currentPage: 1, total: 0 - }, - option: { - height: 'auto', - calcHeight: 30, - tip: false, - searchShow: true, - searchMenuSpan: 6, - border: true, - index: true, - selection: true, - viewBtn: true, - dialogWidth: 900, - dialogClickModal: false, - column: [ - - { - label: "绉熸埛ID", - prop: "tenantId", - width: 100, - search: true, - addDisplay: false, - editDisplay: false, - span: 24, - rules: [{ - required: true, - message: "璇疯緭鍏ョ鎴稩D", - trigger: "blur" - }] - }, - { - label: "鍏ㄧО", - prop: "fullName", - width: 120, - span:24, - rules: [{ - required: true, - message: "璇疯緭鍏ュ叏绉�", - trigger: "blur" - }] - }, - { - label: "绉熸埛鍚嶇О", - prop: "tenantName", - search: true, - width: 180, - span: 24, - rules: [{ - required: true, - message: "璇疯緭鍏ュ弬鏁板悕绉�", - trigger: "blur" - }] - }, - { - label: "鑱旂郴浜�", - prop: "linkman", - width: 150, - search: true, - rules: [{ - required: true, - message: "璇疯緭鍏ヨ仈绯讳汉", - trigger: "blur" - }] - }, - { - label: "鑱旂郴鐢佃瘽", - prop: "contactNumber", - width: 150, - }, - { - label: "鑱旂郴鍦板潃", - prop: "address", - span: 24, - minRows: 2, - type: "textarea", - hide: true, - }, - { - label: '寮�鍚笁鍛�', - prop: 'ssaEnable', - type: 'radio', - width: 100, - value:0, - disabled:Boolean, - dicData: [{ - label: '寮�鍚�', - value: 0 - }, { - label: '涓嶅紑鍚�', - value: 1 - },], - }, - { - label: "缁戝畾鍩熷悕", - prop: "domainUrl", - span: 24, - }, - { - label: "绯荤粺鑳屾櫙", - prop: "backgroundUrl", - type: 'upload', - listType: 'picture-img', - dataType: 'string', - action: '/api/blade-resource/oss/endpoint/put-file', - propsHttp: { - res: 'data', - url: 'link', - }, - hide: true, - span: 24, - }, - ] }, data: [], settingForm: {}, @@ -263,7 +145,7 @@ search: true, span: 24, type: "select", - dicUrl: "/api/blade-develop/datasource/select", + dicUrl: "/api/ubcs-develop/datasource/select", props: { label: "name", value: "id" @@ -285,7 +167,7 @@ search: true, span: 24, type: "select", - dicUrl: "/api/blade-system/tenant-package/select", + dicUrl: "/api/ubcs-system/tenant-package/select", props: { label: "packageName", value: "id" @@ -305,14 +187,12 @@ }, ] }, + BooleanFlag:Boolean, }; }, created() { - // 鑾峰彇鍒皌rue杩樻槸false鐩存帴璧嬪�硷紝瀹氫箟鏂规硶浼氬氨鏄幏鍙栦笉鍒帮紝涓嶇煡閬撲粈涔堥棶棰橈紝寮哄埗鐢↗SON.parse浼氬湪鍚庨潰杩藉姞涓�涓猟isabled锛屾墍浠ョ洿鎺ヨ幏鍙栥�傚悗鏈熷鏋滄坊鍔燾loumn浼氬嚭鐜癰ug锛岀敤foreach寰幆鍑篶olumn鍦ㄥ垽鏂璽ype鏄惁绛変簬radio锛岀劧鍚庡皢鍗曠嫭radio鐨刣isabled鏀逛负res.data.data - this.$axios.get('/api/blade-system/tenant/find-ssa-enable').then(res => { - this.option.column[6].disabled= res.data.data - }); + this.initBoolean() }, watch: { 'packageForm.packageId'() { @@ -343,9 +223,130 @@ }, tenantId() { return this.selectionList[0].tenantId; + }, + option(){ + return{ + height: 'auto', + columnBtn:false, + calcHeight: 30, + tip: false, + searchShow: true, + searchMenuSpan: 6, + border: true, + index: true, + selection: true, + viewBtn: true, + dialogWidth: 900, + dialogClickModal: false, + highlightCurrentRow: true, //琛岄�変腑鏃堕珮浜� + column: [ + { + label: "绉熸埛ID", + prop: "tenantId", + width: 100, + search: true, + addDisplay: false, + editDisplay: false, + span: 24, + rules: [{ + required: true, + message: "璇疯緭鍏ョ鎴稩D", + trigger: "blur" + }] + }, + { + label: "鍏ㄧО", + prop: "fullName", + width: 120, + span:24, + rules: [{ + required: true, + message: "璇疯緭鍏ュ叏绉�", + trigger: "blur" + }] + }, + { + label: "绉熸埛鍚嶇О", + prop: "tenantName", + search: true, + width: 180, + span: 24, + rules: [{ + required: true, + message: "璇疯緭鍏ュ弬鏁板悕绉�", + trigger: "blur" + }] + }, + { + label: "鑱旂郴浜�", + prop: "linkman", + width: 150, + search: true, + rules: [{ + required: true, + message: "璇疯緭鍏ヨ仈绯讳汉", + trigger: "blur" + }] + }, + { + label: "鑱旂郴鐢佃瘽", + prop: "contactNumber", + width: 150, + }, + { + label: "鑱旂郴鍦板潃", + prop: "address", + span: 24, + minRows: 2, + type: "textarea", + hide: true, + }, + { + label: '寮�鍚笁鍛�', + prop: 'ssaEnable', + type: 'radio', + width: 100, + value:0, + disabled:this.BooleanFlag , + hide:true, + dicData: [{ + label: '寮�鍚�', + value: 0 + }, { + label: '涓嶅紑鍚�', + value: 1 + },], + }, + { + label: "缁戝畾鍩熷悕", + prop: "domainUrl", + span: 24, + }, + { + label: "绯荤粺鑳屾櫙", + prop: "backgroundUrl", + type: 'upload', + listType: 'picture-img', + dataType: 'string', + action: '/api/ubcs-resource/oss/endpoint/put-file', + propsHttp: { + res: 'data', + url: 'link', + }, + hide: true, + span: 24, + }, + ] + } } }, methods: { + initBoolean(){ + this.$axios.get('/api/ubcs-system/tenant/find-ssa-enable').then(res => { + this.BooleanFlag=res.data.data; + //console.log('---',res) + }); + }, initData() { getMenuTree().then(res => { const column = this.findObject(this.packageOption.column, "menuId"); @@ -360,7 +361,7 @@ message: "鎿嶄綔鎴愬姛!" }); done(); - console.log(done) + // console.log(done) }, error => { window.console.log(error); loading(); @@ -421,8 +422,15 @@ this.onLoad(this.page, params); done(); }, + clickRowChange(row){ + this.$refs.crud.toggleSelection(); + this.selectionList = row; + this.$refs.crud.setCurrentRow(row); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + }, selectionChange(list) { this.selectionList = list; + this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); }, selectionClear() { this.selectionList = []; @@ -510,20 +518,20 @@ handlePackageSetting() { this.packageSettingBox = true; }, - handleSubmit(form, done, loading) { - setting(this.ids, form).then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "閰嶇疆鎴愬姛!" - }); - done(); - this.box = false; - }, error => { - window.console.log(error); - loading(); - }); - }, + // handleSubmit(form, done, loading) { + // setting(this.ids, form).then(() => { + // this.onLoad(this.page); + // this.$message({ + // type: "success", + // message: "閰嶇疆鎴愬姛!" + // }); + // done(); + // this.box = false; + // }, error => { + // window.console.log(error); + // loading(); + // }); + // }, handleDatasourceSubmit(form, done, loading) { datasource(this.tenantId, form.datasourceId).then(() => { this.$message({ -- Gitblit v1.9.3