|
|
@@ -39,7 +39,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-dashed">
|
|
|
- <div class="mg-b-20">函数公式..</div>
|
|
|
+ <div class="mg-b-20">函数公式..(节点公式)</div>
|
|
|
<div class="edit-text">
|
|
|
<span>
|
|
|
<formula-item
|
|
|
@@ -48,7 +48,7 @@
|
|
|
>
|
|
|
</formula-item>
|
|
|
</span>
|
|
|
- <span>=</span>
|
|
|
+ <span style="margin-left: 5px;margin-right: 5px;">=</span>
|
|
|
<span v-for="(item,index) in processFormula" :key="index">
|
|
|
<el-tooltip class="item" effect="light" placement="top-start" :disabled="item.type!=='Element'">
|
|
|
<div slot="content">{{item.tableName }}</div>
|
|
|
@@ -66,24 +66,16 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-show="operationVisible" class="operation-box flex1 flex flex-d-c ov-hidden">
|
|
|
- <div>选择参数设置</div>
|
|
|
+ <div class="flex ">
|
|
|
+ <div>选择参数设置</div>
|
|
|
+ <div style="margin-left: 29%;font-weight: 700;">公式配置</div>
|
|
|
+ </div>
|
|
|
<div class="flex flex-d-c flex1 ov-hidden">
|
|
|
<el-row :gutter="20" class="flex1 ov-hidden">
|
|
|
<el-col :span="8" class="h-100p">
|
|
|
<el-card shadow="never" v-loading="treeLoad" class="h-100p ov-auto">
|
|
|
<el-scrollbar style="height: 100%">
|
|
|
- <!-- <el-tree
|
|
|
- class="filter-tree"
|
|
|
- lazy
|
|
|
- :load="loadNode"
|
|
|
- @node-click="getNodeDetail"
|
|
|
- :props="defaultProps"
|
|
|
- :expand-on-click-node="false"
|
|
|
- highlight-current
|
|
|
- node-key="id"
|
|
|
- ref="tree"
|
|
|
- >
|
|
|
- </el-tree> -->
|
|
|
+
|
|
|
<el-tree
|
|
|
class="filter-tree"
|
|
|
:data="treeData"
|
|
|
@@ -100,70 +92,78 @@
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
<el-col :span="16" class="h-100p flex flex-d-c ov-hidden">
|
|
|
- <div class="flex" style="justify-content: space-between;width:100%">
|
|
|
- <el-select v-model="eleTableId" @change="getTableEle" placeholder="请选择元素表1" style="width:45%">
|
|
|
- <el-option v-if="paramDataList.length" label="选择节点参数2" value="选择节点参数"></el-option>
|
|
|
- <el-option v-for="item in eleTableList" :key="item.id" :label="item.tableName" :value="(item.pkeyId!==null&&item.pkeyId!==-1)?item.pkeyId:item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- <!-- 搜索元素下拉框 -->
|
|
|
- <el-select v-model="input3" filterable clearable placeholder="搜索元素字段" @change="getInput" style="width:45%">
|
|
|
- <el-option
|
|
|
- v-for="item in eleList1"
|
|
|
- :key="item.id"
|
|
|
- :label="item.eName"
|
|
|
- :value="item.eName">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="mg-t-10 no-mb-col flex1 ov-hidden">
|
|
|
- <el-scrollbar style="height: 100%">
|
|
|
- <el-row v-loading="eleListable" v-if="eleList.length>0">
|
|
|
- <el-col :span="6" v-for="item in eleList" :key="item.id" >
|
|
|
- <div class="ele-box">
|
|
|
- <span v-if="item.k">{{item.name}}</span>
|
|
|
- <span v-else>{{item.eName}}</span>
|
|
|
- <el-checkbox v-model="item.checked" @change="value => eleChang(value,item)"></el-checkbox>
|
|
|
- </div>
|
|
|
+ <div class="operation-box">
|
|
|
+ <!-- 运算符选择区域 -->
|
|
|
+ <div class="flex jc-sb operation-symbol-box">
|
|
|
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-else style="text-align: center;line-height: 328px;border:1px solid #bbb">暂无数据</el-row>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- <div class="flex jc-sb">
|
|
|
- <!-- <div>定位数据位置:</div> -->
|
|
|
- <div class="icon-box">
|
|
|
- <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelect"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperator('+')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperator('-')" icon="el-icon-remove-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperator('*')" icon="el-icon-circle-close"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperator('%')">÷</el-link>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <!-- <el-link :underline="false" type="primary" class="mg-r-20" @click="eleAddFormula">元素添加到公式</el-link> -->
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets('(',false)">(</el-link>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets(')',true)">)</el-link>
|
|
|
- <!-- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets('[',false)">【</el-link>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets(']',true)">】</el-link> -->
|
|
|
- <el-link :underline="false" type="primary" @click="addText">输入值</el-link>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="border-grey sele-ele-box" style="height:50px">
|
|
|
- <draggable v-model="selectEleFormula">
|
|
|
- <formula-item
|
|
|
- v-for="(item,index) in selectEleFormula" :key="index"
|
|
|
- :item="item" @click="obj => eleFormulaClick(obj,index)"
|
|
|
- >
|
|
|
- </formula-item>
|
|
|
- </draggable>
|
|
|
+ <div class="icon-box ">
|
|
|
+ <span class="text-sm" >插入运算符:</span>
|
|
|
+
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperator('+')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperator('-')" icon="el-icon-remove-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperator('*')" icon="el-icon-circle-close"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperator('%')">÷</el-link>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets('(',false)">(</el-link>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBrackets(')',true)">)</el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addText">固定值</el-link>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 操作
|
|
|
+ <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelect"></el-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="border-grey sele-ele-box1" >
|
|
|
+ <draggable v-model="selectEleFormula">
|
|
|
+ <formula-item
|
|
|
+ v-for="(item,index) in selectEleFormula" :key="index"
|
|
|
+ :item="item" @click="obj => eleFormulaClick(obj,index)"
|
|
|
+ >
|
|
|
+ </formula-item>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ <div class="flex mg-t-10" style="justify-content: space-between;width:100%;">
|
|
|
+ <el-select v-model="eleTableId" @change="getTableEle" placeholder="请选择元素表1" style="width:45%">
|
|
|
+ <el-option v-if="paramDataList.length" label="选择节点参数2" value="选择节点参数"></el-option>
|
|
|
+ <el-option v-for="item in eleTableList" :key="item.id" :label="item.tableName" :value="(item.pkeyId!==null&&item.pkeyId!==-1)?item.pkeyId:item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- 搜索元素下拉框 -->
|
|
|
+ <!-- <el-select v-model="input3" filterable clearable placeholder="搜索元素字段" @change="getInput" style="width:45%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in eleList1"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.eName"
|
|
|
+ :value="item.eName">
|
|
|
+ </el-option>
|
|
|
+ </el-select> -->
|
|
|
+ <div class="text-align-c">
|
|
|
+ <el-button size="small" @click="canceloperationVisible ">取消</el-button>
|
|
|
+ <el-button size="small" @click="operationHandle" type="primary">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mg-t-10 no-mb-col flex1" >
|
|
|
+ <el-scrollbar style="height: 350px">
|
|
|
+ <!-- <el-row v-loading="eleListable" v-if="eleList.length>0">
|
|
|
+ <el-col :span="6" v-for="item in eleList" :key="item.id" >
|
|
|
+ <div class="ele-box">
|
|
|
+ <span v-if="item.k">{{item.name}}</span>
|
|
|
+ <span v-else>{{item.eName}}</span>
|
|
|
+ <el-checkbox v-model="item.checked" @change="value => eleChang(value,item)"></el-checkbox>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ </el-row> -->
|
|
|
+ <!-- <el-row v-else style="text-align: center;line-height: 328px;border:1px solid #bbb">暂无数据</el-row> -->
|
|
|
+ 777
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <div class="text-align-c">
|
|
|
- <el-button size="small" @click="operationHandle" type="primary">保存</el-button>
|
|
|
- <el-button size="small" @click="canceloperationVisible ">取消</el-button>
|
|
|
- </div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-show="!operationVisible && !showFunDetail && !deviationRange.show">
|
|
|
@@ -205,7 +205,23 @@
|
|
|
<template v-else>
|
|
|
<div class="flex" >
|
|
|
<div class=" flex-d-c" style="width:40%">
|
|
|
- <component ref="dynamiccomponent" v-bind:is="componentMap[item.name]" :formulainfo="item" :curele="equationSelectEle" :formulamap="formulaMap" @uncheck="unCheckEleComp" class="flex1"></component>
|
|
|
+ <component ref="dynamiccomponent"
|
|
|
+ v-bind:is="componentMap[item.name]"
|
|
|
+ :formulainfo="item"
|
|
|
+ :curele="equationSelectEle"
|
|
|
+ :formulamap="formulaMap"
|
|
|
+ :map="formulaDetailMap"
|
|
|
+ @uncheck="unCheckEleComp"
|
|
|
+ class="flex1"
|
|
|
+ :moreConditions="moreConditions"
|
|
|
+ :isMore="isMore"
|
|
|
+ :isGetData="isGetData"
|
|
|
+ :dataListGet="dataListGet"
|
|
|
+ :isDataChange="isDataChange"
|
|
|
+ :dataForm="dataForm"
|
|
|
+ :remark="remark"
|
|
|
+ >
|
|
|
+ </component>
|
|
|
<div class="flex1" v-show="item.showSelectEle" style="margin-top:10px;margin-bottom:30px">
|
|
|
<el-scrollbar style="height: 400px">
|
|
|
<el-tree
|
|
|
@@ -439,7 +455,6 @@ import datasReme from "./component/funComponent/datasReme"
|
|
|
import datasGetlist from "./component/funComponent/datasGetlist"
|
|
|
import datasJoin from "./component/funComponent/datasJoin"
|
|
|
import ifelse from "./component/funComponent/ifelse"
|
|
|
-import dataChange from "./component/funComponent/dataChange"
|
|
|
|
|
|
import deviationRange from "./component/deviationRange/deviationRange"
|
|
|
import {rangeToString} from "./component/deviationRange/rangeToString"
|
|
|
@@ -448,6 +463,9 @@ import {formulaArrayToString} from "./formulaArrayToString"
|
|
|
import {formulaStringToArray} from "./formulaStringToArray"
|
|
|
|
|
|
import draggable from 'vuedraggable'
|
|
|
+import {formatArrayMore,restoreArrayMore,generateResult} from './component/funComponent/multiIfElseTools'
|
|
|
+import dataChange from "./component/funComponent/dataChange"
|
|
|
+import tableFormWrite from "./component/table-form-write.vue";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -467,7 +485,8 @@ export default {
|
|
|
ifelse,
|
|
|
|
|
|
deviationRange,
|
|
|
- dataChange
|
|
|
+ dataChange,
|
|
|
+ tableFormWrite
|
|
|
},
|
|
|
props: {
|
|
|
wbsid:{
|
|
|
@@ -591,6 +610,16 @@ export default {
|
|
|
version:1,//版本号,以后可能会有不兼容旧公式的改动,留作以后可能用来判断
|
|
|
input3:'',//搜索元素字段
|
|
|
eleListable:false,
|
|
|
+ isMore:false,//是否是多条件判断
|
|
|
+ moreConditions:[],//多条件判断数组
|
|
|
+ formulaDetailMap:{},//公式详情map
|
|
|
+ dataListGet:'',
|
|
|
+ isGetData:false,//是否获取数据
|
|
|
+ isDataChange:false,//是否数据自变
|
|
|
+ dataForm:'',
|
|
|
+ remark:'',//备注
|
|
|
+
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -1167,6 +1196,8 @@ export default {
|
|
|
},
|
|
|
//获取当前元素的表名
|
|
|
getItemTableName(item){
|
|
|
+
|
|
|
+
|
|
|
if(item.type==="Element"){
|
|
|
this.rightDict.forEach((ele)=>{
|
|
|
if(ele.ekey===item.tableElementKey){
|
|
|
@@ -1360,10 +1391,198 @@ export default {
|
|
|
return true;
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//保存公式
|
|
|
saveFormula(){
|
|
|
console.log('保存',this.pid);
|
|
|
console.log(this.processFormula,'this.processFormula1111111112333');
|
|
|
+ console.log(this.resultFormula,'this.resultFormula1111111112333');
|
|
|
+ console.log(this.$refs.dynamiccomponent,'this.$refs.dynamiccomponent');
|
|
|
+
|
|
|
+ if(this.$refs.dynamiccomponent&&this.$refs.dynamiccomponent.length>0&&this.$refs.dynamiccomponent[0]&& this.$refs.dynamiccomponent[0].symbol=='more'){
|
|
|
+ //多条件保存公式
|
|
|
+
|
|
|
+ console.log('this.$refs.conditionList[0]',this.$refs.dynamiccomponent[0].conditionList);
|
|
|
+ let resMore=formatArrayMore(this.$refs.dynamiccomponent[0].conditionList);
|
|
|
+ const resJson=generateResult(this.$refs.dynamiccomponent[0].conditionList);
|
|
|
+ let remark=this.$refs.dynamiccomponent[0].remark;
|
|
|
+console.log(remark,'remark');
|
|
|
+
|
|
|
+ console.log(resJson,'resJson');
|
|
|
+
|
|
|
+
|
|
|
+ if(this.formulaid){
|
|
|
+ updateFormula({
|
|
|
+ id:this.formulaid,
|
|
|
+ formula:'',
|
|
|
+ formulas:resMore,
|
|
|
+ remark:remark,
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:JSON.stringify(resJson),
|
|
|
+ scope:this.globaltype,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ dev:deviationRangeText
|
|
|
+ }).then(()=>{
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ saveFormula({
|
|
|
+ formula:'',
|
|
|
+ formulas:resMore,
|
|
|
+ remark:remark,
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:JSON.stringify(resJson),
|
|
|
+ scope:this.globaltype,
|
|
|
+ dev:deviationRangeText,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ ver:this.version
|
|
|
+ }).then((res)=>{
|
|
|
+ if(res.data.data){
|
|
|
+ this.formulaid = res.data.data;
|
|
|
+ }
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+
|
|
|
+ }else if(this.$refs.dynamiccomponent&&this.$refs.dynamiccomponent.length>0&&this.$refs.dynamiccomponent[0]&& this.$refs.dynamiccomponent[0].symbol=='getData'){
|
|
|
+ //数据获取保存公式
|
|
|
+ const dataRes = this.$refs.dynamiccomponent[0].getDataConditionData();
|
|
|
+ console.log(dataRes,'dataRes');
|
|
|
+ const result =dataRes.result;
|
|
|
+ const mapEle = JSON.stringify(dataRes.mapEle);
|
|
|
+ console.log(mapEle,'mapEle');
|
|
|
+
|
|
|
+
|
|
|
+ if(this.formulaid){
|
|
|
+ updateFormula({
|
|
|
+ id:this.formulaid,
|
|
|
+ formula:"FC.switchCase"+'('+result+')',
|
|
|
+
|
|
|
+ remark:'',
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:mapEle,
|
|
|
+ scope:this.globaltype,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ dev:deviationRangeText
|
|
|
+ }).then(()=>{
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ saveFormula({
|
|
|
+ formula:"FC.switchCase" +'('+result+')',
|
|
|
+
|
|
|
+ remark:'',
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:mapEle,
|
|
|
+ scope:this.globaltype,
|
|
|
+ dev:deviationRangeText,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ ver:this.version
|
|
|
+ }).then((res)=>{
|
|
|
+ if(res.data.data){
|
|
|
+ this.formulaid = res.data.data;
|
|
|
+ }
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+ }else if(this.$refs.dynamiccomponent&&this.$refs.dynamiccomponent.length>0&&this.$refs.dynamiccomponent[0]&& this.$refs.dynamiccomponent[0].formData){
|
|
|
+ console.log(this.$refs.dynamiccomponent[0],'this.$refs.dynamiccomponent[0');
|
|
|
+ const resForm=this.$refs.dynamiccomponent[0].getDataChangeList();
|
|
|
+ console.log(resForm,'resForm');
|
|
|
+
|
|
|
+ //数据自变保存
|
|
|
+
|
|
|
+ if(this.formulaid){
|
|
|
+ updateFormula({
|
|
|
+ id:this.formulaid,
|
|
|
+ formula:resForm.test,
|
|
|
+ remark:'',
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:JSON.stringify(resForm.map),
|
|
|
+ scope:this.globaltype,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ dev:deviationRangeText
|
|
|
+ }).then(()=>{
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ saveFormula({
|
|
|
+ formula:resForm.test,
|
|
|
+ remark:'',
|
|
|
+ nodeId:this.nodeid,
|
|
|
+ elementId:this.eleid,
|
|
|
+ scale:this.isRetain?this.retainNum:'',
|
|
|
+ number:number,
|
|
|
+ map:JSON.stringify(resForm.map),
|
|
|
+ scope:this.globaltype,
|
|
|
+ dev:deviationRangeText,
|
|
|
+ // projectId:this.curProjiect.id||this.projectId,
|
|
|
+ projectId:this.curProjiect.id||this.pid,
|
|
|
+ ver:this.version
|
|
|
+ }).then((res)=>{
|
|
|
+ if(res.data.data){
|
|
|
+ this.formulaid = res.data.data;
|
|
|
+ }
|
|
|
+ this.formulaStringToArray();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
let arr=JSON.parse(JSON.stringify(this.processFormula));
|
|
|
let filteredArr = arr.filter(item => item.id ===this.checkGsId);
|
|
|
let obj
|
|
|
@@ -1371,7 +1590,7 @@ export default {
|
|
|
obj = formulaArrayToString(this.processFormula,this.resultFormula);
|
|
|
obj2 = formulaArrayToString(filteredArr,this.resultFormula);
|
|
|
// 判断 obj2.text 是否包含 FC.ifelse
|
|
|
- if (obj2.text && obj2.text.includes('FC.ifelse')) {
|
|
|
+ if (obj2.text && (obj2.text.includes('FC.ifelse'))|| obj2.text.includes("''")) {
|
|
|
obj = obj2; // 如果包含 FC.ifelse,使用 obj2
|
|
|
}
|
|
|
let deviationRangeText = rangeToString(this.deviationRange.datas,obj.eleMap);
|
|
|
@@ -1465,6 +1684,43 @@ export default {
|
|
|
async formulaStringToArray(){
|
|
|
let detail = (await formulaDetail({elementId:this.eleid,scope:this.globaltype,nodeId:this.nodeid,projectId:this.curProjiect.id||this.pid})).data.data;
|
|
|
console.log(detail,'detail');
|
|
|
+ this.remark = detail.remark;
|
|
|
+
|
|
|
+ if(detail&&detail.formula.includes('FC.ifelseMulti')){
|
|
|
+ detail.formula = detail.formula.replace('FC.ifelseMulti','FC.ifelse');
|
|
|
+ this.isMore = true;
|
|
|
+ this.formulaDetailMap = detail.map;
|
|
|
+ this.moreConditions = restoreArrayMore(detail.formulas,this.formulaDetailMap)
|
|
|
+
|
|
|
+ }else if(detail&&detail.formula.includes('FC.switchCase')){
|
|
|
+ //数据获取
|
|
|
+ this.formulaDetailMap = detail.map;
|
|
|
+ detail.formula = detail.formula.replace('FC.switchCase','FC.ifelse');
|
|
|
+ this.isGetData = true;
|
|
|
+ this.dataListGet=detail.formula
|
|
|
+ console.log( this.dataListGet,' this.dataListGet');
|
|
|
+
|
|
|
+ }else if(detail&&detail.formula.includes('FC.dataChange')){
|
|
|
+ //数据自变
|
|
|
+ this.formulaDetailMap = detail.map;
|
|
|
+
|
|
|
+ this.isDataChange = true;
|
|
|
+ this.dataForm=detail.formula
|
|
|
+ console.log( this.dataForm,' this.dataListGet');
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.isMore = false;
|
|
|
+ this.moreConditions = []
|
|
|
+ this.formulaDetailMap ={}
|
|
|
+ this.isGetData = false;
|
|
|
+ this.dataListGet=''
|
|
|
+ this.isDataChange = false;
|
|
|
+ this.dataForm='';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(detail&&detail.id){
|
|
|
//获取右边元素的字典
|
|
|
let dictMap=detail.dict
|
|
|
@@ -1475,9 +1731,16 @@ export default {
|
|
|
|
|
|
}
|
|
|
this.rightDict=dictArr
|
|
|
+ console.log( this.rightDict,' this.rightDict');
|
|
|
+
|
|
|
this.formulaid = detail.id;
|
|
|
//let formula = formulaStringToArray('FC.sum(FC.repeat(E[测试测试_222]))+FC.ifelse(3<E[测试测试_333]&&E[测试测试_333]<10,E[测试测试_222]+E[测试测试_333],E[测试测试_333])',detail.map,this.formulaMap);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let formula = formulaStringToArray(detail.formula,detail.map,this.formulaMap);
|
|
|
+ console.log(formula,'formula');
|
|
|
+
|
|
|
this.processFormula = formula.processFormula;
|
|
|
formula.resultFormula[0].id = this.resultFormula[0].id;
|
|
|
formula.resultFormula[0].name = this.resultFormula[0].name;
|
|
|
@@ -1834,7 +2097,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.icon-box .el-link{
|
|
|
- font-size: 24px;
|
|
|
+ font-size: 14px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
</style>
|
|
|
@@ -1847,4 +2110,31 @@ export default {
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
+.operation-box-inset{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
</style>
|
|
|
+<style scoped>
|
|
|
+.operation-symbol-box{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid rgb(229, 231, 235);
|
|
|
+ background-color: #F9FAFB;
|
|
|
+ padding: 10px 10px;
|
|
|
+ border-radius: 5px 5px 0px 0px;
|
|
|
+ margin-top: 10px;
|
|
|
+
|
|
|
+}
|
|
|
+.sele-ele-box1{
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid rgb(229, 231, 235);
|
|
|
+ border-radius: 0px 0px 5px 5px;
|
|
|
+
|
|
|
+ height: 50px;
|
|
|
+}
|
|
|
+.text-sm{
|
|
|
+ font-size: 14px;
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+</style>
|