|
@@ -345,16 +345,25 @@ export default {
|
|
|
return belongTo
|
|
|
},
|
|
|
/** 查询角色列表 */
|
|
|
- getList() {
|
|
|
+ async getList() {
|
|
|
this.loading = true;
|
|
|
+ let sysTime
|
|
|
+ let lk
|
|
|
+ await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
|
|
|
+ sysTime = res.data.sysTime
|
|
|
+ lk = res.data.lk
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
var searchParams = {
|
|
|
currentPage: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
roleName: this.queryParams.roleName,
|
|
|
roleKey: this.queryParams.roleKey,
|
|
|
- status: this.queryParams.status
|
|
|
+ status: this.queryParams.status,
|
|
|
+ sysTime: sysTime,
|
|
|
+ lk: lk
|
|
|
}
|
|
|
- this.$axios.get('/sysRoleController/getAll',
|
|
|
+ await this.$axios.get('/sysRoleController/getAll',
|
|
|
{params: searchParams}).then((res) => {
|
|
|
this.roleList = res.data.records
|
|
|
this.total = res.data.total
|
|
@@ -530,7 +539,7 @@ export default {
|
|
|
this.edit = false;
|
|
|
}, 500),
|
|
|
/** 修改按钮操作 */
|
|
|
- handleUpdate: debounce(function () {
|
|
|
+ handleUpdate: debounce(async function () {
|
|
|
this.reset();
|
|
|
const _selectData = this.$refs.xTable.getRadioRecord(true)
|
|
|
if (_selectData == null) {
|
|
@@ -544,27 +553,49 @@ export default {
|
|
|
if (_selectData.roleKey == 'xtgly' || _selectData.roleKey == 'sjgly') {
|
|
|
this.edit=true;
|
|
|
}
|
|
|
-
|
|
|
const roleId = _selectData.roleId
|
|
|
- // const roleMenu = this.getRoleMenuTreeselect(roleId);
|
|
|
+
|
|
|
+ let sysTime1
|
|
|
+ let lk1
|
|
|
+ await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
|
|
|
+ sysTime1 = res.data.sysTime
|
|
|
+ lk1 = res.data.lk
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+ var param1 = {
|
|
|
+ roleId: roleId,
|
|
|
+ sysTime: sysTime1,
|
|
|
+ lk: lk1
|
|
|
+ }
|
|
|
+
|
|
|
+ await this.$axios.get('/sysMenuController/roleMenuTreeselect',
|
|
|
+ {params: param1}).then((res) => {
|
|
|
+ this.menuOptions = res.data.menus;
|
|
|
+ let checkedKeys = res.data.checkedKeys
|
|
|
+ checkedKeys.forEach((v) => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.menu.setChecked(v, true, false);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ let sysTime
|
|
|
+ let lk
|
|
|
+ await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
|
|
|
+ sysTime = res.data.sysTime
|
|
|
+ lk = res.data.lk
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+
|
|
|
var param = {
|
|
|
- roleId: roleId
|
|
|
+ roleId: roleId,
|
|
|
+ sysTime: sysTime,
|
|
|
+ lk: lk
|
|
|
}
|
|
|
- this.$axios.get('/sysRoleController/getInfo',
|
|
|
+ await this.$axios.get('/sysRoleController/getInfo',
|
|
|
{params: param}).then((res2) => {
|
|
|
this.form = res2.data;
|
|
|
this.open = true;
|
|
|
- this.$axios.get('/sysMenuController/roleMenuTreeselect',
|
|
|
- {params: param}).then((res) => {
|
|
|
- this.menuOptions = res.data.menus;
|
|
|
- let checkedKeys = res.data.checkedKeys
|
|
|
- console.log(checkedKeys)
|
|
|
- checkedKeys.forEach((v) => {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.menu.setChecked(v, true, false);
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
})
|
|
|
this.title = "修改角色";
|
|
|
}, 1000),
|
|
@@ -581,7 +612,7 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm: debounce(function () {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate(async valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.roleKey.trim() == 'xtgly' || this.form.roleKey.trim() == 'sjgly') {
|
|
|
if (this.form.builtIn != '0') {
|
|
@@ -593,6 +624,17 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ let sysTime
|
|
|
+ let lk
|
|
|
+ await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
|
|
|
+ sysTime = res.data.sysTime
|
|
|
+ lk = res.data.lk
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+ this.form.sysTime = sysTime
|
|
|
+ this.form.lk = lk
|
|
|
+
|
|
|
if (this.form.roleId != undefined) {
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys();
|
|
|
// 更新操作
|
|
@@ -608,12 +650,10 @@ export default {
|
|
|
}
|
|
|
this.loading = false
|
|
|
}).catch((error) => {
|
|
|
- // this.$message.error(error)
|
|
|
this.loading = false
|
|
|
})
|
|
|
} else {
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys();
|
|
|
-
|
|
|
this.$axios.post('/sysRoleController/addRole', this.form).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
this.$message.success('新增成功')
|
|
@@ -626,7 +666,6 @@ export default {
|
|
|
}
|
|
|
this.loading = false
|
|
|
}).catch((error) => {
|
|
|
- // this.$message.error(error)
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
@@ -675,11 +714,21 @@ export default {
|
|
|
/**
|
|
|
* 删除提交
|
|
|
*/
|
|
|
- doDelete: debounce(function (_selectData) {
|
|
|
+ doDelete: debounce(async function (_selectData) {
|
|
|
+ let sysTime
|
|
|
+ let lk
|
|
|
+ await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
|
|
|
+ sysTime = res.data.sysTime
|
|
|
+ lk = res.data.lk
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+
|
|
|
const param = {
|
|
|
- roleId: _selectData.roleId
|
|
|
+ roleId: _selectData.roleId,
|
|
|
+ sysTime: sysTime,
|
|
|
+ lk: lk
|
|
|
}
|
|
|
- this.$axios.post('/sysRoleController/delRole', param).then((res) => {
|
|
|
+ await this.$axios.post('/sysRoleController/delRole', param).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
this.$message({
|
|
|
type: 'success',
|