From 101f111bdf888c799ceda8fb324b5ea97d5830de Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 11 四月 2024 11:24:22 +0800
Subject: [PATCH] 解析显式表达式
---
Source/ProjectWeb/src/views/base/UIContentArea.vue | 95 ++++++++++++++++++++++++++++++++++++++++++-----
Source/ProjectWeb/src/components/dynamic-components/dynamic-TreeTable.vue | 1
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue | 8 ++--
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue | 1
4 files changed, 90 insertions(+), 15 deletions(-)
diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-TreeTable.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-TreeTable.vue
index b563d16..72354eb 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-TreeTable.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-TreeTable.vue
@@ -396,6 +396,7 @@
this.TreeSelectList = row;
this.$emit("setDataStore", {
area: this.areasName,
+ type:this.componentVO.uiComponentType,
dataStore:row
});
},
diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
index 5c04b55..f4495f6 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -555,14 +555,14 @@
},
selectChange(row) {
this.selectList = row;
- },
- searchChange(form,done){
- console.log(form)
- done()
this.$emit("setDataStore", {
area: this.areasName,
+ type:this.componentVO.uiComponentType,
dataStore:row
});
+ },
+ searchChange(form,done){
+ done();
}
}
}
diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
index f6b272f..4cc211c 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
@@ -75,6 +75,7 @@
if(newval) {
this.$emit("setDataStore", {
area: this.areasName,
+ type:this.componentVO.uiComponentType,
dataStore:newval
});
}
diff --git a/Source/ProjectWeb/src/views/base/UIContentArea.vue b/Source/ProjectWeb/src/views/base/UIContentArea.vue
index 3a368ff..10e9627 100644
--- a/Source/ProjectWeb/src/views/base/UIContentArea.vue
+++ b/Source/ProjectWeb/src/views/base/UIContentArea.vue
@@ -1,7 +1,7 @@
<template>
<basic-container :cradStyle="cradStyle" cardBodyStyle="height:100%;box-sizing: border-box;padding-bottom:5px;">
- <el-tabs style="height: 100%;" class="UITabs" v-if="areasData.length>1" v-model="activeName" type="card" @tab-click="tabHandleClick">
- <el-tab-pane style="height:100%;overflow: auto" v-for="(areaItem,index) in areasData" :key="areaItem.oid" :label="areaItem.name" :name="areasName+'-Tab-'+index">
+ <el-tabs style="height: 100%;" class="UITabs" v-if="newAreasData.length>1" v-model="activeName" type="card" @tab-click="tabHandleClick">
+ <el-tab-pane style="height:100%;overflow: auto" v-for="(areaItem,index) in newAreasData" :key="areaItem.oid" :label="areaItem.name" :name="areasName+'-Tab-'+index">
<el-collapse class="UI-collapse" :key="areaItem.oid+'-collapse'" v-model="collapseActiveNames" v-if="areaItem.componentVOs.length>1" @change="handleChange">
<el-collapse-item v-for="(componentVO,componentIndex) in areaItem.componentVOs" :name="areasName+'-collapse-'+componentIndex">
<template slot="title">
@@ -11,7 +11,7 @@
<compoent-index :key="areasName+'componentVO-'+componentVO.oid"
:inDialog="inDialog"
:componentVO="componentVO"
- :sourceData="sourceData"
+ :sourceData="newSourceData"
:dataStore="dataStore"
:areasName="areasName"
:paramVOS="paramVOS"
@@ -24,7 +24,7 @@
<compoent-index :key="areasName+'componentVO-'+areaItem.componentVOs[0].oid"
:inDialog="inDialog"
:componentVO="areaItem.componentVOs[0]"
- :sourceData="sourceData"
+ :sourceData="newSourceData"
:dataStore="dataStore"
:areasName="areasName"
:paramVOS="paramVOS"
@@ -33,9 +33,9 @@
</div>
</el-tab-pane>
</el-tabs>
- <div v-else style="height:100%;overflow: auto">
- <el-collapse class="UI-collapse" :key="areasData[0].oid+'-collapse'" v-model="collapseActiveNames" v-if="areasData[0].componentVOs.length>1" @change="handleChange">
- <el-collapse-item v-for="(componentVO,componentIndex) in areasData[0].componentVOs" :name="areasName+'-collapse-'+componentIndex">
+ <div v-else-if="newAreasData.length===1" style="height:100%;overflow: auto">
+ <el-collapse class="UI-collapse" :key="newAreasData[0].oid+'-collapse'" v-model="collapseActiveNames" v-if="newAreasData[0].componentVOs.length>1" @change="handleChange">
+ <el-collapse-item v-for="(componentVO,componentIndex) in newAreasData[0].componentVOs" :name="areasName+'-collapse-'+componentIndex">
<template slot="title">
{{componentVO.name}}
</template>
@@ -43,7 +43,7 @@
<compoent-index :key="areasName+'componentVO-'+componentVO.oid"
:inDialog="inDialog"
:componentVO="componentVO"
- :sourceData="sourceData"
+ :sourceData="newSourceData"
:dataStore="dataStore"
:areasName="areasName"
:paramVOS="paramVOS"
@@ -53,10 +53,10 @@
</el-collapse-item>
</el-collapse>
<div v-else class="componentVO">
- <compoent-index :key="areasName+'componentVO-'+areasData[0].componentVOs[0].oid"
+ <compoent-index :key="areasName+'componentVO-'+newAreasData[0].componentVOs[0].oid"
:inDialog="inDialog"
- :componentVO="areasData[0].componentVOs[0]"
- :sourceData="sourceData"
+ :componentVO="newAreasData[0].componentVOs[0]"
+ :sourceData="newSourceData"
:dataStore="dataStore"
:areasName="areasName"
:paramVOS="paramVOS"
@@ -64,11 +64,42 @@
:isShow="true"></compoent-index>
</div>
</div>
+ <div v-else>
+ <el-alert
+ v-if="areasData.length==0"
+ class="alert"
+ :closable="false"
+ title="閰嶇疆閿欒"
+ type="error"
+ show-icon
+ description="璇ュ尯鍩熸病鏈夐厤缃樉绀虹殑鍐呭">
+ </el-alert>
+ <el-alert
+ v-else-if="Object.keys(newSourceData).length === 0"
+ class="alert"
+ :closable="false"
+ title="婧愭暟鎹负绌�"
+ type="error"
+ show-icon
+ description="涓嶆弧瓒虫樉绀鸿〃杈惧紡鏉′欢锛屾病鏈夊彲鏄剧ず鐨勫唴瀹�">
+ </el-alert>
+ <el-alert
+ v-else
+ class="alert"
+ :closable="false"
+ title=""
+ type="error"
+ show-icon
+ description="涓嶆弧瓒虫樉绀鸿〃杈惧紡鏉′欢锛屾病鏈夊彲鏄剧ず鐨勫唴瀹广��">
+ </el-alert>
+ {{newSourceData}}
+ </div>
</basic-container>
</template>
<script>
import compoentIndex from "@/components/dynamic-components/index"
+import {validatenull, verifyNotNull} from "@/util/validate";
export default {
name: "UIContentArea",
components:{compoentIndex},
@@ -107,10 +138,52 @@
collapseActiveNames:[this.areasName+'-collapse-0']
}
},
+ computed:{
+ newAreasData(){
+ let newAreasData = [];
+ this.areasData.forEach(areaData => {
+ //楠岃瘉鏄惧紡琛ㄨ揪寮�
+ if (!validatenull(areaData.displayExpression)) {
+ if (this.checkDisplayExpression(areaData.displayExpression)) {
+ newAreasData.push(areaData)
+ }
+ } else {
+ newAreasData.push(areaData)
+ }
+ })
+ return newAreasData;
+ },
+ newSourceData(){
+ if(this.sourceData.attributes && this.sourceData.parentId!=undefined && this.sourceData.parentId !=null){
+ //婧愭暟鎹槸鏍戣妭鐐�
+ return this.sourceData.attributes
+ }
+ return this.sourceData;
+ }
+ },
+ created() {
+
+ },
mounted() {
// console.log(this.areasData);
},
methods:{
+ checkDisplayExpression(displayExpressionStr){
+ //"${folderbusinesstype}"<>"workunit" and "${folderbusinesstype}"<>"part" and "${folderbusinesstype}"<>"Terminology" and "${folderbusinesstype}"<>"AssMaterial" and "${folderbusinesstype}"<>"resourcelib" and "${folderbusinesstype}"<>"material" and "${folderbusinesstype}"<>"machine"
+ // "${folderbusinesstype}"="AssMaterial" or "${folderbusinesstype}"="assmaterial"
+ //"${folderbusinesstype}"="material"
+ //${folderbusinesstype}涓烘簮鏁版嵁涓殑灞炴��
+
+ let checkdisplay=false;
+ //鏇挎崲and鍜宱r
+ let newDisplayExpressionStr=displayExpressionStr.replace(/"\s*and\s*"/g,'" && "').replace(/"\s*AND\s*"/g,'" && "').replace(/"\s*or\s*"/g,'" || "').replace(/"\s*OR\s*"/g,'" || "');
+ newDisplayExpressionStr=newDisplayExpressionStr.replace(/"\s*<>\s*"/g,'" != "').replace(/"\s*=\s*"/g,'" == "');
+ newDisplayExpressionStr=newDisplayExpressionStr.replace(/"\$\{/g,'this.newSourceData.').replace(/\}"/g,'')
+ if(eval('('+newDisplayExpressionStr+')')){
+ checkdisplay=true;
+ }
+ return checkdisplay;
+ },
tabHandleClick(tab, event) {
// console.log(tab, event);
},
--
Gitblit v1.9.3