Commit 60ce609a by yuwei

2.0.0项目初始化

parent 30822b4a
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -67,13 +67,13 @@ export default { ...@@ -67,13 +67,13 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
configName: [ configName: [
{ required: true, message: "参数名称不能为空", trigger: "blur" } { required: true, message: '参数名称不能为空', trigger: 'blur' }
], ],
configKey: [ configKey: [
{ required: true, message: "参数键名不能为空", trigger: "blur" } { required: true, message: '参数键名不能为空', trigger: 'blur' }
], ],
configValue: [ configValue: [
{ required: true, message: "参数键值不能为空", trigger: "blur" } { required: true, message: '参数键值不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
} }
}, },
created () { created () {
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -92,18 +92,18 @@ export default { ...@@ -92,18 +92,18 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addConfig(this.form).then(response => { addConfig(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getConfig: function(id) { getConfig: function (id) {
getConfig(id).then(response => { getConfig(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -65,13 +65,13 @@ export default { ...@@ -65,13 +65,13 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
configName: [ configName: [
{ required: true, message: "参数名称不能为空", trigger: "blur" } { required: true, message: '参数名称不能为空', trigger: 'blur' }
], ],
configKey: [ configKey: [
{ required: true, message: "参数键名不能为空", trigger: "blur" } { required: true, message: '参数键名不能为空', trigger: 'blur' }
], ],
configValue: [ configValue: [
{ required: true, message: "参数键值不能为空", trigger: "blur" } { required: true, message: '参数键值不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getConfig: function(id) { getConfig: function (id) {
getConfig(id).then(response => { getConfig(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -100,18 +100,18 @@ export default { ...@@ -100,18 +100,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateConfig(this.form).then(response => { updateConfig(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="roleList" :data="configList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
// 默认选择中表格头 // 默认选择中表格头
checkedTableColumns: [], checkedTableColumns: [],
tableSize: 'medium', tableSize: 'medium',
// 角色表格数据 // 参数表格数据
configList: [], configList: [],
// 总数据条数 // 总数据条数
total: 0, total: 0,
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<script> <script>
import { addDept, listDept } from '@/api/system/dept' import { addDept, listDept } from '@/api/system/dept'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'DeptAdd', name: 'DeptAdd',
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -72,13 +72,13 @@ export default { ...@@ -72,13 +72,13 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: "上级部门不能为空", trigger: "blur" } { required: true, message: '上级部门不能为空', trigger: 'blur' }
], ],
deptName: [ deptName: [
{ required: true, message: "部门名称不能为空", trigger: "blur" } { required: true, message: '部门名称不能为空', trigger: 'blur' }
], ],
deptNo: [ deptNo: [
{ required: true, message: "部门编码不能为空", trigger: "blur" } { required: true, message: '部门编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
}, },
created () { created () {
console.log('data:' + JSON.stringify(this.data)) console.log('data:' + JSON.stringify(this.data))
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer (node) { normalizer (node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
...@@ -127,18 +127,18 @@ export default { ...@@ -127,18 +127,18 @@ export default {
} }
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addDept(this.form).then(response => { addDept(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
<script> <script>
import { getDept, listDept } from '@/api/system/dept' import { getDept, listDept } from '@/api/system/dept'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'DeptDetail', name: 'DeptDetail',
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer (node) { normalizer (node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
} }
}, },
/** 获取详情 */ /** 获取详情 */
getDept: function(id) { getDept: function (id) {
getDept(id).then(response => { getDept(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<script> <script>
import { getDept, listDept, updateDept } from '@/api/system/dept' import { getDept, listDept, updateDept } from '@/api/system/dept'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'DeptEdit', name: 'DeptEdit',
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -69,13 +69,13 @@ export default { ...@@ -69,13 +69,13 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: "上级部门不能为空", trigger: "blur" } { required: true, message: '上级部门不能为空', trigger: 'blur' }
], ],
deptName: [ deptName: [
{ required: true, message: "部门名称不能为空", trigger: "blur" } { required: true, message: '部门名称不能为空', trigger: 'blur' }
], ],
deptNo: [ deptNo: [
{ required: true, message: "部门编码不能为空", trigger: "blur" } { required: true, message: '部门编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer (node) { normalizer (node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
} }
}, },
/** 获取详情 */ /** 获取详情 */
getDept: function(id) { getDept: function (id) {
getDept(id).then(response => { getDept(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -133,18 +133,18 @@ export default { ...@@ -133,18 +133,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateDept(this.form).then(response => { updateDept(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -193,8 +193,8 @@ export default { ...@@ -193,8 +193,8 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd (row) { handleAdd (row) {
this.showOptions.data = {} this.showOptions.data = {}
if (row != undefined) { if (row !== undefined) {
this.showOptions.data.parentId = row.id; this.showOptions.data.parentId = row.id
} }
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = true this.showOptions.showAdd = true
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
}, },
statusFormatter (row, column, cellValue, index) { statusFormatter (row, column, cellValue, index) {
const status = row.status const status = row.status
if (status === "0") { if (status === '0') {
return <el-tag type="warning">禁用</el-tag> return <el-tag type="warning">禁用</el-tag>
} else { } else {
return <el-tag type="success">启用</el-tag> return <el-tag type="success">启用</el-tag>
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -68,10 +68,10 @@ export default { ...@@ -68,10 +68,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
dictName: [ dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" } { required: true, message: '字典名称不能为空', trigger: 'blur' }
], ],
dictCode: [ dictCode: [
{ required: true, message: "字典编码不能为空", trigger: "blur" } { required: true, message: '字典编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} }
}, },
created () { created () {
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -90,18 +90,18 @@ export default { ...@@ -90,18 +90,18 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addDict(this.form).then(response => { addDict(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDict: function(id) { getDict: function (id) {
getDict(id).then(response => { getDict(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -66,10 +66,10 @@ export default { ...@@ -66,10 +66,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
dictName: [ dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" } { required: true, message: '字典名称不能为空', trigger: 'blur' }
], ],
dictCode: [ dictCode: [
{ required: true, message: "字典编码不能为空", trigger: "blur" } { required: true, message: '字典编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDict: function(id) { getDict: function (id) {
getDict(id).then(response => { getDict(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -98,18 +98,18 @@ export default { ...@@ -98,18 +98,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateDict(this.form).then(response => { updateDict(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -72,10 +72,10 @@ export default { ...@@ -72,10 +72,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
itemText: [ itemText: [
{ required: true, message: "字典项文本不能为空", trigger: "blur" } { required: true, message: '字典项文本不能为空', trigger: 'blur' }
], ],
itemValue: [ itemValue: [
{ required: true, message: "字典项值不能为空", trigger: "blur" } { required: true, message: '字典项值不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
created () { created () {
console.log('data:' + JSON.stringify(this.data)) console.log('data:' + JSON.stringify(this.data))
this.form.dictId = this.data.dictId this.form.dictId = this.data.dictId
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -96,18 +96,18 @@ export default { ...@@ -96,18 +96,18 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addDictItem(this.form).then(response => { addDictItem(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDictItem: function(id) { getDictItem: function (id) {
getDictItem(id).then(response => { getDictItem(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -69,10 +69,10 @@ export default { ...@@ -69,10 +69,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
itemText: [ itemText: [
{ required: true, message: "字典项文本不能为空", trigger: "blur" } { required: true, message: '字典项文本不能为空', trigger: 'blur' }
], ],
itemValue: [ itemValue: [
{ required: true, message: "字典项值不能为空", trigger: "blur" } { required: true, message: '字典项值不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDictItem: function(id) { getDictItem: function (id) {
getDictItem(id).then(response => { getDictItem(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -101,18 +101,18 @@ export default { ...@@ -101,18 +101,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateDictItem(this.form).then(response => { updateDictItem(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="roleList" :data="dictItemList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="roleList" :data="dictList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
<script> <script>
import { getMenu, listMenu } from '@/api/system/menu' import { getMenu, listMenu } from '@/api/system/menu'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'MenuDetail', name: 'MenuDetail',
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -102,12 +102,12 @@ export default { ...@@ -102,12 +102,12 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getDicts("sys_menu_type").then(response => { this.getDicts('sys_menu_type').then(response => {
if (response.success) { if (response.success) {
this.menuTypeOptions = response.data this.menuTypeOptions = response.data
} }
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getMenuTreeSelect: function() { getMenuTreeSelect: function () {
listMenu().then(response => { listMenu().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
/** 转换资源数据结构 */ /** 转换资源数据结构 */
normalizer (node) { normalizer (node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
...@@ -146,7 +146,7 @@ export default { ...@@ -146,7 +146,7 @@ export default {
} }
}, },
/** 获取详情 */ /** 获取详情 */
getMenu: function(id) { getMenu: function (id) {
getMenu(id).then(response => { getMenu(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<script> <script>
import { getMenu, listMenu, updateMenu } from '@/api/system/menu' import { getMenu, listMenu, updateMenu } from '@/api/system/menu'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'MenuEdit', name: 'MenuEdit',
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -96,13 +96,13 @@ export default { ...@@ -96,13 +96,13 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: "上级资源不能为空", trigger: "blur" } { required: true, message: '上级资源不能为空', trigger: 'blur' }
], ],
menuName: [ menuName: [
{ required: true, message: "资源名称不能为空", trigger: "blur" } { required: true, message: '资源名称不能为空', trigger: 'blur' }
], ],
menuSort: [ menuSort: [
{ required: true, message: "资源排序不能为空", trigger: "blur" } { required: true, message: '资源排序不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -115,12 +115,12 @@ export default { ...@@ -115,12 +115,12 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getDicts("sys_menu_type").then(response => { this.getDicts('sys_menu_type').then(response => {
if (response.success) { if (response.success) {
this.menuTypeOptions = response.data this.menuTypeOptions = response.data
} }
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getMenuTreeSelect: function() { getMenuTreeSelect: function () {
listMenu().then(response => { listMenu().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
/** 转换资源数据结构 */ /** 转换资源数据结构 */
normalizer (node) { normalizer (node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children
} }
return { return {
id: node.id, id: node.id,
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
} }
}, },
/** 获取详情 */ /** 获取详情 */
getMenu: function(id) { getMenu: function (id) {
getMenu(id).then(response => { getMenu(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -167,18 +167,18 @@ export default { ...@@ -167,18 +167,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateMenu(this.form).then(response => { updateMenu(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -207,8 +207,8 @@ export default { ...@@ -207,8 +207,8 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd (row) { handleAdd (row) {
this.showOptions.data = {} this.showOptions.data = {}
if (row != undefined) { if (row !== undefined) {
this.showOptions.data.parentId = row.id; this.showOptions.data.parentId = row.id
} }
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = true this.showOptions.showAdd = true
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
postName: [ postName: [
{ required: true, message: "岗位名称不能为空", trigger: "blur" } { required: true, message: '岗位名称不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
} }
}, },
created () { created () {
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -80,18 +80,18 @@ export default { ...@@ -80,18 +80,18 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addPost(this.form).then(response => { addPost(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getPost: function(id) { getPost: function (id) {
getPost(id).then(response => { getPost(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
postName: [ postName: [
{ required: true, message: "岗位名称不能为空", trigger: "blur" } { required: true, message: '岗位名称不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getPost: function(id) { getPost: function (id) {
getPost(id).then(response => { getPost(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -88,18 +88,18 @@ export default { ...@@ -88,18 +88,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updatePost(this.form).then(response => { updatePost(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -109,10 +109,10 @@ export default { ...@@ -109,10 +109,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
roleName: [ roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" } { required: true, message: '角色名称不能为空', trigger: 'blur' }
], ],
roleCode: [ roleCode: [
{ required: true, message: "角色编码不能为空", trigger: "blur" } { required: true, message: '角色编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -124,22 +124,22 @@ export default { ...@@ -124,22 +124,22 @@ export default {
// 部门列表 // 部门列表
deptOptions: [], deptOptions: [],
menuDefaultProps: { menuDefaultProps: {
children: "children", children: 'children',
label: "menuName" label: 'menuName'
}, },
deptDefaultProps: { deptDefaultProps: {
children: "children", children: 'children',
label: "deptName" label: 'deptName'
} }
} }
}, },
created () { created () {
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getDicts("sys_data_scope").then(response => { this.getDicts('sys_data_scope').then(response => {
if (response.success) { if (response.success) {
this.dataScopeOptions = response.data this.dataScopeOptions = response.data
} }
...@@ -196,20 +196,20 @@ export default { ...@@ -196,20 +196,20 @@ export default {
return checkedKeys return checkedKeys
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.form.menuList = this.getMenuAllCheckedKeys() this.form.menuList = this.getMenuAllCheckedKeys()
this.form.deptList = this.getDeptAllCheckedKeys() this.form.deptList = this.getDeptAllCheckedKeys()
addRole(this.form).then(response => { addRole(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -107,23 +107,23 @@ export default { ...@@ -107,23 +107,23 @@ export default {
// 部门列表 // 部门列表
deptOptions: [], deptOptions: [],
menuDefaultProps: { menuDefaultProps: {
children: "children", children: 'children',
label: "menuName" label: 'menuName'
}, },
deptDefaultProps: { deptDefaultProps: {
children: "children", children: 'children',
label: "deptName" label: 'deptName'
} }
} }
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getDicts("sys_data_scope").then(response => { this.getDicts('sys_data_scope').then(response => {
if (response.success) { if (response.success) {
this.dataScopeOptions = response.data this.dataScopeOptions = response.data
} }
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
return checkedKeys return checkedKeys
}, },
/** 获取详情 */ /** 获取详情 */
getRole: function(id) { getRole: function (id) {
getRole(id).then(response => { getRole(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -102,10 +102,10 @@ export default { ...@@ -102,10 +102,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
roleName: [ roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" } { required: true, message: '角色名称不能为空', trigger: 'blur' }
], ],
roleCode: [ roleCode: [
{ required: true, message: "角色编码不能为空", trigger: "blur" } { required: true, message: '角色编码不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -117,23 +117,23 @@ export default { ...@@ -117,23 +117,23 @@ export default {
// 部门列表 // 部门列表
deptOptions: [], deptOptions: [],
menuDefaultProps: { menuDefaultProps: {
children: "children", children: 'children',
label: "menuName" label: 'menuName'
}, },
deptDefaultProps: { deptDefaultProps: {
children: "children", children: 'children',
label: "deptName" label: 'deptName'
} }
} }
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getDicts("sys_data_scope").then(response => { this.getDicts('sys_data_scope').then(response => {
if (response.success) { if (response.success) {
this.dataScopeOptions = response.data this.dataScopeOptions = response.data
} }
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
return checkedKeys return checkedKeys
}, },
/** 获取详情 */ /** 获取详情 */
getRole: function(id) { getRole: function (id) {
getRole(id).then(response => { getRole(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -203,20 +203,20 @@ export default { ...@@ -203,20 +203,20 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.form.menuList = this.getMenuAllCheckedKeys() this.form.menuList = this.getMenuAllCheckedKeys()
this.form.deptList = this.getDeptAllCheckedKeys() this.form.deptList = this.getDeptAllCheckedKeys()
updateRole(this.form).then(response => { updateRole(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
...@@ -79,8 +79,8 @@ import { listDept } from '@/api/system/dept' ...@@ -79,8 +79,8 @@ import { listDept } from '@/api/system/dept'
import { listPost } from '@/api/system/post' import { listPost } from '@/api/system/post'
import { listRole } from '@/api/system/role' import { listRole } from '@/api/system/role'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'UserAdd', name: 'UserAdd',
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -115,32 +115,32 @@ export default { ...@@ -115,32 +115,32 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
username: [ username: [
{ required: true, message: "用户名称不能为空", trigger: "blur" } { required: true, message: '用户名称不能为空', trigger: 'blur' }
], ],
nickname: [ nickname: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: '用户昵称不能为空', trigger: 'blur' }
], ],
password: [ password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" } { required: true, message: '用户密码不能为空', trigger: 'blur' }
], ],
email: [ email: [
{ required: true, message: "电子邮箱不能为空", trigger: "blur" }, { required: true, message: '电子邮箱不能为空', trigger: 'blur' },
{ {
type: "email", type: 'email',
message: "请输入正确的电子邮箱", message: '请输入正确的电子邮箱',
trigger: ["blur", "change"] trigger: ['blur', 'change']
} }
], ],
phone: [ phone: [
{ required: true, message: "手机号码不能为空", trigger: "blur" }, { required: true, message: '手机号码不能为空', trigger: 'blur' },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码", message: '请输入正确的手机号码',
trigger: "blur" trigger: 'blur'
} }
], ],
deptId: [ deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" } { required: true, message: '归属部门不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
} }
}, },
created () { created () {
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -205,18 +205,18 @@ export default { ...@@ -205,18 +205,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addUser(this.form).then(response => { addUser(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -75,8 +75,8 @@ import { listDept } from '@/api/system/dept' ...@@ -75,8 +75,8 @@ import { listDept } from '@/api/system/dept'
import { listPost } from '@/api/system/post' import { listPost } from '@/api/system/post'
import { listRole } from '@/api/system/role' import { listRole } from '@/api/system/role'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'UserDetail', name: 'UserDetail',
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
}) })
}, },
/** 获取详情 */ /** 获取详情 */
getUser: function(id) { getUser: function (id) {
getUser(id).then(response => { getUser(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<treeselect v-model="form.deptId" :options="deptOptions" :normalizer="normalizer" placeholder="请选择归属部门" /> <treeselect v-model="form.deptId" :options="deptOptions" :normalizer="normalizer" placeholder="请选择归属部门" />
</el-form-item> </el-form-item>
<el-form-item label="岗位"> <el-form-item label="岗位">
<el-select v-model="form.postList" filterable multiple placeholder="请选择岗位"> <el-select v-model="form.postList" multiple placeholder="请选择岗位">
<el-option <el-option
v-for="item in postOptions" v-for="item in postOptions"
:key="item.id" :key="item.id"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="角色"> <el-form-item label="角色">
<el-select v-model="form.roleList" filterable multiple placeholder="请选择角色"> <el-select v-model="form.roleList" multiple placeholder="请选择角色">
<el-option <el-option
v-for="item in roleOptions" v-for="item in roleOptions"
:key="item.id" :key="item.id"
...@@ -76,8 +76,8 @@ import { listDept } from '@/api/system/dept' ...@@ -76,8 +76,8 @@ import { listDept } from '@/api/system/dept'
import { listPost } from '@/api/system/post' import { listPost } from '@/api/system/post'
import { listRole } from '@/api/system/role' import { listRole } from '@/api/system/role'
import { construct } from '@/utils/json-tree' import { construct } from '@/utils/json-tree'
import Treeselect from "@riophae/vue-treeselect" import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css" import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
name: 'UserEdit', name: 'UserEdit',
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function() { default: function () {
return {} return {}
} }
} }
...@@ -103,36 +103,39 @@ export default { ...@@ -103,36 +103,39 @@ export default {
showDetail: false showDetail: false
}, },
// 表单参数 // 表单参数
form: {}, form: {
postList: [],
roleList: []
},
// 表单校验 // 表单校验
rules: { rules: {
username: [ username: [
{ required: true, message: "用户名称不能为空", trigger: "blur" } { required: true, message: '用户名称不能为空', trigger: 'blur' }
], ],
nickname: [ nickname: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: '用户昵称不能为空', trigger: 'blur' }
], ],
password: [ password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" } { required: true, message: '用户密码不能为空', trigger: 'blur' }
], ],
email: [ email: [
{ required: true, message: "电子邮箱不能为空", trigger: "blur" }, { required: true, message: '电子邮箱不能为空', trigger: 'blur' },
{ {
type: "email", type: 'email',
message: "请输入正确的电子邮箱", message: '请输入正确的电子邮箱',
trigger: ["blur", "change"] trigger: ['blur', 'change']
} }
], ],
phone: [ phone: [
{ required: true, message: "手机号码不能为空", trigger: "blur" }, { required: true, message: '手机号码不能为空', trigger: 'blur' },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码", message: '请输入正确的手机号码',
trigger: "blur" trigger: 'blur'
} }
], ],
deptId: [ deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" } { required: true, message: '归属部门不能为空', trigger: 'blur' }
] ]
}, },
// 状态数据字典 // 状态数据字典
...@@ -147,7 +150,7 @@ export default { ...@@ -147,7 +150,7 @@ export default {
}, },
created () { created () {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
} }
...@@ -161,7 +164,7 @@ export default { ...@@ -161,7 +164,7 @@ export default {
showCard () { showCard () {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function() { getDeptTreeSelect: function () {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -199,7 +202,7 @@ export default { ...@@ -199,7 +202,7 @@ export default {
}) })
}, },
/** 获取详情 */ /** 获取详情 */
getUser: function(id) { getUser: function (id) {
getUser(id).then(response => { getUser(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -209,18 +212,18 @@ export default { ...@@ -209,18 +212,18 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
updateUser(this.form).then(response => { updateUser(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success("保存成功") this.$message.success('保存成功')
setTimeout(() => { setTimeout(() => {
// 2秒后跳转列表页 // 2秒后跳转列表页
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, 2000) }, 2000)
} else { } else {
this.$message.error("保存失败") this.$message.error('保存失败')
} }
}) })
} }
......
...@@ -274,8 +274,8 @@ export default { ...@@ -274,8 +274,8 @@ export default {
// 部门列表 // 部门列表
deptOptions: [], deptOptions: [],
defaultProps: { defaultProps: {
children: "children", children: 'children',
label: "deptName" label: 'deptName'
} }
} }
}, },
...@@ -405,8 +405,8 @@ export default { ...@@ -405,8 +405,8 @@ export default {
}, },
/** 节点单击事件 */ /** 节点单击事件 */
handleNodeClick (data) { handleNodeClick (data) {
this.queryParams.deptId = data.id; this.queryParams.deptId = data.id
this.getList(); this.getList()
}, },
toggleAdvanced () { toggleAdvanced () {
this.advanced = !this.advanced this.advanced = !this.advanced
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
showCard (data) { showCard (data) {
Object.assign(this.options, data); Object.assign(this.options, data)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment