xiejun
2023-11-29 514c220eb2800b7e945e1bb46db178500b4f16c9
Merge remote-tracking branch 'origin/master'
已修改3个文件
889 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/index.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/user.vue 660 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
@@ -75,7 +75,7 @@
    // 表单类型(add, edit, detail)
    type: {
      type: String,
      default: "",
      default: "add",
    },
    // 自定义表单类型
    selfColumnType: {
@@ -106,6 +106,8 @@
  },
  data() {
    return {
      //年代号
      dataYearValue:null,
      filteredObject: {},
      filteredArray: [],
      isSeriesType: {},
@@ -139,7 +141,7 @@
      // 表单属性
      attributes: [],
      slotColumnList: [],
      isShow:null,
      isShow: "",
    };
  },
  mounted() {
@@ -170,12 +172,6 @@
      immediate: true,
      handler(newV) {
        this.$emit("getFormData", newV);
        // console.log("filteredObject",this.filteredObject)
        if (this.filteredObject.label === "系列号") {
          if (newV.isSeries === "false") {
            this.filteredObject.disabled = true;
          }
        }
      },
    },
    attrList: {
@@ -184,15 +180,6 @@
      handler(newVal, oldVal) {
        if (newVal) {
          this.$emit("attrList", newVal)
        }
      }
    },
    isSeriesType: {
      deep: true,
      immediate: true,
      handler(newVal, oldVal) {
        if (newVal) {
          this.$emit("isSeriesType", newVal)
        }
      }
    },
