Commit 4c4884f0 by liimin

优化

1 parent c7a7bf55
...@@ -8,7 +8,7 @@ VUE_APP_TITLE=tFIMS ...@@ -8,7 +8,7 @@ VUE_APP_TITLE=tFIMS
# 网络请求mock测试地址 # 网络请求mock测试地址
# VUE_APP_API=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS # VUE_APP_API=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
# 网络请求公用地址 # 网络请求公用地址
VUE_APP_API=http://tfims.test.glsx.com.cn/router VUE_APP_API=http://tfims.test.glsx.com.cn/router
# 仓库地址 # 仓库地址
VUE_APP_REPO=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS VUE_APP_REPO=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
......
...@@ -5,22 +5,22 @@ ...@@ -5,22 +5,22 @@
</template> </template>
<script> <script>
import util from '@/libs/util' // import util from '@/libs/util'
export default { // export default {
name: 'app', // name: 'app',
watch: { // watch: {
'$i18n.locale': 'i18nHandle' // '$i18n.locale': 'i18nHandle'
}, // },
created () { // created () {
this.i18nHandle(this.$i18n.locale) // this.i18nHandle(this.$i18n.locale)
}, // },
methods: { // methods: {
i18nHandle (val, oldVal) { // i18nHandle (val, oldVal) {
util.cookies.set('lang', val) // util.cookies.set('lang', val)
document.querySelector('html').setAttribute('lang', val) // document.querySelector('html').setAttribute('lang', val)
} // }
} // }
} // }
</script> </script>
<style lang="scss"> <style lang="scss">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:41 * @Date: 2019-08-26 18:02:41
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-09 15:51:58 * @Last Modified time: 2019-09-10 17:29:30
*/ */
import axios from '@/plugin/axios' import axios from '@/plugin/axios'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:49 * @Date: 2019-08-26 18:02:49
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-06 14:17:40 * @Last Modified time: 2019-09-10 18:09:16
*/ */
import MD5 from 'js-md5' import MD5 from 'js-md5'
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:55 * @Date: 2019-08-26 18:02:55
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-06 13:50:36 * @Last Modified time: 2019-09-10 17:10:53
*/ */
import request from './request' import request from './request'
...@@ -107,6 +107,15 @@ export function AccountValidate (data = {}) { ...@@ -107,6 +107,15 @@ export function AccountValidate (data = {}) {
} }
/** /**
* 获取登录日志
* @param {} data
*/
export function getLoginlogs (data) {
data.method = `${user_path}search.loginlog`
return request(data)
}
/**
* 获取角色权限资源列表 * 获取角色权限资源列表
* @param {*} data 参数 * @param {*} data 参数
*/ */
......
import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.user.'
export function ModifyPassword (data) {
data.method = `${path}password.modify`
return request(data, RequestMethods.GET)
}
export function getLoginlogs (data) {
data.method = `${path}search.loginlog`
return request(data)
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-09-01 19:06:01 * @Date: 2019-09-01 19:06:01
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-06 12:22:40 * @Last Modified time: 2019-09-10 10:32:06
*/ */
import { LOGIN_URL, REG_URL, Role_LIST_URL } from '@/api/sys.account' import { LOGIN_URL, REG_URL, Role_LIST_URL } from '@/api/sys.account'
...@@ -51,3 +51,8 @@ export const LOGIN_TYPE = 1 // 1pc,2小程序 ...@@ -51,3 +51,8 @@ export const LOGIN_TYPE = 1 // 1pc,2小程序
* 超级管理员类型 * 超级管理员类型
*/ */
export const SUPPER_ADMIN = 1 // export const SUPPER_ADMIN = 1 //
/**
* 职务置灰选项
*/
export const POST_DISABLED = ['2001', '2002', '2003'] // 总经理 仓库 部门经理
<template>
<i :class="`el-icon-${name}`" aria-hidden="true"></i>
</template>
<script>
export default {
name: 'd2-el-icon',
props: {
name: {
type: String,
required: false,
default: ''
}
}
}
</script>
<template> <template>
<div> <i class="fa" :class="`fa-${name}`" aria-hidden="true"></i>
<i class="fa" v-if="isFa" :class="`fa-${name}`" aria-hidden="true"></i>
<i v-else :class="`el-icon-${name}`" aria-hidden="true"></i>
</div>
</template> </template>
<script> <script>
...@@ -14,11 +11,6 @@ export default { ...@@ -14,11 +11,6 @@ export default {
type: String, type: String,
required: false, required: false,
default: 'font-awesome' default: 'font-awesome'
},
isFa: {
type: Boolean,
required: false,
default: true
} }
} }
} }
......
...@@ -6,5 +6,6 @@ import authButton from './d2-auth/d2-auth-btn.js' ...@@ -6,5 +6,6 @@ import authButton from './d2-auth/d2-auth-btn.js'
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('d2-container', d2Container) Vue.component('d2-container', d2Container)
Vue.component('d2-icon', () => import('./d2-icon')) Vue.component('d2-icon', () => import('./d2-icon'))
Vue.component('d2-el-icon', () => import('./d2-el-icon'))
Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue')) Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue'))
Vue.component([authButton.name], authButton) Vue.component([authButton.name], authButton)
...@@ -28,6 +28,7 @@ export default { ...@@ -28,6 +28,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.header-datetime{ .header-datetime{
transform: translateX(-30px); font-size: 12px;
transform: translateX(-10px);
} }
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
placement="bottom"> placement="bottom">
<el-button class="d2-mr btn-text can-hover" type="text" @click="toggle"> <el-button class="d2-mr btn-text can-hover" type="text" @click="toggle">
<d2-icon v-if="active" name="compress"/> <d2-icon v-if="active" name="compress"/>
<d2-icon v-else name="arrows-alt" style="font-size: 16px"/> <d2-el-icon v-else name="full-screen" style="font-size: 16px"/>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
......
<template> <template>
<el-button class="d2-mr btn-text can-hover" type="text" @click="handleClick"> <el-button class="d2-mr btn-text can-hover" type="text" @click="handleClick">
<d2-icon name="search" style="font-size: 18px;"/> <d2-el-icon name="search" style="font-size: 18px;"/>
</el-button> </el-button>
</template> </template>
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
class="d2-ml-0 d2-mr btn-text can-hover" class="d2-ml-0 d2-mr btn-text can-hover"
type="text" type="text"
@click="dialogVisible = true"> @click="dialogVisible = true">
<d2-icon <d2-el-icon
name="diamond" name="magic-stick"
style="font-size: 16px"/> style="font-size: 18px"/>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<el-dialog <el-dialog
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div class="d2-panel-search-item" :class="hoverMode ? 'can-hover' : ''" flex> <div class="d2-panel-search-item" :class="hoverMode ? 'can-hover' : ''" flex>
<div class="d2-panel-search-item__icon" flex-box="0"> <div class="d2-panel-search-item__icon" flex-box="0">
<div class="d2-panel-search-item__icon-box" flex="main:center cross:center"> <div class="d2-panel-search-item__icon-box" flex="main:center cross:center">
<d2-icon v-if="item.icon" :name="item.icon"/> <d2-el-icon v-if="item.icon" :name="item.icon"/>
<d2-icon-svg v-else-if="item.iconSvg" :name="item.iconSvg"/> <!-- <d2-icon-svg v-else-if="item.iconSvg" :name="item.iconSvg"/>
<d2-icon v-else name="file-o"/> <d2-icon v-else name="file-o"/> -->
</div> </div>
</div> </div>
<div class="d2-panel-search-item__info" flex-box="1" flex="dir:top"> <div class="d2-panel-search-item__info" flex-box="1" flex="dir:top">
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
></el-avatar> ></el-avatar>
</div> </div>
<div class="name-role"> <div class="name-role">
<span class="sender">{{ user.userName }} - {{ ['超级管理员','管理员'][+user.roleType] }}</span> <span class="sender">{{ user.userName }} - {{ user.postName }}</span>
</div> </div>
<div class="registe-info"> <div class="registe-info">
<span class="registe-info"> <span class="registe-info">
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div>--> </div>-->
<div class="main-operation"> <div class="main-operation">
<span class="main-operation-item"> <span class="main-operation-item">
<el-button size="small" icon="fa fa-male" @click="openPersonalDialog"> 查看个人信息</el-button> <el-button size="small" icon="fa fa-male" @click="openPersonalDialog"> 个人信息</el-button>
</span> </span>
<span class="main-operation-item"> <span class="main-operation-item">
<el-button size="small" icon="fa fa-key" @click="openPasswordDialog"> 修改密码</el-button> <el-button size="small" icon="fa fa-key" @click="openPasswordDialog"> 修改密码</el-button>
...@@ -163,8 +163,8 @@ export default { ...@@ -163,8 +163,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.personal-panel { .personal-panel {
font-size: 14px; font-size: 13px;
width: 248px; width: 220px;
text-align: center; text-align: center;
border-color: rgba(180, 190, 190, 0.2); border-color: rgba(180, 190, 190, 0.2);
border-width: 1px; border-width: 1px;
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
text-align: center; text-align: center;
} }
.name-role { .name-role {
font-size: 14px; font-size: 12px;
padding: 5px; padding: 5px;
} }
.personal-relation { .personal-relation {
...@@ -223,7 +223,7 @@ export default { ...@@ -223,7 +223,7 @@ export default {
border-top-width: 1px; border-top-width: 1px;
border-top-style: solid; border-top-style: solid;
&-item { &-item {
padding: 12px 16px; padding: 8px 16px;
} }
&:hover { &:hover {
cursor: pointer; cursor: pointer;
......
...@@ -62,7 +62,7 @@ permision.packAsideMenus = function (resources, idsInPermision) { ...@@ -62,7 +62,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环 if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true return true
} }
if ((obj.parentId+'') === '0') { // 取出1级菜单 if ((obj.parentId + '') === '0') { // 取出1级菜单
__aMenusInPermision.push(__oMenu) __aMenusInPermision.push(__oMenu)
} else { // 取出子菜单 } else { // 取出子菜单
__aSub.push(__oMenu) __aSub.push(__oMenu)
......
// Vue // Vue
import Vue from 'vue' import Vue from 'vue'
import i18n from './i18n' // import i18n from './i18n'
import App from './App' import App from './App'
// 核心插件 // 核心插件
import d2Admin from '@/plugin/d2admin' import d2Admin from '@/plugin/d2admin'
...@@ -26,7 +26,7 @@ Vue.use(d2Admin) ...@@ -26,7 +26,7 @@ Vue.use(d2Admin)
new Vue({ new Vue({
router, router,
store, store,
i18n, // i18n,
render: h => h(App), render: h => h(App),
// created () { // created () {
// 处理路由 得到每一级的路由设置 // 处理路由 得到每一级的路由设置
......
// 菜单 侧边栏
export default [
{ path: '/index', title: '系统监控', icon: 'desktop' },
{
title: '页面',
icon: 'folder-o',
children: [
{ path: '/page1', title: '页面 1' },
{ path: '/page2', title: '页面 2' },
{ path: '/page3', title: '页面 3' }
]
}, {
title: '车辆管理',
icon: 'folder-o',
path: '/trafficManagement'
}, {
title: '子系统管理',
icon: 'folder-o',
path: '/subSysManagement'
}, {
title: '上报日志',
icon: 'folder-o',
path: '/reportingLogs'
}
]
// 菜单 顶栏
export default [
{ path: '/index', title: '系统监控', icon: 'home' },
{
title: '页面',
icon: 'folder-o',
children: [
{ path: '/page1', title: '页面 1' },
{ path: '/page2', title: '页面 2' },
{ path: '/page3', title: '页面 3' }
]
}
]
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
} from '@/common/constants' } from '@/common/constants'
import qs from 'qs' import qs from 'qs'
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
const expiresMinute = 30 const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误 // 创建一个错误
function errorCreate (msg) { function errorCreate (msg) {
const error = new Error(msg) const error = new Error(msg)
...@@ -59,17 +59,18 @@ service.interceptors.request.use( ...@@ -59,17 +59,18 @@ service.interceptors.request.use(
url, url,
params params
} = config } = config
if (!LogExternals.some(u => u === url || (params && u === params.method))) { const uuid = util.cookies.get('uuid')
const token = util.cookies.get('token') // 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
if (!token) { // 判断是否长时间未操作 if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) {
await store.dispatch('d2admin/account/logout') await store.dispatch('d2admin/account/logout')
router.replace('/login') router.replace('/login')
} }
} if (uuid) { // 判断 cookie 是否存在 存在则更新时间 避免登出时 记录空值
const inExpiresMinutes = new Date(new Date().getTime() + expiresMinute * 60 * 1000) const inExpiresMinutes = new Date(new Date().getTime() + expiresMinute * 60 * 1000)
util.cookies.set('token', 'token', { util.cookies.set('uuid', uuid, {
expires: inExpiresMinutes expires: inExpiresMinutes
}) })
}
resolve(config) resolve(config)
}) })
}, },
......
...@@ -42,7 +42,7 @@ router.beforeEach(async (to, from, next) => { ...@@ -42,7 +42,7 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('d2admin/account/load') await store.dispatch('d2admin/account/load')
next(to.path) next(to.path)
} else { } else {
if (store.state.d2admin.user.info) { if (store.state.d2admin.user.info) { // sessionstorage 用户存继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
next() next()
} else { } else {
if (to.path === '/login') { // 如果是登录页面路径,就直接next() if (to.path === '/login') { // 如果是登录页面路径,就直接next()
......
...@@ -169,7 +169,7 @@ export const resources = { ...@@ -169,7 +169,7 @@ export const resources = {
}] }]
}, },
'105': { '105': {
path: 'materialList', path: '/materialList',
icon: 'tickets', icon: 'tickets',
name: 'fimsMaterialList', name: 'fimsMaterialList',
meta: { meta: {
...@@ -265,7 +265,7 @@ export const resources = { ...@@ -265,7 +265,7 @@ export const resources = {
title: '用户管理', title: '用户管理',
authId: '10701', authId: '10701',
parentId: '107', parentId: '107',
cache:true cache: true
}, },
auth: [{ // 列表操作 auth: [{ // 列表操作
authId: '1070101', authId: '1070101',
...@@ -342,7 +342,7 @@ export const resources = { ...@@ -342,7 +342,7 @@ export const resources = {
title: '登录日志', title: '登录日志',
authId: '10703', authId: '10703',
parentId: '107', parentId: '107',
cache:true cache: true
}, },
component: _import('userManage/loginLogs') component: _import('userManage/loginLogs')
}, },
...@@ -354,7 +354,7 @@ export const resources = { ...@@ -354,7 +354,7 @@ export const resources = {
title: '上报日志', title: '上报日志',
authId: '108', authId: '108',
parentId: '0', parentId: '0',
cache:true cache: true
}, },
component: _import('reportingLogs') component: _import('reportingLogs')
// auth: [{ // auth: [{
......
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
state.station = station.confes state.station = station.confes
state.subsys = subsys.confes state.subsys = subsys.confes
state.post = post.confes state.post = post.confes
await dispatch('save2db', { name:'', value: state }) await dispatch('save2db', { name: '', value: state })
resolve(state) resolve(state)
}) })
}) })
...@@ -68,10 +68,10 @@ export default { ...@@ -68,10 +68,10 @@ export default {
resolve(__data) resolve(__data)
}) })
}, },
set({ state, dispatch }, {name,value}) { set ({ state, dispatch }, { name, value }) {
return new Promise(async resolve => { return new Promise(async resolve => {
state[name] = value state[name] = value
await dispatch('save2db', { name, value}) await dispatch('save2db', { name, value })
resolve(value) resolve(value)
}) })
}, },
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
await dispatch('d2admin/db/set', { await dispatch('d2admin/db/set', {
dbName: 'database', dbName: 'database',
path:name?`base.${name}`:'base', path: name ? `base.${name}` : 'base',
value, value,
user: true user: true
}, { root: true }) }, { root: true })
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
// 当前用户的 uuid // 当前用户的 uuid
uuid: util.cookies.get('uuid'), uuid: util.cookies.get('uuid'),
// 当前的 token // 当前的 token
token: util.cookies.get('token'), // token: util.cookies.get('token'),
// 当前地址 // 当前地址
url: _.get(window, 'location.href', ''), url: _.get(window, 'location.href', ''),
// 用户设置 // 用户设置
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
// value: info, // value: info,
// user: true // user: true
// }, { root: true }) // }, { root: true })
sessionStorage.setItem('user', escape(JSON.stringify(info))) sessionStorage.setItem('tfims-user', escape(JSON.stringify(info)))
// end // end
resolve() resolve()
}) })
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
// defaultValue: {}, // defaultValue: {},
// user: true // user: true
// }, { root: true }) // }, { root: true })
state.info = JSON.parse(unescape(sessionStorage.getItem('user'))) state.info = JSON.parse(unescape(sessionStorage.getItem('tfims-user')))
// end // end
resolve() resolve()
}) })
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
// user: true // user: true
// }, { root: true }) // }, { root: true })
state.info = null state.info = null
sessionStorage.removeItem('user') sessionStorage.removeItem('tfims-user')
resolve() resolve()
}) })
} }
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
]) ])
}, },
methods: { methods: {
get:_.get, get: _.get,
handleShowMore (log) { handleShowMore (log) {
// 打印一条日志的所有信息到控制台 // 打印一条日志的所有信息到控制台
this.$notify({ this.$notify({
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
:value="post.confCode" :value="post.confCode"
v-for="(post,index) in baseData.posts" v-for="(post,index) in baseData.posts"
:key="index" :key="index"
:disabled="POST_DISABLED.includes(post.confCode)"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
import { Reg } from '@/api/sys.account' import { Reg } from '@/api/sys.account'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import notice from '@/common/notice' import notice from '@/common/notice'
import { RegistType } from '@/common/constants' import { RegistType, POST_DISABLED } from '@/common/constants'
export default { export default {
name: 'DialogReg', name: 'DialogReg',
props: { props: {
...@@ -95,6 +96,7 @@ export default { ...@@ -95,6 +96,7 @@ export default {
}, },
data () { data () {
return { return {
POST_DISABLED,
company: [], company: [],
regForm: { regForm: {
createType: RegistType.BY_SELF, // 1 自注册 2 管理员创建 createType: RegistType.BY_SELF, // 1 自注册 2 管理员创建
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
maxlength="10" maxlength="10"
v-focus v-focus
> >
<i slot="prepend" class="fa fa-user-circle-o"></i> <d2-el-icon slot="prepend" name="user"></d2-el-icon>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
maxlength="12" maxlength="12"
placeholder="请输入密码" placeholder="请输入密码"
> >
<i slot="prepend" class="fa fa-keyboard-o"></i> <d2-el-icon slot="prepend" name="key"/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item class="form-action"> <el-form-item class="form-action">
...@@ -154,7 +154,6 @@ export default { ...@@ -154,7 +154,6 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "~@/components/d2-icon/font-awesome-4.7.0/css/font-awesome.min.css";
.page-login { .page-login {
@extend %unable-select; @extend %unable-select;
$backgroundColor: #2a343d; $backgroundColor: #2a343d;
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</template> </template>
<script> <script>
import { getLoginlogs } from '@api/userManage' import { getLoginlogs } from '@api/sys.account'
export default { export default {
name: 'FimsLoginLogs', name: 'FimsLoginLogs',
data () { data () {
......
...@@ -82,17 +82,17 @@ export default { ...@@ -82,17 +82,17 @@ export default {
mounted () { mounted () {
this.fetchData() this.fetchData()
this.$event.$on('e-role-dialog-close', async isReload => { this.$event.$on('e-role-dialog-close', async isReload => {
if(isReload){ if (isReload) {
this.fetchData() this.fetchData()
const { roles } = await RoleList() const { roles } = await RoleList()
this.set({name:BaseData.ROLE.KEY,value:roles}) this.set({ name: BaseData.ROLE.KEY, value: roles })
} }
this.editVisible = false this.editVisible = false
}) })
}, },
methods: { methods: {
...mapActions('d2admin/base',['set']), ...mapActions('d2admin/base', ['set']),
fetchData () { fetchData () {
this.loadRoleList() this.loadRoleList()
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
:value="post.confCode" :value="post.confCode"
v-for="(post,index) in baseData.posts" v-for="(post,index) in baseData.posts"
:key="index" :key="index"
:disabled="POST_DISABLED.includes(post.confCode)"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import notice from '@/common/notice' import notice from '@/common/notice'
import { RegistType } from '@/common/constants' import { RegistType, POST_DISABLED } from '@/common/constants'
import util from '@/libs/util' import util from '@/libs/util'
export default { export default {
name: 'DialogReg', name: 'DialogReg',
...@@ -132,6 +133,7 @@ export default { ...@@ -132,6 +133,7 @@ export default {
}, },
data () { data () {
return { return {
POST_DISABLED,
regForm: { regForm: {
createType: RegistType.BY_ADMIN, // 1 自注册 2 管理员创建 createType: RegistType.BY_ADMIN, // 1 自注册 2 管理员创建
loginName: '', loginName: '',
...@@ -195,7 +197,7 @@ export default { ...@@ -195,7 +197,7 @@ export default {
methods: { methods: {
...mapActions('d2admin/base', ['load']), ...mapActions('d2admin/base', ['load']),
handleClose (done) { handleClose (done) {
this.$event.$emit('e-reg-dialog-close',false) this.$event.$emit('e-reg-dialog-close', false)
}, },
// 提交注册或审核数据 // 提交注册或审核数据
submit () { submit () {
...@@ -208,7 +210,7 @@ export default { ...@@ -208,7 +210,7 @@ export default {
if (operateStatus) { if (operateStatus) {
notice.okTips(`${this.title}成功!`) notice.okTips(`${this.title}成功!`)
this.$refs.regForm.resetFields() this.$refs.regForm.resetFields()
this.$event.$emit('e-reg-dialog-close',true) this.$event.$emit('e-reg-dialog-close', true)
} else { } else {
notice.errorTips(`${this.title}失败!`) notice.errorTips(`${this.title}失败!`)
} }
......
...@@ -55,9 +55,9 @@ module.exports = { ...@@ -55,9 +55,9 @@ module.exports = {
'js-cookie': 'Cookies', 'js-cookie': 'Cookies',
'nprogress': 'NProgress', 'nprogress': 'NProgress',
'echarts': 'echarts', 'echarts': 'echarts',
'lodash':'_', 'lodash': '_',
// 'vue-i18n':'vue-i18n', // 'vue-i18n':'vue-i18n',
'ua-parser':'UaParser' 'ua-parser': 'UaParser'
} }
// 非开发环境 // 非开发环境
if (process.env.NODE_ENV !== 'development') { if (process.env.NODE_ENV !== 'development') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!