Commit 33ab6221 by 胡悦

暂存

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