From e55cf23dc536ce06b9a8b14edd889215956c1eda Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 21 四月 2023 19:30:16 +0800
Subject: [PATCH] 增加弹窗界面,以及代码整合

---
 Source/UBCS-WEB/src/views/code/code.vue |  795 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 772 insertions(+), 23 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index c684910..ba79473 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -88,20 +88,21 @@
 
     <!-- 瀵硅瘽妗� -->
     <el-dialog title="缂栫爜瑙勫垯浣跨敤鑼冨洿"
-                append-to-body
-                :visible.sync="codeRangeSettingBox"
-                width="800px">
+        append-to-body
+        :visible.sync="codeRangeSettingBox"
+        width="800px">
       <avue-crud
-              :option="dialogeOption" 
-              :table-loading="dialogLoading"
-              :data="useRangeData"
-              @refresh-change="refreshUseRangeChange"></avue-crud>
+        :option="dialogeOption" 
+        :table-loading="dialogLoading"
+        :data="useRangeData"
+        @refresh-change="refreshUseRangeChange">
+      </avue-crud>
     </el-dialog>
     <!-- 鍏嬮殕瀵硅瘽妗� -->
     <el-dialog title="鍏嬮殕缂栫爜瑙勫垯"
-                append-to-body
-                :visible.sync="cloneSettingBox"
-                width="800px">
+        append-to-body
+        :visible.sync="cloneSettingBox"
+        width="800px">
       <clone-code></clone-code>
     </el-dialog>
 
@@ -177,19 +178,287 @@
     </avue-crud>
     </basic-container>
 
-     <!-- 鍩虹缂栫爜瑙勫垯瀵硅瘽妗� @closed="closeRefresh"-->
+     <!-- 鍩虹缂栫爜瑙勫垯瀵硅瘽妗� -->
      <el-dialog title="娣诲姞鐮佹淇℃伅"
