Commit 60ce609a by yuwei

2.0.0项目初始化

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