Commit 33ab6221 by 胡悦

暂存

1 parent 16c274e4
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:model="ruleForm" :model="ruleForm"
:rules="rules" :rules="rules"
:label-position="labelPosition" :label-position="labelPosition"
label-width="100px" :label-width="labelWidth"
:size="size" :size="size"
> >
<el-form-item <el-form-item
...@@ -134,6 +134,10 @@ export default { ...@@ -134,6 +134,10 @@ export default {
size: { size: {
type: String, type: String,
default: 'small' default: 'small'
},
labelWidth: {
type: String,
default: '100px'
} }
}, },
methods: { methods: {
......
...@@ -3,9 +3,10 @@ import store from '@/store/index' ...@@ -3,9 +3,10 @@ import store from '@/store/index'
let BASE_URL = store.state.baseURL let BASE_URL = store.state.baseURL
const MOCK_CONFIG_URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config' const MOCK_CONFIG_URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const env = process.env.NODE_ENV const env = process.env.NODE_ENV
// https://oss-config.test.glsx.com.cn/mock/5f8fda237ec90706c0f89d05/service
// http://192.168.0.63:8880
if (!BASE_URL) { if (!BASE_URL) {
BASE_URL = env === 'development' ? ' https://oss-config.test.glsx.com.cn/mock/5f8fda237ec90706c0f89d05/service' BASE_URL = env === 'development' ? 'https://oss-config.test.glsx.com.cn/mock/5f8fda237ec90706c0f89d05/service'
: '' : ''
} }
...@@ -35,4 +36,10 @@ const ORGINIZA_API = { ...@@ -35,4 +36,10 @@ const ORGINIZA_API = {
ORGINIZA_SIMPLElIST: BASE_URL + '/usercenter/organization/simpleList', ORGINIZA_SIMPLElIST: BASE_URL + '/usercenter/organization/simpleList',
ORGINIZA_TREEORY: BASE_URL + '/usercenter/organization/treeOrg' ORGINIZA_TREEORY: BASE_URL + '/usercenter/organization/treeOrg'
} }
export { API, USER_API, ROLE_API, ORGINIZA_API } const DICT_API = {
DICT_SEARCH: {
apiUrl: BASE_URL + '/publiccenter/dict/type/search'
},
DICT_ADD: BASE_URL + '/publiccenter/dict/type/add'
}
export { API, USER_API, ROLE_API, ORGINIZA_API, DICT_API }
import HTTP from '@/utils/http'
import { DICT_API } from '@/config/config'
export default class DictService extends HTTP {
addDict (params) {
return new Promise((resolve, reject) => {
this.axiosPost({
url: DICT_API.DICT_ADD,
data: {params},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
}
})
})
}
}
...@@ -18,6 +18,16 @@ const Constants = { ...@@ -18,6 +18,16 @@ const Constants = {
'1': '仅系统管理员', '1': '仅系统管理员',
'2': '可见租户' '2': '可见租户'
}, },
// 组织状态
ORGINIZA_STATUS: {
'1': '正常',
'2': '停用'
},
// 字典状态
DICT_STATUS: {
'1': '启用, green',
'2': '停用, red'
},
// (0:系统管理员,1:服务商,2:门店,3:技工) // (0:系统管理员,1:服务商,2:门店,3:技工)
USERTYPE: { USERTYPE: {
'0': '超级管理员', '0': '超级管理员',
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<basic-table <basic-table
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :apiParame="apiParame"
:searchForm="searchForm" :searchForm="searchForm"
:hasNum="false" :hasNum="false"
> >
...@@ -38,7 +38,10 @@ ...@@ -38,7 +38,10 @@
slot="status" slot="status"
slot-scope="scope" slot-scope="scope"
> >
<span class="dot green"></span><span class="statusText">正常</span> <span
class="dot"
:class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span><span class="statusText">{{ scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span> </span>
<span <span
slot="table-button" slot="table-button"
...@@ -74,9 +77,15 @@ ...@@ -74,9 +77,15 @@
</template> </template>
<script> <script>
import {
DICT_API
} from '@/config/config'
import Service from 'services/dictionary';
const dictService = new Service()
export default { export default {
data() { data() {
return { return {
DICTSTATUS: this.$Constants.DICT_STATUS,
searchForm: {}, searchForm: {},
dictionaryFormList: [ dictionaryFormList: [
{ {
...@@ -154,18 +163,24 @@ export default { ...@@ -154,18 +163,24 @@ export default {
] ]
} }
}, },
getListApi: null, apiParame: DICT_API.DICT_SEARCH,
// 弹窗 // 弹窗
dictionaryDialogTitle: '新增字典', dictionaryDialogTitle: '新增字典',
dictionaryVisible: false, dictionaryVisible: false,
dictionaryForm: {}, dictionaryForm: {
enableStatus: true
},
dictionaryData: [ dictionaryData: [
{ label: '字典名称:', prop: 'dictName', type: 'input' }, { label: '字典名称:', prop: 'dictName', type: 'input' },
{ label: '字典类型', prop: 'dictType', type: 'input' }, { label: '字典类型', prop: 'dictType', type: 'input' },
{ label: '状态', prop: 'enableStatus', type: 'switch' }, { label: '状态', prop: 'enableStatus', type: 'switch' },
{ label: '备注', prop: 'remark', type: 'input', inputText: 'textarea' } { label: '备注', prop: 'remark', type: 'input', inputText: 'textarea' }
], ],
dictionaryRules: {} dictionaryRules: {
dictName: [{ required: true, message: '请输入字典名称', trigger: blur }],
dictType: [{ required: true, message: '请输入字典类型', trigger: blur }],
enableStatus: [{ required: true }]
}
} }
}, },
methods: { methods: {
...@@ -186,10 +201,12 @@ export default { ...@@ -186,10 +201,12 @@ export default {
}, },
// 确定 // 确定
handleConfirm() { handleConfirm() {
console.log(this.$refs.dictionaryForm) console.log(this.dictionaryForm)
this.$refs.dictionaryForm.$children[0].validate((valid) => { this.$refs.dictionaryForm.$children[0].validate((valid) => {
if (valid) { if (valid) {
dictService.addDict(this.dictionaryForm).then(res => {
this.handleClose() this.handleClose()
})
} else { } else {
console.log('error') console.log('error')
} }
...@@ -198,6 +215,10 @@ export default { ...@@ -198,6 +215,10 @@ export default {
// 取消 // 取消
handleClose(row) { handleClose(row) {
console.log(row) console.log(row)
if (row) {
this.dictionaryForm = row
// this.dictionaryForm.enableStatus
}
if (!this.dictionaryVisible && this.$refs.dictionaryForm) { if (!this.dictionaryVisible && this.$refs.dictionaryForm) {
this.$refs.dictionaryForm.$children[0].resetFields() this.$refs.dictionaryForm.$children[0].resetFields()
} }
......
<template> <template>
<div class="system-container"> <div class="system-container">
<div class="user-container"> <div class="orginiza-container">
<search-form <search-form
class="searchTop border-shadow" class="searchTop border-shadow"
:formModel="searchForm" :formModel="searchForm"
:formList="userFormList" :formList="orginizaFormList"
> >
<slot name="form-slot"> <slot name="form-slot">
<el-button <el-button
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleClose" @click="btnClick('create')"
>新增</el-button> >新增</el-button>
</div> </div>
<el-table <el-table
...@@ -91,17 +91,17 @@ ...@@ -91,17 +91,17 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<basic-dialog <basic-dialog
:title="userDialogTitle" :title="orginizaDialogTitle"
:isVisible="userVisible" :isVisible="orginizaVisible"
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="handleClose" @closeDialog="handleClose"
> >
<slot> <slot>
<rule-form <rule-form
:ruleForm="userForm" :ruleForm="orginizaForm"
:rules="userRules" :rules="orginizaRules"
:ruleData="userData" :ruleData="orginizaData"
ref='userForm' ref='orginizaForm'
></rule-form> ></rule-form>
</slot> </slot>
</basic-dialog> </basic-dialog>
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
return { return {
ORGINIZASTATUS: this.$Constants.ORGINIZASTATUS, ORGINIZASTATUS: this.$Constants.ORGINIZASTATUS,
searchForm: {}, searchForm: {},
userFormList: [ orginizaFormList: [
{ {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
...@@ -189,20 +189,20 @@ export default { ...@@ -189,20 +189,20 @@ export default {
} }
}, },
// 弹窗数据 // 弹窗数据
userDialogTitle: '新增用户', orginizaDialogTitle: '新增用户',
userVisible: false, orginizaVisible: false,
userForm: { orginizaForm: {
account: '', account: '',
departmentId: '', departmentId: '',
superiorId: '', superiorId: '',
enableStatus: true enableStatus: true
}, },
userData: [ orginizaData: [
{ label: '组织名称', prop: 'account', type: 'input' }, { label: '组织名称', prop: 'account', type: 'input' },
{ label: '显示排序', prop: 'departmentId', type: 'input' }, { label: '显示排序', prop: 'departmentId', type: 'input' },
{ label: '组织状态', prop: 'superiorId', type: 'input' } { label: '组织状态', prop: 'superiorId', type: 'radio', children: this.$Constants.ORGINIZA_STATUS }
], ],
userRules: { orginizaRules: {
account: [{ required: true, message: '请输入登录名称', trigger: blur }] account: [{ required: true, message: '请输入登录名称', trigger: blur }]
}, },
// 部门弹窗 // 部门弹窗
...@@ -293,8 +293,8 @@ export default { ...@@ -293,8 +293,8 @@ export default {
methods: { methods: {
// 确定,新增用户、编辑用户 // 确定,新增用户、编辑用户
handleConfirm() { handleConfirm() {
console.log(this.$refs.userForm) console.log(this.$refs.orginizaForm)
this.$refs.userForm.$children[0].validate((valid) => { this.$refs.orginizaForm.$children[0].validate((valid) => {
if (valid) { if (valid) {
this.handleClose() this.handleClose()
} else { } else {
...@@ -304,15 +304,18 @@ export default { ...@@ -304,15 +304,18 @@ export default {
}, },
// 取消 // 取消
handleClose() { handleClose() {
if (!this.userVisible && this.$refs.userForm) { if (!this.orginizaVisible && this.$refs.orginizaForm) {
this.$refs.userForm.$children[0].resetFields() this.$refs.orginizaForm.$children[0].resetFields()
} }
this.userVisible = !this.userVisible this.orginizaVisible = !this.orginizaVisible
}, },
// 按钮事件 // 按钮事件
btnClick(pType, scope) { btnClick(pType, scope) {
console.log(pType, scope) console.log(pType, scope)
switch (pType) { switch (pType) {
case 'create':
this.handleClose()
break
case 'edit': case 'edit':
this.editEvent(scope) this.editEvent(scope)
break break
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleClose" @click="btnClick('create')"
>新增</el-button> >新增</el-button>
</div> </div>
<basic-table <basic-table
...@@ -57,10 +57,11 @@ ...@@ -57,10 +57,11 @@
> >
<slot> <slot>
<rule-form <rule-form
:ruleForm="roleName" :ruleForm="roleForm"
:rules="roleRules" :rules="roleRules"
:ruleData="roleData" :ruleData="roleData"
ref='roleName' :labelWidth="'120px'"
ref='roleForm'
> >
<slot <slot
name="form-slot" name="form-slot"
...@@ -141,9 +142,9 @@ export default { ...@@ -141,9 +142,9 @@ export default {
}, },
apiParame: ROLE_API.ROLE_SEARCH, apiParame: ROLE_API.ROLE_SEARCH,
// 弹窗数据 // 弹窗数据
roleDialogTitle: '新增用户', roleDialogTitle: '新增角色',
roleVisible: false, roleVisible: false,
roleName: { roleForm: {
account: '胡悦', account: '胡悦',
departmentId: '', departmentId: '',
superiorId: '', superiorId: '',
...@@ -156,12 +157,14 @@ export default { ...@@ -156,12 +157,14 @@ export default {
{ label: '租户可见度:', prop: 'visibleType', type: 'radio', hasSelect: true, children: this.$Constants.ROLE_VISIBLE }, { label: '租户可见度:', prop: 'visibleType', type: 'radio', hasSelect: true, children: this.$Constants.ROLE_VISIBLE },
{ label: '数据权限:', prop: 'permissionType', type: 'radio', children: this.$Constants.ROLE_AUTH }, { label: '数据权限:', prop: 'permissionType', type: 'radio', children: this.$Constants.ROLE_AUTH },
// [{ id: 1, label: '本人' }, { id: 2, label: '本人及下属' }, { id: 3, label: '本部门' }, { id: 4, label: '本部门&下属' }, { id: 5, label: '全部' }] // [{ id: 1, label: '本人' }, { id: 2, label: '本人及下属' }, { id: 3, label: '本部门' }, { id: 4, label: '本部门&下属' }, { id: 5, label: '全部' }]
{ label: '菜单权限:', prop: 'rolename', type: 'customize' } { label: '菜单权限:', prop: 'menuIdList', type: 'customize' }
], ],
roleRules: { roleRules: {
roleName: [{ required: true, message: '请输入角色名称', trigger: blur }], roleName: [{ required: true, message: '请输入角色名称', trigger: blur }],
enableStatus: [{ required: true }], enableStatus: [{ required: true }],
visibleType: [{ required: true, message: '请选择租户可见度' }],
permissionType: [{ required: true, message: '请选择数据权限' }],
menuIdList: [{ required: true, message: '请选择菜单列表' }]
}, },
data: [{ data: [{
id: 1, id: 1,
...@@ -203,7 +206,6 @@ export default { ...@@ -203,7 +206,6 @@ export default {
methods: { methods: {
// 重置搜索条件 // 重置搜索条件
refresh() { refresh() {
console.log('chognzhi ')
this.searchForm = {} this.searchForm = {}
}, },
// 确定 // 确定
...@@ -229,9 +231,11 @@ export default { ...@@ -229,9 +231,11 @@ export default {
console.log(pType, scope) console.log(pType, scope)
switch (pType) { switch (pType) {
case 'create': case 'create':
this.editEvent() this.roleDialogTitle = '新增角色'
this.handleClose()
break break
case 'edit': case 'edit':
this.roleDialogTitle = '编辑角色'
this.editEvent(scope) this.editEvent(scope)
break break
case 'delete': case 'delete':
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleClose" @click="btnClick('create')"
>新增</el-button> >新增</el-button>
</div> </div>
<basic-table <basic-table
...@@ -329,11 +329,6 @@ export default { ...@@ -329,11 +329,6 @@ export default {
}, },
// 取消 // 取消
handleClose(row) { handleClose(row) {
if (row && row.id) {
this.userDialogTitle = '编辑用户'
} else {
this.userDialogTitle = '新增用户'
}
if (!this.userVisible && this.$refs.userForm) { if (!this.userVisible && this.$refs.userForm) {
this.$refs.userForm.$children[0].resetFields() this.$refs.userForm.$children[0].resetFields()
} }
...@@ -355,7 +350,12 @@ export default { ...@@ -355,7 +350,12 @@ export default {
btnClick(pType, scope) { btnClick(pType, scope) {
console.log(pType, scope) console.log(pType, scope)
switch (pType) { switch (pType) {
case 'create':
this.userDialogTitle = '新增用户'
this.handleClose()
break
case 'edit': case 'edit':
this.userDialogTitle = '编辑用户'
this.editEvent(scope) this.editEvent(scope)
break break
case 'delete': case 'delete':
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!