From dee310a30bccd84aeae18f5a07e56c546d537159 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 23 四月 2024 17:41:24 +0800 Subject: [PATCH] 表单展示 --- Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue | 143 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 96 insertions(+), 47 deletions(-) diff --git a/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue b/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue index af3363a..6942d23 100644 --- a/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue +++ b/Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue @@ -1,48 +1,68 @@ <template> <!--UI涓婁笅鏂囩殑灞曠ず鍣�--> - <div style="height:calc(100% - 4px);min-width:1200px"> + <div style="height:calc(100% - 4px);min-width:1200px" > <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" + :dataStore="checkedData.northAreaInDialog.data" + :paramVOS="paramVOS" :inDialog="inDialog" :sourceData="sourceData" - :dataStore="checkedData.northAreaInDialog[0]" - :paramVOS="paramVOS" + :sourceBtmType="btmType" + areas-name="northArea" @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" + :dataStore="checkedData.westAreaInDialog.data" + :paramVOS="paramVOS" :inDialog="inDialog" :sourceData="sourceData" - :dataStore="checkedData.westAreaInDialog[0]" - :paramVOS="paramVOS" + :sourceBtmType="btmType" + areas-name="westArea" + cradStyle="" @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: 300px;height: '+centerHeight"> + <UIContentArea :key="'centerArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.centerAreas" - :inDialog="inDialog" - :sourceData="checkedData.westAreaInDialog[0]" - :dataStore="checkedData.centerAreaInDialog[0]" + :dataStore="checkedData.centerAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :sourceData="checkedData.westAreaInDialog.data[checkedData.westAreaInDialog.data.length-1]" + :sourceBtmType="checkedData.westAreaInDialog.DefineVOBtmType" + areas-name="centerArea" + cradStyle="" @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: 150px;"> + <UIContentArea :key="'southArea-'+uiDefineVO.oid" + :uiBtmType="btmType" + :uiContext="context" :areasData="uiDefineVO.southAreas" - :inDialog="inDialog" - :sourceData="checkedData.centerAreaInDialog[0]" - :dataStore="checkedData.southAreaInDialog[0]" + :dataStore="checkedData.southAreaInDialog.data" :paramVOS="paramVOS" + :inDialog="inDialog" + :sourceData="checkedData.centerAreaInDialog.data[checkedData.centerAreaInDialog.data.length-1]" + :sourceBtmType="checkedData.centerAreaInDialog.DefineVOBtmType" + areas-name="southArea" + cradStyle="" @setDataStore="setDataStore"> </UIContentArea> </el-footer> @@ -53,18 +73,25 @@ <script> import UIContentArea from "@/views/base/UIContentArea" -import {uiDefineVOData} from "@/views/base/uiDefineVOInDialog" +import {verifyNull} from "@/util/validate"; +import {getUIContext} from '@/api/base/ui' export default { name: "UIContentViewerInDialog", components:{UIContentArea}, props:{ + btmType:{ + type: String, + }, + context:{ + type: String, + }, inDialog: { type: Boolean, default: false }, sourceData:{ - //鑿滃崟婧愭暟鎹垨鑰呭脊绐楁椂鎸夐挳鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁 + //鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁 type:Object, default: {} }, @@ -76,49 +103,71 @@ paramVOS:{ type:Object, default: {} - }, - customOptions:{ - type:Object, - default: {} } }, data() { return { - btmType:this.customOptions.btmType,//涓氬姟绫诲瀷锛堟垨閾炬帴绫诲瀷锛� - content:this.customOptions.content,//UI涓婁笅鏂囩殑鍚嶇О checkedData:{ //鍚勫尯鍩熼�変腑鏁版嵁 - northAreaInDialog:[], - westAreaInDialog:[], - centerAreaInDialog:[], - southAreaInDialog:[] + northAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + westAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + centerAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + }, + southAreaInDialog:{ + DefineVOBtmType:'', + data:[{}] + } }, - uiDefineVO: uiDefineVOData, + uiDefineVO: {}, centerHeight:'100%' } }, watch: { - + typeAndContext:{ + handler(newV,oldV){ + if(oldV!=newV && !verifyNull(newV)){ + this.initUI(); + } + }, + immediate: true, + } }, computed: { - + typeAndContext(){ + return this.btmType+this.context; + } }, created() { - if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { - this.centerHeight = 'calc(100% - 310px)'; - } else { - this.centerHeight = '100%'; + if (verifyNull(this.btmType) || verifyNull(this.context) ) { + this.$message.error("鑷畾涔夌粍浠堕厤缃殑淇℃伅閿欒锛岃鍙傝�冣��?type=xxx&context=yyy¶m=zzz鈥滆繖绉嶅舰寮忋�傚叾涓璽ype鏄笟鍔$被鍨嬶紙鎴栭摼鎺ョ被鍨嬶級锛宑ontext鏄疷I涓婁笅鏂囩殑鍚嶇О"); + return false; } }, methods: { - initUI(){ - + initUI() { + getUIContext({btmType: this.btmType, id: this.context}).then(res => { + this.uiDefineVO = res.data.obj; + this.initContext(); + }) }, - initContent(){ - + initContext() { + if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { + this.centerHeight = '65%'; + } else { + this.centerHeight = '100%'; + } }, 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