-                    append-to-body
-                    :visible.sync="addBasicCodeSettingBox"
-                    width="780px"
-                    style=" margin-top: -8vh;"
-                    destroy-on-close>
-        <add-basic-code ref='addBasicChild'></add-basic-code>
+        :visible.sync="addBasicCodeSettingBox"
+        width="780px"
+        append-to-body
+        style="margin-top: -8vh;"
+        destroy-on-close>
+
+        <!-- 灞炴�х爜娈碉紝灞炴�ч�夋嫨寮圭獥 -->
+        <el-dialog title="涓篬灞炴�閫夊彇鍊�"
+          append-to-body
+          :visible.sync="isShowSelectAttrOption"
+          width="78%"
+          style="height: 100%; margin-top: -8vh; overflow: hidden">
+          <div style="overflow-y: auto; height: 60vh">
+            <el-row>
+              <!-- 宸︿晶涓婚搴撳垎绫绘爲 -->
+              <el-col :span="5">
+                <div class="box">
+                  <el-scrollbar style="height: auto; border-bottom-right-radius:8px ">
+                    <basic-container>
+                      <div class="abox">
+                        <avue-tree :data="attrClassifyTreeData" :option="treeOption" @node-click="nodeClick"/>
+                      </div>
+                    </basic-container>
+                  </el-scrollbar>
+                </div>
+              </el-col>
+
+              <!-- 鍙充晶琛ㄦ牸鏄剧ず鍖哄煙 -->
+              <el-col span="19">
+                <basic-container>
+                  <div class="bbox">
+                  <avue-crud ref="crud"
+                      v-model="form"
+                      :data="selectattrData"
+                      :option="attrOption"
+                      :permission="permissionList"
+                      :table-loading="selectAttrOptionLoading"
+                      @search-change="selectAttrOptionSearchChange"
+                      @search-reset="searchAttrReset"
+                      @selection-change="selectionChangeAttr">
+                  </avue-crud>
+                  </div>
+                </basic-container>
+              </el-col>
+
+            </el-row>
+          </div>
+
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="isShowSelectAttrOption = false">鍙� 娑�</el-button>
+            <el-button type="primary" @click="savelistClassifyLinkAttr">纭� 瀹�</el-button>
+          </div>
+          
+        </el-dialog>
+
+         <!-- 灞炴�х爜娈碉紝鍏紡缂栬緫妗嗗脊绐� -->
+        <el-dialog title="鍏紡缂栬緫妗�"
+          append-to-body
+          :visible.sync="isShowformulaEdit"
+          @close="closeFormulaEdit"
+          width="78%"
+          style="height: 150vh; margin-top: -13vh; overflow: hidden">
+
+          <div style="overflow-y: auto; height: 80vh">
+            <el-row>
+              <!-- 宸︿晶鍏紡鍐呭 -->
+              <el-col :span="14" style="overflow: hidden">
+                <el-card class="box-card" style="height: 33vh; overflow-y: auto; overflow-x: auto;">
+                    <div slot="header" class="clearfix">
+                      <span style="font-size: medium;">鍏紡鍐呭</span>
+                      <el-button type="primary" size="mini" style="float: right;" @click="saveFormulaContent">纭畾</el-button>
+                      <el-button type="warning" size="mini" style="margin-right: 10px; float: right;" @click="resetformulaContent">娓呯┖鍐呭</el-button>
+                    </div>
+                    <div class="text item">
+                      <el-input type="textarea" :rows="5" style="width: 560px;" v-model="formulaContent"></el-input>
+                    </div>
+
+                </el-card>
+              </el-col>
+
+              <!-- 鍙充晶杩愮畻绗� -->
+              <el-col :span="10">
+                <el-card class="box-card" style="height: 33vh;">
+                  <div slot="header" class="clearfix">
+                    <span style="font-size: medium;">杩愮畻绗�</span>
+                  </div>
+                  <div class="text item">
+                    <div class="formula-editor">
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'7'})">7</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'8'})">8</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'9'})">9</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'/'})">/</button><br/>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'4'})">4</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'5'})">5</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'6'})">6</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'*'})">*</button><br/>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'1'})">1</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'2'})">2</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'3'})">3</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>'})">-</button><br/>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'0'})">0</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'00'})">00</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'.'})">.</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'+'})">+</button><br/>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'->'})">-></button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'=='})">==</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'('})">(</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':')'})">)</button><br/>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'<'})">&lt;</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>'})">&gt;</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'<='})">&lt;=</button>
+                        <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>='})">&gt;=</button>
+                    </div>
+                  </div>
+                </el-card>
+              </el-col>
+            </el-row>
+
+            <el-row>
+
+              <!-- 宸︿晶鍏紡閫夋嫨鍖哄煙 -->
+              <el-col :span="14" style="overflow: hidden">
+                <el-card class="box-card" style="height: 40vh; overflow-y: auto; overflow-x: auto;">
+                  <div slot="header" class="clearfix">
+                    <span style="font-size: medium;">鍏紡閫夋嫨</span>
+                  </div>
+                  <div class="text item">
+                    <el-tabs v-model="activeName">
+
+                      <el-tab-pane label="甯哥敤" name="first">
+                        <el-table
+                          :data="commonFormulaTableData"
+                          :show-header="false"
+                          @row-dblclick="dbClickAddContent"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="300">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="300">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+
+                      <el-tab-pane label="璐㈠姟" name="second">
+                        <el-table
+                          :data="financialFormulaTableData"
+                          @row-dblclick="dbClickAddContent"
+                          :show-header="false"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="300">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="300">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+
+                      <el-tab-pane label="鏃ユ湡" name="third">
+                        <el-table
+                          :data="dateFormulaTableData"
+                          :show-header="false"
+                          @row-dblclick="dbClickAddContent"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="300">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="300">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+
+                      <el-tab-pane label="鏁板" name="fourth">
+                        <el-table
+                          :data="mathFormulaTableData"
+                          :show-header="false"
+                          @row-dblclick="dbClickAddContent"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="300">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="300">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+
+                      <el-tab-pane label="鍏朵粬" name="five">
+                        <el-table
+                          :data="otherFormulaTableData"
+                          @row-dblclick="dbClickAddContent"
+                          :show-header="false"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="300">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="300">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+
+                    </el-tabs>
+                    
+                  </div>
+                </el-card>
+              </el-col>
+
+              <!-- 鍙充晶鍙橀噺閫夋嫨鍖哄煙 -->
+              <el-col :span="10" style="overflow: hidden">
+                <el-card class="box-card" style="height: 40vh; overflow-y: auto; overflow-x: auto;">
+                  <div slot="header" class="clearfix">
+                    <span style="font-size: medium;">鍙橀噺</span>
+                  </div>
+                  <div class="text item">
+                    <el-tabs v-model="activeNameAttr">
+                      <el-tab-pane label="鏈満鏅彉閲�" name="first">
+                        <el-table
+                          :data="thisSceneTableData"
+                          @row-dblclick="dbClickAddContent"
+                          :show-header="false"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="40">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="100">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+                      <el-tab-pane label="绯荤粺鍙橀噺" name="second">
+                        <el-table
+                          :data="systemVariableTableData"
+                          @row-dblclick="dbClickAddContent"
+                          :show-header="false"
+                          style="width: 100%">
+                          <el-table-column
+                            prop="formula"
+                            width="150">
+                          </el-table-column>
+                          <el-table-column
+                            prop="desc"
+                            width="150">
+                          </el-table-column>
+                        </el-table>
+                      </el-tab-pane>
+                    </el-tabs>
+                  </div>
+                </el-card>
+              </el-col>
+            </el-row>
+          </div>
+          
+        </el-dialog>
+
+        <!-- 娣诲姞鐮佹淇℃伅鐨勮嚜瀹氫箟缁勪欢 -->
+        <add-basic-code ref='addBasicChild' @openAttrSelectOrGetValue="openAttrSelectOrGetValue" @openformulaEdit="openformulaEdit"></add-basic-code>
+
+        <!-- 绗竴灞傚璇濇鐨勬寜閽拰锛岀嚎鏉� -->
         <el-divider direction="horizontal"></el-divider>
         <div slot="footer" class="dialog-footer">
           <el-button @click="addBasicCodeSettingBox = false">鍙� 娑�</el-button>
           <el-button type="primary" @click="saveBasicCode">淇� 瀛�</el-button>
         </div>
