Unverified 提交 b95b1870 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

Merge pull request #1172 from dataease/pr@v1.4@fix_some_bug

fix: 前端用户列表控制台报错
...@@ -45,8 +45,13 @@ export default { ...@@ -45,8 +45,13 @@ export default {
} else { } else {
res = await window.SyncComponentCache[this.url] res = await window.SyncComponentCache[this.url]
} }
const Fn = Function
this.mode = new Fn(`return ${res.data || res}`)()
/* if (res && res.data) {
const Fn = Function const Fn = Function
this.mode = new Fn(`return ${res.data || res}`)() this.mode = new Fn(`return ${res.data || res}`)()
} */
} }
} }
}, },
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
/* pwd && (this.form.pwd = decrypt(pwd)) */ /* pwd && (this.form.pwd = decrypt(pwd)) */
/* overTime && (this.form.overTime = overTime) */ /* overTime && (this.form.overTime = overTime) */
overTime && (this.$set(this.form, 'overTime', overTime)) overTime && (this.$set(this.form, 'overTime', overTime))
this.requestShort() // this.requestShort()
}) })
}, },
......
<template> <template>
<layout-content :header="formType=='add' ? $t('user.create') : $t('user.modify')" back-name="system-user"> <layout-content :header="formType=='add' ? $t('user.create') : $t('user.modify')" back-name="system-user">
<el-form ref="createUserForm" :model="form" :rules="rule" size="small" label-width="auto" label-position="right"> <el-form ref="createUserForm" :model="form" :rules="rule" size="small" label-width="80px" label-position="right">
<el-form-item label="ID" prop="username"> <el-form-item label="ID" prop="username">
<el-input v-model="form.username" :disabled="formType !== 'add'" /> <el-input v-model="form.username" :disabled="formType !== 'add'" />
</el-form-item> </el-form-item>
......
<template> <template>
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]"> <layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<complex-table <complex-table
v-if="canLoadDom"
:data="data" :data="data"
:columns="columns" :columns="columns"
local-key="userGrid" local-key="userGrid"
...@@ -174,7 +175,8 @@ import { PHONE_REGEX } from '@/utils/validate' ...@@ -174,7 +175,8 @@ import { PHONE_REGEX } from '@/utils/validate'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect' import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { ldapStatus, pluginLoaded } from '@/api/user' import { pluginLoaded } from '@/api/user'
/* import { ldapStatus, pluginLoaded } from '@/api/user' */
import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user' import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user'
import { getDeptTree, treeByDeptId } from '@/api/system/dept' import { getDeptTree, treeByDeptId } from '@/api/system/dept'
...@@ -214,11 +216,14 @@ export default { ...@@ -214,11 +216,14 @@ export default {
{ label: this.$t('commons.disable'), value: '0' } { label: this.$t('commons.disable'), value: '0' }
], ],
multiple: false multiple: false
}
]
}, },
extraFilterComponents: [
{ field: 'd.name', label: this.$t('commons.organization'), component: 'DeComplexInput' }, { field: 'd.name', label: this.$t('commons.organization'), component: 'DeComplexInput' },
{ field: 'r.name', label: this.$t('commons.role'), component: 'DeComplexInput' } { field: 'r.name', label: this.$t('commons.role'), component: 'DeComplexInput' }
] ],
},
paginationConfig: { paginationConfig: {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
...@@ -307,7 +312,8 @@ export default { ...@@ -307,7 +312,8 @@ export default {
orderConditions: [], orderConditions: [],
last_condition: null, last_condition: null,
openLdap: false, openLdap: false,
isPluginLoaded: false isPluginLoaded: false,
canLoadDom: false
} }
}, },
mounted() { mounted() {
...@@ -315,13 +321,17 @@ export default { ...@@ -315,13 +321,17 @@ export default {
this.search() this.search()
}, },
beforeCreate() { beforeCreate() {
ldapStatus().then(res => {
this.openLdap = res.success && res.data
})
pluginLoaded().then(res => { pluginLoaded().then(res => {
this.isPluginLoaded = res.success && res.data this.isPluginLoaded = res.success && res.data
if (this.isPluginLoaded) {
this.searchConfig.components.push(...this.extraFilterComponents)
}
this.canLoadDom = true
}).catch(e => {
this.canLoadDom = true
}) })
}, },
methods: { methods: {
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
this.orderConditions = [] this.orderConditions = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论