wangting
2024-05-06 506b5b59e3899d8dd40a61cc8b9a575bbde3caaa
添加action
已修改10个文件
217 ■■■■ 文件已修改
Source/ProjectWeb/src/actions/base/BaseAction.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/PLT-basic-component/basicForm.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/actions/AddEditDialog.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentArea.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/actions/base/BaseAction.js
@@ -20,22 +20,30 @@
        item = item.replace(':', '=');
        if (item.indexOf('${') > -1) {
          if (item.split('=')[1].indexOf('.') > -1) {
            if (options.sourceData.length < 1 || !options.sourceData.oid) {
            //initvaluenull=true允许初始值为空
            if ((options.sourceData.length < 1 || !options.sourceData.oid) && options.paramVOS['initvaluenull']!=true && options.paramVOS['initvaluenull']!="true") {
              isShow = false;
              Vue.prototype.$message.error("请先选择一条来源数据")
              return false;
            }
            let name = item.split('=')[1].split('.')[1].replace('${', '').replace('}', '');
            initValues[item.split('=')[0]] = options.sourceData[name]
            if(options.sourceData){
              initValues[item.split('=')[0]] = options.sourceData[name]
            }else {
              initValues[item.split('=')[0]]=""
            }
          } else {
            if (options.dataStore.length < 1) {
            if (options.dataStore.length < 1 && options.paramVOS['initvaluenull'] != true && options.paramVOS['initvaluenull'] != "true") {
              isShow = false;
              Vue.prototype.$message.error("请先选择一条数据");
              return false;
            }
            let name = item.split('=')[1].replace('${', '').replace('}', '');
            initValues[item.split('=')[0]] = options.dataStore[0][name];
            if (options.dataStore[0]) {
              initValues[item.split('=')[0]] = options.dataStore[0][name];
            } else {
              initValues[item.split('=')[0]] = "";
            }
          }
        }
      }
Source/ProjectWeb/src/components/PLT-basic-component/basicForm.vue
@@ -70,7 +70,11 @@
      //表单是否可编辑
      type:Boolean,
      default:true
    }
    },
    initValue:{
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
@@ -103,10 +107,13 @@
  watch: {
    formItems: {
      handler(val) {
        if(val[0] &&val[0].column && val[0].column.isArray()){
        if (val[0] && val[0].column && val[0].column.isArray()) {
          this.getInitGroup(val);
        }else{
        } else {
          this.getInit(val);
        }
        if (this.initValue) {
          Object.assign(this.form, this.initValue);
        }
      },
      immediate: true,
@@ -154,7 +161,6 @@
        code = this.initItem(code);
        column.push(code);
        this.allColumn.push(code);
        console.log('allColumn',this.allColumn)
      }
      this.option.column = column;
    },
@@ -220,9 +226,9 @@
        if(col.data && col.data.length>0){
          col.dicData = col.data.map((d) => {
            return {
              label: d.value,
              key: d.key,
              value: d.key,
              label: d.key,
              key: d.value,
              value: d.value,
              attributes:d.attributes
            };
          });
Source/ProjectWeb/src/components/actions/AddEditDialog.vue
@@ -16,6 +16,7 @@
                :isEdit="true"
                :formItems="formItems"
                :formData="form"
                :initValue="paramVOS.initvalue"
                @getFormData="getFormData">
    </basic-form>
    <ui-view ref="uiViewRef" v-else-if="paramVOS.context"
@@ -116,7 +117,7 @@
  created() {
  },
  watch: {
    sourceData: {
    paramVOS: {
      handler(val) {
        if (this.paramVOS.form) {
          this.onLoad();
@@ -136,7 +137,6 @@
        getFormDefineById(this.paramVOS.type,this.paramVOS.form).then(result => {
          this.formItems=result.data.obj.items;
          this.span=result.data.obj.columnOneRow?(24/result.data.obj.columnOneRow) : 12;
          if (this.paramVOS.initvalue) {
            this.form=this.paramVOS.initvalue;
          }
@@ -153,7 +153,7 @@
              formDefineId: this.paramVOS.form,
              oid: this.dataStore[0].oid
            }, sourceDataMap), this.paramVOS.getdataurl, this.paramVOS.getdatamethod).then(res => {
              this.form = res.data.obj;
              this.form=res.data.obj;
              this.loading = false;
            }).catch(error => {
              this.$message.error(error);
@@ -168,9 +168,24 @@
      }
    },
    contextSave(){
      debugger;
      if(this.saveCallback){
        this.saveCallback({});
      const useDataType=this.paramVOS["useDataType"] || "form";//使用ui上下文中的哪个类型数据,默认form。值:form、tree、table、TreeTable
      for(let key in this.$refs.uiViewRef.data){
        if(this.$refs.uiViewRef.data[key].type== useDataType){
          this.form=this.$refs.uiViewRef.data[key].data;
          if (this.paramVOS.savebeforeevent) {
            var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction');
            import("../"+urlobj.jsPath+".js").then(module => {
              module[urlobj.methodName]({
                paramVOS: this.paramVOS,
                dataStore: this.dataStore,
                sourceData:this.sourceData
              },this.formSaveHandle);
            })
          } else {
            this.formSaveHandle();
          }
          return;
        }
      }
    },
    formSave() {
@@ -204,7 +219,7 @@
        formValues.defaultValues.btmname = this.paramVOS.type;
      }
      let datas = {
        formDefineId: this.paramVOS.form,
        formDefineId: this.paramVOS.form || "",
        preEvent: this.paramVOS.preevent,
        afterEvent: this.paramVOS.afterevent,
        beforeServerEvent: this.paramVOS.beforeserverevent,
@@ -220,7 +235,7 @@
            message: "保存成功!"
          });
          if(that.saveCallback){
            that.saveCallback(that.form);
            that.saveCallback(that.type,that.form);
          }
          that.dialogClose();
        });
@@ -231,7 +246,7 @@
            message: "修改成功!"
          });
          if(that.saveCallback){
            that.saveCallback(that.form);
            that.saveCallback(that.type,that.form);
          }
          that.dialogClose();
        });
Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue
@@ -134,7 +134,7 @@
      const paramVOS = buttonitem.paramVOS;
      const DefineVO = this.componentVO.treeDefineVO || this.componentVO.tableDefineVO || this.componentVO.treeTableDefineVO || this.componentVO.formDefineVO;
      if (!paramVOS['title']) {
        paramVOS['title'] = buttonitem.name + (DefineVO.title || this.componentVO.description || '');
        paramVOS['title'] = buttonitem.name + (DefineVO.title || '');
      }
      if (!paramVOS['type']) {
@@ -148,14 +148,13 @@
      const that = this;
      //paramVOS.customBtn //弹窗默认有保存按钮,customBtn为true时内容展示自定义按钮
      paramVOS.form = "editknowledgefolderall"
      doAction(buttonitem, {
        paramVOS: paramVOS,
        dataStore: this.dataStore || [],
        sourceData: this.sourceData || {}
      }, function () {
      }, function (actionType,data) {
        if (that.$parent.handleRefresh) {
          that.$parent.handleRefresh()
          that.$parent.handleRefresh(actionType,data)
        }
      });
    }
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -8,6 +8,7 @@
                :disabled="!inDialog"
                :isEdit="canEdit"
                :formData="form"
                :initValue="paramVOS.initvalue"
                @getFormData="getFormData">
    </basic-form>
  </div>
@@ -85,8 +86,14 @@
          this.$emit("setDataStore", {
            area: this.areasName,
            type:this.componentVO.uiComponentType,
            btmType:this.componentVO.treeDefineVO.btmType,
            btmType:this.currentDefineVO.btmType,
            dataStore:[newval]
          });
          this.$emit("setData", {
            area: this.areasName,
            type:this.componentVO.uiComponentType,
            btmType:this.currentDefineVO.btmType,
            data:newval
          });
        }
      }
