Ver Fonte

task-6617 错别字调整

tianxinyu há 1 semana atrás
pai
commit
020652cf2a

+ 430 - 468
src/business/platform/org/employee/panel.vue

@@ -1,85 +1,41 @@
 <template>
-    <ibps-layout ref="layout" style="width: 99%;">
-        <div v-if="showTree" slot="west" :style="{width:width+'px'}" class="ibps-employee-selector-tree">
-            <div ref="searchForm" class="ibps-tree-search-form">
-                <el-select
-                    v-model="partyType"
-                    :disabled="currentOrgIdValue===''?false:$store.getters.isSuper?false:!isUseScope"
-                    placeholder="请选择"
-                    @change="changePartyType"
-                >
-                    <el-option
-                        v-for="option in partyTypeOptions"
-                        :key="option.value"
-                        :value="option.value"
-                        :label="option.label"
-                    />
-                </el-select>
-                <!-- <el-checkbox v-model="inclueChild" :disabled="partyType==='role'||partyType==='group'" style="margin:5px 0 0 5px;">包含子项</el-checkbox> -->
-                <!-- 重置 -->
-            </div>
-            <div v-if="toolbars" ref="toolbar" class="ibps-tree-toolbar">
-                <ibps-toolbar
-                    :actions="toolbars"
-                    type="icon"
-                    @action-event="handleTreeAction"
-                />
-            </div>
-            <div
-                :style="{ height:(tableHeight)+'px'}"
-            >
-                <el-scrollbar
-                    style="height: 100%;width:100%; padding-bottom:8px;"
-                    wrap-class="ibps-tree-wrapper ibps-scrollbar-wrapper"
-                >
-                    <el-tree
-                        v-if="!isUseScope||!hiddenTree"
-                        ref="elTree"
-                        v-loading="loadingTree"
-                        :data="treeData"
-                        :expand-on-click-node="false"
-                        :props="{ children: 'children', label: 'name',isLeaf: 'leaf'}"
-                        :default-expanded-keys="defaultExpandedKeys"
-                        :default-expand-all="defaultExpandAll"
-                        :load="lazyTree?partyType==='org'&&partyTypeId==='3'?loadOrgTreeNode3:partyType==='position'?partyTypeId==='3'?loadPosTreeNode3:loadPosTreeNode:loadOrgTreeNode:null"
-                        :lazy="lazyTree"
-                        node-key="id"
-                        pid-key="parentId"
-                        highlight-current
-                        @node-click="handleNodeClick"
-                    >
-                        <span slot-scope="{ node, data }" class="custom-tree-node" :style="node.disabled ? 'cursor:not-allowed;color:#dcdfe6': ''">
-                            {{ node.label }}
-                        </span>
-                    </el-tree>
-                </el-scrollbar>
-            </div>
-        </div>
-        <ibps-crud
-            ref="crud"
-            height="520"
-            :data="listData"
-            :toolbars="listConfig.toolbars"
-            :search-form="listConfig.searchForm"
-            :pk-key="pkKey"
-            :columns="listConfig.columns"
-            :pagination="pagination"
-            :loading="loading"
-            :selection-type="multiple?'checkbox':'radio'"
-            @selection-change="handleSelectionChange"
-            @action-event="handleAction"
-            @sort-change="handleSortChange"
-            @pagination-change="handlePaginationChange"
-        />
-        <more-search
-            :title="title"
-            :visible="dialogFormVisible"
-            class-name="org-panel-more-search-dialog"
-            @callback="search"
-            @close="visible => dialogFormVisible = visible"
-            @action-event="handleMoreSearchAction"
-        />
-    </ibps-layout>
+  <ibps-layout ref="layout" style="width: 99%;">
+    <div v-if="showTree" slot="west" :style="{ width: width + 'px' }" class="ibps-employee-selector-tree">
+      <div ref="searchForm" class="ibps-tree-search-form">
+        <el-select v-model="partyType" :disabled="currentOrgIdValue === '' ? false : $store.getters.isSuper ? false : !isUseScope"
+          placeholder="请选择" @change="changePartyType">
+          <el-option v-for="option in partyTypeOptions" :key="option.value" :value="option.value"
+            :label="option.label" />
+        </el-select>
+        <!-- <el-checkbox v-model="inclueChild" :disabled="partyType==='role'||partyType==='group'" style="margin:5px 0 0 5px;">包含子项</el-checkbox> -->
+        <!-- 重置 -->
+      </div>
+      <div v-if="toolbars" ref="toolbar" class="ibps-tree-toolbar">
+        <ibps-toolbar :actions="toolbars" type="icon" @action-event="handleTreeAction" />
+      </div>
+      <div :style="{ height: (tableHeight) + 'px' }">
+        <el-scrollbar style="height: 100%;width:100%; padding-bottom:8px;"
+          wrap-class="ibps-tree-wrapper ibps-scrollbar-wrapper">
+          <el-tree v-if="!isUseScope || !hiddenTree" ref="elTree" v-loading="loadingTree" :data="treeData"
+            :expand-on-click-node="false" :props="{ children: 'children', label: 'name', isLeaf: 'leaf' }"
+            :default-expanded-keys="defaultExpandedKeys" :default-expand-all="defaultExpandAll"
+            :load="lazyTree ? partyType === 'org' && partyTypeId === '3' ? loadOrgTreeNode3 : partyType === 'position' ? partyTypeId === '3' ? loadPosTreeNode3 : loadPosTreeNode : loadOrgTreeNode : null"
+            :lazy="lazyTree" node-key="id" pid-key="parentId" highlight-current @node-click="handleNodeClick">
+            <span slot-scope="{ node, data }" class="custom-tree-node"
+              :style="node.disabled ? 'cursor:not-allowed;color:#dcdfe6' : ''">
+              {{ node.label }}
+            </span>
+          </el-tree>
+        </el-scrollbar>
+      </div>
+    </div>
+    <ibps-crud ref="crud" height="520" :data="listData" :toolbars="listConfig.toolbars"
+      :search-form="listConfig.searchForm" :pk-key="pkKey" :columns="listConfig.columns" :pagination="pagination"
+      :loading="loading" :selection-type="multiple ? 'checkbox' : 'radio'" @selection-change="handleSelectionChange"
+      @action-event="handleAction" @sort-change="handleSortChange" @pagination-change="handlePaginationChange" />
+    <more-search :title="title" :visible="dialogFormVisible" class-name="org-panel-more-search-dialog"
+      @callback="search" @close="visible => dialogFormVisible = visible" @action-event="handleMoreSearchAction" />
+  </ibps-layout>
 </template>
 <script>
 import { getScriptValue } from '@/api/platform/form/formDef'// 脚本
