src/views/dispatch/dispatchChildoperable.vue
@@ -1,6 +1,11 @@
<template>
  <basic-container>
    <div class="dispatchChildoperable">
    <div
      :class="[
        'dispatchChildoperable',
        $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
      ]"
    >
      <avue-crud
        :option="option"
        :data="data"
@@ -46,6 +51,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      form: {},
      query1: {},
@@ -65,6 +71,7 @@
        // menuWidth: 160,
        align: "center",
        selection: true,
        ...this.$store.state.control.clearOtherBut,
        column: [
          // },
          {
@@ -131,7 +138,7 @@
            width: 70,
            labelWidth: 120,
            hide: true,
            defaultExpandAll:true,
            defaultExpandAll: true,
            // props: {
            //   label: "realName",
            //   value: "id",
@@ -144,7 +151,7 @@
              value: "id",
            },
            //不包含父节点值
            leafOnly:true,
            leafOnly: true,
            multiple: true,
            rules: [
              {
@@ -360,10 +367,9 @@
      if (this.useifid != 266) {
        form["deptId"] = this.useifid;
      }
      console.log(form,123456);
      form["ids"] = form.userIds.join(","),
      delete form.userIds;
      console.log(form,321);
      console.log(form, 123456);
      (form["ids"] = form.userIds.join(",")), delete form.userIds;
      console.log(form, 321);
      saveDispatcher(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -459,18 +465,26 @@
      this.onLoad(this.page, this.query1);
    },
    beforeOpen(done, type,row) {
    beforeOpen(done, type, row) {
      this.initFlag = true;
      if(type=="edit"){
        console.log(row,123);
      if (type == "edit") {
        console.log(row, 123);
        const userColumn = this.findObject(this.option.column, "userIds");
        userColumn.multiple = false;
        userColumn.dicUrl = "/api/blade-user/security-dispatcher-tree?deptId="+this.userInfo.dept_id+"&id="+this.form.userIds+"&realName="+this.form.securityName;
        userColumn.dicUrl =
          "/api/blade-user/security-dispatcher-tree?deptId=" +
          this.userInfo.dept_id +
          "&id=" +
          this.form.userIds +
          "&realName=" +
          this.form.securityName;
      }
      if(type=="add"){
      if (type == "add") {
        const userColumn = this.findObject(this.option.column, "userIds");
        userColumn.multiple = true;
        userColumn.dicUrl = "/api/blade-user/security-dispatcher-tree?deptId="+this.userInfo.dept_id;
        userColumn.dicUrl =
          "/api/blade-user/security-dispatcher-tree?deptId=" +
          this.userInfo.dept_id;
      }
      done();
    },