Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/1.2.2' into 1.2.2

# Conflicts:
#	src/views/basic/dynamicModel/list/index.vue
yangfan 3 mesiacov pred
rodič
commit
ff8c855f3b

+ 5 - 6
package-lock.json

@@ -41,6 +41,7 @@
         "jsencrypt": "^3.0.0-rc.1",
         "jsonlint": "1.6.3",
         "jszip": "3.10.1",
+        "lodash": "^4.17.21",
         "moment": "^2.29.4",
         "monaco-editor": "^0.20.0",
         "node-sql-parser": "^5.3.2",
@@ -16051,9 +16052,8 @@
     },
     "node_modules/lodash": {
       "version": "4.17.21",
-      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
-      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
-      "dev": true
+      "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
+      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
     },
     "node_modules/lodash.debounce": {
       "version": "4.0.8",
@@ -38158,9 +38158,8 @@
     },
     "lodash": {
       "version": "4.17.21",
-      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
-      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
-      "dev": true
+      "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
+      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
     },
     "lodash.debounce": {
       "version": "4.0.8",

+ 1 - 0
package.json

@@ -55,6 +55,7 @@
     "jsencrypt": "^3.0.0-rc.1",
     "jsonlint": "1.6.3",
     "jszip": "3.10.1",
+    "lodash": "^4.17.21",
     "moment": "^2.29.4",
     "monaco-editor": "^0.20.0",
     "node-sql-parser": "^5.3.2",

+ 1 - 1
src/assets/scss/common.scss

@@ -693,7 +693,7 @@
   .flow-form {
     overflow-y: auto;
     .el-input.is-disabled .el-input__inner {
-      background-color: #fff !important;
+      //background-color: #fff !important;
       border-color: #dcdfe6 !important;
       color: #606266 !important;
     }

+ 1 - 1
src/components/Dataset-filter/util.js

@@ -426,7 +426,7 @@ export const getTabelAPIData = (filter, enumId, formAllVar, componentList, type,
             }
             //api返回值变量
             if (i.varType[0] === 4) {
-              formVarObj[i.key] = sessionStorage.getItem(`API_${rowIndex + '_' + i.varType[1]}`)
+              formVarObj[i.key] = sessionStorage.getItem(`API_${i.varType[1]}`) || sessionStorage.getItem(`API_${rowIndex + '_' + i.varType[1]}`)
             }
           }
         })

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 156 - 83
src/components/Generator/components/InputTable/index.vue


+ 8 - 2
src/components/Generator/index/RightComponents/Table.vue

@@ -39,9 +39,15 @@
     <el-form-item label="子表关联录入" label-width="100px">
       <el-switch v-model="activeData.relationConfFlag" />
     </el-form-item>
-    <el-form-item label="选择表单">
+    <el-form-item >
+      <template slot="label">
+        <span>选择表单</span>
+        <el-tooltip style="cursor: pointer" effect="dark" :content="'被选择的表单需同时符合【未关联其他表单】和【是一个单表表单】才会在下拉选择中展示'" placement="top">
+          <i class="el-icon-question" />
+        </el-tooltip>
+      </template>
       <el-select v-model="activeData.relationConf.itemRelationTable" filterable placeholder="请选择" clearable @change="onRelationTableChange($event)">
-        <el-option v-for="(item, index) in allTabelList" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
+        <el-option v-for="(item, index) in allTabelList.filter(o=> (o.associationType && o.associationType == 1) && (o.visualdevTableType && o.visualdevTableType == 1))" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
       </el-select>
     </el-form-item>
     <el-form-item label="字段映射关联" label-width="100px">

+ 8 - 2
src/components/Generator/index/RightPanel.vue

@@ -252,9 +252,15 @@
         <!-- 关联设置 -->
         <el-form v-loading="loading" v-show="currentTab === 'relation'" label-width="90px" size="small" labelPosition="left">
           <template v-if="activeData.relationData">
-            <el-form-item label="关联表单">
+            <el-form-item >
+              <template slot="label">
+                <span>关联表单</span>
+                <el-tooltip style="cursor: pointer" effect="dark" :content="'被关联的表单需同时符合【未关联其他表单】和【是一个单表表单】才会在下拉选择中展示'" placement="top">
+                  <i class="el-icon-question" />
+                </el-tooltip>
+              </template>
               <el-select v-model="activeData.relationData.itemRelationTable" filterable placeholder="请选择" clearable @change="onRelationTableChange($event)">
