【增加】增加字典接口 增加权限的组件
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
<el-col :span="20">
|
||||
<div class="search-box-left">
|
||||
<label>数据字典编码:</label>
|
||||
<el-input v-model="q.account" placeholder="请输入数据字典编码"></el-input>
|
||||
<el-input v-model="q.dicCode" placeholder="请输入数据字典编码"></el-input>
|
||||
<label>数据字典名称:</label>
|
||||
<el-input v-model="q.account" placeholder="请输入数据字典名称"></el-input>
|
||||
<el-input v-model="q.dicName" placeholder="请输入数据字典名称"></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4" align="right">
|
||||
@@ -36,9 +36,9 @@
|
||||
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="ACCOUNT" title="数据字典编码"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="CELLPHONE_NUMBER" title="数据字典名称"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="CREATEDATE" title="创建时间"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="dicCode" title="数据字典编码"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="dicName" title="数据字典名称"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow field="description" title="描述"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="openRowData('view', row)">查看</el-button>
|
||||
@@ -57,12 +57,12 @@
|
||||
:total="total"/>
|
||||
</div>
|
||||
<!-- 新增/编辑/查看 用户 -->
|
||||
<el-dialog :title="dialogTitle " :visible.sync="dialogUser" width="750px" :close-on-click-modal="false"
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogUser" width="750px" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false" modal-append-to-body append-to-body>
|
||||
<div class="user-form">
|
||||
<el-form :model="form" label-width="186px" :disabled="mode === 'view'">
|
||||
<el-form-item label="数据字典编码:" required>
|
||||
<el-input v-model="form.account" maxlength="20" show-word-limit placeholder="请输入数据字典编码"></el-input>
|
||||
<el-input v-model="form.dicCode" :disabled="mode === 'view' || mode === 'modify' " maxlength="20" show-word-limit placeholder="请输入数据字典编码"></el-input>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="密码:" :required="mode === 'add'" v-if="mode !== 'view'">-->
|
||||
<!--<el-input v-model="form.password" maxlength="20" type="password" placeholder="请输入密码"></el-input>-->
|
||||
@@ -71,11 +71,11 @@
|
||||
<!--<el-input v-model="repassword" maxlength="20" type="password" placeholder="请确认密码"></el-input>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item label="数据字典名称:">
|
||||
<el-input v-model="form.cellPhoneNumber" placeholder="请输入数据字典名称"></el-input>
|
||||
<el-input v-model="form.dicName" placeholder="请输入数据字典名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="姓名:" required>
|
||||
<el-input v-model="form.usname" maxlength="20" show-word-limit placeholder="请输入姓名"></el-input>
|
||||
<el-form-item label="描述:" required>
|
||||
<el-input v-model="form.description" maxlength="20" show-word-limit placeholder="请输入描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="done">
|
||||
@@ -93,8 +93,8 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
q: {
|
||||
account: '', // 用户名
|
||||
roleName: '', // 角色名称
|
||||
dicCode: '', // 用户名
|
||||
dicName: '', // 角色名称
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
@@ -103,14 +103,9 @@ export default {
|
||||
mode: '',
|
||||
dialogUser: false,
|
||||
form: {
|
||||
account: '', // 用户名
|
||||
cellPhoneNumber: '', // 手机号
|
||||
department: '', // 部门
|
||||
email: '', // 邮箱
|
||||
password: '', // 密码
|
||||
usid: '',
|
||||
usname: '', // 姓名
|
||||
roleIdList: [''] // 角色
|
||||
dicCode:'',
|
||||
dicName:'',
|
||||
description:''
|
||||
},
|
||||
repassword: '',
|
||||
roleList: []
|
||||
@@ -123,7 +118,10 @@ export default {
|
||||
},
|
||||
// 获取所有字典
|
||||
sysUserList () {
|
||||
|
||||
this.$api.dictionary.getDic(this.q).then((res)=>{
|
||||
this.tableData = res.data.records
|
||||
this.total=res.data.total
|
||||
})
|
||||
},
|
||||
// 重置
|
||||
reset () {
|
||||
@@ -152,14 +150,9 @@ export default {
|
||||
add () {
|
||||
this.mode = 'add'
|
||||
this.form = {
|
||||
account: '', // 用户名
|
||||
cellPhoneNumber: '', // 手机号
|
||||
department: '', // 部门
|
||||
email: '', // 邮箱
|
||||
password: '', // 密码
|
||||
usid: '',
|
||||
usname: '', // 姓名
|
||||
roleIdList: [''] // 角色
|
||||
dicCode:'',
|
||||
dicName:'',
|
||||
description:''
|
||||
}
|
||||
this.repassword = ''
|
||||
this.dialogUser = true
|
||||
@@ -181,22 +174,27 @@ export default {
|
||||
// },
|
||||
// 删除
|
||||
deleteRow (row) {
|
||||
this.deleteUser(row.USID)
|
||||
this.deleteUser(row.id)
|
||||
},
|
||||
// 新增用户
|
||||
sysUserAddUser () {
|
||||
const data = JSON.parse(JSON.stringify(this.form))
|
||||
data.account = this.$JSEncrypt(data.account)
|
||||
data.password = this.$JSEncrypt(data.password)
|
||||
const jsonData = JSON.stringify(data)
|
||||
this.$api.user.sysUserAddUser(Base64.encodeURI(jsonData)).then(_ => {
|
||||
this.$message.success('操作成功')
|
||||
this.dialogUser = false
|
||||
this.reset()
|
||||
})
|
||||
if(this.mode=='add'){
|
||||
this.$api.dictionary.addDic(this.form).then((res)=>{
|
||||
this.$message.success("新增成功")
|
||||
this.sysUserList()
|
||||
})
|
||||
}else{
|
||||
this.$api.dictionary.editDic(this.form).then((res)=>{
|
||||
this.$message.success("编辑成功")
|
||||
this.sysUserList()
|
||||
})
|
||||
}
|
||||
|
||||
this.dialogUser = false
|
||||
},
|
||||
// 编辑查看用户
|
||||
openRowData (mode, row) {
|
||||
this.mode = mode
|
||||
if(mode=='view'){
|
||||
this.$router.push({
|
||||
path:'/system/dicdeatil',
|
||||
@@ -205,19 +203,16 @@ export default {
|
||||
pId:row.id
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.mode = mode
|
||||
}else if(mode=='add'){
|
||||
|
||||
this.form = {
|
||||
account: row.ACCOUNT, // 用户名
|
||||
cellPhoneNumber: row.CELLPHONE_NUMBER, // 手机号
|
||||
department: row.DEPARTMENT, // 部门
|
||||
email: row.EMAIL, // 邮箱
|
||||
password: '', // 密码
|
||||
usid: row.USID, // 用户ID
|
||||
usname: row.USNAME, // 姓名
|
||||
roleIdList: [row.ROLEID] // 角色
|
||||
description:'',
|
||||
dicName:'',
|
||||
dicCode:''
|
||||
}
|
||||
this.repassword = ''
|
||||
this.dialogUser = true
|
||||
}else{
|
||||
this.form = JSON.parse(JSON.stringify(row))
|
||||
this.dialogUser = true
|
||||
}
|
||||
|
||||
@@ -229,7 +224,7 @@ export default {
|
||||
if (!users.length) {
|
||||
return this.$message.warning('请选择数据后在进行操作')
|
||||
}
|
||||
const ids = users.map(item => item.USID).join(',')
|
||||
const ids = users.map(item => item.id).join(',')
|
||||
this.deleteUser(ids)
|
||||
},
|
||||
// 删除用户
|
||||
@@ -239,10 +234,10 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// this.$api.user.sysUserDelete({ ids }).then(_ => {
|
||||
this.$api.dictionary.delDic(ids ).then(_ => {
|
||||
this.$message.success('操作成功')
|
||||
this.sysUserList()
|
||||
// })
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user