+      
       </el-dialog>
 
   </basic-container>
@@ -199,8 +468,11 @@
 <script>
   import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus } from "@/api/code/mdmrule";
   import { gridCodeBasicSec, downOrderNum, upOrderNum, deleteData, editSave, getObjectByOid, listDataByOids, refDataGrid} from "@/api/code/codebasic";
+  import { treeTopCodeClassify, listClassifyLinkAttr } from "@/api/code/codeclassify";
   import optionBasic from "@/const/code/codebasic";
   import optionRule from "@/const/code/mdmrule";
+  import attrOption from "@/const/code/selectattroption";
+  import treeOption from "@/const/code/classifytreeoption";
   import {mapGetters} from "vuex";
 
 export default {
@@ -216,7 +488,7 @@
           total: 0
         },
         selectionList: [],
-        //缂栫爜瑙勫垯琛ㄦ牸閰嶇疆
+        /*缂栫爜瑙勫垯琛ㄦ牸閰嶇疆*/
         optionRule: optionRule,
 
         data: [],
@@ -225,17 +497,374 @@
         cloneSettingBox: false,
         optionBasic: optionBasic,
 
-        //鍩虹鐮佹灞曠ず
+        /*鍩虹鐮佹鐩稿叧鏁版嵁*/
         basicData:[],
         loadingBasic: true,
         selectionBasicList: [],
         addBasicCodeSettingBox: false,
+        /* 涓哄睘鎬ч�夊彇鍊肩獥鍙f樉绀烘墦寮�鎺у埗鍙橀噺 */
+        isShowSelectAttrOption: false,
+        /* 涓哄睘鎬ч�夊�煎乏渚ф爲鏁版嵁 */
+        attrClassifyTreeData: [],
+        treeOption: treeOption,
+        currentSelectTreeData: '', //褰撳墠閫変腑鐨勬爲鑺傜偣
+        /* 涓哄睘鎬ч�夊�煎彸渚ц〃鏍肩浉鍏虫暟鎹� */
+        attrOption: attrOption,
+        selectattrData: [],
+        selectAttrOptionLoading: false,
+        selectionChangeAttrList: [],
+        /*鍏紡缂栬緫妗嗗璇濇*/
+        isShowformulaEdit: false, //鍏紡缂栬緫妗嗗璇濇鏄剧ず鎺у埗
+        formulaContent: '', //鍏紡缂栬緫妗嗗唴瀹�
+        activeName: 'first', //褰撳墠娲诲姩鐨則ab
+        activeNameAttr: 'first', //鍙橀噺涓殑褰撳墠娲诲姩tab
+
         
