luohairen
2024-11-27 f67241a72e48a90cbcca28acbc2ce9aaffdfa43d
Merge remote-tracking branch 'origin/master'
3个文件已修改
66 ■■■■■ 已修改文件
src/components/FileUpload/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectProcess/components/RunProcess.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectProcess/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FileUpload/index.vue
@@ -153,7 +153,7 @@
    // 上传成功回调
    handleUploadSuccess(res, file) {
      if (res.code === 200) {
        this.uploadList.push({ name: res.fileName, url: res.fileName });
        this.uploadList.push({ name: res.newFileName, originalName: res.originalFilename , url: res.fileName });
        this.uploadedSuccessfully();
      } else {
        this.number--;
@@ -166,7 +166,9 @@
    // 删除文件
    handleDelete(index) {
      this.fileList.splice(index, 1);
      this.$emit("input", this.listToString(this.fileList));
      // this.$emit("input", this.listToString(this.fileList));
      //修改为返回数组
      this.$emit("input", this.fileList);
    },
    // 上传结束处理
    uploadedSuccessfully() {
@@ -174,7 +176,9 @@
        this.fileList = this.fileList.concat(this.uploadList);
        this.uploadList = [];
        this.number = 0;
        this.$emit("input", this.listToString(this.fileList));
        // this.$emit("input", this.listToString(this.fileList));
        //修改为返回数组
        this.$emit("input", this.fileList);
        this.$modal.closeLoading();
      }
    },
src/views/projectProcess/components/RunProcess.vue
@@ -10,7 +10,7 @@
      <div>
        <div style="display: flex; flex-direction: row; justify-content: center; align-items: center;font-size: 24px">
          <div>当前流程:</div>
          <div v-if="nowProcessId">{{nowProcessName}}</div>
          <div v-if="nowProcessId">{{selectProcessName}}</div>
          <div v-else>未绑定流程</div>
        </div>
      </div>
@@ -103,43 +103,47 @@
    nowProcessId: {  // 当前项目绑定的流程id
      required: true,
      type: String
    },
    nowProcessName: {
      required: true,
      type: String
    }
  },
  watch: {
    // 监听回显值
    nowProcessId(newVal, oldVal) {
      console.log("传入值:", newVal, this.processList)
      this.processList.forEach((item,index) => {
        console.log(item.id, newVal, item.id === newVal)
        if(item.id === newVal){
          console.log("wwwwwww")
          this.selectProcessId = newVal
          this.$nextTick(() => {
            this.$refs.myTable.toggleRowSelection(item);
          })
        }
      })
    projectInfo: {
      handler(newVal, oldVal) {
        console.log("传入值:", newVal, this.processList)
        this.setSelect(this.nowProcessId)
      },
      deep: true
    }
  },
  data() {
    return {
      selectProcessId: '',  // 组件内部选中的流程id
      selectProcessName: '',  // 组件内部选中的流程id
    }
  },
  methods: {
    setSelect(value) {
      console.log("调用值:", value)
      this.processList.forEach((item,index) => {
        console.log(item.id, value, item.id === value)
        if(item.id === value){
          this.selectProcessName = item.name
          this.$nextTick(() => {
            this.$refs.myTable.toggleRowSelection(item);
          })
        }
      })
    },
    // 实现el-table单选
    handleSelectionChange(val) {
      console.log(val, "选中")
      if (val.length > 1) {
        this.$refs.myTable.clearSelection();
        this.$refs.myTable.toggleRowSelection(val.pop());
        this.$refs.myTable.toggleRowSelection(val[val.length - 1]);
      }
      if(val.length != 0){
        this.selectProcessId = val[val.length - 1].id;
        console.log("选中id:", this.selectProcessId)
      }
    },
    // 启动流程
@@ -162,6 +166,8 @@
      })
    },
    handleClose() {
      this.selectProcessId = ""
      this.selectProcessName = ""
      this.$emit("close")
    }
  }
src/views/projectProcess/index.vue
@@ -270,9 +270,8 @@
      :currentColumns="columns"
    />
    <RunProcess :show="showRunProcess"
    <RunProcess ref="runProcess" :show="showRunProcess"
                :now-process-id="nowProcessId"
                :now-process-name="nowProcessName"
                :project-info="projectRunFrom"
                :process-list="processList"
                @close="closeRunProcess">
@@ -306,7 +305,6 @@
      processList: [],
      showRunProcess: false,
      nowProcessId: '',
      nowProcessName: '',
      isImportOrExport: false,
      fileDialogVisible: false,
      //是否需要新增按钮(储蓄项目需要)
@@ -390,6 +388,10 @@
  },
  methods: {
    closeRunProcess() {
      this.projectRunFrom = {
        projectId: null,
        projectName: ''
      }
      this.showRunProcess = false
      this.getList()
    },
@@ -398,10 +400,12 @@
      // 拿到流程列表 TODO 根据项目类型做筛选
      getProcessConfigInfoList().then(response => {
        this.processList = response.data;
        this.nowProcessId = row.flowableProcessId;
        // // 防止:id没变不触发监听
        // this.$refs.runProcess.setSelect(row.flowableProcessId);
        this.projectRunFrom.projectId = row.id;
        this.projectRunFrom.projectName = row.projectName;
        this.nowProcessId = row.flowableProcessId;
        this.nowProcessName = row.flowableProcessName;
        this.showRunProcess = true;
      });
    },