From 46c673f0bf4a22ae108e90cfcf1bdeb4f0b6a45c Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 07 五月 2024 17:48:19 +0800 Subject: [PATCH] 添加action,数据联动 --- Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue | 158 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 116 insertions(+), 42 deletions(-) diff --git a/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue b/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue index 5dc73fd..2b4043b 100644 --- a/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue +++ b/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue @@ -1,48 +1,76 @@ <template> <!--UI涓婁笅鏂囩殑灞曠ず鍣�--> - <div style="height:calc(100% - 4px);min-width:1200px"> + <div style="height:calc(100% - 4px);" > <el-header v-if="uiDefineVO.northAreas && uiDefineVO.northAreas.length>0"> - <UIContentArea :key="'northArea-'+uiDefineVO.oid" areas-name="northAreaInDialog" + <UIContentArea :key="'northArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.northAreas" - :inDialog="inDialog" - :sourceData="sourceData" - :dataStore="checkedData.northAreaInDialog" + :dataStore="checkedData.northAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :canEdit="canEdit" + :sourceData="sourceData" + :sourceBtmType="btmType" + areas-name="northAreaInDialog" + @setData="setData" @setDataStore="setDataStore"> </UIContentArea> </el-header> - <el-container :style="'height: '+(uiDefineVO.northAreas && uiDefineVO.northAreas.length>0?'calc(100% - 70px)':'100%')"> - <el-aside v-if="uiDefineVO.westAreas && uiDefineVO.westAreas.length>0" :width="uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='table' || uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='TreeTable'?'420px':'320px'" height="100%"> - <UIContentArea :key="'westArea-'+uiDefineVO.oid" areas-name="westAreaInDialog" - cradStyle="" + <el-container + :style="'height: '+(uiDefineVO.northAreas && uiDefineVO.northAreas.length>0?'calc(100% - 70px)':'100%')"> + <el-aside v-if="uiDefineVO.westAreas && uiDefineVO.westAreas.length>0" + :width="uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='table' || uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='TreeTable'?'420px':'320px'" + height="100%"> + <UIContentArea :key="'westArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.westAreas" - :inDialog="inDialog" - :sourceData="sourceData" - :dataStore="checkedData.westAreaInDialog" + :dataStore="checkedData.westAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :canEdit="canEdit" + :sourceData="sourceData" + :sourceBtmType="btmType" + areas-name="westAreaInDialog" + cradStyle="" + @setData="setData" @setDataStore="setDataStore"> </UIContentArea> </el-aside> - <el-container style="height: 100%"> - <el-main v-if="uiDefineVO.centerAreas && uiDefineVO.centerAreas.length>0" :style="'height: '+centerHeight"> - <UIContentArea :key="'centerArea-'+uiDefineVO.oid" areas-name="centerAreaInDialog" - cradStyle="" + <el-container style="height: 100%;display: block"> + <el-main v-if="uiDefineVO.centerAreas && uiDefineVO.centerAreas.length>0" :style="'min-height: 200px;height: '+centerHeight"> + <UIContentArea :key="'centerArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.centerAreas" - :inDialog="inDialog" - :sourceData="checkedData.westAreaInDialog[checkedData.westAreaInDialog.length-1]" - :dataStore="checkedData.centerAreaInDialog" + :dataStore="checkedData.centerAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :canEdit="canEdit" + :sourceData="checkedData.westAreaInDialog.data[checkedData.westAreaInDialog.data.length-1]" + :sourceBtmType="checkedData.westAreaInDialog.DefineVOBtmType" + areas-name="centerAreaInDialog" + cradStyle="" + @setData="setData" @setDataStore="setDataStore"> </UIContentArea> </el-main> - <el-footer v-if="uiDefineVO.southAreas && uiDefineVO.southAreas.length>0" height="35%" style="max-height: 300px"> - <UIContentArea :key="'southArea-'+uiDefineVO.oid" areas-name="southAreaInDialog" - cradStyle="" + <el-footer v-if="uiDefineVO.southAreas && uiDefineVO.southAreas.length>0" height="35%" + style="min-height: 100px;"> + <UIContentArea :key="'southArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.southAreas" - :inDialog="inDialog" - :sourceData="checkedData.centerAreaInDialog[checkedData.centerAreaInDialog.length-1]" - :dataStore="checkedData.southAreaInDialog" + :dataStore="checkedData.southAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :canEdit="canEdit" + :sourceData="checkedData.centerAreaInDialog.data[checkedData.centerAreaInDialog.data.length-1]" + :sourceBtmType="checkedData.centerAreaInDialog.DefineVOBtmType" + areas-name="southAreaInDialog" + cradStyle="" + @setData="setData" @setDataStore="setDataStore"> </UIContentArea> </el-footer> @@ -54,7 +82,7 @@ <script> import UIContentArea from "@/views/base/UIContentArea" import {verifyNull} from "@/util/validate"; -import {getUIContent} from '@/api/base/region' +import {getUIContext} from '@/api/base/ui' export default { name: "UIContentViewerInDialog", @@ -63,12 +91,17 @@ btmType:{ type: String, }, - content:{ + context:{ type: String, }, inDialog: { type: Boolean, default: false + }, + canEdit:{ + //鍐呭鏄惁鍙紪杈� + type:Boolean, + default:false }, sourceData:{ //鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁 @@ -87,19 +120,54 @@ }, data() { return { + //鍚勫尯鍩熺殑閫変腑鏁版嵁 checkedData:{ - //鍚勫尯鍩熼�変腑鏁版嵁 - northAreaInDialog:[{}], - westAreaInDialog:[{}], - centerAreaInDialog:[{}], - southAreaInDialog:[{}] + northAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + westAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + centerAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + southAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + } + }, + //鍚勫尯鍩熸暟鎹� + data:{ + northAreaInDialog:{ + type:'', + DefineVO:null, + data:null + }, + westAreaInDialog:{ + type:'', + DefineVO:null, + data:null + }, + centerAreaInDialog:{ + type:'', + DefineVO:null, + data:null + }, + southAreaInDialog:{ + type:'', + DefineVO:null, + data:null + } }, uiDefineVO: {}, centerHeight:'100%' } }, watch: { - typeAContent:{ + typeAndContext:{ handler(newV,oldV){ if(oldV!=newV && !verifyNull(newV)){ this.initUI(); @@ -109,32 +177,38 @@ } }, computed: { - typeAContent(){ - return this.btmType+this.content; + typeAndContext(){ + return this.btmType+this.context; } }, created() { - if (verifyNull(this.btmType) || verifyNull(this.content) ) { - this.$message.error("鑷畾涔夌粍浠堕厤缃殑淇℃伅閿欒锛岃鍙傝�僢s=name?type=xxx&context=yyy¶m=zzz杩欑褰㈠紡銆傚叾涓璽ype鏄笟鍔$被鍨嬶紙鎴栭摼鎺ョ被鍨嬶級锛宑ontext鏄疷I涓婁笅鏂囩殑鍚嶇О,name涓虹粍浠跺悕绉帮紝绌哄�兼椂榛樿灞曠ずUI寮曟搸"); + if (verifyNull(this.btmType) || verifyNull(this.context) ) { + this.$message.error("鑷畾涔夌粍浠堕厤缃殑淇℃伅閿欒锛岃鍙傝�冣��?type=xxx&context=yyy¶m=zzz鈥滆繖绉嶅舰寮忋�傚叾涓璽ype鏄笟鍔$被鍨嬶紙鎴栭摼鎺ョ被鍨嬶級锛宑ontext鏄疷I涓婁笅鏂囩殑鍚嶇О"); return false; } }, methods: { initUI() { - getUIContent({btmType: this.btmType, id: this.content}).then(res => { + getUIContext({btmType: this.btmType, id: this.context}).then(res => { this.uiDefineVO = res.data.obj; - this.initContent(); + this.initContext(); }) }, - initContent() { + initContext() { if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { - this.centerHeight = 'calc(100% - 310px)'; + this.centerHeight = '65%'; } else { this.centerHeight = '100%'; } }, + setData(value) { + this.data[value.area].DefineVO = value.currentDefineVO; + this.data[value.area].data = value.data; + this.data[value.area].type = value.type; + }, setDataStore(value) { - this.checkedData[value.area] = value.dataStore; + this.checkedData[value.area].DefineVOBtmType = value.btmType; + this.checkedData[value.area].data = value.dataStore; } } } -- Gitblit v1.9.3