-                <el-option v-for="(item, index) in allTabelList" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
+                <el-option v-for="(item, index) in allTabelList.filter(o=> o.visualdevTableType && o.visualdevTableType == 1)" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
               </el-select>
               <!--                  <el-cascader ref="relationcascader"-->
               <!--                    v-model="i.relationName" :options="relationData" :props="{ expandTrigger: 'hover', emitPath: false }"-->

+ 4 - 2
src/main.js

@@ -81,7 +81,9 @@ require('brace/theme/chrome')
 // 注册组件后即可使用
 import Editor from 'bin-ace-editor'
 Vue.component(Editor.name, Editor)
-Vue.prototype.apiVariableSetItem = function (key, value) {
+import { throttle } from 'lodash';
+// 避免高频率调用 使用节流throttle
+Vue.prototype.apiVariableSetItem = throttle(function (key, value) {
   if (key === 'API_VARIABLE_CHANGE') {
     let newStorageEvent = document.createEvent('StorageEvent')
     const storage = {
@@ -93,7 +95,7 @@ Vue.prototype.apiVariableSetItem = function (key, value) {
     }
     return storage.setItem(key, value)
   }
-}
+},340)
 const vm = new Vue({
   el: '#app',
   router,

+ 2 - 2
src/utils/define.js

@@ -3,9 +3,9 @@
 // JAVA Cloud对应网关地址
 // const APIURl = 'http://192.168.0.103:8181'
 
-// const url = 'https://windata.platomix.net' // 测试环境
+const url = 'https://windata.platomix.net' // 测试环境
 // const url = 'https://api.bi.platomix.net' // 测试环境
-const url = 'https://bi.platomix.net' // BI环境
+// const url = 'https://bi.platomix.net' // BI环境
 // const url = 'https://miniapp.zhangmushiye.com/' // 樟木环境
 // const url = 'http://hr.cscec8st.com.cn:50021/' // 中建环境
 // const url = 'http://hr.cscec8st.com.cn:50022/' // 中建环境

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
src/utils/request.js


+ 5 - 1
src/views/basic/dynamicModel/list/Form.vue

@@ -848,13 +848,17 @@ export default {
   line-height: 5px;
 }
 ::v-deep .detailForm .el-form-item__content {
-  .el-input-number,.el-input span{
+  .el-input-number span,.el-input span{
     display: none;
   }
   .el-input-number,.el-input *{
     background: none;
     border:none;
+    color:#696464;
     cursor: revert;
   }
+  .el-date-editor--datetime span,.el-date-editor--time span,.el-date-editor--date span{
+    display: inline;
+  }
 }
 </style>

+ 31 - 25
src/views/basic/dynamicModel/list/index.vue

@@ -2947,33 +2947,39 @@ export default {
           return v
         }
       })
-      for (const i of this.columnList) {
-        if (i?.jnpfKey === 'uploadImg') {
-          let newListArray = newList.map((o) => o[i.field])
-          this.imgList[i.field] = newListArray
-          // const res = await getFileById(newListArray.map((v) => v.split(';')).flat())
-          // let obj = {}
-          // Object.keys(res.data.data).forEach((o) => {
-          //   obj[o] = comUrl + '/' + res.data.data[o].filePath
-          // })
-          // this.imgList[i.field] = obj
-        }
-        if (i?.jnpfKey === 'uploadFz') {
-          let newListArray = newList
-            .map((o) => o[i.field])
-            .map((o) => (o?.url ? '' : o))
-            .filter((o) => o && o !== 'null')
-          const res = await getFileById(newListArray.map((v) => v.split(';')).flat())
-          let obj = {}
-          Object.keys(res.data.data).forEach((o) => {
-            obj[o] = res.data.data[o]
-          })
-          this.fileList[i.field] = obj
-        }
-        if (i.children && i.children.length < 1) {
-          fields[i.field] = columnMergeCells.findIndex((o) => o.title === i.title)
+      async function getImgFun(columnList) {
+        for (const i of columnList) {
+          if (i?.jnpfKey === 'uploadImg') {
+            let newListArray = newList.map((o) => o[i.field])
+            this.imgList[i.field] = newListArray
+            // const res = await getFileById(newListArray.map((v) => v.split(';')).flat())
+            // let obj = {}
+            // Object.keys(res.data.data).forEach((o) => {
+            //   obj[o] = comUrl + '/' + res.data.data[o].filePath
+            // })
+            // this.imgList[i.field] = obj
+          }
+          if (i?.jnpfKey === 'uploadFz') {
+            let newListArray = newList
+              .map((o) => o[i.field])
+              .map((o) => (o?.url ? '' : o))
+              .filter((o) => o && o !== 'null')
+            const res = await getFileById(newListArray.map((v) => v.split(';')).flat())
+            let obj = {}
+            Object.keys(res.data.data).forEach((o) => {
+              obj[o] = res.data.data[o]
+            })
+            this.fileList[i.field] = obj
+          }
+          if (i.children && i.children.length < 1) {
+            fields[i.field] = columnMergeCells.findIndex((o) => o.title === i.title)
+          }
+          if (i?.jnpfKey === 'table' && i.children && i.children.length) {
+            await getImgFun.call(this,i.children)
+          }
         }
       }
+      await getImgFun.call(this,this.columnList)
       const mergeCells = []
       list
         .filter((v) => v)

+ 28 - 9
src/views/workFlow/components/FlowBox.vue

@@ -181,7 +181,8 @@ export default {
       signImg: '',
       copyIds: '',
       customizedView: '',
-      flowEditFormData:{}
+      flowEditFormData:{},
+      flowFormEditData:{}
     }
   },
   methods: {
@@ -330,7 +331,8 @@ export default {
       }
     },
     eventReciver(formData, eventType) {
-      this.formData = formData
+      this.formData =  formData
+      // this.formData =  {data: this.flowEditFormData.formDataJson,dataJson: this.flowEditFormData.formDataJson, id: this.flowEditFormData.id, flowId: this.flowEditFormData.flowId}
       this.eventType = eventType
       if (eventType === 'save' || eventType === 'submit') {
         return this.submitOrSave()
@@ -341,9 +343,19 @@ export default {
         this.copyIds = ''
         this.handleReset()
         this.visible = true
-        this.$nextTick(()=>{
-          this.$refs.flowEditForm && this.$refs.flowEditForm.init(this.flowEditFormData)
-        })
+        let formDataJson = JSON.parse(this.flowEditFormData.formDataJson)
+        let updateVisualdevDataDto = formDataJson.formData
+        if (!updateVisualdevDataDto) return;
+        let newOldData = updateVisualdevDataDto.primaryTable.data
+        updateVisualdevDataDto.primaryTable.oldData = newOldData
+        updateVisualdevDataDto.primaryTableInfo = {data:newOldData}
+        updateVisualdevDataDto.primaryTable.data =  formData.data
+        // this.flowFormEditData = {
+        //   modelId:this.flowEditFormData.formId,
+        //   dataId:updateVisualdevDataDto.primaryTable.id,
+        //   cubeId:updateVisualdevDataDto.primaryTable.dbLink,
+        //   updateVisualdevDataDto,
+        // }
       }
     },
     submitOrSave() {
@@ -479,7 +491,7 @@ export default {
       })
     },
     handleTransfer(freeApproverUserId) {
-      Transfer(this.setting.taskId, { freeApproverUserId }).then((res) => {
+      Transfer(this.setting.taskId, { freeApproverUserId,...this.flowFormEditData }).then((res) => {
         this.$message({
           type: 'success',
           message: res.data.msg,
@@ -539,7 +551,7 @@ export default {
         this.publicApprovalMethods()
       // }
     },
-    publicApprovalMethods(flowEditForm){
+    publicApprovalMethods(){
       if (this.properties.hasSign && !this.signImg) {
         this.$message({
           message: '请签名',
@@ -557,8 +569,8 @@ export default {
       if (this.eventType === 'audit' && this.properties.hasFreeApprover) {
         query = { freeApproverUserId: this.handleId, ...query }
       }
-      if (flowEditForm) {
-        query = { ...flowEditForm, ...query }
+      if (this.flowFormEditData) {
+        query = { ...this.flowFormEditData, ...query }
       }
       const approvalMethod = this.eventType === 'audit' ? Audit : Reject
       approvalMethod(this.setting.taskId, query, this.setting.id).then((res) => {
@@ -638,4 +650,11 @@ export default {
     width: 100%;
   }
 }
+::v-deep .el-input {
+  width: 95% !important;
+}
+::v-deep .el-input-number--small {
+  width: 95% !important;
+  line-height: 33px;
+}
 </style>

+ 28 - 20
src/views/workFlow/workFlowForm/dynamicForm/index.vue

@@ -133,9 +133,9 @@ export default {
               //老数据
               this.formData = JSON.parse(this.formData.primaryTable.data)
               this.fillFormData(this.oldformConf, oldData)
-              this.fillFormData(this.formConf, this.formData)
+              this.fillFormData(this.formConf, this.formData,{},)
             } else {
-              this.fillFormData(this.formConf, this.formData)
+              this.fillFormData(this.formConf, this.formData,{},)
             }
             this.$nextTick(() => {
               this.loading = false
@@ -155,8 +155,8 @@ export default {
         this.key = +new Date()
       })
     },
-    fillFormData(form, data, columnDict) {
-      if (this.opType != '-1') form.disabled = true // this.setting.readonly
+    fillFormData(form, data, columnDict,editFlg) {
+       // this.setting.readonly
       const loop = (list) => {
         for (let i = 0; i < list.length; i++) {
           let item = list[i]
@@ -191,23 +191,31 @@ export default {
               if (item.__config__ && item.__config__.jnpfKey === 'uploadFz') {
                 item.__config__.defaultValue = item.__config__.defaultValue.length ? item.__config__.defaultValue.split(';') : []
               }
-              let noShow = false,
-                isDisabled = true
-              if (this.setting.formOperates && this.setting.formOperates.length) {
-                let arr = this.setting.formOperates.filter((o) => o.id === item.__vModel__) || []
-                if (arr.length) {
-                  let obj = arr[0]
-                  noShow = !obj.read
-                  isDisabled = !obj.write
+              if (editFlg && editFlg === 1){
+                let noShow = false,
+                  isDisabled = true,
+                  isRequired = true
+                if (this.setting.formOperates && this.setting.formOperates.length) {
+                  let arr = this.setting.formOperates.filter((o) => o.id == item.__vModel__) || []
+                  if (arr.length) {
+                    let obj = arr[0]
+                    noShow = !obj.read
+                    isDisabled = !obj.write
+                    isRequired = obj.required
+                  }
+                } else {
+                  isDisabled = false
                 }
-              } else {
-                isDisabled = false
+                isDisabled = item.disabled ? item.disabled : isDisabled
+                noShow = item.__config__.displayNone ? item.__config__.displayNone : noShow
+                isRequired = item.__config__.required ? item.__config__.required : isRequired
+                if (this.setting.readonly) isDisabled = true
+                this.$set(item, 'disabled', isDisabled)
+                this.$set(item, 'displayNone', noShow)
+                this.$set(item.__config__, 'required', isRequired)
+              }else {
+                if (this.opType != '-1') form.disabled = true
               }
-              isDisabled = item.disabled ? item.disabled : isDisabled
-              noShow = item.__config__.noShow ? item.__config__.noShow : noShow
-              if (this.setting.readonly) isDisabled = true
-              this.$set(item, 'disabled', isDisabled)
-              this.$set(item.__config__, 'noShow', noShow)
             }
           }
           if (item.__config__ && item.__config__.jnpfKey !== 'table' && item.__config__.children && Array.isArray(item.__config__.children)) {
@@ -265,7 +273,7 @@ export default {
     dataFormSubmit(eventType) {
       if (this.setting.isPreview) return this.$message({ message: '功能预览不支持数据保存', type: 'warning' })
       this.eventType = eventType
-      this.$refs.dynamicForm && this.$refs.dynamicForm.submitForm('flow')
+      this.$refs.dynamicForm && this.$refs.dynamicForm.submitForm()
     }
   }
 }