@@ -205,11 +192,22 @@
      deep: true,
      immediate: true
    },
    isShow: {
      handler(newV) {
        this.$emit("isShow", newV)
      }
    },
    dataYearValue:{
      handler(newV){
        if(newV){
          this.$emit("dataYearValue",newV)
        }
      }
    }
  },
  methods: {
    // 渲染表单模板
    templateRender(formItemList, TreeValue) {
      // debugger
      if (this.eventList) {
        this.eventFlag = this.eventList.some(item => {
          if (item.classifyInvokeEditFlag === 'true') {
@@ -224,18 +222,12 @@
      let dictKeys = [];
      let slotColumnList = [];
      formItemList.forEach((formItem) => {
        console.log('formItem',formItem);
        formItem = this.resetFormConfig(formItem);
        //属性码段规则
        if (formItem.secType === "codeattrsec") {
          this.attrList.push(formItem);
        }
        //系列号规则
        if (formItem.label === "系列号") {
          this.isSeriesType = formItem;
          // console.log("系列号",formItem)
        }
        //更改方式规则
        if (formItem.field === "codeStandardEditType") {
          if (this.status === "amend") {
            formItem.readOnly = true;
@@ -281,23 +273,27 @@
          formItem.fieldMap[formItem.field + 'id'] = 'id'
        }
        let columnItem = {
          change: (val) => {
            // console.log(val)
            if (val.column.field === "drawingno") {
              this.codeattrsecValue = val.value;
              return;
            }
            ;
            //是否系列-系列号
            if (val.column.field === "isSeries") {
              if (val.value === "false") {
                this.isShow = true;
              }else {
              } else {
                this.isShow = false;
              }
            }
            if(val.column.field === "releaseDate"){
              if(val.value){
                this.dataYearValue = val.column.valueFormat;
              }else {
                this.dataYearValue = null;
              }
            }
          },
          dataKey: formItem.dataKey || formItem.field,
          label: formItem.text,
@@ -308,8 +304,7 @@
          field: formItem.field,
          type: this.columnType[formItem.type],
          dicData: this.getDataList(formItem.type, formItem.data),
          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false) ||
            (this.isShow && formItem.label === "系列号" ? true : false),
          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
          prepend: this.preOrSufFixShow("text", formItem.prefix),
          append: this.preOrSufFixShow("text", formItem.suffix),
          prefixIcon: this.preOrSufFixShow("icon", formItem.prefix),
@@ -319,13 +314,10 @@
          keyAttr: formItem.keyAttr,
          value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) ||
            (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) ||
            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) ||
            (formItem.field === "isSeries" ? "true" : null),
            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null),
          placeholder: formItem.inputTip,
          comboxKey: formItem.comboxKey,
          tip: formItem.tooltips,
          // hidden:formItem.secType && formItem.codeValueApplyStatus == 3 ? true : false,
          // readonly:formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ?true : false ,
          display: !formItem.hidden,
          maxlength: formItem.maxlength,
          filterable: true,
@@ -364,7 +356,6 @@
          },
        };
        this.filteredObject = columnItem
        // console.log("columnItem", columnItem)
        slotColumnList.push(columnItem);
        if (group.length === 0) {
          column.push(columnItem);
@@ -373,9 +364,7 @@
        }
      });
      // this.filteredArray = column.filter(obj => obj.label === "系列号");
      this.slotColumnList = slotColumnList;
      // console.log(slotColumnList)
      this.$set(this.option, "column", column);
      this.$set(this.option, "group", group);
      this.updateIndex++;
@@ -387,9 +376,12 @@
      this.getFormDetail();
    },
    //修改级联项
    changeChildItem(items, TreeValue) {
      let column = this.option.column;
      let group = this.option.group;
    changeChildItem(items, TreeValue, type) {
      type = type || "add"
      // let column = this.option.column;
      // let group = this.option.group;
      let column = [];
      let group = [];
      let that = this;
      items.forEach((item) => {
        let formItem = this.resetFormConfig(item);
@@ -412,9 +404,6 @@
          formItem.fieldMap[formItem.field + 'id'] = 'id'
        }
        let columnItem = {
          change: (val) => {
            // console.log('1', val)
          },
          label: formItem.text,
          labelslot: true,
          prop: this.$utilFunc.isValuableObj(formItem.referConfig)
@@ -423,7 +412,7 @@
          field: formItem.field,
          type: this.columnType[formItem.type],
          dicData: this.getDataList(formItem.type, formItem.data),
          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
          disabled: type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
          prepend: this.preOrSufFixShow("text", formItem.prefix),
          append: this.preOrSufFixShow("text", formItem.suffix),
          prefixIcon: this.preOrSufFixShow("icon", formItem.prefix),
@@ -475,7 +464,6 @@
            value: "key",
          },
        };
        if (group.length === 0) {
          that.slotColumnList.forEach((colItem, index) => {
            if (colItem.field == columnItem.field) {
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -1,85 +1,88 @@
<template>
  <el-dialog
    :visible.sync="dialogVisible"
    v-if="dialogVisible"
    v-dialogDrag
    top="-5vh"
    class="avue-dialog avue-dialog--top"
    :title="title"
    :visible.sync="dialogVisible"
    :width="width"
    append-to-body
    class="avue-dialog avue-dialog--top"
    top="-5vh"
    @opened="openDialog"
  >
    <FormTemplate
      key="masterForm" data-key="masterForm"
      :status="status"
      v-bind="$attrs"
      :type="type"
      :TreeValue="TreeValue"
      :rowOid="rowOid"
      :eventList="eventList"
      :templateOid="templateOid"
      v-if="dialogVisible"
      v-if="dialogVisible" key="masterForm"
      ref="FormTemplate"
      v-bind="$attrs"
      :TreeValue="TreeValue"
      :eventList="eventList"
      :rowOid="rowOid"
      :status="status"
      :templateOid="templateOid"
      :type="type"
      data-key="masterForm"
      @getFormData="getFormData"
      @isShow="isShowHandler"
      @dataYearValue="dataYearHandler"
    ></FormTemplate>
    <div
      class="tab_box"
      v-if="
        type !== 'detail' &&
        dialogVisible &&
        (showCodeApply || showResembleQuery) &&
        type !== 'preview'
      "
      class="tab_box"
    >
      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
        <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply">
        <el-tab-pane v-if="showCodeApply" label="码值申请" name="codeApply">
          <FormTemplate
            key="codeApplyForm" data-key="codeApplyForm"
            secDTOListv-bind="$attrs"
            :type="type"
            :selfColumnType="selfColumnType"
            key="codeApplyForm" ref="CodeApply"
            :selfColumnConfig="selfColumnConfig"
            ref="CodeApply"
            @getFormData="getCodeApplyFormData"
            :selfColumnType="selfColumnType"
            :type="type"
            data-key="codeApplyForm"
            secDTOListv-bind="$attrs"
            @attrList="attrListForm"
            @isSeriesType="isSeriesTypeString"
            @getFormData="getCodeApplyFormData"
            @referConfigDataUpdate="referConfigDataUpdate"
          ></FormTemplate>
        </el-tab-pane>
        <el-tab-pane
          v-if="showResembleQuery"
          label="相似项查询"
          name="resembleQuery"
          v-if="showResembleQuery"
        >
          <ResembleQuery
            v-bind="$attrs"
            ref="resembleQueryRef"
            :hasResemble="this.hasResemble"
            :column="this.resembleTableColumn"
            v-bind="$attrs"
            :codeClassifyOid="codeClassifyOid"
            :column="this.resembleTableColumn"
            :form="this.form"
            :hasResemble="this.hasResemble"
            :templateOid="templateOid"
          ></ResembleQuery>
        </el-tab-pane>
      </el-tabs>
    </div>
    <template #footer>
      <div class="" v-if="type !== 'detail'">
        <el-button @click="close()" size="small">取 消</el-button>
      <div v-if="type !== 'detail'" class="">
        <el-button size="small" @click="close()">取 消</el-button>
        <el-button
          @click="submit()"
          type="primary"
          :loading="submitBtnLoading"
          size="small"
          >{{ submitText }}</el-button
          type="primary"
          @click="submit()"
        >{{ submitText }}
        </el-button
        >
        <el-button
          @click="resembleQuerySubmit"
          type="primary"
          size="small"
          v-if="showResembleQuery"
          >相似像查询</el-button
          size="small"
          type="primary"
          @click="resembleQuerySubmit"
        >相似像查询
        </el-button
        >
      </div>
    </template>
@@ -87,14 +90,15 @@
</template>
<script>
import { getCodeRule, getFormTemplate } from "@/api/formTemplate.js";
import {getCodeRule, getFormTemplate} from "@/api/formTemplate.js";
import FormTemplate from "./FormTemplate";
import ResembleQuery from "./ResembleQuery";
export default {
  name: "FormTemplateDialog",
  components: { ResembleQuery, FormTemplate },
  components: {ResembleQuery, FormTemplate},
  props: {
    status:{
    status: {
      type: String,
      default: "",
    },
@@ -102,7 +106,7 @@
      type: Boolean,
      default: false,
    },
    TreeValue:{
    TreeValue: {
      type: String,
      default: "",
    },
@@ -138,11 +142,11 @@
  },
  data() {
    return {
      isSeriesType:{},
      attrList:[],
      eventList:[],
      isSeriesType: {},
      attrList: [],
      eventList: [],
      //码值的第二种只读隐藏情况
      codeValueApplyStatus:'',
      codeValueApplyStatus: '',
      loading: false,
      submitBtnLoading: false,
      hasResemble: false,
@@ -222,9 +226,11 @@
        "secretgrade",
      ],
      codeRuleOid: "",
      isShowStatus: ""
    };
  },
  created() {},
  created() {
  },
  computed: {
    dialogVisible: {
      get() {
@@ -235,9 +241,9 @@
      },
    },
  },
  watch:{
    codeApplyForm:{
      handler(newval,oldval){
  watch: {
    codeApplyForm: {
      handler(newval, oldval) {
        // console.log('newval',newval)
      }
    }
@@ -275,7 +281,7 @@
              this.$refs.FormTemplate.templateRender(
                res.data.formDefineVO.items
              );
              this.eventList=res.data.templateVO.attributes
              this.eventList = res.data.templateVO.attributes
              // this.$refs.FormTemplate.$emit('eventList',  res.data.templateVO.attributes);
              if (Object.keys(this.setForm).length > 0) {
                this.$refs.FormTemplate.form = this.setForm;
@@ -316,6 +322,7 @@
          if (that.secVOList.length > 0 && that.type === "add") {
            that.showCodeApply = true;
            that.activeName = "codeApply";
            this.$nextTick(() => {
              that.$refs.CodeApply.templateRender(that.secVOList, this.TreeValue);
            });
@@ -326,12 +333,7 @@
      });
    },
    getFormData(form) {
      // if (this.status === "apply"){
      //   form.codeStandardEditType = "制定";
      //   return;
      // }
      this.form = form;
      // console.log("form",form)
      //属性码段赋值
      if (this.attrList) {
        this.attrList.forEach(item => {
@@ -342,12 +344,28 @@
      }
    },
    isSeriesTypeString(val){
      this.isSeriesType = val;
    //系列号规则
    isShowHandler(val) {
      let that = this;
      this.isShowStatus = val;
        this.secVOList.forEach(item => {
          if (item.name === "系列号") {
            this.$set(item, "readOnly", val)
          }
        })
      if(this.$refs.CodeApply.changeChildItem ){
        this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type);
      }
    },
    //年代号
    dataYearHandler(val){
      console.log("val",val)
    },
    //属性码段赋值
    attrListForm(attrListForm){
      this.attrList=attrListForm;
    attrListForm(attrListForm) {
      this.attrList = attrListForm;
    },
    getCodeApplyFormData(codeApplyForm) {
      // console.log("codeApplyForm",codeApplyForm)
@@ -355,21 +373,21 @@
    },
    // 参照组件数据变更
    referConfigDataUpdate(data) {
      const { field } = data;
      let childItems=[];
      const {field} = data;
      let childItems = [];
      this.secVOList = this.secVOList.map((item) => {
        if (item.parentClassifySecOid === field) {
          this.$refs.CodeApply.form[item.oid] = undefined;
          this.$refs.CodeApply.form[item.name] = undefined;
          item.readOnly=false;
          item.referConfig.extraParams.parentClassifyValueOid=data.value;
          item.readOnly = false;
          item.referConfig.extraParams.parentClassifyValueOid = data.value;
          item.referConfig.reloadData = true;
          childItems.push(item)
        }
        return item;
      });
      //this.$refs.CodeApply.templateRender(this.secVOList,this.TreeValue);
      this.$refs.CodeApply.changeChildItem(childItems);
      this.$refs.CodeApply.changeChildItem(childItems,this.TreeValue,this.type);
    },
    resembleQuerySubmit() {
      this.activeName = "resembleQuery";
@@ -426,7 +444,7 @@
        "lastmodifier"
      ];
      let resForm = {};
      const { defaultValue, formValue } = this.getDefaultValueAndFormValues(
      const {defaultValue, formValue} = this.getDefaultValueAndFormValues(
        this.form
      );
      noData.forEach((item) => {
@@ -534,9 +552,13 @@
          if (!this.codeApplyForm[item.parentClassifySecOid]) {
            return true;
          } else {
            return false;
            return item.readOnly || false;
          }
        } else {
          return item.readOnly || false;
        }
      } else {
        return item.readOnly || false;
      }
    },
    isRequired(item) {
@@ -577,6 +599,7 @@
  top: 2px;
  color: red;
}
// 解决swich组件不垂直居中的问题
/deep/ .el-switch {
  vertical-align: baseline;
Source/UBCS-WEB/src/views/system/user.vue
@@ -199,22 +199,6 @@
export default {
  data() {
    const validatePass = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请输入密码'));
      } else {
        callback();
      }
    };
    const validatePass2 = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请再次输入密码'));
      } else if (value !== this.form.password) {
        callback(new Error('两次输入密码不一致!'));
      } else {
        callback();
      }
    };
    return {
      tenantId:'',
      form: {},
@@ -278,310 +262,6 @@
          value: 'value',
          children: 'children'
        }
      },
      option: {
        height:'auto',
        calcHeight: 80,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        columnBtn:false,
        border: true,
        index: true,
        selection: true,
        /* 下面这三个属性默认设置为true,
          实际根据permissionList中对照的属性进行控制的 */
        viewBtn: true,
        editBtn: true,
        delBtn: true,
        addBtn: true,
        dialogType: 'drawer',
        dialogClickModal: false,
        highlightCurrentRow: true, //行选中时高亮
        column: [
          {
            label: "登录账号",
            prop: "account",
            search: true,
            display: false
          },
          {
            label: "所属租户",
            prop: "tenantName",
            slot: true,
            display: false
          },
          {
            label: "用户姓名",
            prop: "realName",
            search: true,
            display: false
          },
          {
            label: "所属角色",
            prop: "roleName",
            slot: true,
            display: false
          },
          {
            label: "密码策略",
            prop: "pwdStrategy",
            slot: true,
            display: false
          },
          {
            label: "所属部门",
            prop: "deptName",
            slot: true,
            display: false
          },
          {
            label: "用户平台",
            prop: "userTypeName",
            slot: true,
            display: false
          },
          {
            label: "用户平台",
            type: "select",
            dicUrl: "/api/ubcs-system/dict/dictionary?code=user_type",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            dataType: "number",
            search: true,
            hide: true,
            display: false,
            prop: "userType",
            rules: [{
              required: true,
              message: "请选择用户平台",
              trigger: "blur"
            }],
          },
          {
            label: "状态",
            display: false,
            sortable:true,
            html:true,
            prop: "userStatus",
            formatter : function (row, column) {
              return row.userStatus == 0 ? '<i class="el-icon-check" style="color: #32cd32;font-size: 20px;font-weight: 800"></i>' : '<i class="el-icon-close" style="color: #ff0000;font-size: 20px;font-weight: 800"></i>'
            }
          },
        ],
        group: [
          {
            label: '基础信息',
            prop: 'baseInfo',
            icon: 'el-icon-user-solid',
            column: [
              {
                label: "所属租户",
                prop: "tenantId",
                type: "tree",
                dicUrl: "/api/ubcs-system/tenant/select",
                props: {
                  label: "tenantName",
                  value: "tenantId"
                },
                hide: !website.tenantMode,
                addDisplay: website.tenantMode,
                editDisplay: website.tenantMode,
                viewDisplay: website.tenantMode,
                rules: [{
                  required: true,
                  message: "请输入所属租户",
                  trigger: "click"
                }],
                span: 24,
                value:""
              },
              {
                label: "登录账号",
                prop: "account",
                rules: [{
                  required: true,
                  message: "请输入登录账号",
                  trigger: "blur"
                }],
              },
              {
                label: "用户平台",
                type: "select",
                dicUrl: "/api/ubcs-system/dict/dictionary?code=user_type",
                props: {
                  label: "dictValue",
                  value: "dictKey"
                },
                value:'1',
                dataType: "number",
                slot: true,
                prop: "userType",
                rules: [{
                  required: true,
                  message: "请选择用户平台",
                  trigger: "blur"
                }]
              },
              {
                label: '密码',
                prop: 'password',
                type: "password",
                hide: true,
                editDisplay: false,
                viewDisplay: false,
                rules: [{required: true, validator: validatePass, trigger: 'blur'}]
              },
              {
                label: '确认密码',
                prop: 'password2',
                hide: true,
                type: "password",
                editDisplay: false,
                viewDisplay: false,
                rules: [{required: true, validator: validatePass2, trigger: 'blur'}]
              },
            ]
          },
          {
            label: '详细信息',
            prop: 'detailInfo',
            icon: 'el-icon-s-order',
            column: [
              {
                label: "用户昵称",
                prop: "name",
                hide: true,
                rules: [{
                  required: true,
                  message: "请输入用户昵称",
                  trigger: "blur"
                }]
              },
              {
                label: "用户姓名",
                prop: "realName",
                rules: [{
                  required: true,
                  message: "请输入用户姓名",
                  trigger: "blur"
                }, {
                  min: 2,
                  max: 5,
                  message: '姓名长度在2到5个字符'
                }]
              },
              {
                label: "手机号码",
                prop: "phone",
                overHidden: true
              },
              {
                label: "电子邮箱",
                prop: "email",
                hide: true,
                overHidden: true
              },
              {
                label: "用户性别",
                prop: "sex",
                type: "select",
                dicData: [
                  {
                    label: "男",
                    value: 1
                  },
                  {
                    label: "女",
                    value: 2
                  },
                  {
                    label: "未知",
                    value: 3
                  }
                ],
                hide: true
              },
              {
                label: "用户生日",
                type: "date",
                prop: "birthday",
                format: "yyyy-MM-dd hh:mm:ss",
                valueFormat: "yyyy-MM-dd hh:mm:ss",
                hide: true
              },
              {
                label: "账号状态",
                prop: "statusName",
                hide: true,
                display: false
              }
            ]
          },
          {
            label: '职责信息',
            prop: 'dutyInfo',
            icon: 'el-icon-s-custom',
            column: [
              {
                label: "用户编号",
                prop: "code",
              },
              {
                label: "所属角色",
                prop: "roleId",
                multiple: true,
                type: "tree",
                dicData: [],
                props: {
                  label: "title"
                },
                checkStrictly: true,
                slot: true,
                rules: [{
                  required: true,
                  message: "请选择所属角色",
                  trigger: "click"
                }]
              },
              {
                label: "所属部门",
                prop: "deptId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "title"
                },
                checkStrictly: true,
                slot: true,
                rules: [{
                  required: true,
                  message: "请选择所属部门",
                  trigger: "click"
                }]
              },
              /*{
                label: "所属岗位",
                prop: "postId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "postName",
                  value: "id"
                },
                rules: [{
                  required: false,
                  message: "请选择所属岗位",
                  trigger: "click"
                }],
              },*/
            ]
          },
        ]
      },
      data: [],
      platformQuery: {},
@@ -714,7 +394,8 @@
        pwdstrategyId:''
      },
      userflag:true,
      usernumber:0
      usernumber:0,
      userStatus:false,
    };
  },
  watch: {
@@ -749,21 +430,322 @@
        unsealBtn: this.vaildData(this.permission.user.user_unseal,false),
      };
    },
    // platformPermissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.user.user_add, false),
    //     viewBtn: this.vaildData(this.permission.user.user_view, false),
    //     delBtn: this.vaildData(this.permission.user.user_delete, false),
    //     editBtn: this.vaildData(this.permission.user.user_edit, false),
    //     deactEnBtn: this.vaildData(this.permission.user.user_deact_en,false),
    //     exportBtn: this.vaildData(this.permission.user.user_export,false),
    //     pwdStrategyBtn: this.vaildData(this.permission.user.user_pwd_strategy,false),
    //     importBtn: this.vaildData(this.permission.user.user_import,false),
    //     resetBtn: this.vaildData(this.permission.user.user_reset,false),
    //     roleBtn: this.vaildData(this.permission.user.user_role,false),
    //     unsealBtn: this.vaildData(this.permission.user.user_unseal,false),
    //   };
    // },
    option() {
      return{
          height:'auto',
          calcHeight: 80,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          columnBtn:false,
          border: true,
          index: true,
          selection: true,
          /* 下面这三个属性默认设置为true,
            实际根据permissionList中对照的属性进行控制的 */
          viewBtn: true,
          editBtn: true,
          delBtn: true,
          addBtn: true,
          dialogType: 'drawer',
          dialogClickModal: false,
          highlightCurrentRow: true, //行选中时高亮
          column: [
            {
              label: "登录账号",
              prop: "account",
              search: true,
              display: false
            },
            {
              label: "所属租户",
              prop: "tenantName",
              slot: true,
              display: false
            },
            {
              label: "用户姓名",
              prop: "realName",
              search: true,
              display: false
            },
            {
              label: "所属角色",
              prop: "roleName",
              slot: true,
              display: false
            },
            {
              label: "密码策略",
              prop: "pwdStrategy",
              slot: true,
              display: false
            },
            {
              label: "所属部门",
              prop: "deptName",
              slot: true,
              display: false
            },
            {
              label: "用户平台",
              prop: "userTypeName",
              slot: true,
              display: false
            },
            {
              label: "用户平台",
              type: "select",
              dicUrl: "/api/ubcs-system/dict/dictionary?code=user_type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              search: true,
              hide: true,
              display: false,
              prop: "userType",
              rules: [{
                required: true,
                message: "请选择用户平台",
                trigger: "blur"
              }],
            },
            {
              label: "状态",
              display: false,
              sortable:true,
              html:true,
              prop: "userStatus",
              formatter : function (row, column) {
                return row.userStatus == 0 ? '<i class="el-icon-check" style="color: #32cd32;font-size: 20px;font-weight: 800"></i>' : '<i class="el-icon-close" style="color: #ff0000;font-size: 20px;font-weight: 800"></i>'
              }
            },
          ],
          group: [
            {
              label: '基础信息',
              prop: 'baseInfo',
              icon: 'el-icon-user-solid',
              column: [
                {
                  label: "所属租户",
                  prop: "tenantId",
                  type: "tree",
                  dicUrl: "/api/ubcs-system/tenant/select",
                  props: {
                    label: "tenantName",
                    value: "tenantId"
                  },
                  hide: !website.tenantMode,
                  addDisplay: website.tenantMode,
                  editDisplay: website.tenantMode,
                  viewDisplay: website.tenantMode,
                  rules: [{
                    required: true,
                    message: "请输入所属租户",
                    trigger: "click"
                  }],
                  span: 24,
                  value:""
                },
                {
                  label: "登录账号",
                  prop: "account",
                  rules: [{
                    required: true,
                    message: "请输入登录账号",
                    trigger: "blur"
                  }],
                },
                {
                  label: "用户平台",
                  type: "select",
                  dicUrl: "/api/ubcs-system/dict/dictionary?code=user_type",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  value:'1',
                  dataType: "number",
                  slot: true,
                  prop: "userType",
                  rules: [{
                    required: true,
                    message: "请选择用户平台",
                    trigger: "blur"
                  }]
                },
                {
                  label: '密码',
                  prop: 'password',
                  type: "password",
                  hide: true,
                  editDisplay: false,
                  viewDisplay: false,
                  rules: [{
                    required: true,
                    validator:(rule, value,callback) => {
                      if (value === '') {
                        callback(new Error('请再次输入密码'));
                      } else if (value !== this.form.password) {
                        callback(new Error('两次输入密码不一致!'));
                      } else {
                        callback();
                      }
                    },
                    trigger: 'blur'
                  }]
                },
                {
                  label: '确认密码',
                  prop: 'password2',
                  hide: true,
                  type: "password",
                  editDisplay: false,
                  viewDisplay: false,
                  rules: [{
                    required: true,
                    validator:(rule, value,callback) => {
                      if (value === '') {
                        callback(new Error('请再次输入密码'));
                      } else if (value !== this.form.password) {
                        callback(new Error('两次输入密码不一致!'));
                      } else {
                        callback();
                      }
                    },
                    trigger: 'blur'
                  }]
                },
              ]
            },
            {
              label: '详细信息',
              prop: 'detailInfo',
              icon: 'el-icon-s-order',
              column: [
                {
                  label: "用户昵称",
                  prop: "name",
                  hide: true,
                  rules: [{
                    required: true,
                    message: "请输入用户昵称",
                    trigger: "blur"
                  }]
                },
                {
                  label: "用户姓名",
                  prop: "realName",
                  rules: [{
                    required: true,
                    message: "请输入用户姓名",
                    trigger: "blur"
                  }, {
                    min: 2,
                    max: 5,
                    message: '姓名长度在2到5个字符'
                  }]
                },
                {
                  label: "手机号码",
                  prop: "phone",
                  overHidden: true
                },
                {
                  label: "电子邮箱",
                  prop: "email",
                  hide: true,
                  overHidden: true
                },
                {
                  label: "用户性别",
                  prop: "sex",
                  type: "select",
                  dicData: [
                    {
                      label: "男",
                      value: 1
                    },
                    {
                      label: "女",
                      value: 2
                    },
                    {
                      label: "未知",
                      value: 3
                    }
                  ],
                  hide: true
                },
                {
                  label: "用户生日",
                  type: "date",
                  prop: "birthday",
                  format: "yyyy-MM-dd hh:mm:ss",
                  valueFormat: "yyyy-MM-dd hh:mm:ss",
                  hide: true
                },
                {
                  label: "账号状态",
                  prop: "statusName",
                  hide: true,
                  display: false
                }
              ]
            },
            {
              label: '职责信息',
              prop: 'dutyInfo',
              icon: 'el-icon-s-custom',
              column: [
                {
                  label: "用户编号",
                  prop: "code",
                },
                {
                  label: "所属角色",
                  prop: "roleId",
                  multiple: true,
                  type: "tree",
                  dicData: [],
                  disabled:this.userStatus,
                  props: {
                    label: "title"
                  },
                  checkStrictly: true,
                  slot: true,
                  rules: [{
                    required: true,
                    message: "请选择所属角色",
                    trigger: "click"
                  }]
                },
                {
                  label: "所属部门",
                  prop: "deptId",
                  type: "tree",
                  multiple: true,
                  dicData: [],
                  props: {
                    label: "title"
                  },
                  checkStrictly: true,
                  slot: true,
                  rules: [{
                    required: true,
                    message: "请选择所属部门",
                    trigger: "click"
                  }]
                },
              ]
            },
          ]
      }
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
@@ -1116,6 +1098,12 @@
      })
    },
    beforeOpen(done, type) {
      // console.log(type)
      if(type === "edit"){
        this.userStatus = true;
      }else {
        this.userStatus = false;
      }
      //console.log(type)
      // console.log('this.tenantId',this.tenantId)
      // const column = this.findObject(this.option.group,'tenantId');