@@ -95,408 +51,414 @@ import MoreSearch from './more-search'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-    components: {
-        MoreSearch
+  components: {
+    MoreSearch
+  },
+  mixins: [SelectionMixin, selectorScope, panelTree],
+  props: {
+    value: [Object, Array],
+    multiple: Boolean,
+    filtrate: {
+      type: Boolean,
+      default: false
     },
-    mixins: [SelectionMixin, selectorScope, panelTree],
-    props: {
-        value: [Object, Array],
-        multiple: Boolean,
-        filtrate: {
-            type: Boolean,
-            default: false
-        },
-        seetingSearchPartyType: String, // 设置查询用户类型
-        height: {
-            type: String
-            //   default: '400px'
-        },
-        partyTypeId: { // 类型节点ID
-            type: [String, Number],
-            default: ''
-        },
-        partyTypeScope: String,
-        currentOrgId: { // 当前用户组ID
-            type: [String, Number],
-            default: ''
-        },
-        script: String,
-        customPartyTypeOptions: {
-            type: [Object, Array],
-            default: () => {}
-        },
-        showTree: { // 是否显示左树
-            type: Boolean,
-            default: true
-        },
-        isSuperInitTree: { // 是否为超管初始化树类型数据
-            type: Object,
-            default: () => {}
-        }
+    seetingSearchPartyType: String, // 设置查询用户类型
+    height: {
+      type: String
+      //   default: '400px'
     },
-    data () {
-        const { first = '', second = '' } = this.$store.getters.level
-        const { isSuper = false } = this.$store.getters
-        let level = second || first
-        if (isSuper) {
-            level = null
-        }
-        return {
-            level,
-            width: 200,
-            dialogFormVisible: false, // 弹窗
-            editId: '',
-            title: '更多查询条件',
-            partyTypeOptions: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions : partyTypeOptions,
-            statusOptions: statusOptions,
-            genderOptions: genderOptions,
-            partyType: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions[0].value : 'position',
-            // inclueChild: true,
-            partyId: '',
-            treeDatas: [],
-
-            // 树配置
-            loadingTree: false,
-            treeData: [],
-            toolbars: [{
-                key: 'refresh'
-            }, {
-                key: 'expand'
-            }, {
-                key: 'compress'
-            }],
-            // 列表配置
-            pkKey: 'id', // 主键  如果主键不是pk需要传主键
-            loading: false,
-            listData: [],
-            loazTreeData: [],
-            listConfig: {
-                // 工具栏
-                toolbars: [
-                    { key: 'search' }
-                    // { key: 'moreSearch' }
-                ],
-                // 查询条件
-                searchForm: {
-                    labelWidth: 50,
-                    forms: [
-                        { prop: 'Q^FULL_NAME_^SL', label: '姓名', itemWidth: '200' }
-                    ]
-                },
-                // 表格字段配置
-                columns: [
-                    { prop: 'name', label: '姓名', width: 100 },
-                    { prop: 'createTime', label: '创建时间', width: 100 }
-                ]
-            },
-            pagination: {},
-            sorts: {},
-            moreSearchParams: {},
-            lazyTree: true,
-            defaultExpandedKeys: ['0'],
-            defaultExpandAll: true,
-            lazyOrgTree: true,
-            partyTypeIdValue: '',
-            currentOrgIdValue: '',
-            scriptValue: '',
-            scriptExecuteTime: false, // 脚本函数是否只执行一次
-            hiddenTree: false // 由于树形懒加载load函数的变换,需要重现渲染tree,load才能生效
-        }
+    partyTypeId: { // 类型节点ID
+      type: [String, Number],
+      default: ''
     },
-    computed: {
-        tableHeight () {
-            const h = this.height.substr(0, this.height.length - 2)
-            return parseInt(h)
-        },
-        changeParams () {
-            const { partyTypeId, currentOrgId, isUseScope, script, partyTypeScope } = this
-            return {
-                partyTypeId,
-                currentOrgId,
-                isUseScope,
-                script,
-                partyTypeScope
-            }
-        }
+    partyTypeScope: String,
+    currentOrgId: { // 当前用户组ID
+      type: [String, Number],
+      default: ''
+    },
+    script: String,
+    customPartyTypeOptions: {
+      type: [Object, Array],
+      default: () => { }
     },
-    watch: {
-        showTree: {
-            handler: function (val, oldVal) {
-                this.lazyTree = this.partyType === 'org'
-                if (val === false) {
-                    this.listConfig.searchForm.forms = [
-                        { prop: 'Q^NAME_^SL', label: '姓名' }
-                    ]
-                    this.listConfig.columns = [
-                        { prop: 'name', label: '姓名' }
-                        // { prop: 'createTime', label: '创建时间', width: 200 }
-                    ]
-                } else {
-                    this.listConfig.searchForm.forms = [
-                        { prop: 'Q^NAME_^SL', label: '姓名', itemWidth: '200' }
-                        // { prop: 'Q^ACCOUNT_^SL', label: '帐号', itemWidth: '200' }
-                    ]
-                    this.listConfig.columns = [
-                        { prop: 'name', label: '姓名' }
-                        // { prop: 'createTime', label: '创建时间', width: 200 }
-                    ]
-                }
-            },
-            immediate: true
+    showTree: { // 是否显示左树
+      type: Boolean,
+      default: true
+    },
+    isSuperInitTree: { // 是否为超管初始化树类型数据
+      type: Object,
+      default: () => { }
+    }
+  },
+  data() {
+    const { first = '', second = '' } = this.$store.getters.level
+    const { isSuper = false } = this.$store.getters
+    let level = second || first
+    if (isSuper) {
+      level = null
+    }
+    return {
+      level,
+      width: 200,
+      dialogFormVisible: false, // 弹窗
+      editId: '',
+      title: '更多查询条件',
+      partyTypeOptions: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions : partyTypeOptions,
+      statusOptions: statusOptions,
+      genderOptions: genderOptions,
+      partyType: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions[0].value : 'position',
+      // inclueChild: true,
+      partyId: '',
+      treeDatas: [],
+
+      // 树配置
+      loadingTree: false,
+      treeData: [],
+      toolbars: [{
+        key: 'refresh'
+      }, {
+        key: 'expand'
+      }, {
+        key: 'compress'
+      }],
+      // 列表配置
+      pkKey: 'id', // 主键  如果主键不是pk需要传主键
+      loading: false,
+      listData: [],
+      loazTreeData: [],
+      listConfig: {
+        // 工具栏
+        toolbars: [
+          { key: 'search' }
+          // { key: 'moreSearch' }
+        ],
+        // 查询条件
+        searchForm: {
+          labelWidth: 50,
+          forms: [
+            { prop: 'Q^FULL_NAME_^SL', label: '姓名', itemWidth: '200' }
+          ]
         },
-        changeParams: {
-            handler: function (newval, oldval) {
-                this.partyTypeIdValue = newval.partyTypeId
-                this.currentOrgIdValue = newval.currentOrgId
-                this.scriptValue = newval.script
-                // 普通模式与选择器范围模式切换调用
-                let initDesignatedAType // 机构和岗位懒加载时的特殊处理参数【类型为3时的切换】
-                if (oldval === undefined) {
-                    initDesignatedAType = false
-                } else {
-                    if ((newval.partyTypeScope === 'org' || newval.partyTypeScope === 'position') && newval.partyTypeId === '3') {
-                        initDesignatedAType = false
-                    } else {
-                        initDesignatedAType = true
-                    }
-                }
-                newval.isUseScope ? this.loadTreeData(true, initDesignatedAType) : null
-            },
-            deep: true,
-            immediate: true
-        }
+        // 表格字段配置
+        columns: [
+          { prop: 'name', label: '姓名', width: 100 },
+          { prop: 'createTime', label: '创建时间', width: 100 }
+        ]
+      },
+      pagination: {},
+      sorts: {},
+      moreSearchParams: {},
+      lazyTree: true,
+      defaultExpandedKeys: ['0'],
+      defaultExpandAll: true,
+      lazyOrgTree: true,
+      partyTypeIdValue: '',
+      currentOrgIdValue: '',
+      scriptValue: '',
+      scriptExecuteTime: false, // 脚本函数是否只执行一次
+      hiddenTree: false // 由于树形懒加载load函数的变换,需要重现渲染tree,load才能生效
+    }
+  },
+  computed: {
+    tableHeight() {
+      const h = this.height.substr(0, this.height.length - 2)
+      return parseInt(h)
     },
-    mounted () {
-        if (this.showTree) {
-            if (this.isUseScope) return
-            this.loadTreeData(true)
+    changeParams() {
+      const { partyTypeId, currentOrgId, isUseScope, script, partyTypeScope } = this
+      return {
+        partyTypeId,
+        currentOrgId,
+        isUseScope,
+        script,
+        partyTypeScope
+      }
+    }
+  },
+  watch: {
+    showTree: {
+      handler: function (val, oldVal) {
+        this.lazyTree = this.partyType === 'org'
+        if (val === false) {
+          this.listConfig.searchForm.forms = [
+            { prop: 'Q^NAME_^SL', label: '姓名' }
+          ]
+          this.listConfig.columns = [
+            { prop: 'name', label: '姓名' }
+            // { prop: 'createTime', label: '创建时间', width: 200 }
+          ]
         } else {
-            this.loadListData()
+          this.listConfig.searchForm.forms = [
+            { prop: 'Q^NAME_^SL', label: '姓名', itemWidth: '200' }
+            // { prop: 'Q^ACCOUNT_^SL', label: '账号', itemWidth: '200' }
+          ]
+          this.listConfig.columns = [
+            { prop: 'name', label: '姓名' }
+            // { prop: 'createTime', label: '创建时间', width: 200 }
+          ]
         }
+      },
+      immediate: true
     },
-    methods: {
-        /**
-         * 加载数据
-         */
-        loadListData () {
-            let type = this.partyType
-            this.loading = true
-            if (this.showTree) {
-                if (this.$utils.isNotEmpty(this.partyId) || this.isUseScope) {
-                    type = this.partyType
-                } else if (this.currentOrgIdValue && this.currentOrgIdValue !== '') {
-                    type = 'org'
-                }
-                let flag = 0
-                if (type === 'position' && !this.partyId && this.partyTypeIdValue === '1') {
-                    type = 'user'
-                    flag = '1'
-                }
-                query(type, this.getFormatParams(flag)).then(response => {
-                    this.loading = false
-                    ActionUtils.handleListData(this, response.data)
-                    this.setSelectRow()
-                }).catch(() => {
-                    this.loading = false
-                })
-            } else if (this.seetingSearchPartyType === 'position') {
-                queryWithOrg4Position(this.getFormatParams()).then(response => {
-                    this.loading = false
-                    ActionUtils.handleListData(this, response.data)
-                    this.setSelectRow()
-                }).catch(() => {
-                    this.loading = false
-                })
-            } else if (this.$utils.isNotEmpty(this.currentOrgIdValue)) {
-                queryWoutOrg(this.getFormatParams()).then(response => {
-                    this.loading = false
-                    ActionUtils.handleListData(this, response.data)
-                    this.setSelectRow()
-                }).catch(() => {
-                    this.loading = false
-                })
-            } else {
-                queryPageList(this.getFormatParams('1')).then(response => {
-                    this.loading = false
-                    ActionUtils.handleListData(this, response.data)
-                    this.setSelectRow()
-                }).catch(() => {
-                    this.loading = false
-                })
-            }
-        },
-        getScriptData (scriptValue, once = false) {
-            if (this.scriptExecuteTime) return
-            getScriptValue({
-                script: scriptValue,
-                vars: ''
-            }).then(response => {
-                const data = JSON.parse(response.data)
-                this.treeData = TreeUtils.transformToTreeFormat(data.data)
-                this.setTree(this.partyType === 'org', this.treeData)
-                this.scriptExecuteTime = once
-            })
-        },
-        /**
-         * 获取查询条件格式化参数
-         */
-        getFormatParams (flag = '0') {
-            const storeGetters = this.$store.getters
-            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-            const key = this.partyType === 'org' ? 'orgId' : this.partyType === 'position' ? 'positionId' : this.partyType === 'role' ? 'roleId' : this.partyType === 'group' ? 'groupId' : ''
-            const deptLists = storeGetters.deptList.map((m) => {
-                return m.positionId
-            })
-            if (this.showTree) {
-                if (this.$utils.isNotEmpty(this.partyId) || this.currentOrgIdValue !== '') {
-                    if (this.partyId !== 0 && this.partyId !== '0') {
-                        params[key] = this.partyId === '' ? this.currentOrgIdValue : this.partyId
-                    }
-                    if (!this.partyId && this.partyTypeId === '2' && this.partyType === 'position') {
-                        const position = storeGetters.userInfo.employee.positions
-                        params.positionId = position
-                    }
-                } else {
-                    if (this.partyType === 'position') {
-                        params[key] = this.partyTypeId ? (this.partyTypeId === '1' ? '' : this.partyTypeId) : deptLists.join(',')
-                    } else {
-                        params[key] = this.partyTypeId === '1' ? '' : this.partyTypeId
-                    }
-                }
-            }
-            if (this.seetingSearchPartyType === 'position') {
-                params['positionId'] = this.partyTypeId
-            }
-            if (this.moreSearchParams) {
-                Object.assign(params, this.moreSearchParams)
-            }
-            // if (this.$utils.isNotEmpty(this.currentOrgId)) {
-            //   params['orgId'] = this.partyId || this.currentOrgId
-            // }
-            const res = ActionUtils.formatParams(params, this.pagination, this.sorts)
-            // 数据过滤
-            if (this.level && (flag === '1' || this.partyType === 'role')) {
-                res.customs = {
-                    position: this.level
-                }
-            }
-            return res
-        },
-        /**
-         * 处理分页事件
-         */
-        handlePaginationChange (page) {
-            this.changePageCoreRecordData()
-            ActionUtils.setPagination(this.pagination, page)
-            this.loadListData()
-        },
-        /**
-         * 处理排序
-         */
-        handleSortChange (sort) {
-            ActionUtils.setSorts(this.sorts, sort)
-            this.loadListData()
-        },
-        /**
-         * 查询
-         */
-        search () {
-            this.loadListData()
-        },
-        /**
-         * 重置查询条件
-         */
-        reset () {
-            this.$refs['crud'].handleReset()
-        },
-        /**
-         * 处理按钮事件
-         */
-        handleAction (command, position, selection, data) {
-            switch (command) {
-                case 'search':// 查询
-                    ActionUtils.setFirstPagination(this.pagination)
-                    this.search()
-                    break
-                case 'moreSearch':// 更多
-                    this.handleMoreSearch()
-                    break
-                default:
-                    break
-            }
-        },
-        /**
-         * 处理按钮事件
-         */
-        handleMoreSearchAction (data) {
-            ActionUtils.setFirstPagination(this.pagination)
-            this.moreSearchParams = data
-            this.loadListData()
-        },
-        /**
-         * 处理更多
-         */
-        handleMoreSearch () {
-            this.dialogFormVisible = true
-        },
-        changePartyType (value) {
-            this.loadingTree = true
-            if (this.isUseScope) {
-                this.hiddenTree = true
-            }
-            this.partyType = value
-            const ref = this.$refs.elTree
-            const { loadPosTreeNode, loadPosTreeNode3, loadOrgTreeNode3, loadOrgTreeNode } = this
-            ref.store.load = value === 'position' ? this.partyTypeId === '3' ? loadPosTreeNode3 : loadPosTreeNode : value === 'org' ? this.partyTypeId === '3' ? loadOrgTreeNode3 : loadOrgTreeNode : null
-            // 选择器范围模式函数回调
-            this.moreSearchParams = {}
-            // 普通模式与选择器范围模式切换调用
-            !this.isUseScope ? this.loadTreeData() : null
-            this.scriptExecuteTime = false // 初始化脚本类型时的函数调用
-            this.$emit('change-party-type', value)
-        },
-        getChildrenIds (data, list) {
-            list.push(data.id)
-            const children = data.children
-            if (this.$utils.isNotEmpty(children)) {
-                for (let i = 0; i < children.length; i++) {
-                    const element = children[i]
-                    this.getChildrenIds(element, list)
-                }
-            }
-            return list
+    changeParams: {
+      handler: function (newval, oldval) {
+        this.partyTypeIdValue = newval.partyTypeId
+        this.currentOrgIdValue = newval.currentOrgId
+        this.scriptValue = newval.script
+        // 普通模式与选择器范围模式切换调用
+        let initDesignatedAType // 机构和岗位懒加载时的特殊处理参数【类型为3时的切换】
+        if (oldval === undefined) {
+          initDesignatedAType = false
+        } else {
+          if ((newval.partyTypeScope === 'org' || newval.partyTypeScope === 'position') && newval.partyTypeId === '3') {
+            initDesignatedAType = false
+          } else {
+            initDesignatedAType = true
+          }
         }
-
+        newval.isUseScope ? this.loadTreeData(true, initDesignatedAType) : null
+      },
+      deep: true,
+      immediate: true
     }
-}
-</script>
-  <style lang="scss" >
-  $border-color: #e5e6e7;
-  .org-panel-more-search-dialog{
-    .el-dialog__body{
-      height:  calc(40vh - 120px) !important;
+  },
+  mounted() {
+    if (this.showTree) {
+      if (this.isUseScope) return
+      this.loadTreeData(true)
+    } else {
+      this.loadListData()
     }
-  }
-  .ibps-employee-selector-tree{
-    .ibps-tree-toolbar {
-        border: 1px solid $border-color;
-        height: 30px;
-        padding: 5px;
+  },
+  methods: {
+    /**
+     * 加载数据
+     */
+    loadListData() {
+      let type = this.partyType
+      this.loading = true
+      if (this.showTree) {
+        if (this.$utils.isNotEmpty(this.partyId) || this.isUseScope) {
+          type = this.partyType
+        } else if (this.currentOrgIdValue && this.currentOrgIdValue !== '') {
+          type = 'org'
+        }
+        let flag = 0
+        if (type === 'position' && !this.partyId && this.partyTypeIdValue === '1') {
+          type = 'user'
+          flag = '1'
+        }
+        query(type, this.getFormatParams(flag)).then(response => {
+          this.loading = false
+          ActionUtils.handleListData(this, response.data)
+          this.setSelectRow()
+        }).catch(() => {
+          this.loading = false
+        })
+      } else if (this.seetingSearchPartyType === 'position') {
+        queryWithOrg4Position(this.getFormatParams()).then(response => {
+          this.loading = false
+          ActionUtils.handleListData(this, response.data)
+          this.setSelectRow()
+        }).catch(() => {
+          this.loading = false
+        })
+      } else if (this.$utils.isNotEmpty(this.currentOrgIdValue)) {
+        queryWoutOrg(this.getFormatParams()).then(response => {
+          this.loading = false
+          ActionUtils.handleListData(this, response.data)
+          this.setSelectRow()
+        }).catch(() => {
+          this.loading = false
+        })
+      } else {
+        queryPageList(this.getFormatParams('1')).then(response => {
+          this.loading = false
+          ActionUtils.handleListData(this, response.data)
+          this.setSelectRow()
+        }).catch(() => {
+          this.loading = false
+        })
+      }
+    },
+    getScriptData(scriptValue, once = false) {
+      if (this.scriptExecuteTime) return
+      getScriptValue({
+        script: scriptValue,
+        vars: ''
+      }).then(response => {
+        const data = JSON.parse(response.data)
+        this.treeData = TreeUtils.transformToTreeFormat(data.data)
+        this.setTree(this.partyType === 'org', this.treeData)
+        this.scriptExecuteTime = once
+      })
+    },
+    /**
+     * 获取查询条件格式化参数
+     */
+    getFormatParams(flag = '0') {
+      const storeGetters = this.$store.getters
+      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+      const key = this.partyType === 'org' ? 'orgId' : this.partyType === 'position' ? 'positionId' : this.partyType === 'role' ? 'roleId' : this.partyType === 'group' ? 'groupId' : ''
+      const deptLists = storeGetters.deptList.map((m) => {
+        return m.positionId
+      })
+      if (this.showTree) {
+        if (this.$utils.isNotEmpty(this.partyId) || this.currentOrgIdValue !== '') {
+          if (this.partyId !== 0 && this.partyId !== '0') {
+            params[key] = this.partyId === '' ? this.currentOrgIdValue : this.partyId
+          }
+          if (!this.partyId && this.partyTypeId === '2' && this.partyType === 'position') {
+            const position = storeGetters.userInfo.employee.positions
+            params.positionId = position
+          }
+        } else {
+          if (this.partyType === 'position') {
+            params[key] = this.partyTypeId ? (this.partyTypeId === '1' ? '' : this.partyTypeId) : deptLists.join(',')
+          } else {
+            params[key] = this.partyTypeId === '1' ? '' : this.partyTypeId
+          }
+        }
+      }
+      if (this.seetingSearchPartyType === 'position') {
+        params['positionId'] = this.partyTypeId
       }
-      .ibps-tree-search-form {
-        padding: 5px;
-        padding-bottom: 20px;
-        border-right: 1px solid $border-color;
-        background: #ffffff;
+      if (this.moreSearchParams) {
+        Object.assign(params, this.moreSearchParams)
       }
-      .ibps-tree-main {
-        border: 1px solid $border-color;
+      // if (this.$utils.isNotEmpty(this.currentOrgId)) {
+      //   params['orgId'] = this.partyId || this.currentOrgId
+      // }
+      const res = ActionUtils.formatParams(params, this.pagination, this.sorts)
+      // 数据过滤
+      if (this.level && (flag === '1' || this.partyType === 'role')) {
+        res.customs = {
+          position: this.level
+        }
       }
-      .ibps-tree-wrapper {
-        background: #ffffff;
-        .el-tree > .el-tree-node {
-          display: inline-block;
+      return res
+    },
+    /**
+     * 处理分页事件
+     */
+    handlePaginationChange(page) {
+      this.changePageCoreRecordData()
+      ActionUtils.setPagination(this.pagination, page)
+      this.loadListData()
+    },
+    /**
+     * 处理排序
+     */
+    handleSortChange(sort) {
+      ActionUtils.setSorts(this.sorts, sort)
+      this.loadListData()
+    },
+    /**
+     * 查询
+     */
+    search() {
+      this.loadListData()
+    },
+    /**
+     * 重置查询条件
+     */
+    reset() {
+      this.$refs['crud'].handleReset()
+    },
+    /**
+     * 处理按钮事件
+     */
+    handleAction(command, position, selection, data) {
+      switch (command) {
+        case 'search':// 查询
+          ActionUtils.setFirstPagination(this.pagination)
+          this.search()
+          break
+        case 'moreSearch':// 更多
+          this.handleMoreSearch()
+          break
+        default:
+          break
+      }
+    },
+    /**
+     * 处理按钮事件
+     */
+    handleMoreSearchAction(data) {
+      ActionUtils.setFirstPagination(this.pagination)
+      this.moreSearchParams = data
+      this.loadListData()
+    },
+    /**
+     * 处理更多
+     */
+    handleMoreSearch() {
+      this.dialogFormVisible = true
+    },
+    changePartyType(value) {
+      this.loadingTree = true
+      if (this.isUseScope) {
+        this.hiddenTree = true
+      }
+      this.partyType = value
+      const ref = this.$refs.elTree
+      const { loadPosTreeNode, loadPosTreeNode3, loadOrgTreeNode3, loadOrgTreeNode } = this
+      ref.store.load = value === 'position' ? this.partyTypeId === '3' ? loadPosTreeNode3 : loadPosTreeNode : value === 'org' ? this.partyTypeId === '3' ? loadOrgTreeNode3 : loadOrgTreeNode : null
+      // 选择器范围模式函数回调
+      this.moreSearchParams = {}
+      // 普通模式与选择器范围模式切换调用
+      !this.isUseScope ? this.loadTreeData() : null
+      this.scriptExecuteTime = false // 初始化脚本类型时的函数调用
+      this.$emit('change-party-type', value)
+    },
+    getChildrenIds(data, list) {
+      list.push(data.id)
+      const children = data.children
+      if (this.$utils.isNotEmpty(children)) {
+        for (let i = 0; i < children.length; i++) {
+          const element = children[i]
+          this.getChildrenIds(element, list)
         }
       }
+      return list
+    }
+
+  }
+}
+</script>
+<style lang="scss">
+$border-color: #e5e6e7;
+
+.org-panel-more-search-dialog {
+  .el-dialog__body {
+    height: calc(40vh - 120px) !important;
+  }
+}
+
+.ibps-employee-selector-tree {
+  .ibps-tree-toolbar {
+    border: 1px solid $border-color;
+    height: 30px;
+    padding: 5px;
   }
-  </style>
+
+  .ibps-tree-search-form {
+    padding: 5px;
+    padding-bottom: 20px;
+    border-right: 1px solid $border-color;
+    background: #ffffff;
+  }
+
+  .ibps-tree-main {
+    border: 1px solid $border-color;
+  }
+
+  .ibps-tree-wrapper {
+    background: #ffffff;
+
+    .el-tree>.el-tree-node {
+      display: inline-block;
+    }
+  }
+}
+</style>

+ 2 - 2
src/locales/zh-CN.json

@@ -629,7 +629,7 @@
 		}
 	},
 	"login": {
-		"account": "号",
+		"account": "号",
 		"backLogin": "返回",
 		"capsTooltip": "大写锁定已开启",
 		"code": "请输入验证码",
@@ -747,7 +747,7 @@
 					"title": "修改密码"
 				},
 				"prop": {
-					"account": "号",
+					"account": "号",
 					"gender": "性别",
 					"name": "姓名",
 					"orgPath": "归属组织路径",

+ 2 - 2
src/store/modules/ibps/modules/account.js

@@ -46,7 +46,7 @@ export default {
             return new Promise(async (resolve, reject) => {
                 // 开始请求登录接口
                 login(form).then(async response => {
-                    const { data = {} } = response
+                    const { data = {}} = response
                     const tokenInfo = JSON.parse(JSON.stringify(data))
                     tokenInfo.licJson = undefined
                     const licenceData = data.licJson || { isTrialVersion: false }
@@ -119,7 +119,7 @@ export default {
             })
         },
         /**
-         * 注册
+         * 注册
          * @param {*} param context 上下文
          * @param {*} form 表单
          */

+ 34 - 34
src/store/modules/ibps/modules/saas.js

@@ -2,47 +2,47 @@ import { register } from '@/api/saas/tenant/tenant'
 import { open } from '@/api/oauth2/user'
 
 export default {
-  namespaced: true,
-  state: {
+    namespaced: true,
+    state: {
     // 用户信息
-    tenantOpen: false
-  },
-  actions: {
+        tenantOpen: false
+    },
+    actions: {
     /**
      *  @description 是否开启注册
      *
      */
-    getRegisterTenantOpen({
-      state
-    }) {
-      return new Promise((resolve, reject) => {
-        open().then(response => {
-          const regOpen = response.data
-          state.tenantOpen = regOpen
-          resolve(response)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-    /**
-     * 注册
+        getRegisterTenantOpen ({
+            state
+        }) {
+            return new Promise((resolve, reject) => {
+                open().then(response => {
+                    const regOpen = response.data
+                    state.tenantOpen = regOpen
+                    resolve(response)
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
+        /**
+     * 注册
      * @param {*} param context 上下文
      * @param {*} form 表单
      */
-    register({
-      commit,
-      dispatch
-    }, form) {
-      return new Promise(async(resolve, reject) => {
-        // 开始请求注册接口
-        register(form).then(response => {
-          resolve()
-        }).catch(err => {
-          console.error('err: ', err)
-          reject(err)
-        })
-      })
+        register ({
+            commit,
+            dispatch
+        }, form) {
+            return new Promise(async (resolve, reject) => {
+                // 开始请求注册接口
+                register(form).then(response => {
+                    resolve()
+                }).catch(err => {
+                    console.error('err: ', err)
+                    reject(err)
+                })
+            })
+        }
     }
-  }
 }

+ 1 - 1
src/store/modules/ibps/modules/user.js

@@ -10,7 +10,7 @@ export default {
     state: {
         // 用户信息
         info: {},
-        // 
+        // 
         account: '',
         // 切换的账号
         switchAccount: '',

+ 351 - 362
src/views/platform/org/employee/edit/basic-info.vue

@@ -1,56 +1,36 @@
 <template>
-    <el-row style="height: 500px">
-        <el-col :span="6">
-            <div style="padding-left: 55px">
-                <span class="photo-area" @click="dialogFormVisible = canEdit">
-                    <img v-if="formData.photo" :src="image" class="avatar">
-                    <i v-else class="el-icon-plus avatar-uploader-icon" />
-                    <div
-                        v-if="canEdit"
-                        :class="formData.photo !== '' ? 'handle-photo-buttons' : null"
-                        @click.stop="() => { dialogFormVisible = false }"
-                    >
-                        <div v-if="formData.photo !== ''">
-                            <i class="el-icon-edit" @click.stop="dialogFormVisible = canEdit" />
-                            <i class="el-icon-delete" @click.stop="formData.photo = ''" />
-                        </div>
-                    </div>
-                </span>
+  <el-row style="height: 500px">
+    <el-col :span="6">
+      <div style="padding-left: 55px">
+        <span class="photo-area" @click="dialogFormVisible = canEdit">
+          <img v-if="formData.photo" :src="image" class="avatar">
+          <i v-else class="el-icon-plus avatar-uploader-icon" />
+          <div v-if="canEdit" :class="formData.photo !== '' ? 'handle-photo-buttons' : null"
+            @click.stop="() => { dialogFormVisible = false }">
+            <div v-if="formData.photo !== ''">
+              <i class="el-icon-edit" @click.stop="dialogFormVisible = canEdit" />
+              <i class="el-icon-delete" @click.stop="formData.photo = ''" />
             </div>
-            <span v-if="canEdit" class="operation">点击上方进行头像操作</span>
-            <ibps-uploader
-                :visible="dialogFormVisible"
-                :limit="limit"
-                :accept="accept"
-                @action-event="uploaderAction"
-                @close="(visible) => (dialogFormVisible = visible)"
-            />
-        </el-col>
-        <el-col :span="16">
-            <el-form
-                ref="employeeForm"
-                :rules="rules"
-                :model="formData"
-                label-width="130px"
-                @submit.native.prevent
-            >
-                <input type="password" style="width: 0; height: 0; line-height: 0; padding: 0; border-width: 0">
-                <el-form-item label="账号" prop="account">
-                    <el-input v-if="canEdit" v-model="formData.account" autocomplete="off" clearable />
-                    <span v-else>{{ formData.account }}</span>
-                </el-form-item>
-                <el-form-item v-show="!formData.id" label="密码" :prop="!formData.id ? 'password' : ''">
-                    <el-input
-                        v-if="canEdit"
-                        v-model="formData.password"
-                        autocomplete="off"
-                        type="password"
-                        show-password
-                        clearable
-                    />
-                    <span v-else>{{ formData.password }}</span>
-                </el-form-item>
-                <!-- <el-form-item label="是否管理员" prop="isSuper">
+          </div>
+        </span>
+      </div>
+      <span v-if="canEdit" class="operation">点击上方进行头像操作</span>
+      <ibps-uploader :visible="dialogFormVisible" :limit="limit" :accept="accept" @action-event="uploaderAction"
+        @close="(visible) => (dialogFormVisible = visible)" />
+    </el-col>
+    <el-col :span="16">
+      <el-form ref="employeeForm" :rules="rules" :model="formData" label-width="130px" @submit.native.prevent>
+        <input type="password" style="width: 0; height: 0; line-height: 0; padding: 0; border-width: 0">
+        <el-form-item label="账号" prop="account">
+          <el-input v-if="canEdit" v-model="formData.account" autocomplete="off" clearable />
+          <span v-else>{{ formData.account }}</span>
+        </el-form-item>
+        <el-form-item v-show="!formData.id" label="密码" :prop="!formData.id ? 'password' : ''">
+          <el-input v-if="canEdit" v-model="formData.password" autocomplete="off" type="password" show-password
+            clearable />
+          <span v-else>{{ formData.password }}</span>
+        </el-form-item>
+        <!-- <el-form-item label="是否管理员" prop="isSuper">
                     <el-switch
                         v-if="!readonly"
                         v-model="formData.isSuper"
@@ -62,68 +42,68 @@
                         {{ formData.isSuper|optionsFilter(isSuperOptions,'label') }}
                     </el-tag>
                 </el-form-item> -->
-                <el-form-item label="单位名称">
-                    <el-input v-if="!readonly" v-model="formData.qq" clearable />
-                    <span v-else>{{ formData.qq }}</span>
-                </el-form-item>
-                <el-form-item label="员工编号">
-                    <el-input v-if="canEdit" v-model="formData.jianDingZiGeZ" clearable />
-                    <span v-else>{{ formData.jianDingZiGeZ }}</span>
-                </el-form-item>
-                <el-form-item label="员工姓名" prop="name">
-                    <el-input v-if="canEdit" v-model="formData.name" clearable />
-                    <span v-else>{{ formData.name }}</span>
-                </el-form-item>
-                <el-form-item label="员工状态" prop="status">
-                    <el-select v-if="!readonly" v-model="formData.status" clearable placeholder="请选择" style="width: 100%">
-                        <el-option label="激活" value="actived" />
-                        <el-option label="未激活" value="inactive" />
-                        <el-option label="锁定" value="locked" />
-                        <el-option label="禁用" value="disabled" />
-                        <el-option label="过期" value="expired" />
-                        <el-option label="已删除" value="deleted" />
-                    </el-select>
-                    <el-tag v-else :type="formData.status | optionsFilter(statusOptions, 'type')">
-                        {{ formData.status | optionsFilter(statusOptions, 'label') }}
-                    </el-tag>
-                </el-form-item>
-                <el-form-item label="性别">
-                    <el-radio-group v-if="!readonly" v-model="formData.gender">
-                        <el-radio label="male">男</el-radio>
-                        <el-radio label="female">女</el-radio>
-                    </el-radio-group>
-                    <el-tag v-else :type="formData.gender | optionsFilter(genderOptions, 'type')">
-                        {{ formData.gender | optionsFilter(genderOptions, 'label') }}
-                    </el-tag>
-                </el-form-item>
-                <el-form-item>
-                    <template slot="label">
-                        用户类型
-                        <help-tip :title="formAsterisk.title" :content="formAsterisk.content" />
-                    </template>
-                    <el-radio-group v-if="!readonly" v-model="formData.jiNengZhiCheng">
-                        <el-radio label="inside">内部员工</el-radio>
-                        <el-radio label="ordinary">临床医护</el-radio>
-                    </el-radio-group>
-                    <el-tag v-else>
-                        {{ formData.jiNengZhiCheng == 'ordinary' ? '临床医护' : '内部员工' }}
-                    </el-tag>
-                </el-form-item>
-                <el-form-item label="邮箱" prop="email">
-                    <!-- <el-input v-model="formData.email" clearable /> -->
-                    <el-input v-if="canEdit" v-model="formData.email" clearable />
-                    <span v-else>{{ formData.email }}</span>
-                </el-form-item>
-                <el-form-item label="地址">
-                    <el-input v-if="canEdit" v-model="formData.address" clearable />
-                    <span v-else>{{ formData.address }}</span>
-                </el-form-item>
-                <el-form-item label="手机号码">
-                    <el-input v-if="canEdit" v-model="formData.mobile" clearable />
-                    <span v-else>{{ formData.mobile }}</span>
-                </el-form-item>
-                <!-- 功能逻辑存在问题,弃用 -->
-                <!-- <el-form-item v-if="!readonly">
+        <el-form-item label="单位名称">
+          <el-input v-if="!readonly" v-model="formData.qq" clearable />
+          <span v-else>{{ formData.qq }}</span>
+        </el-form-item>
+        <el-form-item label="员工编号">
+          <el-input v-if="canEdit" v-model="formData.jianDingZiGeZ" clearable />
+          <span v-else>{{ formData.jianDingZiGeZ }}</span>
+        </el-form-item>
+        <el-form-item label="员工姓名" prop="name">
+          <el-input v-if="canEdit" v-model="formData.name" clearable />
+          <span v-else>{{ formData.name }}</span>
+        </el-form-item>
+        <el-form-item label="员工状态" prop="status">
+          <el-select v-if="!readonly" v-model="formData.status" clearable placeholder="请选择" style="width: 100%">
+            <el-option label="激活" value="actived" />
+            <el-option label="未激活" value="inactive" />
+            <el-option label="锁定" value="locked" />
+            <el-option label="禁用" value="disabled" />
+            <el-option label="过期" value="expired" />
+            <el-option label="已删除" value="deleted" />
+          </el-select>
+          <el-tag v-else :type="formData.status | optionsFilter(statusOptions, 'type')">
+            {{ formData.status | optionsFilter(statusOptions, 'label') }}
+          </el-tag>
+        </el-form-item>
+        <el-form-item label="性别">
+          <el-radio-group v-if="!readonly" v-model="formData.gender">
+            <el-radio label="male">男</el-radio>
+            <el-radio label="female">女</el-radio>
+          </el-radio-group>
+          <el-tag v-else :type="formData.gender | optionsFilter(genderOptions, 'type')">
+            {{ formData.gender | optionsFilter(genderOptions, 'label') }}
+          </el-tag>
+        </el-form-item>
+        <el-form-item>
+          <template slot="label">
+            用户类型
+            <help-tip :title="formAsterisk.title" :content="formAsterisk.content" />
+          </template>
+          <el-radio-group v-if="!readonly" v-model="formData.jiNengZhiCheng">
+            <el-radio label="inside">内部员工</el-radio>
+            <el-radio label="ordinary">临床医护</el-radio>
+          </el-radio-group>
+          <el-tag v-else>
+            {{ formData.jiNengZhiCheng == 'ordinary' ? '临床医护' : '内部员工' }}
+          </el-tag>
+        </el-form-item>
+        <el-form-item label="邮箱" prop="email">
+          <!-- <el-input v-model="formData.email" clearable /> -->
+          <el-input v-if="canEdit" v-model="formData.email" clearable />
+          <span v-else>{{ formData.email }}</span>
+        </el-form-item>
+        <el-form-item label="地址">
+          <el-input v-if="canEdit" v-model="formData.address" clearable />
+          <span v-else>{{ formData.address }}</span>
+        </el-form-item>
+        <el-form-item label="手机号码">
+          <el-input v-if="canEdit" v-model="formData.mobile" clearable />
+          <span v-else>{{ formData.mobile }}</span>
+        </el-form-item>
+        <!-- 功能逻辑存在问题,弃用 -->
+        <!-- <el-form-item v-if="!readonly">
                     <template slot="label">
                         入职/转岗培训
                         <help-tip title="" content="开启时,保存数据后将为当前用户开启入职/转岗培训" />
@@ -155,9 +135,9 @@
                         placeholder="请选择培训人员带教老师"
                     />
                 </el-form-item> -->
-            </el-form>
-        </el-col>
-    </el-row>
+      </el-form>
+    </el-col>
+  </el-row>
 </template>
 <script>
 import { fileUrl } from '@/api/platform/file/attachment'
@@ -166,280 +146,289 @@ import { genderOptions, statusOptions, isSuperOptions, userSecurityTextObj, regx
 import { getFile } from '@/utils/avatar'
 import { validateEmpty } from '@/utils/validate'
 export default {
-    components: {
-        IbpsUploader: () => import('@/business/platform/file/uploader'),
-        helpTip: () => import('@/business/platform/form/formbuilder/right-aside/components/help-tip.vue'),
-        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+  components: {
+    IbpsUploader: () => import('@/business/platform/file/uploader'),
+    helpTip: () => import('@/business/platform/form/formbuilder/right-aside/components/help-tip.vue'),
+    IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+  },
+  props: {
+    data: Object,
+    readonly: {
+      type: Boolean,
+      default: false
     },
-    props: {
-        data: Object,
-        readonly: {
-            type: Boolean,
-            default: false
-        },
-        formType: {
-            type: String,
-            default: 'add'
-        }
-    },
-    data () {
-        const validateWcAccount = (rule, value, callback) => {
-            const re = /^\S+$/
-            if (!re.test(value)) {
-                callback(new Error('企业微信账户不能包含空格'))
-            } else {
-                callback()
-            }
-        }
-        const validateAccount = (rule, value, callback) => {
-            // const re = /^[a-zA-Z][0-9a-zA-Z]{1,192}$/
-            const re = /^[\w-]{4,16}$/
-            if (!re.test(value)) {
-                callback(new Error('由数字、字母、下划线及减号组成,长度最少4位最多16位'))
-            } else {
-                callback()
-            }
-        }
-        const validateEmail = (rule, value, callback) => {
-            var search = '@'
-            var start = value.indexOf(search) // 获得字符串的开始位置
-            var result = value.substring(start, search.length - start)
-            const re = /^[0-9a-zA-Z]{1}[0-9a-zA-Z_.-]{1,16}[0-9a-zA-Z]{1}$/
-            if (!re.test(result) && result.length > 3 && result.length < 18) {
-                callback(new Error('必须以字母或者数字开头;字母或者数字结尾(结尾不包括邮箱后缀名),且字符类型为字母、数字、下划线、点、减号'))
-            } else if (!re.test(result) && (result.length > 18 || result.length < 3)) {
-                callback(new Error('长度最少为3位,最多为18位'))
-            } else {
-                callback()
+    formType: {
+      type: String,
+      default: 'add'
+    }
+  },
+  data() {
+    const validateWcAccount = (rule, value, callback) => {
+      const re = /^\S+$/
+      if (!re.test(value)) {
+        callback(new Error('企业微信账户不能包含空格'))
+      } else {
+        callback()
+      }
+    }
+    const validateAccount = (rule, value, callback) => {
+      // const re = /^[a-zA-Z][0-9a-zA-Z]{1,192}$/
+      const re = /^[\w-]{4,16}$/
+      if (!re.test(value)) {
+        callback(new Error('由数字、字母、下划线及减号组成,长度最少4位最多16位'))
+      } else {
+        callback()
+      }
+    }
+    const validateEmail = (rule, value, callback) => {
+      var search = '@'
+      var start = value.indexOf(search) // 获得字符串的开始位置
+      var result = value.substring(start, search.length - start)
+      const re = /^[0-9a-zA-Z]{1}[0-9a-zA-Z_.-]{1,16}[0-9a-zA-Z]{1}$/
+      if (!re.test(result) && result.length > 3 && result.length < 18) {
+        callback(new Error('必须以字母或者数字开头;字母或者数字结尾(结尾不包括邮箱后缀名),且字符类型为字母、数字、下划线、点、减号'))
+      } else if (!re.test(result) && (result.length > 18 || result.length < 3)) {
+        callback(new Error('长度最少为3位,最多为18位'))
+      } else {
+        callback()
+      }
+    }
+    const validatePassword = (rule, value, callback) => {
+      // const re = /^[0-9a-zA-Z]{1,128}$/
+      const complexityRegular = this.regx
+      if (value !== undefined) {
+        if (this.userSecurity.complexity.length === 0) {
+          // if (!re.test(value)) {
+          //     callback(new Error('密码必须是由数字字母组成,至少1位'))
+          // } else {
+          //     callback()
+          // }
+          callback()
+        } else {
+          const flag = []
+          for (var l in complexityRegular) {
+            if (value.match(complexityRegular[l]) !== null) {
+              flag.push(l)
             }
-        }
-        const validatePassword = (rule, value, callback) => {
-            // const re = /^[0-9a-zA-Z]{1,128}$/
-            const complexityRegular = this.regx
-            if (value !== undefined) {
-                if (this.userSecurity.complexity.length === 0) {
-                    // if (!re.test(value)) {
-                    //     callback(new Error('密码必须是由数字字母组成,至少1位'))
-                    // } else {
-                    //     callback()
-                    // }
-                    callback()
-                } else {
-                    const flag = []
-                    for (var l in complexityRegular) {
-                        if (value.match(complexityRegular[l]) !== null) {
-                            flag.push(l)
-                        }
-                    }
-                    if (flag.toString() !== this.userSecurity.complexity.toString()) {
-                        callback(new Error('格式:' + this.userSecurity.maxLengthText + ';' + this.userSecurity.minLengthText + ';' + this.userSecurity.complexityText))
-                    } else {
-                        if (value.length > this.userSecurity.maxLength || value.length < this.userSecurity.minLength) {
-                            callback(new Error('格式:' + this.userSecurity.maxLengthText + ';' + this.userSecurity.minLengthText + ';' + this.userSecurity.complexityText))
-                        } else {
-                            callback()
-                        }
-                    }
-                }
+          }
+          if (flag.toString() !== this.userSecurity.complexity.toString()) {
+            callback(new Error('格式:' + this.userSecurity.maxLengthText + ';' + this.userSecurity.minLengthText + ';' + this.userSecurity.complexityText))
+          } else {
+            if (value.length > this.userSecurity.maxLength || value.length < this.userSecurity.minLength) {
+              callback(new Error('格式:' + this.userSecurity.maxLengthText + ';' + this.userSecurity.minLengthText + ';' + this.userSecurity.complexityText))
             } else {
-                callback()
-            }
-        }
-        const canEdit = !this.readonly || this.formType === 'part'
-        return {
-            canEdit,
-            formAsterisk: {
-                title: '关于用户类型',
-                content: `此属性用于设置用户端展示的功能`
-            },
-            dialogFormVisible: false,
-            limit: 1, // 规定上传个数
-            accept: '.jpeg,.gif,.png,.jpg,.JPEG,.GIF,.PNG,.JPG', // 规定上传类型
-            formName: 'employeeForm',
-            formData: {},
-            isSuper: this.$store.getters.isSuper,
-            genderOptions: genderOptions,
-            statusOptions: statusOptions,
-            isSuperOptions: isSuperOptions,
-            userSecurityTextObj: userSecurityTextObj,
-            regx: regx,
-            required: true,
-            // 用户安全设置
-            userSecurity: {
-                complexity: [],
-                complexityText: '',
-                maxLength: '',
-                maxLengthText: '',
-                minLength: '',
-                minLengthText: ''
-            },
-            rules: {
-                account: [
-                    { required: true, message: this.$t('validate.required') },
-                    { type: 'string', min: 4, max: 16, message: '帐号长度至少4位,至多16位', trigger: 'blur' },
-                    { validator: validateAccount, trigger: 'blur' }
-                ],
-                wcAccount: [
-                    { required: false, message: this.$t('validate.required') },
-                    { validator: validateWcAccount, trigger: 'blur' }
-                ],
-                password: [
-                    { required: true, message: this.$t('validate.required') },
-                    { type: 'string', min: 1, max: 128, message: '密码长度至少3位,至多128位', trigger: 'blur' },
-                    { validator: validatePassword, trigger: 'blur' }
-                ],
-                name: [
-                    { required: true, message: this.$t('validate.required') },
-                    { validator: validateEmpty, trigger: 'blur' },
-                    { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }
-                ],
-                status: [{ required: true, message: this.$t('validate.required') }],
-                gender: [{ required: true, message: this.$t('validate.required') }]
-                // email: [
-                //     { required: true, message: this.$t('validate.required') },
-                //     { type: 'email', message: '请输入正确的邮箱地址', min: 3, max: 18, trigger: ['blur', 'change'] },
-                //     { validator: validateEmail, trigger: 'blur' }
-                // ]
+              callback()
             }
+          }
         }
+      } else {
+        callback()
+      }
+    }
+    const canEdit = !this.readonly || this.formType === 'part'
+    return {
+      canEdit,
+      formAsterisk: {
+        title: '关于用户类型',
+        content: `此属性用于设置用户端展示的功能`
+      },
+      dialogFormVisible: false,
+      limit: 1, // 规定上传个数
+      accept: '.jpeg,.gif,.png,.jpg,.JPEG,.GIF,.PNG,.JPG', // 规定上传类型
+      formName: 'employeeForm',
+      formData: {},
+      isSuper: this.$store.getters.isSuper,
+      genderOptions: genderOptions,
+      statusOptions: statusOptions,
+      isSuperOptions: isSuperOptions,
+      userSecurityTextObj: userSecurityTextObj,
+      regx: regx,
+      required: true,
+      // 用户安全设置
+      userSecurity: {
+        complexity: [],
+        complexityText: '',
+        maxLength: '',
+        maxLengthText: '',
+        minLength: '',
+        minLengthText: ''
+      },
+      rules: {
+        account: [
+          { required: true, message: this.$t('validate.required') },
+          { type: 'string', min: 4, max: 16, message: '账号长度至少4位,至多16位', trigger: 'blur' },
+          { validator: validateAccount, trigger: 'blur' }
+        ],
+        wcAccount: [
+          { required: false, message: this.$t('validate.required') },
+          { validator: validateWcAccount, trigger: 'blur' }
+        ],
+        password: [
+          { required: true, message: this.$t('validate.required') },
+          { type: 'string', min: 1, max: 128, message: '密码长度至少3位,至多128位', trigger: 'blur' },
+          { validator: validatePassword, trigger: 'blur' }
+        ],
+        name: [
+          { required: true, message: this.$t('validate.required') },
+          { validator: validateEmpty, trigger: 'blur' },
+          { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }
+        ],
+        status: [{ required: true, message: this.$t('validate.required') }],
+        gender: [{ required: true, message: this.$t('validate.required') }]
+        // email: [
+        //     { required: true, message: this.$t('validate.required') },
+        //     { type: 'email', message: '请输入正确的邮箱地址', min: 3, max: 18, trigger: ['blur', 'change'] },
+        //     { validator: validateEmail, trigger: 'blur' }
+        // ]
+      }
+    }
+  },
+  computed: {
+    image() {
+      return getFile(this.formData.photo)
+    }
+  },
+  watch: {
+    data() {
+      this.formData = this.data
     },
-    computed: {
-        image () {
-            return getFile(this.formData.photo)
+    formData: {
+      handler: function (val, oldVal) {
+        if (val !== oldVal) {
+          if (this.formData.id && !this.readonly) {
+            this.rules.password[0].required = false
+          } else {
+            this.rules.password[0].required = true
+          }
+          this.handleEmitEvent()
+          this.formValidate()
         }
+      },
+      deep: true
+    }
+  },
+  mounted() {
+    this.formData = this.data
+  },
+  created() {
+    this.isSuper = this.$store.getters.isSuper
+  },
+  methods: {
+    handleGetDefaultUserSecurity() {
+      getDefaultUserSecurity().then((response) => {
+        const userSecurityTextObj = this.userSecurityTextObj
+        const complexityArr = response.data.complexity.split(',').sort()
+        const arr = []
+        complexityArr.forEach((i) => {
+          arr.push(userSecurityTextObj[parseInt(i)])
+        })
+        this.userSecurity.complexity = complexityArr
+        this.userSecurity.complexityText = arr.join(',')
+        this.userSecurity.maxLength = response.data.maxLength
+        this.userSecurity.maxLengthText = '最大长度' + response.data.maxLength
+        this.userSecurity.minLength = response.data.minLength
+        this.userSecurity.minLengthText = '最小长度' + response.data.minLength
+      }).catch(() => { })
     },
-    watch: {
-        data () {
-            this.formData = this.data
-        },
-        formData: {
-            handler: function (val, oldVal) {
-                if (val !== oldVal) {
-                    if (this.formData.id && !this.readonly) {
-                        this.rules.password[0].required = false
-                    } else {
-                        this.rules.password[0].required = true
-                    }
-                    this.handleEmitEvent()
-                    this.formValidate()
-                }
-            },
-            deep: true
-        }
+    /**
+     * 表单验证
+     */
+    formValidate() {
+      this.$nextTick(() => {
+        this.$refs[this.formName].validate(() => { })
+      })
     },
-    mounted () {
-        this.formData = this.data
+    validate(callback) {
+      this.$refs[this.formName].validate((v) => {
+        callback(v)
+      })
     },
-    created () {
-        this.isSuper = this.$store.getters.isSuper
+    /**
+     * 重置字段
+     */
+    resetFields() {
+      this.$refs[this.formName].resetFields()
     },
-    methods: {
-        handleGetDefaultUserSecurity () {
-            getDefaultUserSecurity().then((response) => {
-                const userSecurityTextObj = this.userSecurityTextObj
-                const complexityArr = response.data.complexity.split(',').sort()
-                const arr = []
-                complexityArr.forEach((i) => {
-                    arr.push(userSecurityTextObj[parseInt(i)])
-                })
-                this.userSecurity.complexity = complexityArr
-                this.userSecurity.complexityText = arr.join(',')
-                this.userSecurity.maxLength = response.data.maxLength
-                this.userSecurity.maxLengthText = '最大长度' + response.data.maxLength
-                this.userSecurity.minLength = response.data.minLength
-                this.userSecurity.minLengthText = '最小长度' + response.data.minLength
-            }).catch(() => {})
-        },
-        /**
-         * 表单验证
-         */
-        formValidate () {
-            this.$nextTick(() => {
-                this.$refs[this.formName].validate(() => {})
-            })
-        },
-        validate (callback) {
-            this.$refs[this.formName].validate((v) => {
-                callback(v)
-            })
-        },
-        /**
-         * 重置字段
-         */
-        resetFields () {
-            this.$refs[this.formName].resetFields()
-        },
-        handleEmitEvent () {
-            this.$emit('input', this.formData)
-        },
-        uploaderAction (buttonKey, data) {
-            this.formData.photo = fileUrl(data.id || data[0].id)
-            this.dialogFormVisible = false
-        }
+    handleEmitEvent() {
+      this.$emit('input', this.formData)
+    },
+    uploaderAction(buttonKey, data) {
+      this.formData.photo = fileUrl(data.id || data[0].id)
+      this.dialogFormVisible = false
     }
+  }
 }
 </script>
 
-<style lang="scss" >
+<style lang="scss">
 .operation {
-    margin-left: 75px;
-    height: 30px;
-    line-height: 30px;
-    display: block;
+  margin-left: 75px;
+  height: 30px;
+  line-height: 30px;
+  display: block;
 }
+
 .avatar-uploader .el-upload {
-    /* margin-top: 5px; */
-    border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
+  /* margin-top: 5px; */
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
 }
+
 .avatar-uploader .el-upload:hover {
-    border-color: #409eff;
+  border-color: #409eff;
 }
+
 .avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 178px;
-    height: 178px;
-    line-height: 178px !important;
-    text-align: center;
-    border: 1px dashed #d9d9d9;
-    border-radius: 4px;
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px !important;
+  text-align: center;
+  border: 1px dashed #d9d9d9;
+  border-radius: 4px;
 }
+
 .photo-area {
+  display: block;
+  position: relative;
+  width: 178px;
+  height: 178px;
+  z-index: 9997;
+
+  .avatar {
     display: block;
-    position: relative;
     width: 178px;
     height: 178px;
-    z-index: 9997;
-    .avatar {
-        display: block;
-        width: 178px;
-        height: 178px;
-    }
-    .handle-photo-buttons {
-        width: 100%;
-        height: 100%;
-        position: absolute;
-        top: 0;
-        background: rgba(7, 0, 0, 0.6);
-        display: none;
-        z-index: 9998;
-        > div {
-            margin: 44% 0 0 30%;
-            i {
-                z-index: 9999;
-                cursor: pointer;
-                margin: 0 7px;
-                color: white;
-                font-size: 18px;
-            }
-        }
+  }
+
+  .handle-photo-buttons {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    top: 0;
+    background: rgba(7, 0, 0, 0.6);
+    display: none;
+    z-index: 9998;
+
+    >div {
+      margin: 44% 0 0 30%;
+
+      i {
+        z-index: 9999;
+        cursor: pointer;
+        margin: 0 7px;
+        color: white;
+        font-size: 18px;
+      }
     }
+  }
 }
-.photo-area:hover > .handle-photo-buttons {
-    display: block;
+
+.photo-area:hover>.handle-photo-buttons {
+  display: block;
 }
 </style>

+ 22 - 46
src/views/saas/tenant/list/admin/edit.vue

@@ -1,34 +1,18 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    class="dialog"
-    :class="readonly?'leave-dialog-readonly':'leave-dialog-disReadonly'"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <el-form
-      ref="tenantForm"
-      v-loading="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      :model="user"
-      :rules="rules"
-      :label-width="formLabelWidth"
-      label-suffix=":"
-      @submit.native.prevent
-    >
+  <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
+    append-to-body class="dialog" :class="readonly ? 'leave-dialog-readonly' : 'leave-dialog-disReadonly'"
+    @open="getFormData" @close="closeDialog">
+    <el-form ref="tenantForm" v-loading="dialogLoading" :element-loading-text="$t('common.loading')" :model="user"
+      :rules="rules" :label-width="formLabelWidth" label-suffix=":" @submit.native.prevent>
       <el-form-item v-if="tenantName" :label="$t('platform.saas.tenant.prop.parentName')" prop="parentName">
         <span>{{ tenantName }}</span>
       </el-form-item>
       <el-form-item label="姓名" prop="name">
-        <el-input v-if="!readonly" v-model="user.name" v-pinyin="{vm:user,key:'account'}" maxlength="64" />
+        <el-input v-if="!readonly" v-model="user.name" v-pinyin="{ vm: user, key: 'account' }" maxlength="64" />
         <span v-else>{{ user.name }}</span>
       </el-form-item>
       <el-form-item label="账号" prop="account">
-        <el-input v-if="!readonly" v-model="user.account" :disabled="formId!==''" />
+        <el-input v-if="!readonly" v-model="user.account" :disabled="formId !== ''" />
         <span v-else>{{ user.account }}</span>
       </el-form-item>
       <el-form-item v-show="!user.id" label="密码" prop="password">
@@ -41,33 +25,25 @@
         </el-tag>
       </el-form-item> -->
       <el-form-item label="手机号" prop="phone">
-        <el-input v-if="!readonly" v-model="user.phone" :disabled="formId!==''" />
+        <el-input v-if="!readonly" v-model="user.phone" :disabled="formId !== ''" />
         <span v-else>{{ user.phone }}</span>
       </el-form-item>
       <el-form-item label="邮箱" prop="email">
-        <el-input v-if="!readonly" v-model="user.email" :disabled="formId!==''" />
+        <el-input v-if="!readonly" v-model="user.email" :disabled="formId !== ''" />
         <span v-else>{{ user.email }}</span>
       </el-form-item>
       <el-form-item label="性别" prop="gender">
         <el-select v-if="!readonly" v-model="user.gender" placeholder="请选择" style="width:100%;">
-          <el-option
-            v-for="option in genderOption"
-            :key="option.value"
-            :label="option.label"
-            :value="option.value"
-          />
+          <el-option v-for="option in genderOption" :key="option.value" :label="option.label" :value="option.value" />
         </el-select>
-        <span v-else>{{ user.gender|optionsFilter(genderOption, 'label') }}</span>
+        <span v-else>{{ user.gender | optionsFilter(genderOption, 'label') }}</span>
       </el-form-item>
       <el-form-item v-if="readonly" label="状态" prop="status">
-        <span>{{ user.status|optionsFilter(approveStatusOptions,'label') }}</span>
+        <span>{{ user.status | optionsFilter(approveStatusOptions, 'label') }}</span>
       </el-form-item>
     </el-form>
     <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
+      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
     </div>
   </el-dialog>
 </template>
@@ -199,7 +175,7 @@ export default {
         ],
         account: [
           { required: true, message: this.$t('validate.required') },
-          { type: 'string', min: 3, max: 128, message: '号长度至少3位,至多128位', trigger: 'blur' },
+          { type: 'string', min: 3, max: 128, message: '号长度至少3位,至多128位', trigger: 'blur' },
           { validator: validateAccount, trigger: 'blur' }
         ],
         password: [
@@ -232,13 +208,13 @@ export default {
   },
   watch: {
     visible: {
-      handler: function(val, oldVal) {
+      handler: function (val, oldVal) {
         this.dialogVisible = this.visible
       },
       immediate: true
     },
     user: {
-      handler: function(val, oldVal) {
+      handler: function (val, oldVal) {
         var pattern = /\s/
         if (pattern.test(val.name)) {
           if (pattern.test(val.account)) {
@@ -267,7 +243,7 @@ export default {
         this.userSecurity.maxLengthText = '最大长度' + response.data.maxLength
         this.userSecurity.minLength = response.data.minLength
         this.userSecurity.minLengthText = '最小长度' + response.data.minLength
-      }).catch(() => {})
+      }).catch(() => { })
     },
     handleActionEvent({ key }) {
       switch (key) {
@@ -313,17 +289,17 @@ export default {
       this.$refs[this.formName].resetFields()
     },
     /**
-     * 表单验证
-     */
+ * 表单验证
+ */
     formValidate() {
       if (this.readonly) return
       this.$nextTick(() => {
-        this.$refs[this.formName].validate(() => {})
+        this.$refs[this.formName].validate(() => { })
       })
     },
     /**
-     * 获取表单数据
-     */
+ * 获取表单数据
+ */
     getFormData() {
       if (this.$utils.isEmpty(this.formId)) {
         // 重置表单

+ 24 - 43
src/views/system/register/tenant-form.vue

@@ -1,37 +1,15 @@
 <template>
-  <el-form
-    ref="loginForm"
-    :rules="loginRules"
-    :model="loginForm"
-    class="login-form"
-    status-icon
-    label-width="0"
-  >
+  <el-form ref="loginForm" :rules="loginRules" :model="loginForm" class="login-form" status-icon label-width="0">
     <el-form-item prop="company">
-      <el-input
-        v-model="loginForm.company"
-        :placeholder="$t('login.company')"
-        autocomplete="off"
-        prefix-icon="iconfont ibps-icon-university"
-        clearable
-        @keyup.enter.native="handleRegister"
-      />
+      <el-input v-model="loginForm.company" :placeholder="$t('login.company')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-university" clearable @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="companyCode">
-      <el-input
-        v-model="loginForm.code"
-        :placeholder="$t('login.companyCode')"
-        autocomplete="off"
-        prefix-icon="iconfont ibps-icon-university"
-        @keyup.enter.native="handleRegister"
-      />
+      <el-input v-model="loginForm.code" :placeholder="$t('login.companyCode')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-university" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="scale">
-      <el-select
-        v-model="loginForm.scale"
-        placeholder="公司规模"
-        style="width:100%;"
-      >
+      <el-select v-model="loginForm.scale" placeholder="公司规模" style="width:100%;">
         <el-option label="1-50人" value="1-50人" />
         <el-option label="51-100人" value="51-100人" />
         <el-option label="101-200人" value="101-200人" />
@@ -44,13 +22,8 @@
       <ibps-address-cascader v-model="area" :data="areaData" level="province" top-val="86" data-type="name" />
     </el-form-item>
     <el-form-item prop="fullName">
-      <el-input
-        v-model="loginForm.fullName"
-        :placeholder="$t('login.fullName')"
-        autocomplete="off"
-        prefix-icon="iconfont ibps-icon-user"
-        @keyup.enter.native="handleRegister"
-      />
+      <el-input v-model="loginForm.fullName" :placeholder="$t('login.fullName')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-user" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="gender">
       <el-radio-group v-model="loginForm.gender">
@@ -59,23 +32,30 @@
       </el-radio-group>
     </el-form-item>
     <el-form-item prop="email">
-      <el-input v-model="loginForm.email" :placeholder="$t('login.email')" autocomplete="off" prefix-icon="iconfont ibps-icon-envelope" @keyup.enter.native="handleRegister" />
+      <el-input v-model="loginForm.email" :placeholder="$t('login.email')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-envelope" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="mobile">
-      <el-input v-model="loginForm.mobile" :placeholder="$t('login.mobile')" autocomplete="off" prefix-icon="iconfont ibps-icon-mobile" @keyup.enter.native="handleRegister" />
+      <el-input v-model="loginForm.mobile" :placeholder="$t('login.mobile')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-mobile" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="passWd">
-      <el-input v-model="loginForm.passWd" :type="passwordType" :placeholder="$t('login.password')" prefix-icon="ibps-icon-lock" autocomplete="off" @keyup.enter.native="handleRegister">
-        <i slot="suffix" :class="passwordType=='password'?'ibps-icon-eye-slash':'ibps-icon-eye'" class=" el-input__icon" @click="showPassword" />
+      <el-input v-model="loginForm.passWd" :type="passwordType" :placeholder="$t('login.password')"
+        prefix-icon="ibps-icon-lock" autocomplete="off" @keyup.enter.native="handleRegister">
+        <i slot="suffix" :class="passwordType == 'password' ? 'ibps-icon-eye-slash' : 'ibps-icon-eye'" class=" el-input__icon"
+          @click="showPassword" />
       </el-input>
     </el-form-item>
     <el-form-item prop="validCode">
-      <el-input v-model="loginForm.validCode" :placeholder="$t('login.code')" autocomplete="off" prefix-icon="iconfont ibps-icon-qrcode" @keyup.enter.native="handleRegister">
-        <template slot="append"><span :class="[{display:msgKey}]" class="msg-text" @click="handleSend">{{ $t(msgKey?'login.msgScuccess':'login.msgInit',{'time':msgTime}) }}</span></template>
+      <el-input v-model="loginForm.validCode" :placeholder="$t('login.code')" autocomplete="off"
+        prefix-icon="iconfont ibps-icon-qrcode" @keyup.enter.native="handleRegister">
+        <template slot="append"><span :class="[{ display: msgKey }]" class="msg-text" @click="handleSend">{{
+          $t(msgKey ? 'login.msgScuccess' : 'login.msgInit', { 'time':msgTime}) }}</span></template>
       </el-input>
     </el-form-item>
     <el-form-item>
-      <el-button type="primary" class="login-submit" @click.native.prevent="handleRegister">{{ $t('login.registration') }}</el-button>
+      <el-button type="primary" class="login-submit" @click.native.prevent="handleRegister">{{ $t('login.registration')
+        }}</el-button>
     </el-form-item>
     <el-form-item>
       <el-button plain class="login-submit" @click.native.prevent="handleLogin">{{ $t('login.backLogin') }}</el-button>
@@ -201,7 +181,7 @@ export default {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
           this.$store.dispatch('ibps/saas/register', this.loginForm).then(res => {
-            this.$confirm('注册号成功', '提示', {
+            this.$confirm('注册号成功', '提示', {
               confirmButtonText: '返回登录',
               cancelButtonText: '取消',
               type: 'success'
@@ -228,6 +208,7 @@ export default {
   text-align: center;
   cursor: pointer;
 }
+
 .msg-text.display {
   color: #ccc;
 }

+ 19 - 29
src/views/system/register/user-form.vue

@@ -1,20 +1,8 @@
 <template>
-  <el-form
-    ref="loginForm"
-    :rules="loginRules"
-    :model="loginForm"
-    class="login-form"
-    status-icon
-    label-width="0"
-  >
+  <el-form ref="loginForm" :rules="loginRules" :model="loginForm" class="login-form" status-icon label-width="0">
     <el-form-item prop="fullName">
-      <el-input
-        v-model="loginForm.fullName"
-        :placeholder="$t('login.fullName')"
-        auto-complete="off"
-        prefix-icon="iconfont ibps-icon-user"
-        @keyup.enter.native="handleRegister"
-      />
+      <el-input v-model="loginForm.fullName" :placeholder="$t('login.fullName')" auto-complete="off"
+        prefix-icon="iconfont ibps-icon-user" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="gender">
       <el-radio-group v-model="loginForm.gender">
@@ -24,32 +12,33 @@
     </el-form-item>
 
     <el-form-item prop="company">
-      <el-input
-        v-model="loginForm.company"
-        :placeholder="$t('login.company')"
-        auto-complete="off"
-        prefix-icon="iconfont ibps-icon-university"
-        @keyup.enter.native="handleRegister"
-      />
+      <el-input v-model="loginForm.company" :placeholder="$t('login.company')" auto-complete="off"
+        prefix-icon="iconfont ibps-icon-university" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="area">
       <ibps-address-cascader v-model="area" :data="areaData" level="province" top-val="86" data-type="name" />
     </el-form-item>
     <el-form-item prop="mobile">
-      <el-input v-model="loginForm.mobile" :placeholder="$t('login.mobile')" auto-complete="off" prefix-icon="iconfont ibps-icon-mobile" @keyup.enter.native="handleRegister" />
+      <el-input v-model="loginForm.mobile" :placeholder="$t('login.mobile')" auto-complete="off"
+        prefix-icon="iconfont ibps-icon-mobile" @keyup.enter.native="handleRegister" />
     </el-form-item>
     <el-form-item prop="passWd">
-      <el-input v-model="loginForm.passWd" :type="passwordType" :placeholder="$t('login.password')" prefix-icon="ibps-icon-lock" auto-complete="off" @keyup.enter.native="handleRegister">
-        <i slot="suffix" :class="passwordType=='password'?'ibps-icon-eye-slash':'ibps-icon-eye'" class=" el-input__icon" @click="showPassword" />
+      <el-input v-model="loginForm.passWd" :type="passwordType" :placeholder="$t('login.password')"
+        prefix-icon="ibps-icon-lock" auto-complete="off" @keyup.enter.native="handleRegister">
+        <i slot="suffix" :class="passwordType == 'password' ? 'ibps-icon-eye-slash' : 'ibps-icon-eye'" class=" el-input__icon"
+          @click="showPassword" />
       </el-input>
     </el-form-item>
     <el-form-item prop="validCode">
-      <el-input v-model="loginForm.validCode" :placeholder="$t('login.code')" auto-complete="off" prefix-icon="iconfont ibps-icon-qrcode" @keyup.enter.native="handleRegister">
-        <template slot="append"><span :class="[{display:msgKey}]" class="msg-text" @click="handleSend">{{ $t(msgKey?'login.msgScuccess':'login.msgInit',{'time':msgTime}) }}</span></template>
+      <el-input v-model="loginForm.validCode" :placeholder="$t('login.code')" auto-complete="off"
+        prefix-icon="iconfont ibps-icon-qrcode" @keyup.enter.native="handleRegister">
+        <template slot="append"><span :class="[{ display: msgKey }]" class="msg-text" @click="handleSend">{{
+          $t(msgKey ? 'login.msgScuccess' : 'login.msgInit', { 'time':msgTime}) }}</span></template>
       </el-input>
     </el-form-item>
     <el-form-item>
-      <el-button type="primary" class="login-submit" @click.native.prevent="handleRegister">{{ $t('login.registration') }}</el-button>
+      <el-button type="primary" class="login-submit" @click.native.prevent="handleRegister">{{ $t('login.registration')
+        }}</el-button>
     </el-form-item>
     <el-form-item>
       <el-button plain class="login-submit" @click.native.prevent="handleLogin">{{ $t('login.backLogin') }}</el-button>
@@ -171,7 +160,7 @@ export default {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
           this.$store.dispatch('ibps/account/register', this.loginForm).then(res => {
-            this.$confirm('注册号成功', '提示', {
+            this.$confirm('注册号成功', '提示', {
               confirmButtonText: '返回登录',
               cancelButtonText: '取消',
               type: 'success'
@@ -198,6 +187,7 @@ export default {
   text-align: center;
   cursor: pointer;
 }
+
 .msg-text.display {
   color: #ccc;
 }