Zn 1 年間 前
コミット
1707add6dc

+ 8 - 0
ruoyi-ui/src/components/kFormDesign/OptionsEdit.vue

@@ -478,6 +478,11 @@ export default {
       deep: true,
       immediate: true,
     },
+    // 'formData.tableName': {
+    //   handler(nval) {
+    //     if(nval){}
+    //   }
+    // }
   },
   computed: {
     ...mapState({
@@ -565,6 +570,9 @@ export default {
         };
       }
       this.formData.dynamicName = this.myOptions.dynamicKey;
+      if (this.formData.tableName) {
+        this.getFieldOptions(this.formData.tableName);
+      }
       this.isShow = true;
     },
     // 弹窗取消回调

+ 8 - 2
ruoyi-ui/src/views/bussiness/processMange.vue

@@ -76,7 +76,7 @@
                 getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
               }}</span>
               <span v-else-if="col.prop == 'benTaskNodeState'">{{
-                scope.row.benTaskNodeState == "0" ? "已执行" : "未执行"
+                scope.row.benTaskNodeState == "0" ? "未执行" : "已执行"
               }}</span>
               <span v-else>{{ scope.row[col.prop] }}</span>
             </template>
@@ -249,7 +249,13 @@ export default {
     // 打开运行节点弹窗
     opneExecuteNode(row) {
       console.log(row);
-      this.myForm = row.benTaskNodeName.split("-")[0];
+      let preFix = row.benTaskNodeName.split("-")[0];
+      if (preFix) {
+        //前缀式表单弹窗
+        this.myForm = preFix;
+      } else {
+        //拖拽表单或工艺弹窗
+      }
       this.row = row; //记录当前行数据
       this.open = true; // 打开弹窗
       // 根据当前节点绑定的表单信息查询对应的表单进行展示

ファイルの差分が大きいため隠しています
+ 454 - 432
ruoyi-ui/src/views/dialogMange/index.vue


+ 324 - 319
ruoyi-ui/src/views/dialogTemplate/components/index.vue

@@ -1,28 +1,33 @@
 <template>
   <div class="bigBox">
-   <div class="info">
-    <p class="tt">基础信息</p>
-    <div v-for="(item, index) in infoData[0]" :key="item.title">
-      <span class="titlestyle">{{ item.value }}</span>
-      <span class="infostyle" v-for="(val, index) in infoData[1]">{{ val[item.key] }}</span>
-    </div>
-   </div>
-   <div class="tableBox">
-    <div class="top">
-      <div class="left" v-if="tableCount[0]">
-        <p>{{ tableCount[0].statisticTitle }}</p>
-        <i>{{ tableCount[0].result }}</i>
-      </div>
-      <div class="right">
-        <p>是否外协</p>
-        <el-checkbox v-model="checked"></el-checkbox>
+    <div class="info">
+      <p class="tt">基础信息</p>
+      <div v-for="item in infoData[0]" :key="item.title">
+        <span class="titlestyle">{{ item.value }}</span>
+        <span
+          class="infostyle"
+          v-for="(val, index) in infoData[1]"
+          :key="index"
+          >{{ val[item.key] }}</span
+        >
       </div>
     </div>
-    <!-- 按钮组 -->
-    <el-button-group>
-      <el-button v-for="item in controlBtnArr">
-        <template>
-          <span @click="clickHandler(item, row)"
+    <div class="tableBox">
+      <div class="top">
+        <div class="left" v-if="tableCount[0]">
+          <p>{{ tableCount[0].statisticTitle }}</p>
+          <i>{{ tableCount[0].result }}</i>
+        </div>
+        <div class="right">
+          <p>是否外协</p>
+          <el-checkbox v-model="checked"></el-checkbox>
+        </div>
+      </div>
+      <!-- 按钮组 -->
+      <el-button-group>
+        <el-button v-for="(item, index) in controlBtnArr" :key="index">
+          <template>
+            <span @click="clickHandler(item, row)"
               ><svg-icon
                 v-if="item.btnIcon"
                 class="pre-icon"
@@ -30,70 +35,75 @@
                 :icon-class="item.btnIcon"
               />{{ item.btnName }}</span
             >
-        </template>
-      </el-button>
-    </el-button-group>
-    
-    <el-form ref="tableform" :model="tableDataForm">
-      <el-table
-        border
-        :data="tableData[1].data"
-        style="width: 100%; margin-bottom: 20px">
-        <el-table-column
-          v-for="item in tableData[0].column"
-          v-if="item.key !== 'id'"
-          :prop="item.key"
-          :label="item.value"
-          width="180">
-          <template slot-scope="scope" >
-            <el-input :v-if="scope.row[item.key]" v-model="scope.row[item.key]"></el-input>
           </template>
-        </el-table-column>
-        <el-table-column
+        </el-button>
+      </el-button-group>
+
+      <el-form ref="tableform" :model="tableDataForm">
+        <el-table
+          border
+          :data="tableData[1].data"
+          style="width: 100%; margin-bottom: 20px"
+        >
+          <el-table-column
+            v-for="item in tableData[0].column"
+            :prop="item.key"
+            :label="item.value"
+            :key="item.value"
+            width="180"
+          >
+            <template slot-scope="scope">
+              <el-input
+                :v-if="scope.row[item.key]"
+                v-model="scope.row[item.key]"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <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>
+            </template>
+          </el-table-column>
+        </el-table>
 
-          <template slot-scope="scope">
-            <Menu
-              :row="scope.row"
-              v-for="btnObj in excuteBtnArr"
-              :key="btnObj.id"
-              :listAll="btnObj"
-              @excuteHandler="excuteHandler"
-            ></Menu>
-          </template>
-        </el-table-column>
-
-      </el-table>
+        <div>
+          <b>统计信息 </b>
+          <span v-for="(item, index) in subCount" :key="index"
+            >{{ item.statisticTitle }}: {{ item.result }}</span
+          >
+        </div>
 
-      <div>
-        <b>统计信息 </b>
-        <span v-for="item in subCount">{{ item.statisticTitle }}: {{ item.result }}</span>
-      </div>
+        <el-form-item>
+          <el-button class="addBtn" icon="el-icon-plus" @click="addBtnHandler"
+            >新增</el-button
+          >
+          <el-button
+            class="saveBtn"
+            icon="el-icon-document-checked"
+            @click="saveBtnHandler"
+            >保存</el-button
+          >
+        </el-form-item>
+      </el-form>
 
-      <el-form-item>
-        <el-button class="addBtn" icon="el-icon-plus"
-        @click="addBtnHandler"
-        >新增</el-button>
-        <el-button 
-        class="saveBtn"
-        icon="el-icon-document-checked"
-        @click="saveBtnHandler"
-        >保存</el-button>
-      </el-form-item>
-    </el-form>
-   
-    <div>
+      <div></div>
     </div>
-   </div>
   </div>
 </template>
 
 <script>
-import { dragGroupTableInfo } from "@/api/relateTable/index"
+import { dragGroupTableInfo } from "@/api/relateTable/index";
 import {
   btnCommonApi,
   delTableData,
@@ -103,25 +113,25 @@ import {
   getInfoBySqlKey,
   addTableData,
   batchEdit,
-  getStatisticList
+  getStatisticList,
 } from "@/api/tablelist/commonTable";
-import {camelCase} from "@/utils";
+import { camelCase } from "@/utils";
 import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
 export default {
   components: { Menu },
-  data () {
-   return {
-    // 基础信息行数据
-    infoData: [],
-    listInfo: {},
-    // 是否外协
-    checked: false,
-    tableData: [],
-    // 动态增加表格数据
-    editData: [],
-    tableDataForm: {},
-    tableLists: [],
-    queryParams: {
+  data() {
+    return {
+      // 基础信息行数据
+      infoData: [],
+      listInfo: {},
+      // 是否外协
+      checked: false,
+      tableData: [],
+      // 动态增加表格数据
+      editData: [],
+      tableDataForm: {},
+      tableLists: [],
+      queryParams: {
         pageNum: 1, // 第几页
         pageSize: 10, // 每页大小
         orderByColumn: "", // 根据某列排序
@@ -138,25 +148,25 @@ export default {
           queryCriteriaValue: "",
           // tableCondition: ''
         },
-    },
-    columns: [],
-    // 排序方式 默认降序
-    sortOrder: true,
-    tableName: "",
-    // 当前模版信息
-    templateInfo: {},
-    queryFromWhere:'',
-    condition: [],
-    // 当前点击按钮的数据
-    currentBtnData: {},
-    // 操作列 按钮数据
-    excuteBtnArr: [],
-    // 新增保存的数据
-    addListData:[],
-    controlBtnArr: [],
-   }
- },
-  props: ['groupKey','rowobj','tableCount','subCount', 'subTableName' ],
+      },
+      columns: [],
+      // 排序方式 默认降序
+      sortOrder: true,
+      tableName: "",
+      // 当前模版信息
+      templateInfo: {},
+      queryFromWhere: "",
+      condition: [],
+      // 当前点击按钮的数据
+      currentBtnData: {},
+      // 操作列 按钮数据
+      excuteBtnArr: [],
+      // 新增保存的数据
+      addListData: [],
+      controlBtnArr: [],
+    };
+  },
+  props: ["groupKey", "rowobj", "tableCount", "subCount", "subTableName"],
   computed: {
     isShowExcuteCol() {
       // console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
@@ -166,169 +176,171 @@ export default {
   },
   methods: {
     // 新增
-    addBtnHandler(){
+    addBtnHandler() {
       // if (this.editData == undefined) {
       //   this.editData = new Array();
       // }
 
       let obj = {
         // id:'',
-      }
-      this.addListData.push(obj)
+      };
+      this.addListData.push(obj);
       this.tableData[1].data.push(obj);
     },
     // 保存
-    saveBtnHandler(){
+    saveBtnHandler() {
       console.log(this.addListData);
       let data = {
-        addListMap:this.addListData,
-        basicMap:{
+        addListMap: this.addListData,
+        basicMap: {
           btnType: 10,
           tableName: this.subTableName,
           visible: true,
         },
         commMap: {},
         conditionMap: {},
-      }
-      btnCommonApi(data).then(res => {
-        console.log('保存', res);
-      })
+      };
+      btnCommonApi(data).then((res) => {
+        console.log("保存", res);
+      });
     },
-    async getLists(groupKey){
-      let res = await dragGroupTableInfo({queryMap: {groupKey: groupKey}})
-      this.tableLists = JSON.parse(res.msg)
+    // 获取弹窗信息
+    async getLists(groupKey) {
+      let res = await dragGroupTableInfo({ queryMap: { groupKey: groupKey } });
+      this.tableLists = JSON.parse(res.msg);
       // console.log(this.tableLists);
 
-      this.tableLists.forEach(async item => {
-        if(item.sort == 0){
-
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
-          this.getTableHandle(res,item.sort).then(result => {
-            console.log('result:',result);
-            this.infoData.push(result)
-            this.$set(this.infoData)
-          })
-
-        }else if(item.sort == 1){
-
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
+      this.tableLists.forEach(async (item) => {
+        if (item.sort == 0) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
+          this.getTableHandle(res, item.sort).then((result) => {
+            console.log("result:", result);
+            this.infoData.push(result);
+            this.$set(this.infoData);
+          });
+        } else if (item.sort == 1) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
           this.excuteBtnArr = res.data.resultMap.button;
-          this.getTableHandle(res,item.sort).then(result => {
+          this.getTableHandle(res, item.sort).then((result) => {
             this.tableData.push({
-              column: result
-            })
-          })
+              column: result,
+            });
+          });
           // console.log(this.tableData);
-        }else if(item.sort == 2){
+        } else if (item.sort == 2) {
+          const res = await dragTableInfo({
+            queryMap: { tableKey: item.tableKey },
+          });
 
-          const res = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
-          
-          console.log('butt',res.data.resultMap.button)
-          this.controlBtnArr = res.data.resultMap.button[0]
-          this.controlBtnArr = this.controlBtnArr.children
+          console.log("butt", res.data.resultMap.button);
+          this.controlBtnArr = res.data.resultMap.button[0];
+          this.controlBtnArr = this.controlBtnArr.children;
         }
-      })
+      });
     },
-    async getTableHandle(res,sort){
-        this.columns = []
-        // 得到当前模版信息 --- sql columns queryWhere
-        this.templateInfo = res.data.resultMap;
-      
-        // console.log(res.data.resultMap.querySql);
-        this.queryParams.orderByColumn =
-          res.data.resultMap.querySql.orderByColumn;
+    // 获取基础信息 表头数据
+    async getTableHandle(res, sort) {
+      this.columns = [];
+      // 得到当前模版信息 --- sql columns queryWhere
+      this.templateInfo = res.data.resultMap;
+
+      // console.log(res.data.resultMap.querySql);
+      this.queryParams.orderByColumn =
+        res.data.resultMap.querySql.orderByColumn;
+
+      this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
+      // 根据拖拽时设置当前列表排列顺序
+      this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC";
+      this.tableName = this.templateInfo.template.dtTableName;
+      // 得到查询条件
+      this.queryFromWhere = res.data.resultMap.where;
 
-        this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
-        // 根据拖拽时设置当前列表排列顺序
-        this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC"
-        this.tableName = this.templateInfo.template.dtTableName;
-        // 得到查询条件
-        this.queryFromWhere = res.data.resultMap.where;
-        
-        //  得到当前列表信息
-        this.columns = this.columnsHandler(
-          JSON.parse(this.templateInfo.template.dtColumnName)
+      //  得到当前列表信息
+      this.columns = this.columnsHandler(
+        JSON.parse(this.templateInfo.template.dtColumnName)
+      );
+      if (this.templateInfo) {
+        this.tableCondition = this.templateInfo.querySql.tableCondition;
+        this.tableCondition = this.tableCondition.split("AND");
+        // console.log(this.tableCondition);
+        this.condition = [];
+
+        // 调用查询需要携带当前table的唯一标识
+        this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+
+        this.queryParams.orderByColumn = camelCase(
+          this.queryParams.orderByColumn || ""
         );
-        if (this.templateInfo !== {}) {
-            this.tableCondition = this.templateInfo.querySql.tableCondition
-            this.tableCondition = this.tableCondition.split('AND')
-            // console.log(this.tableCondition);
-            this.condition = [];
-              
-            // 调用查询需要携带当前table的唯一标识
-            this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+        // 根据sql语句查询当前表数据
 
-            this.queryParams.orderByColumn = camelCase(
-              this.queryParams.orderByColumn || ""
-            );
-            // 根据sql语句查询当前表数据
+        let k;
+        this.tableCondition.forEach((item, i) => {
+          let val = item.split("=");
+          if (i !== 0) {
+            k = val[0].split(".");
+            let str = k[0].trim() + "." + k[1];
+            this.condition.push({
+              key: k[0].trim(),
+              value: k[1],
+            });
+          }
+        });
 
-            let k;
-            this.tableCondition.forEach((item, i) => {
-              let val = item.split('=')
-              if(i!==0){
-                
-                k =val[0].split('.')
-                let str = k[0].trim() + '.' + k[1]
-                this.condition.push({
-                  key: k[0].trim(),
-                  value: k[1]
-                })
-              }
-            })
-  
-            this.getDataHandler(this.tableCondition[1]).then(res => {
-              // console.log(res);
-              if(sort == 0){
-                this.infoData.push(res)
-                // this.$set(this.infoData)
-              }else if(sort ==1){
-                this.tableData.push({
-                  data: res
-                })
-                // this.$set(this.tableData)
-              }
-            })
-            // console.log('columns', this.columns);
-            return this.columns
-        }  
+        this.getDataHandler(this.tableCondition[1]).then((res) => {
+          // console.log(res);
+          if (sort == 0) {
+            this.infoData.push(res);
+            // this.$set(this.infoData)
+          } else if (sort == 1) {
+            this.tableData.push({
+              data: res,
+            });
+            // this.$set(this.tableData)
+          }
+        });
+        // console.log('columns', this.columns);
+        return this.columns;
+      }
     },
     // 获取表数据
-    async getDataHandler(contion){
-      let con = contion.split('=')
+    async getDataHandler(contion) {
+      let con = contion.split("=");
       // console.log(con);
-      let key = con[1].trim()
+      let key = con[1].trim();
       // console.log(this.rowobj);
       // console.log(key);
-      
-      let value = key.split('.')
+
+      let value = key.split(".");
 
       // console.log(value);
       this.queryParams.queryMap[key] = "'" + this.rowobj[value[1]] + "'";
-  
-      let tableLists = await unionListTableData(this.queryParams)
+
+      let tableLists = await unionListTableData(this.queryParams);
       // console.log(tableLists.rows);
-      if(tableLists.code == 200){
-          this.tableList = [];
-          tableLists.rows.forEach((item) => {
-            this.tableList.push(item.resultMap);
-          });
-        
-          // 驼峰转换
-          this.tableList = this.tableList.map((item) => {
-            let kv = {};
-            for (let itemKey in item) {
-              kv[camelCase(itemKey)] = item[itemKey];
-            }
-            return kv;
-          })
-          // console.log(this.tableList);
-          // console.log('123', this.tableList);
-          return this.tableList
+      if (tableLists.code == 200) {
+        this.tableList = [];
+        tableLists.rows.forEach((item) => {
+          this.tableList.push(item.resultMap);
+        });
 
+        // 驼峰转换
+        this.tableList = this.tableList.map((item) => {
+          let kv = {};
+          for (let itemKey in item) {
+            kv[camelCase(itemKey)] = item[itemKey];
+          }
+          return kv;
+        });
+        // console.log(this.tableList);
+        // console.log('123', this.tableList);
+        return this.tableList;
       }
       // this.total = tableLists.total;
-      // this.loading = false; 
+      // this.loading = false;
     },
     // 处理列表信息
     columnsHandler(columns) {
@@ -343,8 +355,8 @@ export default {
       });
       return resArr;
     },
-     // 操作列回调
-     excuteHandler(btnData, row) {
+    // 操作列回调
+    excuteHandler(btnData, row) {
       let { btnType, btnParams } = btnData;
       this.currentBtnData = btnData;
       switch (
@@ -375,7 +387,7 @@ export default {
         window.open("http://" + link, "_blank");
       }
     },
-    handleDelete(row, btnData){
+    handleDelete(row, btnData) {
       // console.log(row, btnData);
       // if(row.id){
       //   this.editData.forEach((item ,index) => {
@@ -388,116 +400,109 @@ export default {
       // }
     },
     // 修改
-    handleUpdate(row, btnData){
+    handleUpdate(row, btnData) {
       console.log(row);
-
     },
     // 按钮组点击
-    clickHandler(item, row){},
+    clickHandler(item, row) {},
   },
   mounted() {
     // this.getLists()
   },
-}
+};
 </script>
 
 <style scoped lang="scss">
-
-  .bigBox{
-    margin: auto;
-    display: flex;
-    ::v-deep .info[data-v-32a636fc]{
-      min-width: 200px !important;
-    }
-    .info{
-      margin-right: 60px;
-      .tt{
+.bigBox {
+  margin: auto;
+  display: flex;
+  ::v-deep .info[data-v-32a636fc] {
+    min-width: 200px !important;
+  }
+  .info {
+    margin-right: 60px;
+    .tt {
       font-size: 18px;
       font-weight: 700;
     }
-      span{
-        display: inline-block;
-      }
-      .titlestyle{
-        background-color: #34bfa3;
-        /* width: 50px; */
-        display: inline-block;
-        /* height: 25px; */
-        line-height: 1;
-        padding: 5px;
-        margin-bottom: 20px;
-        margin-right: 5px;
-        text-align: center;
-        color: white;
-        border-radius: 20px; 
-      }
-      .infostyle{
-        background-color: #ebedf2;
-        color: #e84e95;
-      }
+    span {
+      display: inline-block;
+    }
+    .titlestyle {
+      background-color: #34bfa3;
+      /* width: 50px; */
+      display: inline-block;
+      /* height: 25px; */
+      line-height: 1;
+      padding: 5px;
+      margin-bottom: 20px;
+      margin-right: 5px;
+      text-align: center;
+      color: white;
+      border-radius: 20px;
     }
+    .infostyle {
+      background-color: #ebedf2;
+      color: #e84e95;
+    }
+  }
 
-    .tableBox{
-      .svg-icon[data-v-c8a70580]{
-        margin-right: 5px;
-      }
-      min-width: 300px;
-      .addTable{
-        margin: 0px 0px 20px 0px
-      }
-      .titleitem{
-        text-align: center;
-        font-size: 20px;
-        margin-top: 20px;
+  .tableBox {
+    .svg-icon[data-v-c8a70580] {
+      margin-right: 5px;
+    }
+    min-width: 300px;
+    .addTable {
+      margin: 0px 0px 20px 0px;
+    }
+    .titleitem {
+      text-align: center;
+      font-size: 20px;
+      margin-top: 20px;
+    }
+    .addBtn {
+      background-color: #0275d8;
+      color: white;
+    }
+    .saveBtn {
+      background-color: #34bfa3;
+      color: white;
+    }
+    .top {
+      padding: 20px;
+      box-sizing: border-box;
+      background-color: #53b0f8;
+      display: flex;
+      justify-content: space-around;
+      color: white;
+      flex: 1;
+      /* width: 90%; */
+    }
+    .el-button-group {
+      width: 100%;
+      margin: 10px;
+      background-color: white;
+
+      .el-button:first-child {
+        color: blue;
+        border: 1px solid blue;
       }
-      .addBtn{
-        background-color: #0275d8;
-        color: white;
+      .el-button:nth-child(2) {
+        color: palevioletred;
+        border: 1px solid palevioletred;
       }
-      .saveBtn{
-        background-color: #34bfa3;
-        color: white;
+      .el-button:nth-child(3) {
+        color: green;
+        border: 1px solid green;
       }
-      .top{
-        padding: 20px;
-        box-sizing: border-box;
-        background-color: #53b0f8;
-        display: flex;
-        justify-content: space-around;
-        color: white;
-        flex: 1;
-        /* width: 90%; */
-      
+      .el-button:last-child {
+        color: burlywood;
+        border: 1px solid burlywood;
       }
-      .el-button-group{
-        width: 100%;
-        margin: 10px;
-        background-color: white;
-        
-        .el-button:first-child{
-          color: blue;
-          border: 1px solid blue;
-        }
-        .el-button:nth-child(2){
-          color: palevioletred;
-          border: 1px solid palevioletred;
-        }
-        .el-button:nth-child(3){
-          color:green;
-          border: 1px solid green;
-        }
-        .el-button:last-child{
-          color:burlywood;
-          border: 1px solid burlywood;
-        }
-        .custom{
-          width: 120px;
-
-        }
+      .custom {
+        width: 120px;
       }
-      
     }
-
-    
   }
+}
 </style>

+ 0 - 1
ruoyi-ui/src/views/dialogTemplate/indexTable.vue

@@ -122,7 +122,6 @@ import { addGroup, listGroup, getTable, delGroup, updataGroup } from '@/api/rela
 import { addDragTable } from "@/api/tablelist/commonTable.js";
 import { mapGetters, mapState } from "vuex";
 import DictData from "@/components/DictData";
-import { FastBackwardFill, async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
 import { v4 as uuidv4 } from "uuid";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";

+ 47 - 8
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteForm.vue

@@ -12,7 +12,7 @@
           maxlength="32"
           @change="setExternalTaskPriority"
         /> -->
-        <el-select
+        <!-- <el-select
           v-model="formKey"
           value-key="value"
           placeholder="请选择执行表单"
@@ -27,7 +27,12 @@
             :value="item.fId"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
+        <el-cascader
+          v-model="formKey"
+          :options="formList"
+          @change="updateFormKey"
+        ></el-cascader>
       </edit-item>
     </div>
   </el-collapse-item>
@@ -35,10 +40,15 @@
 
 <script>
 import EventEmitter from "@utils/EventEmitter";
-import { setFormKey, getFormKey } from "@packages/bo-utils/myFieldUtil";
+import {
+  setFormKey,
+  getFormKey,
+  setNodeFormType,
+  getNodeFormType,
+} from "@packages/bo-utils/myFieldUtil";
 import { getActive } from "@packages/bpmn-utils/BpmnDesignerUtils";
 import { listForm } from "@/api/dragform/form";
-
+import { listGroup } from "@/api/relateTable/index.js";
 export default {
   name: "ElementExecuteUser",
   data() {
@@ -57,16 +67,45 @@ export default {
   },
   methods: {
     async initFormData() {
-      this.formKey = getFormKey(getActive());
+      this.formKey = [getNodeFormType(getActive()), getFormKey(getActive())];
     },
     updateFormKey(value) {
-      setFormKey(getActive(), value);
+      setNodeFormType(getActive(), value[0]);
+      setFormKey(getActive(), value[1]);
     },
     async getFormList() {
+      let list = [];
+      list.push({
+        label: "拖拽表单",
+        value: "dragForm",
+        children: [],
+      });
+      list.push({
+        label: "组合表单",
+        value: "composeForm",
+        children: [],
+      });
       try {
         let res = await listForm({ isEnablePaging: false });
-        if (res.code == 200) {
-          this.formList = res.rows;
+        let dialogList = await listGroup({
+          isEnablePaging: false,
+          groupType: 1,
+        });
+        if (res.code == 200 && dialogList.code == 200) {
+          // this.formList = res.rows;
+          list[0].children = res.rows.map((item) => {
+            return {
+              label: item.dfName,
+              value: item.fId,
+            };
+          });
+          list[1].children = dialogList.rows.map((item) => {
+            return {
+              label: item.groupName,
+              value: item.groupKey,
+            };
+          });
+          this.formList = list;
         }
       } catch (error) {
         console.log(error);

+ 1 - 0
ruoyi-ui/src/views/system/bpmnPro/components/Toolbar/tools/Save.vue

@@ -205,6 +205,7 @@ export default {
     async updateNodeMsg(obj) {
       let data = getNodeMsg(obj);
       let theData = filterNodeMsg(this.nodeData(), data);
+      return;
       if (!theData.bpmProcessConfigurationList.length) return;
       theData.bpmProcessConfigurationList.forEach((item) => {
         // item.updateBy = this.$store.state.user.name;

+ 4 - 1
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/getNodeMsg.js

@@ -38,7 +38,7 @@ export function getNodeMsg(xmlObj) {
   let prefix = getProcessEngine();
   let { attributes, childNodes } = xmlObj
     .getElementsByTagName("bpmn:process")[0];
-  let bpmProcessConfigurationList = [], bpmNodeHandleUserList = [], bpmNodeScriptRelevanceList = [], attributeArray = ['nodeKey', 'nodeFormKey', 'nodeProcessKey', 'nodeRolePremission', 'spare1', 'spare2', 'spare3', 'createBy', 'updateBy', 'remark', 'nodeExecuteType'];
+  let bpmProcessConfigurationList = [], bpmNodeHandleUserList = [], bpmNodeScriptRelevanceList = [], attributeArray = ['nodeKey', 'nodeFormKey', 'nodeFormType', 'nodeProcessKey', 'nodeRolePremission', 'spare1', 'spare2', 'spare3', 'createBy', 'updateBy', 'remark', 'nodeExecuteType'];
   childNodes.forEach((node) => {
     // let uuid = uuidv4();
 
@@ -46,6 +46,7 @@ export function getNodeMsg(xmlObj) {
       nodeKey: '',
       nodeName: '',
       nodeFormKey: '', //节点表单别名
+      nodeFormType: '',//节点表单类型
       nodeProcessKey: '', //流程别名
       nodeType: '',   //节点类型(判断节点,正常节点..)根据字典维护
       nodeBefore: 'false',
@@ -162,6 +163,8 @@ function getBpmNodeHandleUser(node, nodeObj) {
 
 export function filterNodeMsg(oldMsg, newMsg) {
   let keys = ['bpmProcessConfigurationList', 'bpmNodeScriptRelevanceList', 'bpmNodeHandleUserList', 'removeNodeIds']
+  console.log(oldMsg, newMsg);
+
   newMsg[keys[0]].forEach(item => {
     let sameNode = oldMsg[keys[0]].find((oldItem) => oldItem.nodeKey == item.nodeKey)
     if (sameNode) {

+ 18 - 0
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/myFieldUtil.js

@@ -90,6 +90,24 @@ export function getFormKey(element) {
   return businessObject.get(`${prefix}:nodeFormKey`);
 }
 
+// 表单类型
+export function setNodeFormType(element, value) {
+  const prefix = getProcessEngine();
+  const modeling = getModeler.getModeling();
+  const businessObject = getBusinessObject(element);
+  modeling.updateModdleProperties(element, businessObject, {
+    [`${prefix}:nodeFormType`]: value
+  });
+}
+
+
+export function getNodeFormType(element) {
+  const prefix = getProcessEngine();
+  const businessObject = getBusinessObject(element);
+
+  return businessObject.get(`${prefix}:nodeFormType`);
+}
+
 // 执行用户
 export function isUserTask(element) {
   return is(element, 'bpmn:UserTask');

+ 57 - 31
ruoyi-ui/src/views/system/tenant/index.vue

@@ -183,7 +183,8 @@
             icon="el-icon-edit"
             @click="openTenantExpirationTime(scope.row)"
             v-hasPermi="['system:tenant:remove']"
-            style="margin-left:5px">激活租户
+            style="margin-left: 5px"
+            >激活租户
           </el-button>
         </template>
       </el-table-column>
@@ -316,13 +317,34 @@
     </el-dialog>
 
     <!-- 激活租户弹出层-->
-    <el-dialog title="激活租户" :visible.sync="tenantExpirationTimeOpen" width="500px" append-to-body>
-      <el-form ref="tenantExpirationTimeFrom" :model="tenantExpirationTimeFrom" :rules="rulesTenantExpirationTime" label-width="80px">
-        <el-form-item label="激活租户" prop="tenantExpirationTime" label-width="110px">
-          <el-input v-model="tenantExpirationTimeFrom.tenantExpirationTime" placeholder="请输入激活码" />
+    <el-dialog
+      title="激活租户"
+      :visible.sync="tenantExpirationTimeOpen"
+      width="500px"
+      append-to-body
+    >
+      <el-form
+        ref="tenantExpirationTimeFrom"
+        :model="tenantExpirationTimeFrom"
+        :rules="rulesTenantExpirationTime"
+        label-width="80px"
+      >
+        <el-form-item
+          label="激活租户"
+          prop="tenantExpirationTime"
+          label-width="110px"
+        >
+          <el-input
+            v-model="tenantExpirationTimeFrom.tenantExpirationTime"
+            placeholder="请输入激活码"
+          />
         </el-form-item>
         <el-form-item class="btn">
-          <el-button type="primary" @click="activationOperationMethod('tenantExpirationTimeFrom')">确 定</el-button>
+          <el-button
+            type="primary"
+            @click="activationOperationMethod('tenantExpirationTimeFrom')"
+            >确 定</el-button
+          >
           <el-button @click="tanentCancel">取 消</el-button>
         </el-form-item>
       </el-form>
@@ -341,11 +363,10 @@ import {
   selectAllUser,
   createTenant,
   initTenantMenuData,
-  activationOperation
+  activationOperation,
 } from "@/api/system/tenant";
 import { getDataSourceInfo, insertDataSource } from "@/api/system/data";
 import { servicesLoading } from "@/utils/ruoyi";
-import { async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
 
 export default {
   name: "Tenant",
@@ -423,10 +444,14 @@ export default {
         ],
         databaseName: [
           { required: true, message: "数据库名不能为空", trigger: "blur" },
-          { validator: this.databaseNameValidator, trigger: "blur"  }
+          { validator: this.databaseNameValidator, trigger: "blur" },
         ],
         tenantAccount: [
-          { required: true, message: "租户管理员账号不能为空", trigger: "change" },
+          {
+            required: true,
+            message: "租户管理员账号不能为空",
+            trigger: "change",
+          },
           { validator: this.tenantAccountValidator, trigger: "blur" },
         ],
         databaseIp: [
@@ -443,12 +468,12 @@ export default {
         ],
       },
       //租户激活码弹窗表单
-      tenantExpirationTimeFrom:{
+      tenantExpirationTimeFrom: {
         tenantId: null,
-        tenantExpirationTime: '',
+        tenantExpirationTime: "",
       },
       //租户激活码弹窗标题
-      tenantExpirationTimeOpen:false,
+      tenantExpirationTimeOpen: false,
       //租户激活码规则验证
       rulesTenantExpirationTime: {
         tenantExpirationTime: [
@@ -486,7 +511,7 @@ export default {
       }
     },
     // 数据库名称校验规则
-    databaseNameValidator(rule, value, callback){
+    databaseNameValidator(rule, value, callback) {
       let regex = /^[a-z][a-z0-9]*$/;
       if (regex.test(value)) {
         callback(); // 输入内容符合规则
@@ -742,7 +767,7 @@ export default {
     restTenantExpirationTime() {
       this.tenantExpirationTimeFrom = {
         tenantId: null,
-        tenantExpirationTime: '',
+        tenantExpirationTime: "",
       };
       this.resetForm("tenantExpirationTimeFrom");
     },
@@ -750,37 +775,38 @@ export default {
     openTenantExpirationTime(row) {
       // this.reset();
       const tenantId = row.tenantId || this.ids;
-      this.tenantExpirationTimeFrom.tenantId = row.tenantId
+      this.tenantExpirationTimeFrom.tenantId = row.tenantId;
       this.tenantExpirationTimeOpen = true;
       // this.title="激活租户";
     },
     /**激活租户操作*/
-    activationOperationMethod(form){
+    activationOperationMethod(form) {
       this.$refs[form].validate(async (valid) => {
         if (valid) {
-          let response = await activationOperation(this.tenantExpirationTimeFrom)
-            if(response.code == 200){
-              this.$message.success("激活成功");
-            } else {
-              this.$message.error("激活失败");
-            }
-            this.tenantExpirationTimeOpen = false;
-            this.tenantExpirationTimeFrom = {
-              tenantId: null,
-              tenantExpirationTime: null,
-            };
-   
+          let response = await activationOperation(
+            this.tenantExpirationTimeFrom
+          );
+          if (response.code == 200) {
+            this.$message.success("激活成功");
+          } else {
+            this.$message.error("激活失败");
+          }
+          this.tenantExpirationTimeOpen = false;
+          this.tenantExpirationTimeFrom = {
+            tenantId: null,
+            tenantExpirationTime: null,
+          };
         }
       });
     },
     // 激活租户对话框取消按钮
-    tanentCancel(){
+    tanentCancel() {
       this.tenantExpirationTimeOpen = false;
       this.tenantExpirationTimeFrom = {
         tenantId: null,
         tenantExpirationTime: null,
       };
-    }
+    },
   },
 };
 </script>

+ 120 - 57
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -86,7 +86,7 @@
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
-          @click="handleDelete"
+          @click="handleBatchDelete"
           >删除
         </el-button>
       </el-col>
@@ -121,6 +121,7 @@
       :data="tableList"
       @selection-change="handleSelectionChange"
       row-key="id"
+      ref="tableRef"
       :cell-style="cellStyle"
     >
       <el-table-column
@@ -260,16 +261,17 @@
     <el-dialog
       title="提示"
       :visible.sync="btnDialogVisible"
-      :before-close="handleClose">
+      :before-close="handleClose"
+    >
       <DialogTemplate
-       ref="dialogRef"
+        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>
@@ -281,16 +283,17 @@
     <el-dialog
       title="提示"
       :visible.sync="btnDialogVisible"
-      :before-close="handleClose">
+      :before-close="handleClose"
+    >
       <DialogTemplate
-       ref="dialogRef"
+        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>
@@ -328,7 +331,7 @@ export default {
       // 绑定按钮dialog
       btnDialogVisible: false,
       // 绑定修改dialog
-      groupKey: '',
+      groupKey: "",
       // 遮罩层
       loading: true,
       // 选中数组
@@ -418,13 +421,13 @@ export default {
       // 当前点击按钮的数据
       currentBtnData: {},
       // 修改选中行
-      rowobj:{},
+      rowobj: {},
       // 该行的统计信息
-      subCount:[],
-      tableCount:[],
+      subCount: [],
+      tableCount: [],
       // 弹窗新增数据
-      addLists:[],
-      subTableName: '',
+      addLists: [],
+      subTableName: "",
       // 当前点击行的数据
       currentRow: {},
     };
@@ -510,6 +513,9 @@ export default {
             // });
             this.tableList = await this.setFieldStyleData(tempTableList);
             this.total = res.total;
+            this.$nextTick(() => {
+              this.$refs.tableRef?.clearSelection();
+            });
             this.loading = false;
           });
 
@@ -601,7 +607,12 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(
-        (item) => item[camelCase(this.templateInfo.template?.primaryKey)]
+        (item) =>
+          item[
+            camelCase(
+              this.tableName + "_" + this.templateInfo.template?.primaryKey
+            )
+          ]
       );
       this.single = selection.length != 1;
       this.multiple = !selection.length;
@@ -659,8 +670,8 @@ export default {
       return strs[0];
     },
     // 绑定dialog对话框关闭
-    handleClose(){
-      this.btnDialogVisible = false
+    handleClose() {
+      this.btnDialogVisible = false;
     },
     getLastUppercaseWord(text) {
       const pattern = /\b[A-Z][a-z]*\b/g;
@@ -676,26 +687,27 @@ export default {
     async handleUpdate(row, btnData) {
       // console.log(this.currentBtnData);
 
-      let nameTable = this.templateInfo.template.dtTableName
+      let nameTable = this.templateInfo.template.dtTableName;
       // console.log(nameTable);
       // console.log('row', row);
-      this.rowobj = {}
-      let obj = {}
-      for(let key in row) {
-
-        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
+      this.rowobj = {};
+      let obj = {};
+      for (let key in row) {
+        let modifiedTable = key
+          .replace(/[A-Z]/g, (match) => `_${match}`)
+          .toLowerCase();
 
         this.rowobj[modifiedTable] = row[key];
 
-        let str = modifiedTable.substring(nameTable.length+1)
+        let str = modifiedTable.substring(nameTable.length + 1);
         obj[str] = row[key];
       }
       // console.log("row", row);
-    // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
-    //   if (!data || !data.dfVueTemplate) {
-    //     this.$message.error("当前表格未绑定表单!");
-    //     return;
-    //   }});
+      // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+      //   if (!data || !data.dfVueTemplate) {
+      //     this.$message.error("当前表格未绑定表单!");
+      //     return;
+      //   }});
 
       // 新的修改请求
       try {
@@ -723,8 +735,8 @@ export default {
           }
 
           res.data.template.dfFormSql &&
-          (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
-           this.addRealFieldName(res.data.result.resultMap);
+            (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
+          this.addRealFieldName(res.data.result.resultMap);
           let resultMap = res.data.result.resultMap;
 
           Object.assign(this.defaultValue, resultMap);
@@ -735,18 +747,18 @@ export default {
           this.$nextTick(() => {
             this.$refs.addFromRef.setData(res.data.result.resultMap);
           });
-        }else{
-          this.subTableName = res.data.result.dragTables[1].dtTableName
-          this.btnDialogVisible = true
-          this.groupKey = this.currentBtnData.btnTableFormGroupKey
-          this.$nextTick(()=>{
-            let refChild = this.$refs.dialogRef
+        } else {
+          this.subTableName = res.data.result.dragTables[1].dtTableName;
+          this.btnDialogVisible = true;
+          this.groupKey = this.currentBtnData.btnTableFormGroupKey;
+          this.$nextTick(() => {
+            let refChild = this.$refs.dialogRef;
 
             // console.log(this.$refs.dialogRef);
-            refChild.getLists(this.groupKey)
-          })
+            refChild.getLists(this.groupKey);
+          });
 
-          let tablesubKey = res.data.result.dragTables[1].tableKey
+          let tablesubKey = res.data.result.dragTables[1].tableKey;
 
           // 查询统计信息
           getStatisticList({
@@ -755,25 +767,32 @@ export default {
             },
           }).then((res) => {
             // console.log('统计', res);
-            this.subCount = res.data
+            this.subCount = res.data;
           });
 
-          let prmKey = this.templateInfo.template.primaryKey
-          let pkey = prmKey.replace(/_([a-z])/g, (match, p1) => p1.toUpperCase());
+          let prmKey = this.templateInfo.template.primaryKey;
+          let pkey = prmKey.replace(/_([a-z])/g, (match, p1) =>
+            p1.toUpperCase()
+          );
 
           let data = {
-            queryMap:{
-              tableKey:res.data.result.dragTables[2].tableKey,
-            }
-          }
+            queryMap: {
+              tableKey: res.data.result.dragTables[2].tableKey,
+            },
+          };
 
-          let key = '#{' + this.templateInfo.template.dtTableName + '.' + this.templateInfo.template.primaryKey
+          let key =
+            "#{" +
+            this.templateInfo.template.dtTableName +
+            "." +
+            this.templateInfo.template.primaryKey;
 
-          data.queryMap[key] = "'" + obj[this.templateInfo.template.primaryKey] + "'";
+          data.queryMap[key] =
+            "'" + obj[this.templateInfo.template.primaryKey] + "'";
 
           getStatisticList(data).then((res) => {
             // console.log('统计', res);
-            this.tableCount = res.data
+            this.tableCount = res.data;
           });
         }
 
@@ -784,7 +803,6 @@ export default {
         //   realField = realField[0].toLocaleLowerCase() + realField.substring(1);
         //   resultMap[realField] = resultMap[field];
         // });
-
       } catch (error) {
         this.$message.error("网络异常,请稍后再试");
         console.log(error);
@@ -828,8 +846,11 @@ export default {
     },
     // 添加真正的字段名
     addRealFieldName(row) {
+      console.log(row);
       let fieldList = Object.keys(row);
-      let tableName = this.longestCommonSubstring(fieldList);
+      // let tableName = this.longestCommonSubstring(fieldList);
+      let tableName = camelCase(this.tableName);
+      console.log(this.tableName);
       fieldList.forEach((field) => {
         let realField = field.replace(tableName, "");
         realField = realField[0].toLocaleLowerCase() + realField.substring(1);
@@ -866,6 +887,7 @@ export default {
       let primary = camelCase(this.templateInfo.template?.primaryKey);
       this.addRealFieldName(row);
       if (row[primary] != undefined && row[primary] != null) {
+        console.log(row[primary]);
         delIds = [];
         delIds.push(row[primary]);
       }
@@ -904,6 +926,47 @@ export default {
         })
         .catch(() => {});
     },
+    // 批量删除接口
+    handleBatchDelete(row) {
+      let delIds = this.ids;
+      console.log(this.ids);
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // if (row && row[primary] != undefined && row[primary] != null) {
+      //   delIds = [];
+      //   delIds.push(row[primary]);
+      // }
+      let data = {
+        basicMap: {
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+      };
+      // if (this.currentBtnData.btnParams) {
+      //   let btnParams = JSON.parse(this.currentBtnData.btnParams);
+      //   btnParams.forEach((item) => {
+      //     data.btnParametersMap[
+      //       this.formatField(item.fieldName, camelCase(this.tableName))
+      //     ] = item.fieldValue
+      //       ? item.fieldValue
+      //       : this.currentRow[item.fieldName];
+      //   });
+      // }
+      data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          return delTableData(data);
+          // return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
     /** 导出按钮操作 */
     handleExport() {
       let primary = camelCase(this.templateInfo.template?.primaryKey);
@@ -977,12 +1040,12 @@ export default {
       this.$refs.upload.submit();
     },
     // 弹窗新增的数
-    addListHandler(val){
-      this.addLists.push(...val)
+    addListHandler(val) {
+      this.addLists.push(...val);
       // console.log(this.addLists);
     },
     // 绑定弹窗Dialog确定按钮
-    btnComfirm(){
+    btnComfirm() {
       // let data = {
       //   addListMap:[],
       //   basicMap:{
@@ -1287,7 +1350,7 @@ export default {
 </script>
 
 <style scoped lang="scss">
-  ::v-deep .el-dialog:not(.is-fullscreen){
-    min-width: 610px !important;
-  }
+::v-deep .el-dialog:not(.is-fullscreen) {
+  min-width: 610px !important;
+}
 </style>

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません