增加字典功能
This commit is contained in:
@@ -11,9 +11,11 @@ import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/a
|
||||
import { isAuth } from '@/utils'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import './utils/directives.js'
|
||||
import dict from './utils/dict'
|
||||
|
||||
Vue.use(VueCookie)
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.dict = dict
|
||||
|
||||
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
},
|
||||
menuActiveName: {
|
||||
get () { return this.$store.state.common.menuActiveName },
|
||||
set (val) { this.$store.commit('common/', val) }
|
||||
set (val) { this.$store.commit('common/updateMenuActiveName', val) }
|
||||
},
|
||||
mainTabs: {
|
||||
get () { return this.$store.state.common.mainTabs },
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户类型" prop="operType">
|
||||
<el-select v-model="dataForm.operTypeList" placeholder="请选择" style="width:170px">
|
||||
<el-option v-for="item in operTypeList" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-option v-for="item in dict.get('oper_typ')" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -133,22 +133,6 @@
|
||||
status: '0'
|
||||
},
|
||||
orgNoList: [],
|
||||
operTypeList: [{
|
||||
value: '1',
|
||||
label: '管理人员'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '业务操作人员'
|
||||
}, {
|
||||
value: '3',
|
||||
label: '客户经理'
|
||||
}, {
|
||||
value: '4',
|
||||
label: '技术操作员'
|
||||
}, {
|
||||
value: '9',
|
||||
label: '其他'
|
||||
}],
|
||||
dataRule: {
|
||||
operNo: [
|
||||
{ required: true, message: '登录账号不能为空', trigger: 'blur' }
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="oper_typ"
|
||||
:formatter = "operTypStateFormat"
|
||||
:formatter = "dict.formatter"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="用户类型">
|
||||
@@ -136,19 +136,6 @@
|
||||
},
|
||||
methods: {
|
||||
// 数据转义
|
||||
operTypStateFormat (row, column) {
|
||||
if (row.oper_typ === '1') {
|
||||
return '管理人员'
|
||||
} else if (row.oper_typ === '2') {
|
||||
return '业务操作人员'
|
||||
} else if (row.oper_typ === '3') {
|
||||
return '客户经理'
|
||||
} else if (row.oper_typ === '4') {
|
||||
return '技术操作员'
|
||||
} else {
|
||||
return '其他'
|
||||
}
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
|
||||
Reference in New Issue
Block a user