sql715 2 tháng trước cách đây
mục cha
commit
80ecf8fc33

+ 69 - 2
zkqy-ui/src/assets/js/kFormDesign.js

@@ -1,3 +1,5 @@
+
+
 let tempData = [
   {
     "title": "基础组件",
@@ -431,7 +433,6 @@ let tempData = [
           "disabled": false,
           "hidden": false,
           "showLabel": false,
-          "hideSequence": false,
           "width": "100%"
         },
         "rules": [
@@ -468,6 +469,12 @@ let tempData = [
         ],
         "model": "",
         "key": "",
+        "rules": [
+          {
+            "required": false,
+            "message": "必填项"
+          }
+        ]
       },
       {
         "type": "selectInputList",
@@ -569,7 +576,7 @@ let tempData = [
         "icon": "icon-fengexian",
         "options": {
           "orientation": "left",
-          "noFormItem": true
+          "noFormItem": true,
         },
         "key": "",
         "model": ""
@@ -679,6 +686,66 @@ let tempData = [
         "model": ""
       }
     ]
+  },
+  {
+    "title": "自定义组件",
+    "list": [
+      {
+        "type": "calculation_table",
+        "label": "计算表格",
+        "icon": "icon-table",
+        // "component":Tabulation,
+        "options": {
+          "disabled": false,
+          "showSummary":false,
+          "showAddButton":true,
+          "formula":'sum',
+          "tableColor": "#fafafa",
+          "tableTextColor": "#000",
+          "jsTableFlag":true,
+          // 表关联
+          "mainTableCondition":'',
+          // 条件表字段
+          "joinTableCondition":'',
+
+          // "jsTableValue":'',
+          // "tjbzdTableValue":'',
+          "eventAttribute":true,
+          "eventAttributeList":[
+            {
+              "leftProp": "",
+              "rightProp": "",
+              "symbol":"",
+              "result":''
+            }
+          ],
+          "tableColumns": [
+            {
+              "prop": "",
+              "label": "",
+              "type":"",
+              "list": []
+            },
+            {
+              "prop": "",
+              "label": "",
+              "type":"",
+              "list": []
+            }
+          ],
+          
+        },
+        "tableData": [
+          // {
+          //   // "name": "",
+          // }
+        ],
+        
+        "key": "",
+        "model": ""
+      },
+     
+    ]
   }
 ]
 export default tempData

+ 0 - 17
zkqy-ui/src/views/tablelist/commonTable/BtnMenu.vue

@@ -7,22 +7,11 @@
           :icon="btnObj.btnIcon"
           type="warning"
           ><span>
-            <!-- <svg-icon
-              class="pre-icon"
-              v-if="btnObj.btnIcon"
-              slot="prefix"
-              :icon-class="btnObj.btnIcon" /> -->
             {{ btnObj.btnName }}
             <i class="el-icon-arrow-down el-icon--right"></i></span
         ></el-button>
         <el-button :icon="btnObj.btnIcon" v-else>
           <span>
-            <!-- <svg-icon
-              class="pre-icon"
-              v-if="btnObj.btnIcon"
-              slot="prefix"
-              v-hasPermi="[btnObj.btnHasPermi]"
-              :icon-class="btnObj.btnIcon" /> -->
             {{ btnObj.btnName }}
             <i class="el-icon-arrow-down el-icon--right"></i
           ></span>
@@ -39,12 +28,6 @@
               :icon="item.btnIcon"
             >
               <span>
-                <!-- <svg-icon
-                  v-if="item.btnIcon"
-                  class="pre-icon"
-                  slot="prefix"
-                  :icon-class="item.btnIcon"
-                /> -->
                 {{ item.btnName }}</span
               >
             </el-button>

+ 162 - 334
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -1,34 +1,16 @@
 <template>
   <el-card shadow="always" :body-style="{ padding: '10px' }">
     <div class="app-container">
-      <el-dialog
-        :title="upload.title"
-        :visible.sync="upload.open"
-        width="400px"
-        append-to-body
-      >
-        <el-upload
-          ref="upload"
-          :limit="1"
-          accept=".xlsx, .xls"
-          :headers="upload.headers"
-          :action="
-            upload.url +
-            '?updateSupport=' +
-            upload.updateSupport +
-            '&tableName=' +
-            tableName +
-            '&sqlKey=' +
-            tableKey
-          "
-          v-loading="upload.isUploading"
-          :disabled="upload.isUploading"
-          :on-progress="handleFileUploadProgress"
-          :on-success="handleFileSuccess"
-          :auto-upload="false"
-          :onChange="handleChange"
-          drag
-        >
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+        <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url +
+    '?updateSupport=' +
+    upload.updateSupport +
+    '&tableName=' +
+    tableName +
+    '&sqlKey=' +
+    tableKey
+    " v-loading="upload.isUploading" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress"
+          :on-success="handleFileSuccess" :auto-upload="false" :onChange="handleChange" drag>
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip text-center" slot="tip">
@@ -37,12 +19,8 @@
             <!--            是否更新已经存在的用户数据-->
             <!--          </div>-->
             <span>仅允许导入xls、xlsx格式文件。</span>
-            <el-link
-              type="primary"
-              :underline="false"
-              style="font-size: 12px; vertical-align: baseline"
-              @click="importTemplate"
-              >下载模板
+            <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
+              @click="importTemplate">下载模板
             </el-link>
           </div>
         </el-upload>
@@ -51,110 +29,51 @@
           <el-button @click="upload.open = false">取 消</el-button>
         </div>
       </el-dialog>
-      <Queryfrom
-        v-if="QueryfromLoading"
-        :formVals="templateInfo.where"
-        :statisticList="statisticList"
-        :showCount="showCount"
-        :showSearch="showSearch"
-        @getList="getList"
-        ref="mychild"
-      />
+      <Queryfrom v-if="QueryfromLoading" :formVals="templateInfo.where" :statisticList="statisticList"
+        :showCount="showCount" :showSearch="showSearch" @getList="getList" ref="mychild" />
       <el-row :gutter="10" class="mb8">
         <!-- 按钮行 start -->
-        <btn-menu-list
-          @topBtnHandler="topBtnHandler"
-          :topBtnArr="topBtnArr"
-          :selection="selection"
-        ></btn-menu-list>
-        <right-toolbar
-          :showCount.sync="showCount"
-          :showSearch.sync="showSearch"
-          :counts="true"
-          @queryTable="pageList"
-        ></right-toolbar>
+        <btn-menu-list @topBtnHandler="topBtnHandler" :topBtnArr="topBtnArr" :selection="selection"></btn-menu-list>
+        <right-toolbar :showCount.sync="showCount" :showSearch.sync="showSearch" :counts="true"
+          @queryTable="pageList"></right-toolbar>
       </el-row>
-      <el-table
-        v-loading="loading"
-        :data="tableList"
-        @selection-change="handleSelectionChange"
-        ref="tableRef"
-        :cell-style="cellStyle"
-        :reserve-selection="true"
-        :row-key="getRowKey"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          reserve-selection
-          align="center"
-        >
+      <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" ref="tableRef"
+        :cell-style="cellStyle" :reserve-selection="true" :row-key="getRowKey">
+        <el-table-column type="selection" width="55" reserve-selection align="center">
         </el-table-column>
-        <el-table-column
-          v-for="item in columns"
-          :key="item.key"
-          :label="item.value"
-          align="center"
-          :prop="item.key"
-        >
+        <el-table-column v-for="item in columns" :key="item.key" :label="item.value" align="center" :prop="item.key">
           <template slot-scope="scope">
             <!-- 存在字段样式或字典样式 -->
-            <template
-              v-if="
-                scope.row.styleFieldObj != undefined &&
-                scope.row.styleFieldObj[item.key]
-              "
-            >
+            <template v-if="scope.row.styleFieldObj != undefined &&
+    scope.row.styleFieldObj[item.key]
+    ">
               <!-- 字段样式 -->
               <template v-if="scope.row.styleFieldObj[item.key].styleType == 1">
                 <!-- 一般字体样式 -->
-                <template
-                  v-if="scope.row.styleFieldObj[item.key].fieldStyleType == 0"
-                >
-                  <span
-                    :style="`color:${
-                      scope.row.styleFieldObj[item.key].fontColor
-                    }`"
-                    >{{ scope.row[item.key] }}</span
-                  >
+                <template v-if="scope.row.styleFieldObj[item.key].fieldStyleType == 0">
+                  <span :style="`color:${scope.row.styleFieldObj[item.key].fontColor
+    }`">{{ scope.row[item.key] }}</span>
                 </template>
                 <!-- 标签字体样式 -->
-                <template
-                  v-else-if="
-                    scope.row.styleFieldObj[item.key].fieldStyleType == 1
-                  "
-                >
-                  <el-tag
-                    :type="scope.row.styleFieldObj[item.key].tagType"
-                    :effect="
-                      scope.row.styleFieldObj[item.key].isTagFullBg
-                        ? 'dark'
-                        : 'light'
-                    "
-                  >
+                <template v-else-if="scope.row.styleFieldObj[item.key].fieldStyleType == 1
+    ">
+                  <el-tag :type="scope.row.styleFieldObj[item.key].tagType" :effect="scope.row.styleFieldObj[item.key].isTagFullBg
+    ? 'dark'
+    : 'light'
+    ">
                     {{ scope.row[item.key] }}
                   </el-tag>
                 </template>
               </template>
               <!-- 字典样式 -->
-              <template
-                v-else-if="scope.row.styleFieldObj[item.key].styleType == 2"
-              >
-                <span
-                  v-if="
-                    scope.row.styleFieldObj[item.key].listClass == '' ||
-                    scope.row.styleFieldObj[item.key].listClass == 'default'
-                  "
-                  >{{ scope.row.styleFieldObj[item.key].dictLabel }}</span
-                >
-                <el-tag
-                  v-else
-                  :type="
-                    scope.row.styleFieldObj[item.key].listClass == 'primary'
-                      ? ''
-                      : scope.row.styleFieldObj[item.key].listClass
-                  "
-                  >{{ scope.row.styleFieldObj[item.key].dictLabel }}
+              <template v-else-if="scope.row.styleFieldObj[item.key].styleType == 2">
+                <span v-if="scope.row.styleFieldObj[item.key].listClass == '' ||
+    scope.row.styleFieldObj[item.key].listClass == 'default'
+    ">{{ scope.row.styleFieldObj[item.key].dictLabel }}</span>
+                <el-tag v-else :type="scope.row.styleFieldObj[item.key].listClass == 'primary'
+    ? ''
+    : scope.row.styleFieldObj[item.key].listClass
+    ">{{ scope.row.styleFieldObj[item.key].dictLabel }}
                 </el-tag>
               </template>
             </template>
@@ -164,93 +83,50 @@
             </template>
           </template>
         </el-table-column>
-        <el-table-column
-          v-if="isShowExcuteCol"
-          label="操作"
-          align="center"
-          class-name="small-padding fixed-width"
-        >
+        <el-table-column v-if="isShowExcuteCol" label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
-            <Menu
-              :row="scope.row"
-              v-for="btnObj in excuteBtnArr"
-              :key="btnObj.id"
-              :listAll="btnObj"
-              @excuteHandler="excuteHandler"
-            ></Menu>
+            <Menu :row="scope.row" v-for="btnObj in excuteBtnArr" :key="btnObj.id" :listAll="btnObj"
+              @excuteHandler="excuteHandler"></Menu>
           </template>
         </el-table-column>
       </el-table>
-      <pagination
-        v-show="total > 0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="pageList"
-      />
+      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+        @pagination="pageList" />
       <!-- 添加或修改 -->
       <el-dialog :title="title" :visible.sync="open" append-to-body>
         <!-- <template v-else> -->
-        <div
-          v-show="formType == 'dragFormGroup' && !formListShow"
-          class="dialog_loading"
-        >
+        <div v-show="formType == 'dragFormGroup' && !formListShow" class="dialog_loading">
           <i class="el-icon-loading"></i>
         </div>
         <template>
-          <!-- :style="{ opacity: formListShow ? 1 : 0 }" -->
-          <FormList
-            v-show="formType == 'dragFormGroup' && formListShow && !isLayout"
-            ref="formGroupRef"
-            :formList="formList"
-          ></FormList>
-          <LayoutIndex
-            v-show="formType == 'dragFormGroup' && formListShow && isLayout"
-            ref="formGroupLayoutRef"
-            :layoutData="layoutData"
-          ></LayoutIndex>
-          <!-- <div v-show="times" class="times">
-            <i class="el-icon-loading" style="font-size: 30px"></i>
-          </div> -->
-          <!-- <el-button @click="showValue">test</el-button> -->
+          <FormList v-show="formType == 'dragFormGroup' && formListShow && !isLayout" ref="formGroupRef"
+            :formList="formList"></FormList>
+          <LayoutIndex v-show="formType == 'dragFormGroup' && formListShow && isLayout" ref="formGroupLayoutRef"
+            :layoutData="layoutData"></LayoutIndex>
         </template>
         <template>
-          <k-form-build
-            v-if="jsonData && formType == 'dragForm'"
-            class="formBuild"
-            ref="addFromRef"
-            :dynamicData="dynamicData"
-            :defaultValue="defaultValue"
-            @submit="tempSubBtn"
-            @change="formChangeHandler"
-            :value="jsonData"
-            :tableData="tableTempList"
-          />
+          <k-form-build v-if="jsonData && formType == 'dragForm'" class="formBuild" ref="addFromRef"
+            :dynamicData="dynamicData" :defaultValue="defaultValue" @submit="tempSubBtn" @change="formChangeHandler"
+            :value="jsonData" :tableData="tableTempList" />
         </template>
-
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="editConfirmHandler"
-            >确 定
+        <template>
+          <el-table v-if="jsonData && formType == 'calculateForm'" :data="calculateTableData" style="width: 100%">
+            <el-table-column v-for="(item, index) in calculateTableColumn" :key="index" :prop="item.prop"
+              :label="item.label"   header-align="center"  align="center">
+            </el-table-column>
+          </el-table>
+        </template>
+        <div slot="footer" class="dialog-footer" v-if="jsonData && formType !== 'calculateForm'">
+          <el-button type="primary" @click="editConfirmHandler">确 定
           </el-button>
           <el-button @click="cancel">取 消</el-button>
         </div>
       </el-dialog>
 
       <!-- 绑定按钮dialog -->
-      <el-dialog
-        title="提示"
-        :visible.sync="btnDialogVisible"
-        :before-close="handleClose"
-      >
-        <DialogTemplate
-          ref="dialogRef"
-          :groupKey="groupKey"
-          :rowobj="rowobj"
-          :subCount="subCount"
-          :tableCount="tableCount"
-          :subTableName="subTableName"
-          @addList="addListHandler"
-        >
+      <el-dialog title="提示" :visible.sync="btnDialogVisible" :before-close="handleClose">
+        <DialogTemplate ref="dialogRef" :groupKey="groupKey" :rowobj="rowobj" :subCount="subCount"
+          :tableCount="tableCount" :subTableName="subTableName" @addList="addListHandler">
         </DialogTemplate>
         <span slot="footer" class="dialog-footer">
           <el-button @click="btnDialogVisible = false">取 消</el-button>
@@ -259,20 +135,9 @@
       </el-dialog>
 
       <!-- 自定义弹窗 -->
-      <el-dialog
-        title="提示"
-        :visible.sync="btnDialogVisible"
-        :before-close="handleClose"
-      >
-        <DialogTemplate
-          ref="dialogRef"
-          :groupKey="groupKey"
-          :rowobj="rowobj"
-          :subCount="subCount"
-          :tableCount="tableCount"
-          :subTableName="subTableName"
-          @addList="addListHandler"
-        >
+      <el-dialog title="提示" :visible.sync="btnDialogVisible" :before-close="handleClose">
+        <DialogTemplate ref="dialogRef" :groupKey="groupKey" :rowobj="rowobj" :subCount="subCount"
+          :tableCount="tableCount" :subTableName="subTableName" @addList="addListHandler">
         </DialogTemplate>
         <span slot="footer" class="dialog-footer">
           <el-button @click="btnDialogVisible = false">取 消</el-button>
@@ -297,9 +162,7 @@
         </span>
         <template #footer>
           <span>
-            <el-button type="primary" @click="toastShow = false"
-              >确认</el-button
-            >
+            <el-button type="primary" @click="toastShow = false">确认</el-button>
           </span>
         </template>
       </el-dialog>
@@ -346,7 +209,17 @@ export default {
   },
   data() {
     return {
-      isLayout:false,
+      calculateTableData: [
+        { date: '2023-10-01', name: '张三', address: '北京市' },
+        { date: '2023-10-02', name: '李四', address: '上海市' },
+        { date: '2023-10-03', name: '王五', address: '广州市' }
+      ],
+      calculateTableColumn: [
+        { prop: 'date', label: '日期', width: '180' },
+        { prop: 'name', label: '姓名', width: '180' },
+        { prop: 'address', label: '地址' }
+      ],
+      isLayout: false,
       QueryfromLoading: false,
       layoutData: "", //表单组布局数据
       times: 1, //请求次数
@@ -510,9 +383,9 @@ export default {
   created() {
     // 得到当前展示的table的唯一标识
     this.tableKey = this.$route.query.tableKey;
-    console.log('this.$route.query',this.$route.query)
+    console.log('this.$route.query', this.$route.query)
     // 优化共通模版查询调用逻辑 (Don't fucking change it)
-    console.log('this.queryParams',this.queryParams)
+    console.log('this.queryParams', this.queryParams)
     this.getList(this.queryParams);
   },
   mounted() {
@@ -556,18 +429,18 @@ export default {
     /** 查询列表 */
     getList(queryParams) {
       this.loading = true;
-        // 序列化当前查询参数列表
-        queryParams && (this.queryParams.queryMap = Object.assign({}, queryParams.queryMap));
-        if (typeof queryParams.queryMap.timehorizon != undefined) {
-          // timehorizon 时间范围转换字符串回传后台
-          this.queryParams.queryMap.timehorizon = JSON.stringify(
-            Object.assign({}, queryParams.queryMap.timehorizon)
-          );
-        }
+      // 序列化当前查询参数列表
+      queryParams && (this.queryParams.queryMap = Object.assign({}, queryParams.queryMap));
+      if (typeof queryParams.queryMap.timehorizon != undefined) {
+        // timehorizon 时间范围转换字符串回传后台
+        this.queryParams.queryMap.timehorizon = JSON.stringify(
+          Object.assign({}, queryParams.queryMap.timehorizon)
+        );
+      }
       // 获取当前表单结构信息
       dragTableInfo({ queryMap: { tableKey: this.tableKey } })
         .then((res) => {
-          console.log('[表格中dragTableInfo的结果中的resultMap属性]',res.data.resultMap)
+          console.log('[表格中dragTableInfo的结果中的resultMap属性]', res.data.resultMap)
           // 得到当前模版信息 --- sql columns queryWhere
           this.templateInfo = res.data.resultMap;
           this.QueryfromLoading = true; // 加载查询组件
@@ -581,6 +454,7 @@ export default {
           this.excuteBtnArr = res.data.resultMap.button?.filter(
             (item) => item.btnGroupType == "right"
           );
+          // console.log('[========excuteBtnArr==============]',this.excuteBtnArr)
           this.topBtnArr =
             res.data.resultMap.button?.filter(
               (item) => item.btnGroupType == "top"
@@ -702,9 +576,9 @@ export default {
       this.$refs.mychild.pageList(
         row == undefined
           ? {
-              limit: this.queryParams.pageSize,
-              page: this.queryParams.pageNum,
-            }
+            limit: this.queryParams.pageSize,
+            page: this.queryParams.pageNum,
+          }
           : row
       );
     },
@@ -713,9 +587,9 @@ export default {
       this.ids = selection.map(
         (item) =>
           item[
-            camelCase(
-              this.tableName + "_" + this.templateInfo.template?.primaryKey
-            )
+          camelCase(
+            this.tableName + "_" + this.templateInfo.template?.primaryKey
+          )
           ]
       );
       this.selection = selection;
@@ -802,7 +676,7 @@ export default {
     // 延迟
     sleep(ms) {
       var unixtime_ms = new Date().getTime();
-      while (new Date().getTime() < unixtime_ms + ms) {}
+      while (new Date().getTime() < unixtime_ms + ms) { }
       return "";
     },
     /** 修改按钮操作 */
@@ -995,8 +869,9 @@ export default {
       console.log(this.times);
       return;
     },
-
+    // 计算表格方法
     async handleCalculate(row, btnData) {
+      console.log("btnData, row", btnData, row);
       let nameTable = this.templateInfo.template.dtTableName;
       this.rowobj = {};
       let obj = {};
@@ -1014,6 +889,8 @@ export default {
       // 新的修改请求
       try {
         let { btnFormType, btnGroupType } = btnData;
+        // console.log("btnFormType, btnGroupType", btnFormType, btnGroupType);
+        // console.log('this.currentBtnData', this.currentBtnData)
         let payLoad = {};
         let primary = camelCase(
           this.tableName + "_" + this.templateInfo.template?.primaryKey
@@ -1053,83 +930,34 @@ export default {
             this.$message.error("当前按钮未绑定表单!");
             return;
           }
-          if (btnFormType == "dragFormGroup") {
-            //表单组
-            if (res.code == 200) {
-              if (res.data.mainForm) {
-                //表单组
-                // 判断是否有布局数据
-                this.isLayout =
-                  res.data.layoutJson &&
-                  JSON.parse(res.data.layoutJson)?.list.length > 0;
-                this.transformDataFormat(res.data);
-                if (this.isLayout) {
-                  //自定义布局
-                  this.layoutData = JSON.parse(JSON.stringify(res.data));
-                }
-              } else {
-                this.formList = res.data;
-              }
-              this.open = true;
-              if (btnData.btnFormType == "dragFormGroup") {
-                if (this.times) {
-                  this.times = 0;
-                  // debugger;
-                  this.$nextTick(async () => {
-                    // debugger;
-                    setTimeout(() => {
-                      this.handleUpdate(row, btnData).then((res) => {
-                        this.formListShow = true;
-                      });
-                      // setTimeout(() => {
-                      //   this.times = 0;
-                      // }, 1000);
-                    }, 1000);
-                  });
-                }
-              }
-              if (this.isLayout) {
-                //布局样式
-                this.$nextTick(() => {
-                  // 手动触发布局组件的数据处理函数
-                  this.$refs.formGroupLayoutRef?.initLayoutData(
-                    JSON.parse(JSON.stringify(res.data))
-                  );
-                });
-              }
-            } else {
-              this.$message.error("网络异常,请稍后再试");
-            }
-          } else {
-            let optionsData = "",
-              templateData = "";
-            if (btnGroupType == "top") {
-              optionsData = res.data.dfFormSql;
-              templateData = res.data.dfVueTemplate;
-            } else {
-              //修改
-              optionsData = res.data.template.dfFormSql;
-              templateData = res.data.template.dfVueTemplate;
-
-              this.addRealFieldName(res.data.result.resultMap);
-              let resultMap = res.data.result.resultMap;
-
-              Object.assign(this.defaultValue, resultMap);
-            }
-            //单个表单
+          if (btnFormType == "calculateForm") {
+            console.log('========calculateForm==========',res)
+            console.log('========res.data.result.resultMap==========',res.data.result.resultMap)
+            let optionsData = res.data.template.dfFormSql;//暂时不知道是干什么的
+            let templateData = res.data.template.dfVueTemplate;
+            this.addRealFieldName(res.data.result.resultMap);//没返回?
+            let resultMap = res.data.result.resultMap;
+            //this.defaultValue回显表格数据
+            Object.assign(this.defaultValue, resultMap);
+            // dynamicData下拉框动态数据--data上这么备注的,是个要传给k-form-build的对象
+            // 当 optionsData 存在时执行 JSON.parse(optionsData) 并赋值给 this.dynamicData。
             optionsData && (this.dynamicData = JSON.parse(optionsData));
             this.jsonData = JSON.parse(templateData);
-            // console.log('[----- this.jsonData -----]', this.jsonData )
             this.open = true;
             this.title = "计算表单";
-            this.form.password = this.initPassword;
-            if (btnGroupType == "right") {
-              this.$nextTick(() => {
-                this.$refs.addFromRef.setData(res.data.result.resultMap);
-                console.log('[----- res.data.result.resultMap -----]', res.data.result.resultMap )
-
-              });
+            let calculateResultMap = res.data.result.calculateResultMap
+            if(calculateResultMap && calculateResultMap.tableColumn && calculateResultMap.tableValue){
+              this.calculateTableData = calculateResultMap.tableValue
+              this.calculateTableColumn = calculateResultMap.tableColumn
+            }else{
+              this.calculateTableData = []
+              this.calculateTableColumn = []
             }
+            // if (this.$refs.addFromRef) {
+            //   this.$refs.addFromRef.setData(res.data.result.resultMap);
+            // } else {
+            //   console.error('addFromRef is undefined');
+            // }
           }
         } else {
           this.subTableName = res.data.result.dragTables[1].dtTableName;
@@ -1218,9 +1046,9 @@ export default {
         defaultValue: mainForm.showValue ? mainForm.showValue[0].resultMap : {},
       });
       if (subFormList && subFormList.length > 0) {
-        console.log("subFormList",subFormList)
+        console.log("subFormList", subFormList)
         subFormList.forEach((item) => {
-          console.log("sub item",item)
+          console.log("sub item", item)
           let showValue = null;
           if (item.showValue) {
             showValue = item.showValue[0];
@@ -1270,7 +1098,7 @@ export default {
             formType: item.showTemplate.spare == "2" ? "batch" : "normal",
             defaultValue,
             insertMap: item.insertMap,
-            updateMap:item.updateMap,
+            updateMap: item.updateMap,
             isMainForm: false,
           });
           console.log(this.FormNameList)
@@ -1367,7 +1195,7 @@ export default {
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     // 批量删除接口
     handleBatchDelete() {
@@ -1393,7 +1221,7 @@ export default {
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -1427,7 +1255,7 @@ export default {
     importTemplate() {
       this.download(
         process.env.VUE_APP_BASE_API1 +
-          `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
+        `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
         {},
         `下载模版名称${new Date().getTime()}.xlsx`
       );
@@ -1443,8 +1271,8 @@ export default {
       this.$refs.upload.clearFiles();
       this.$alert(
         "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-          response.msg +
-          "</div>",
+        response.msg +
+        "</div>",
         "导入结果",
         { dangerouslyUseHTMLString: true }
       );
@@ -1473,7 +1301,7 @@ export default {
       this.addLists.push(...val);
     },
     // 绑定弹窗Dialog确定按钮
-    btnComfirm() {},
+    btnComfirm() { },
     // 去掉表名 开头字母小写
     formatField(field = "", tableName) {
       let temp = field.replace(tableName, "");
@@ -1501,7 +1329,7 @@ export default {
       });
     },
     // 处理 动态表单 动态表格 修改数据
-    getEditBatchData(values, data) {},
+    getEditBatchData(values, data) { },
     // 处理 表单组  含有动态表格  新增数据
     getFormGroupBatchData(values, index, result) {
       let tableName = Object.keys(values.data.batch)[0];
@@ -1554,16 +1382,16 @@ export default {
                   item.fieldValue
                     ? item.fieldValue
                     : this.currentRow[
-                        camelCase(item.fieldName.replace(".", "_"))
-                      ];
+                    camelCase(item.fieldName.replace(".", "_"))
+                    ];
               });
               conditionData.forEach((item) => {
                 data.conditionMap[item.fieldName.split(".")[1]] =
                   item.fieldValue
                     ? item.fieldValue
                     : this.currentRow[
-                        camelCase(item.fieldName.replace(".", "_"))
-                      ];
+                    camelCase(item.fieldName.replace(".", "_"))
+                    ];
               });
             }
             if (Object.keys(this.defaultValue).length) {
@@ -1620,13 +1448,13 @@ export default {
             promiseArray.push(...item);
           });
         } else {
-          console.log("res",this.FormNameList)
+          console.log("res", this.FormNameList)
           promiseArray = this.FormNameList.map((item) => {
-            console.log("如何循环---",item);
+            console.log("如何循环---", item);
             return this.$refs.formGroupRef?.getFormData(item);
           });
         }
-        console.log(promiseArray,"111111")
+        console.log(promiseArray, "111111")
         Promise.all(promiseArray).then(async (res) => {
           // console.log("res", res);
           // return;
@@ -1693,8 +1521,8 @@ export default {
                     item.fieldValue
                       ? item.fieldValue
                       : this.currentRow[
-                          camelCase(item.fieldName.replace(".", "_"))
-                        ];
+                      camelCase(item.fieldName.replace(".", "_"))
+                      ];
                 });
                 payLoad.updateCommonEntityList.push(result);
               } else {
@@ -1744,7 +1572,7 @@ export default {
                   let fieldName = formItem.split(".")[1];
                   let value =
                     this.currentRow[
-                      camelCase(relateFormItem.replace(".", "_"))
+                    camelCase(relateFormItem.replace(".", "_"))
                     ];
                   result.conditionMap[fieldName] = value;
                   payLoad.updateCommonEntityList.push(result);
@@ -1794,11 +1622,11 @@ export default {
             });
           } else if (this.currentBtnData.btnType == "INITIATED") {
             payLoad.updateCommonEntityList = res.map((item, index) => {
-              let a={};
-              if(item.updateMap?.length){
-                 item.updateMap.forEach((item) => {
-                   a[item.fieldName.split(".")[1]] =item.refValue;
-                 })
+              let a = {};
+              if (item.updateMap?.length) {
+                item.updateMap.forEach((item) => {
+                  a[item.fieldName.split(".")[1]] = item.refValue;
+                })
               }
               let result = {
                 basicMap: {
@@ -1819,8 +1647,8 @@ export default {
                     item.fieldValue
                       ? item.fieldValue
                       : this.currentRow[
-                          camelCase(item.fieldName.replace(".", "_"))
-                        ];
+                      camelCase(item.fieldName.replace(".", "_"))
+                      ];
                 });
               } else {
                 // 从表条件
@@ -1833,7 +1661,7 @@ export default {
               return result;
             });
           }
-          console.log( payLoad.updateCommonEntityList,"hmc");
+          console.log(payLoad.updateCommonEntityList, "hmc");
           data.basicMap.BpmRunNodeFormDateVo = payLoad;
           // return;
           try {
@@ -1910,8 +1738,8 @@ export default {
     // 使用提交数据类型的按钮获取数据
     tempSubBtn(getData) {
       getData()
-        .then((values) => {})
-        .catch(() => {});
+        .then((values) => { })
+        .catch(() => { });
     },
     // 判断是否生效行样式
     cellStyle({ row, column, rowIndex, columnIndex }) {
@@ -2054,7 +1882,7 @@ export default {
     },
     // 操作列回调
     excuteHandler(btnData, row) {
-      console.log("btnData, row", btnData, row);
+      // console.log("btnData, row", btnData, row);
       let { btnType, btnParams, btnFormType } = btnData;
       this.formType = btnFormType;
       this.currentBtnData = btnData;
@@ -2226,8 +2054,8 @@ export default {
                 item.fieldValue
                   ? item.fieldValue
                   : this.currentRow[
-                      camelCase(item.fieldName.replace(".", "_"))
-                    ];
+                  camelCase(item.fieldName.replace(".", "_"))
+                  ];
             });
           }
           data.basicMap.btnType = this.currentBtnData.btnType;
@@ -2250,10 +2078,10 @@ export default {
           this.$refs.mychild.pageList();
           // this.$modal.msgSuccess("操作成功");
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     // k-form-build表单变化回调
-    formChangeHandler(value, label) {},
+    formChangeHandler(value, label) { },
   },
 };
 </script>