@@ -145,10 +152,11 @@
      const sourceDataMapList = this.sourceDataMapParams;
      this.params = Object.assign({},formParams, sourceDataMapList);
      console.log(this.params)
    },
    onLoad:function () {
      debugger;
      if (this.paramVOS.initvalue) {
        this.form=this.paramVOS.initvalue;
      }
      if (Object.keys(this.sourceData).length>0 && this.isShow) {
        this.loading = true;
        dataForm(this.params).then(res => {
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -170,6 +170,18 @@
        }
      }
    },
    tableList:{
      handler(newval) {
        if(newval) {
          this.$emit("setData", {
            area: this.areasName,
            type:this.componentVO.uiComponentType,
            btmType:this.currentDefineVO.btmType,
            data:newval
          });
        }
      }
    },
    'sourceData':{
      handler(newval) {
        if(newval) {
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
@@ -106,6 +106,18 @@
        }
      }
    },
    data:{
      handler(newval) {
        if(newval) {
          this.$emit("setData", {
            area: this.areasName,
            type:this.componentVO.uiComponentType,
            btmType:this.componentVO.treeDefineVO.btmType,
            data:newval
          });
        }
      }
    },
    sourceData:{
      handler(newval) {
        //源数据有变化时变更当前区域数据
@@ -219,39 +231,57 @@
        parentOid = parentOid.split('@vcitreesep@')[1];
      }
      const parentBtmName = (node.level === 0) ? '' : node.data.attributes.btmname;
      const params=this.params;
      if(node.level === 0){
        params.queryRoot= true;
      }else {
      const params = this.params;
      if (node.level === 0) {
        params.queryRoot = true;
      } else {
        delete params.queryRoot;
      }
      getTree(parentOid, parentBtmName, params).then(res => {
        resolve(res.data.treeData)
        this.$nextTick(()=>{
          if (this.isRefresh) {
            this.$refs.tree.setCurrentKey(this.currentClickNode.data.oid);
            this.isRefresh=false;
          }
        })
      }).catch(error => {
        this.$message.error(error);
      })
    },
    checkNode(checkedNode, checkedData) {
      if (this.isMuti) {
        this.checkDatas = checkedData.checkedNodes;
        let checkDatas = [];
        checkedData.checkedNodes.forEach(item=>{
          checkDatas.push(item.attributes)
        })
        this.checkDatas=checkDatas;
      }
    },
    changeNode(data, node) {
      if (!this.isMuti) {
        this.checkDatas = [data];
        this.checkDatas = [data.attributes];
      }
    },
    clickNode(data, node) {
      this.currentClickNode = node;
    },
    handleRefresh() {
      if (!this.lazy) {
        this.initData();
      } else {
        if (this.currentClickNode) {
          let node = this.currentClickNode.parent;
          node.loaded = false;
          node.expand();
    handleRefresh(type,data) {
      //type:add\edit\delete
      if(type=="delete"){
        this.$refs.tree.remove(this.currentClickNode);
        this.currentClickNode=null;
      }else{
        if (!this.lazy) {
          this.initData();
        } else {
          if (this.currentClickNode) {
            let node = this.currentClickNode.parent;
            node.loaded = false;
            node.expand();
            this.isRefresh=true;
          }
        }
      }
      this.checkDatas = [];
Source/ProjectWeb/src/components/dynamic-components/index.vue
@@ -11,6 +11,7 @@
                 :dataStore="dataStore"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
                 @setData="setData"
                 @setDataStore="setDataStore"
                 :isShow="isShow">
@@ -27,6 +28,7 @@
                :dataStore="dataStore"
                :areasName="areasName"
                :paramVOS="paramVOS"
                @setData="setData"
                @setDataStore="setDataStore"
                :isShow="isShow">
@@ -43,6 +45,7 @@
                :dataStore="dataStore"
                :areasName="areasName"
                :paramVOS="paramVOS"
                @setData="setData"
                @setDataStore="setDataStore"
                :isShow="isShow">
  </dynamic-tree>
@@ -58,6 +61,7 @@
                  :dataStore="dataStore"
                  :areasName="areasName"
                  :paramVOS="paramVOS"
                  @setData="setData"
                  @setDataStore="setDataStore"
                  :isShow="isShow">
@@ -129,6 +133,9 @@
    setDataStore(value) {
      this.$emit("setDataStore", value);
      this.dataStore = value.dataStore;
    },
    setData(value) {
      this.$emit("setData", value);
    }
  }
}
Source/ProjectWeb/src/views/base/UIContentArea.vue
@@ -32,6 +32,7 @@
                          :dataStore="dataStore"
                          :areasName="areasName"
                          :paramVOS="paramVOS"
                          @setData="setData"
                          @setDataStore="setDataStore"
                          :isShow="activeName==(areasName+'-Tab-'+index)?true:false"></compoent-index>
        </div>
@@ -55,6 +56,7 @@
                            :dataStore="dataStore"
                            :areasName="areasName"
                            :paramVOS="paramVOS"
                            @setData="setData"
                            @setDataStore="setDataStore"
                            :isShow="collapseActiveNames.indexOf(areasName+'-collapse-'+componentIndex)!=-1?true:false"></compoent-index>
          </div>
@@ -72,6 +74,7 @@
                        :dataStore="dataStore"
                        :areasName="areasName"
                        :paramVOS="paramVOS"
                        @setData="setData"
                        @setDataStore="setDataStore"
                        :isShow="true"></compoent-index>
      </div>
@@ -239,6 +242,9 @@
    handleChange(val) {
      //console.log(val);
    },
    setData(value) {
      this.$emit("setData", value);
    },
    setDataStore(value) {
      this.$emit("setDataStore", value);
      this.dataStore = value.dataStore;
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue
@@ -12,7 +12,8 @@
                     :canEdit="canEdit"
                     :sourceData="sourceData"
                     :sourceBtmType="btmType"
                     areas-name="northArea"
                     areas-name="northAreaInDialog"
                     @setData="setData"
                     @setDataStore="setDataStore">
      </UIContentArea>
    </el-header>
@@ -31,8 +32,9 @@
                       :canEdit="canEdit"
                       :sourceData="sourceData"
                       :sourceBtmType="btmType"
                       areas-name="westArea"
                       areas-name="westAreaInDialog"
                       cradStyle=""
                       @setData="setData"
                       @setDataStore="setDataStore">
        </UIContentArea>
      </el-aside>
@@ -48,8 +50,9 @@
                         :canEdit="canEdit"
                         :sourceData="checkedData.westAreaInDialog.data[checkedData.westAreaInDialog.data.length-1]"
                         :sourceBtmType="checkedData.westAreaInDialog.DefineVOBtmType"
                         areas-name="centerArea"
                         areas-name="centerAreaInDialog"
                         cradStyle=""
                         @setData="setData"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-main>
@@ -65,8 +68,9 @@
                         :canEdit="canEdit"
                         :sourceData="checkedData.centerAreaInDialog.data[checkedData.centerAreaInDialog.data.length-1]"
                         :sourceBtmType="checkedData.centerAreaInDialog.DefineVOBtmType"
                         areas-name="southArea"
                         areas-name="southAreaInDialog"
                         cradStyle=""
                         @setData="setData"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-footer>
@@ -116,8 +120,8 @@
  },
  data() {
    return {
      //各区域的选中数据
      checkedData:{
        //各区域选中数据
        northAreaInDialog:{
          DefineVOBtmType:'',
          data:[{}]
@@ -133,6 +137,29 @@
        southAreaInDialog:{
          DefineVOBtmType:'',
          data:[{}]
        }
      },
      //各区域数据
      data:{
        northAreaInDialog:{
          type:'',
          btmType:'',
          data:null
        },
        westAreaInDialog:{
          type:'',
          btmType:'',
          data:null
        },
        centerAreaInDialog:{
          type:'',
          btmType:'',
          data:null
        },
        southAreaInDialog:{
          type:'',
          btmType:'',
          data:null
        }
      },
      uiDefineVO: {},
@@ -174,6 +201,11 @@
        this.centerHeight = '100%';
      }
    },
    setData(value) {
      this.data[value.area].btmType = value.btmType;
      this.data[value.area].data = value.data;
      this.data[value.area].type = value.type;
    },
    setDataStore(value) {
      this.checkedData[value.area].DefineVOBtmType = value.btmType;
      this.checkedData[value.area].data = value.dataStore;