Merge remote-tracking branch 'origin/master'
| | |
| | | <template> |
| | | <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid"> |
| | | <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用UI:type#content?param=xxx这种形式</div> |
| | | <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用bs=?type=xxx&context=yyy&pparam=zzz这种形式</div> |
| | | <component v-else :is="currentComponent" |
| | | :customOptions="customOptions" |
| | | :btmType="customOptions.btmType" |
| | | :content="customOptions.content" |
| | | :inDialog="true" |
| | | :key="areasName+'customCom-'+componentVO.oid" |
| | | :componentVO="componentVO" |
| | | :sourceData="sourceData" |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS"></component> |
| | | :paramVOS="customOptions.paramVOS"></component> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | name: "dynamic-custom", |
| | | components:{ |
| | | 'UI':()=>import('@/views/base/UIContentViewerInDialog'), |
| | | 'test':()=>import('@/components/custom-ui/test'), |
| | | 'test2':()=>import('@/components/custom-ui/test2'), |
| | | 'test':()=>import('@/views/custom-ui/test'), |
| | | 'test2':()=>import('@/views/custom-ui/test2'), |
| | | }, |
| | | props:{ |
| | | componentVO:{ |
| | |
| | | default:'' |
| | | }, |
| | | sourceData:{ |
| | | //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据 |
| | | //所属区域的上一区域选中数据 |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | |
| | | data() { |
| | | return { |
| | | height:'300px', |
| | | customClass:this.componentVO.customClass, //UI:type#content?param=xxx或者 组件name:type#content?param=xxx |
| | | customClass:this.componentVO.customClass, //bs=?type=xxx&context=yyy¶m=zzz 或者 bs=组件name?type=xxx&context=yyy¶m=zzz |
| | | isError:false, //路径解析失败 |
| | | currentComponent: 'UI',//组件name |
| | | } |
| | |
| | | }, |
| | | computed:{ |
| | | customOptions() { |
| | | if(this.customClass.indexOf(":") <0){ |
| | | if(this.customClass.indexOf("bs=") <0){ |
| | | this.isError=true; |
| | | return ; |
| | | } |
| | | |
| | | if(this.customClass.split(':')[0]!='UI' && this.customClass.split(':')[0]!='ui'){ |
| | | this.currentComponent=this.customClass.split(':')[0]; |
| | | this.customClass=this.componentVO.customClass.split("bs=")[1]; |
| | | if(this.customClass.indexOf("?") <0 || this.customClass.indexOf("type=") <0 || this.customClass.indexOf("context=") <0){ |
| | | this.isError=true; |
| | | return ; |
| | | } |
| | | if(this.customClass.split('?')[0]!='' && this.customClass.split('?')[0]!='UI' && this.customClass.split('?')[0]!='ui'){ |
| | | this.currentComponent=this.customClass.split('?')[0]; |
| | | } |
| | | this.customClass=this.componentVO.customClass.split("?")[1].split('&'); |
| | | let urlParams={}; |
| | | let btmType='' |
| | | let content='' |
| | | if(this.customClass.split(':')[1].indexOf("?") <0){ |
| | | btmType=this.customClass.split(':')[1].split('#')[0]; |
| | | content=this.customClass.split(':')[1].split('#')[1]; |
| | | }else { |
| | | let split1 = this.customClass.split(':')[1].split('?')[0]; |
| | | let split2 = this.customClass.split(':')[1].split('?')[1]; |
| | | btmType=split1.split('#')[0]; |
| | | content=split1.split('#')[1]; |
| | | let paramsArray = split2.split("&"); |
| | | paramsArray.forEach(item=>{ |
| | | var preParam =item.split("="); |
| | | if(preParam[0]=='btmname'){ |
| | | urlParams['btmType']=preParam[1]; |
| | | }else if(preParam[0]=='imagetype'){ |
| | | urlParams['imageType']=preParam[1]; |
| | | if(preParam[1]=='fileobject'){ |
| | | |
| | | } |
| | | }else{ |
| | | urlParams[preParam[0]] = preParam[1]; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.customClass.forEach(item=>{ |
| | | var preParam =item.split("="); |
| | | if(preParam[0]=='type'){ |
| | | btmType=preParam[1]; |
| | | }else if(preParam[0]=='context'){ |
| | | content=preParam[1]; |
| | | }else{ |
| | | urlParams[preParam[0]] = preParam[1]; |
| | | } |
| | | }) |
| | | return { |
| | | btmType:btmType, |
| | | content:content, |
| | | urlParams: urlParams |
| | | paramVOS:Object.assign(this.paramVOS,urlParams) |
| | | } |
| | | } |
| | | }, |
| | |
| | | default: '' |
| | | }, |
| | | sourceData:{ |
| | | //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据 |
| | | //所属区域的上一区域选中数据 |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | |
| | | :inDialog="inDialog" |
| | | :sourceData="sourceData" |
| | | :dataStore="checkedData.northArea" |
| | | :paramVOS="paramVOS" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-header> |
| | |
| | | :inDialog="inDialog" |
| | | :sourceData="sourceData" |
| | | :dataStore="checkedData.westArea" |
| | | :paramVOS="paramVOS" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-aside> |
| | |
| | | :inDialog="inDialog" |
| | | :sourceData="checkedData.westArea[checkedData.westArea.length-1]" |
| | | :dataStore="checkedData.centerArea" |
| | | :paramVOS="paramVOS" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-main> |
| | |
| | | :inDialog="inDialog" |
| | | :sourceData="checkedData.centerArea[checkedData.centerArea.length-1]" |
| | | :dataStore="checkedData.southArea" |
| | | :paramVOS="paramVOS" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-footer> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { verifyNull } from "@/util/validate"; |
| | | import UIContentArea from "@/views/base/UIContentArea" |
| | | import {uiDefineVOData} from "@/views/base/uiDefineVO" |
| | | |
| | | export default { |
| | | name: "UIContentViewer", |
| | | components:{UIContentArea}, |
| | | props:{ |
| | | inDialog: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | sourceData:{ |
| | | //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据 |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | | paramVOS:{ |
| | | type:Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | components: {UIContentArea}, |
| | | data() { |
| | | return { |
| | | btmType:'',//业务类型(或链接类型) |
| | | content:'',//UI上下文的名称 |
| | | checkedData:{ |
| | | btmType: '',//业务类型(或链接类型) |
| | | content: '',//UI上下文的名称 |
| | | checkedData: { |
| | | //各区域选中数据 |
| | | northArea:[{}], |
| | | westArea:[{}], |
| | | centerArea:[{}], |
| | | southArea:[{}] |
| | | northArea: [{}], |
| | | westArea: [{}], |
| | | centerArea: [{}], |
| | | southArea: [{}] |
| | | }, |
| | | uiDefineVO: uiDefineVOData, |
| | | centerHeight:'100%' |
| | | uiDefineVO: {}, |
| | | centerHeight: '100%', |
| | | inDialog: false, |
| | | //菜单源数据 |
| | | sourceData: {}, |
| | | } |
| | | }, |
| | | watch: { |
| | | |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | watch: {}, |
| | | computed: {}, |
| | | created() { |
| | | if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { |
| | | this.centerHeight = 'calc(100% - 310px)'; |
| | | } else { |
| | | this.centerHeight = '100%'; |
| | | if (verifyNull(this.$route.query.type) || (verifyNull(this.$route.query.context) && verifyNull(this.$route.query.content))) { |
| | | this.$message.error("配置的信息错误,请参考bs=?type=xxx&context=yyy¶m=zzz这种形式。其中type是业务类型(或链接类型),context是UI上下文的名称"); |
| | | return false; |
| | | } |
| | | this.btmType=this.$route.query.type; |
| | | this.content=this.$route.query.context ||this.$route.query.content; |
| | | this.sourceData=this.$route.query; |
| | | this.initUI(); |
| | | this.initContent(); |
| | | }, |
| | | methods: { |
| | | initUI(){ |
| | | |
| | | initUI() { |
| | | this.uiDefineVO = uiDefineVOData; |
| | | }, |
| | | initContent(){ |
| | | |
| | | initContent() { |
| | | if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { |
| | | this.centerHeight = 'calc(100% - 310px)'; |
| | | } else { |
| | | this.centerHeight = '100%'; |
| | | } |
| | | }, |
| | | setDataStore(value) { |
| | | this.checkedData[value.area] = value.dataStore; |
| | |
| | | <script> |
| | | import UIContentArea from "@/views/base/UIContentArea" |
| | | import {uiDefineVOData} from "@/views/base/uiDefineVOInDialog" |
| | | import {verifyNull} from "@/util/validate"; |
| | | |
| | | export default { |
| | | name: "UIContentViewerInDialog", |
| | | components:{UIContentArea}, |
| | | props:{ |
| | | btmType:{ |
| | | type: String, |
| | | }, |
| | | content:{ |
| | | type: String, |
| | | }, |
| | | inDialog: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | sourceData:{ |
| | | //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据 |
| | | //所属区域的上一区域选中数据 |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | |
| | | paramVOS:{ |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | | customOptions:{ |
| | | type:Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | btmType:this.customOptions.btmType,//业务类型(或链接类型) |
| | | content:this.customOptions.content,//UI上下文的名称 |
| | | checkedData:{ |
| | | //各区域选中数据 |
| | | northAreaInDialog:[{}], |
| | |
| | | centerAreaInDialog:[{}], |
| | | southAreaInDialog:[{}] |
| | | }, |
| | | uiDefineVO: uiDefineVOData, |
| | | uiDefineVO: {}, |
| | | centerHeight:'100%' |
| | | } |
| | | }, |
| | |
| | | |
| | | }, |
| | | 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.content) ) { |
| | | this.$message.error("自定义组件配置的信息错误,请参考bs=name?type=xxx&context=yyy¶m=zzz这种形式。其中type是业务类型(或链接类型),context是UI上下文的名称,name为组件名称,空值时默认展示UI引擎"); |
| | | return false; |
| | | } |
| | | this.initUI(); |
| | | this.initContent(); |
| | | }, |
| | | methods: { |
| | | initUI(){ |
| | | |
| | | initUI() { |
| | | this.uiDefineVO = uiDefineVOData; |
| | | }, |
| | | initContent(){ |
| | | |
| | | initContent() { |
| | | if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) { |
| | | this.centerHeight = 'calc(100% - 310px)'; |
| | | } else { |
| | | this.centerHeight = '100%'; |
| | | } |
| | | }, |
| | | setDataStore(value) { |
| | | this.checkedData[value.area] = value.dataStore; |
| | |
| | | "copyFromVersion": null, |
| | | "createTime": null, |
| | | "creator": null, |
| | | "customClass": "test2:processreview#DepartmentProcessReview_web?param=xxx", |
| | | "customClass": "bs=test2?type=processreview&context=DepartmentProcessReview_web¶m=xxx", |
| | | "data": null, |
| | | "description": "", |
| | | "extendAttr": "", |
| | |
| | | "copyFromVersion": null, |
| | | "createTime": null, |
| | | "creator": null, |
| | | "customClass": "test:processreview#DepartmentProcessReview_web?param=xxx", |
| | | "customClass": "bs=?type=processreview&context=DepartmentProcessReview_web¶m=xxx", |
| | | "data": null, |
| | | "description": "", |
| | | "extendAttr": "", |