shuishen
2024-04-18 4522ab3fe8bd45ee753ef187448c1e884bbc601f
src/views/system/user.vue
@@ -244,6 +244,7 @@
              label: "登录账号",
              prop: "account",
              search: true,
              searchLabelWidth: 76,
              display: false
            },
            // {
@@ -464,7 +465,8 @@
                  leafOnly: false,
                  dicData: [],
                  props: {
                    label: "title"
                    label: "title",
                    value: "id"
                  },
                  rules: [{
                    required: true,
@@ -476,14 +478,15 @@
                  label: "所属部门",
                  prop: "deptId",
                  type: "tree",
                  // multiple: true,
                  multiple: true,
                  leafOnly: false,
                  dicData: [],
                  dataType: "string",
                  // dataType: "string",
                  props: {
                    label: "title",
                    value: "id"
                  },
                  // checkStrictly: true,
                  checkStrictly: true,
                  slot: true,
                  span: 12,
                  rules: [{
@@ -717,7 +720,7 @@
        row['userType'] = 1
        row.deptId = func.join(row.deptId)
        row.roleId = func.join(row.roleId)
        row.postId = func.join(row.postId)
        // row.postId = func.join(row.postId)
        add(row).then(() => {
          this.initFlag = false
          this.onLoad(this.page)
@@ -736,7 +739,7 @@
        row['userType'] = 1
        row.deptId = func.join(row.deptId)
        row.roleId = func.join(row.roleId)
        row.postId = func.join(row.postId)
        // row.postId = func.join(row.postId)
        update(row).then(() => {
          this.initFlag = false
          this.onLoad(this.page)
@@ -877,6 +880,7 @@
      handleExport() {
        const account = func.toStr(this.search.account)
        const realName = func.toStr(this.search.realName)
        const deptId = this.treeDeptId
        this.$confirm("是否导出用户数据?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
@@ -884,7 +888,7 @@
        }).then(() => {
          NProgress.start()
          exportBlob(
            `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}`
            `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}&deptId=${deptId}`
          ).then(res => {
            downloadXls(res.data, `用户数据表${dateNow()}.xlsx`)
            NProgress.done()
@@ -906,9 +910,9 @@
            if (this.form.hasOwnProperty("roleId")) {
              this.form.roleId = this.form.roleId.split(",")
            }
            if (this.form.hasOwnProperty("postId")) {
              this.form.postId = this.form.postId.split(",")
            }
            // if (this.form.hasOwnProperty("postId")) {
            //     this.form.postId = this.form.postId.split(",")
            // }
          })
        }
        this.initFlag = true