-        /*浣跨敤鑼冨洿瀵硅瘽妗嗘帶鍒�*/
+        //甯哥敤鍏紡
+        commonFormulaTableData: [{
+          "formula": 'if(compare,trueResult,falseResult)',
+          "desc": '濡傛灉compare鐨勮〃杈惧紡涓簍rue锛屽垯鎵цtrueResult鐨勮〃杈惧紡锛屽惁鍒欐墽琛宖laseResult.渚嬪if(3>2,2*(3+2),3/(2-4)),鍊肩瓑浜�10',
+        },
+        {
+          "formula": 'sum(douber1,douber2)',
+          "desc": '涓や釜鏍煎紡涓篸ouber鐨勫弬鏁版眰鍜�',
+        },
+        {
+          "formula": 'sub(douber1,douber2)',
+          "desc": '鏍煎紡涓篸ouber鐨勫弬鏁癲ouber1鍑忓幓鏍煎紡涓篸ouber鐨勫弬鏁癲ouber2',
+        },
+        {
+          "formula": 'mul(douber1,douber2)',
+          "desc": '涓や釜鏍煎紡涓篸ouber鐨勫弬鏁扮浉涔�',
+        },
+        {
+          "formula": 'div(douber1,douber2)',
+          "desc": '鏍煎紡涓篸ouber鐨勫弬鏁癲ouber1闄や互鏍煎紡涓篸ouber鐨勫弬鏁癲ouber2.褰揹ouber2绛変簬0鐨勬椂鍊欙紝杩斿洖0;濡傛灉闄や笉灏界殑鏃跺�欎繚鐣�10浣嶅皬鏁�',
+        },
+        {
+          "formula": 'mod(int,int)',
+          "desc": '姹備綑鏁�',
+        },
+        {
+          "formula": 'toInt(string)',
+          "desc": '杞崲涓篿nt鏍煎紡',
+        },
+        {
+          "formula": 'doubleRound(string,count)',
+          "desc": '澶勭悊douber鐨勫皬鏁颁綅鏁帮紝count琛ㄧず灏忔暟浣嶆暟',
+        },
+        {
+          "formula": 'zeroIfNull(value)',
+          "desc": '濡傛灉鍙傛暟鐨勫�间负null鎴栬��"",灏嗚繑鍥�0',
+        },
+        {
+          "formula": 'endsWith(string,str1)',
+          "desc": '瀛楃涓瞫tring鏄笉鏄互str1缁撳熬',
+        },
+        {
+          "formula": 'startsWith(string,str1)',
+          "desc": '瀛楃涓瞫tring鏄惁浠tr1寮�澶�',
+        },
+        {
+          "formula": 'charAt(string,index)',
+          "desc": '鑾峰彇瀛楃涓瞫tring涓index浣嶇疆鐨勫瓧绗︼紝濡傛灉闀垮害灏忎簬index锛屽垯杩斿洖',
+        },
+        {
+          "formula": 'equalsIgnoreCase(str1,str2)',
+          "desc": '瀛楃涓瞫tr1鍜屽瓧绗︿覆str2鏄惁鐩哥瓑',
+        },
+        {
+          "formula": 'indexOf(str1,str2)',
+          "desc": '瀛楃涓瞫tr2鍦ㄥ瓧绗︿覆str1涓娆″嚭鐜扮殑浣嶇疆',
+        },
+        {
+          "formula": 'isEmpty(str1)',
+          "desc": '鍙傛暟str1鏄惁涓虹┖锛屽叾涓璶ull杩欎釜瀛楃涓蹭篃琛ㄧず涓虹┖',
+        },
+        {
+          "formula": 'lastIndexOf(str1,str2)',
+          "desc": '瀛楃涓瞫tr2鍦ㄥ瓧绗︿覆str1涓渶鍚庡嚭鐜扮殑浣嶇疆',
+        },
+        {
+          "formula": 'leftStr(str1,index)',
+          "desc": '鑾峰彇index浣嶇疆宸︿晶鐨勬墍鏈夊瓧绗�',
+        },
+        {
+          "formula": 'rightStr(str1,str2)',
+          "desc": '鑾峰彇index浣嶇疆鍙充晶鐨勬墍鏈夊瓧绗�',
+        },
+        {
+          "formula": 'length(str1)',
+          "desc": '鍙傛暟str1鐨勯暱搴�',
+        },
+        {
+          "formula": 'mid(str1,start,end)',
+          "desc": '鑾峰彇str1鐨勪粠start鍒癳nd鐩存帴鐨勫瓧绗︿覆锛屽嚭鐜板紓甯告椂杩斿洖',
+        },
+        {
+          "formula": 'tolowercase(str1)',
+          "desc": '灏嗗瓧绗︿覆str1杞负灏忓啓',
+        },
+        {
+          "formula": 'touppercase(str1)',
+          "desc": '灏嗗瓧绗︿覆str1杞负澶у啓',
+        },
+        {
+          "formula": 'trimzero(str1)',
+          "desc": '鍘婚櫎瀛楃涓瞫tr1涓殑0',
+        },
+        {
+          "formula": 'MD5(str1)',
+          "desc": '灏嗗瓧绗︿覆杩涜MD5鍔犲瘑',
+        },
+       ],
+       //璐㈠姟鍏紡
+        financialFormulaTableData: [{
+            "formula": 'toChinese(value)',
+            "desc": '灏嗛樋鎷変集鏁板瓧杞负涓烘眽瀛楀ぇ鍐欐柟寮�'
+          },
+          {
+            "formula": 'getChineseCurrency(value)',
+            "desc": '灏嗛樋鎷変集鏁板瓧杞负涓烘眽瀛楅噾棰濆ぇ鍐欐柟寮忥紝涓巘ochiness鐨勫尯鍒槸杩欎釜浼氭樉绀哄厓銆佽銆佸垎'
+          },
+          {
+            "formula": 'setThmark(value)',
+            "desc": '涓哄弬鏁皏alue璁剧疆鍗冨垎浣�'
+          }
+        ],
+        //鏃ユ湡鍏紡
+        dateFormulaTableData: [{
+            "formula": 'compareDate(d1,d2)',
+            "desc": '瀵规瘮鍙傛暟d1,d2鐨勫ぇ灏忋�俤1,d2涓簓yyy-MM-dd鏍煎紡鐨勬棩鏈熷瓧绗︿覆'
+          },
+          {
+            "formula": 'nowDate()',
+            "desc": '鑾峰彇褰撳墠鏃ユ湡'
+          },
+          {
+            "formula": 'chinaDate(d1)',
+            "desc": '灏嗘椂闂磋浆鎹负鍐滃巻锛宒1鏄痽yyy-MM-dd鏍煎紡鐨勬棩鏈熷瓧绗︿覆'
+          },
+          {
+            "formula": 'dateAdd(d1,count)',
+            "desc": '鍦╠1鐨勫熀纭�涓婃坊鍔燾ount澶�,d1涓簓yyy-MM-dd HH:mm:ss鏍煎紡鐨勬椂闂村瓧绗︿覆'
+          },
+          {
+            "formula": 'dateBalanceYear(sourceDate,targetDate,false)',
+            "desc": '璁$畻鐩稿樊鐨勫勾浠斤紝姣斿璁$畻骞撮緞锛宼argetDate涓�""琛ㄧず褰撳墠鏃堕棿锛岀涓変釜鍙傛暟涓簍rue琛ㄧず鏈夊浣欑殑鏈堜唤鎴栬�呭ぉ鏁版椂锛屽氨鍔�1;'
+          },
+          {
+            "formula": 'dateBalanceDay(sourceDate,targetDate)',
+            "desc": '璁$畻鐩稿樊鐨勫ぉ鏁帮紝targetDate涓�""琛ㄧず褰撳墠鏃堕棿'
+          },
+          {
+            "formula": 'dateformat(d1,format)<',
+            "desc": '灏嗗綋鍓嶇殑鏃ユ湡锛堟椂闂达級瀛楃涓茶浆涓烘寚瀹氱殑瀛楃涓诧紝濡傛灉format鐨勫唴瀹规湁绌烘牸锛岃浣跨敤&浠f浛'
+          },
+          {
+            "formula": 'nowDatetime()',
+            "desc": '鑾峰彇褰撳墠鏃ユ湡鍜屾椂闂淬�傛牸寮忎负yyyy-MM-dd HH:mm:ss'
+          },
+          {
+            "formula": 'dayOf(d1)',
+            "desc": '鑾峰彇鏍煎紡涓簓yyy-MM-dd鐨勬棩鏈熺殑澶╂暟'
+          },
+          {
+            "formula": 'nowMon()',
+            "desc": '鑾峰彇褰撳墠鐨勬湀浠斤紝鏍煎紡涓篗M'
+          },
+          {
+            "formula": 'monOf(d1)',
+            "desc": '鑾峰彇鏃ユ湡d1鐨勬湀浠芥暟'
+          },
+          {
+            "formula": 'nowTime()',
+            "desc": '鑾峰彇褰撳墠鏃堕棿锛屾牸寮忎负HH:mm:ss'
+          },
+          {
+            "formula": 'nowYear()',
+            "desc": '鑾峰彇骞翠唤锛屾牸寮忎负yyyy'
+          },
+          {
+            "formula": 'yearOf()',
+            "desc": '鑾峰彇鏃堕棿d1鐨勫勾浠�'
+          }
+        ],
+        //鏁板鍏紡
+        mathFormulaTableData: [{
+            "formula": 'abs(value)',
+            "desc": '姹傚弬鏁皏alue鐨勭粷瀵瑰�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'acos(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弽浣欏鸡锛寁alue蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'asin(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弽姝e鸡锛寁alue蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'atan(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弽姝e垏锛寁alue蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'cbrt(value)',
+            "desc": '姹傚弬鏁皏alue鐨勭珛鏂规牴锛寁alue蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'ceil(value)',
+            "desc": '杩斿洖涓嶅ぇ浜庡弬鏁皏alue鐨勬渶灏忔暣鏁帮紝渚嬪ceil(1.7)灏辩瓑浜�2锛寁alue蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'cos(value)',
+            "desc": '姹傚弬鏁皏alue鐨勪綑寮﹀�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'cosh(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弻鏇蹭綑寮﹀�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'exp(n)',
+            "desc": '娆ф媺鏁� e 鐨刵娆″箓锛宯蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'floor(n)',
+            "desc": '娆ф媺鏁� e 鐨刵娆″箓鍑�1锛宯蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'log(value)',
+            "desc": '杩斿洖涓嶅皬浜庡弬鏁皏alue鐨勬渶澶ф暣鏁帮紝渚嬪floor(1.7)绛変簬1锛宯蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'log10(value)',
+            "desc": '鑷劧瀵规暟,value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'log1p(value)',
+            "desc": '璁$畻搴曟暟涓� 10 鐨勫鏁�,value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'random()',
+            "desc": '杩斿洖鍙傛暟涓� 1 涔嬪拰鐨勮嚜鐒跺鏁帮紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'rint(value)',
+            "desc": '杩斿洖涓�涓吉闅忔満鏁帮紝璇ュ�煎ぇ浜庣瓑浜� 0.0 涓斿皬浜� 1.0'
+          },
+          {
+            "formula": 'round(value)',
+            "desc": '杩斿洖鍏跺�兼渶鎺ヨ繎鍙傛暟骞朵笖鏄暣鏁扮殑 double 鍊笺�傚鏋滀袱涓暣鏁扮殑 double 鍊奸兘鍚屾牱鎺ヨ繎锛岄偅涔堢粨鏋滃彇鍋舵暟銆傜壒娈婃儏鍐垫槸锛氬鏋滃弬鏁板�兼槸鏁存暟锛岄偅涔堢粨鏋滃氨鏄鍙傛暟銆傚鏋滃弬鏁版槸 NaN 鎴栨棤绌峰ぇ鎴栨闆舵垨璐熼浂锛岄偅涔堢粨鏋滀笌鍙傛暟鐩稿悓'
+          },
+          {
+            "formula": 'signum(value)',
+            "desc": '绗﹀彿鍑芥暟锛涘鏋滃弬鏁颁负 0锛屽垯杩斿洖 0锛涘鏋滃弬鏁板ぇ浜� 0锛� 鍒欒繑鍥� 1.0锛涘鏋滃弬鏁板皬浜� 0锛屽垯杩斿洖 -1.0'
+          },
+          {
+            "formula": 'sin(value)',
+            "desc": '姹傚弬鏁皏alue鐨勬寮﹀�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'sinh(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弻鏇叉寮﹀�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'tan(value)',
+            "desc": '姹傚弬鏁皏alue鐨勬鍒囧�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'tanh(value)',
+            "desc": '姹傚弬鏁皏alue鐨勫弻鏇叉鍒囧�硷紝value蹇呴』涓烘暟瀛楁牸寮�'
+          },
+          {
+            "formula": 'max(v1,v2)',
+            "desc": '姹備袱涓暟涓殑杈冨ぇ鐨勫�硷紝v1,v2閮藉繀椤讳负鏁板瓧鏍煎紡锛屼緥濡俶ax(3.2,3)灏辩瓑浜�3.2'
+          },
+          {
+            "formula": 'min(v1,v2)',
+            "desc": '姹備袱涓暟涓殑杈冨皬鐨勫�硷紝v1,v2閮藉繀椤讳负鏁板瓧鏍煎紡锛屼緥濡俶ax(3.2,3)灏辩瓑浜�3'
+          },
+          {
+            "formula": 'sqrt(value)',
+            "desc": '姹傚钩鏂规牴'
+          },
+        ],
+        //鍏朵粬鍏紡
+        otherFormulaTableData: [{
+            "formula": 'getcolvalue(servername,tablename,fieldname,pkField,pkValue)',
+            "desc": '鏌ヨservername涓璽ablename鏁版嵁搴撹〃涓璮ieldname瀛楁鐨勫�硷紝pkfield琛ㄧず涓婚敭鐨勫瓧娈靛悕绉帮紝pkValue琛ㄧず涓婚敭鐨勫�硷紝serverName鐜板湪榛樿涓簂ocalServer'
+          },
+        ],
+        
+        //鏈満鏅彉閲�
+        thisSceneTableData: [{
+            "formula": '${}',
+            "desc": ' '
+          },
+        ],
+        //绯荤粺鍙橀噺
+        systemVariableTableData: [{
+            "formula": '#CURRENTUSER.OID#',
+            "desc": '褰撳墠鐢ㄦ埛鐨勪富閿�'
+          },
+          {
+            "formula": '#CURRENTUSER.ID#',
+            "desc": '褰撳墠鐢ㄦ埛鐨勮处鎴�'
+          },
+          {
+            "formula": '#CURRENTTIME#',
+            "desc": '褰撳墠鏃堕棿'
+          },
+          {
+            "formula": '#CURRENTDATE#',
+            "desc": '褰撳墠鏃ユ湡'
+          },
+          {
+            "formula": '#CURRENTDATETIME#',
+            "desc": '褰撳墠鏃ユ湡鏃堕棿'
+          },
+          {
+            "formula": '#CURRENTUSER_NAME#',
+            "desc": '褰撳墠鐢ㄦ埛鐨勫鍚�'
+          },
+          {
+            "formula": '#CURRENTUSER.SECRETGRADE#',
+            "desc": '褰撳墠鐢ㄦ埛瀵嗙骇'
+          },
+          {
+            "formula": '#CURRENTUSER.IPSECRET#',
+            "desc": '褰撳墠鐢ㄦ埛鐨処P瀵嗙骇'
+          },
+          {
+            "formula": '#CURRENTUSER.BUSINESSUNIT#',
+            "desc": '褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏�'
+          },
+          {
+            "formula": '#CURRENTUSER.BUSINESSUNITNAME#',
+            "desc": '褰撳墠鐢ㄦ埛鎵�灞炰笟鍔″崟鍏冨悕绉�'
+          },
+          {
+            "formula": '#CURRENTUSER.GROUPOID#',
+            "desc": '褰撳墠鐢ㄦ埛鐨勯儴闂ㄤ富閿�'
+          },
+          {
+            "formula": '#CURRENTUSER.GROUPNAME#',
+            "desc": '褰撳墠鐢ㄦ埛鎵�灞為儴闂ㄥ悕绉�'
+          },
+          {
+            "formula": '#CURRENTUSER.EMAIL#',
+            "desc": '褰撳墠鐢ㄦ埛閭欢鍦板潃'
+          },
+          {
+            "formula": '#CURRENTUSER.ROLENAME#',
+            "desc": '褰撳墠鐢ㄦ埛鎵�灞炶鑹插悕绉�'
+          }
+        ],
+
+        /*浣跨敤鑼冨洿瀵硅瘽妗嗘樉绀烘帶鍒�*/
         codeRangeSettingBox: false,
         useRangeData: [],
         dialogLoading: true,
-        /*浣跨敤鑼冨洿瀵硅瘽妗�*/
+        /*浣跨敤鑼冨洿瀵硅瘽妗嗛厤缃�*/
         dialogeOption: {
         height: 'auto',
         calcHeight: 30,
@@ -279,6 +908,111 @@
       },
     },
     methods: {
+      
+      // 鎵撳紑鍏紡缂栬緫妗嗭紝绗簩灞傚祵濂楀璇濇
+      openformulaEdit(){
+        this.isShowformulaEdit = true;
+      },
+
+      //鍙屽嚮娣诲姞鍏紡鍐呭
+      dbClickAddContent(row){
+        //console.log(row.formula);
+        this.formulaContent = this.formulaContent + row.formula;
+      },
+
+      //娓呯┖鍏紡鍐呭
+      resetformulaContent(){
+        this.formulaContent = '';
+      },
+
+      //鍏抽棴鏃舵竻绌轰笂娆″叕寮忓唴瀹�
+      closeFormulaEdit(){
+        this.resetformulaContent();
+      },
+
+      //缂栬緫瀹屾垚鍏紡鍐呭鍥炶皟鍒板瓙缁勪欢杩涜鍥炴樉
+      saveFormulaContent(){
+        console.log(this.formulaContent);
+        if(this.formulaContent.trim == null){
+          this.$message.warning("鍏紡鍐呭涓嶈兘涓虹┖锛�");
+          return;
+        }
+        this.$refs.addBasicChild.saveFormulaContent(this.formulaContent);
+        this.isShowformulaEdit = false;  
+      },
+
+      // 鎵撳紑灞炴�ч�夊彇鍊硷紝绗簩灞傚祵濂楀璇濇
+      openAttrSelectOrGetValue(){
+        //console.log(111);
+        this.isShowSelectAttrOption = true;
+      },
+      
+      // 鑾峰彇褰撳墠琚�変腑鏍戣妭鐐圭殑oid
+      nodeClick(data) {
+        this.currentSelectTreeData = data;
+        this.loadlistClassifyLinkAttr()
+      },
+
+      // 鍔犺浇鍒嗙被杩炴帴灞炴�ц〃鏍兼暟鎹�
+      loadlistClassifyLinkAttr(){
+        this.selectAttrOptionLoading = true;
+        listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{
+         //console.log(res.data.data);
+         //閫犲亣鏁版嵁
+         let dataInfo =[ 
+          {"id":"address","name":"浼氳瀹ゅ湴鍧�","oid":"058D840D-1010-A7DE-7C52-B39C03CE89C1","attrLength":"150","description":"","attributeDataTypeText":"瀛楃涓�"},
+          {"id":"businesslicensetype","name":"钀ヤ笟鎵х収绫诲瀷","oid":"BDAC6D3E-1827-35A0-F3CA-0E58A43F6A07","attrLength":"255","description":"钀ヤ笟鎵х収绫诲瀷","attributeDataTypeText":"瀛楃涓�"},
+          {"id":"certificatenumber","name":"淇濆瘑璇佺紪鍙�","oid":"E2BC8332-A721-3713-26C3-C9F6340C2C1D","attrLength":"255","description":"淇濆瘑璇佺紪鍙�","attributeDataTypeText":"瀛楃涓�"},
+        ]
+        this.selectattrData = dataInfo;
+        this.selectAttrOptionLoading = false;
+        })
+      },
+
+      // 鐐瑰嚮鎼滅储鍚庤Е鍙戣浜嬩欢
+      selectAttrOptionSearchChange(params, done) {
+        this.query = params;
+        console.log(params);  //杩欏効闇�瑕佹敼
+        this.loadlistClassifyLinkAttr({"page":1,"limit":-1 ,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid});
+        done();
+      },
+
+      // 灞炴�у彇鍊煎綋鍓嶉�変腑琛屽彂鐢熷彉鍖栨椂瑙﹀彂
+      selectionChangeAttr(list){
+        this.selectionChangeAttrList = list;
+      },
+
+      //閲嶇疆浣嶅睘鎬ч�夊彇鍊艰〃鏍肩殑鎼滅储妗嗕箣鍚庣殑鍥炶皟
+      searchAttrReset() {
+        this.loadlistClassifyLinkAttr()
+      },
+
+      // 灞炴�у彇鍊奸�夊彇鎴愬姛淇濆瓨涔嬪悗瑙﹀彂
+      savelistClassifyLinkAttr(){
+        if(this.selectionChangeAttrList.length != 1){
+          this.$message.warning("鍙兘閫夋嫨涓�鏉℃暟鎹�!");
+          return false;
+        }
+        let data = {
+          "referAttributeId":this.selectionChangeAttrList[0].id,
+          "referAttributeName":this.selectionChangeAttrList[0].name,
+          "referCodeClassifyOid": this.currentSelectTreeData.key,
+          "referCodeClassifyOidName": this.currentSelectTreeData.title,
+        }
+        //console.log(data);
+        //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉
+        this.$refs.addBasicChild.selectedListClassifyLinkAttr(data);
+        this.isShowSelectAttrOption = false;
+      },
+
+      // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙�
+      selectionChange(list) {
+        this.selectionList = list;
+        if(this.selectionList.length > 0){
+          this.currentCodeRuleOid = this.selectionList [list.length-1];
+          this.loadBasic(this.selectionList[list.length-1]);
+        }
+      },
 
       // 鎵撳紑鏂板绐楀彛
       addBasicCodeSec(){
@@ -350,6 +1084,7 @@
           this.loadingBasic = false;
         });
       },
+      // 鍩虹鐮佹閫変腑鏃惰Е鍙�
       selectionBasicChange(list) {
         this.selectionBasicList = list;
         //console.log(this.selectionBasicList);
@@ -561,11 +1296,10 @@
         });
       }
     }
-  };
+};
 </script>
 
 <style>
-
   .el-divider--horizontal {
       margin-top: 19px !important;
       margin-bottom: -20px !important;
@@ -573,5 +1307,20 @@
       margin: 0;
   }
 
+  .el-card__body > .abox {
+    height: 50vh;
+  }
+
+  .el-col-5 > .box {
+    height: 55vh;
+  }
+
+  .operator_,filter, .layui-btn{
+    width:60px;
+  }
+
+  .formula-editor{
+    
+  }
 
 </style>
\ No newline at end of file

--
Gitblit v1.9.3