|
|
@ -10,7 +10,7 @@ const adminStore = useAdminStore(); |
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
|
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
|
|
import { tr } from 'element-plus/es/locales.mjs' |
|
|
import { tr } from 'element-plus/es/locales.mjs' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单验证ref |
|
|
// 表单验证ref |
|
|
const Ref = ref(null) |
|
|
const Ref = ref(null) |
|
|
const roleData = ref([]) |
|
|
const roleData = ref([]) |
|
|
@ -36,7 +36,7 @@ const addRole = ref({ |
|
|
market: '' |
|
|
market: '' |
|
|
}) |
|
|
}) |
|
|
const addRoleMarket = ref([]) |
|
|
const addRoleMarket = ref([]) |
|
|
const channelList = ref(['美股', '港股', 'hc第一频道']) |
|
|
|
|
|
|
|
|
const channelList = ref(['全部']) |
|
|
const getRoleList = async function (val) { |
|
|
const getRoleList = async function (val) { |
|
|
if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) { |
|
|
if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) { |
|
|
ElMessage.error('无此权限') |
|
|
ElMessage.error('无此权限') |
|
|
@ -275,6 +275,23 @@ const getLists = async function () { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取频道列表 |
|
|
|
|
|
const getChannelList = async () => { |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await API({ |
|
|
|
|
|
url: '/role/getChannel', |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('res', res); |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
channelList.value = [...channelList.value, ...res.data] |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log('获取频道列表', res.msg); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
console.log('获取频道列表出错', err); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//金豆过滤 |
|
|
//金豆过滤 |
|
|
const goldenBeanMenuIds = new Set([ |
|
|
const goldenBeanMenuIds = new Set([ |
|
|
permissionMapping.gold_bean_audit, |
|
|
permissionMapping.gold_bean_audit, |
|
|
@ -411,7 +428,8 @@ const permissionEditRoleObj = ref({ |
|
|
market: '', |
|
|
market: '', |
|
|
parentId: null, |
|
|
parentId: null, |
|
|
parentName: '', |
|
|
parentName: '', |
|
|
checkedKeys: [] |
|
|
|
|
|
|
|
|
checkedKeys: [], |
|
|
|
|
|
channel:'' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 编辑角色弹窗 |
|
|
// 编辑角色弹窗 |
|
|
@ -458,6 +476,8 @@ const permissionEditRoleInit = async function (row) { |
|
|
permissionEditRoleObj.value.parentId = row.fatherId |
|
|
permissionEditRoleObj.value.parentId = row.fatherId |
|
|
permissionEditRoleObj.value.parentName = row.fatherName |
|
|
permissionEditRoleObj.value.parentName = row.fatherName |
|
|
permissionEditRoleObj.value.channel = row.channel |
|
|
permissionEditRoleObj.value.channel = row.channel |
|
|
|
|
|
console.log('permissionEditRoleObj.value',permissionEditRoleObj.value); |
|
|
|
|
|
|
|
|
if (EditIds.includes(124)) { |
|
|
if (EditIds.includes(124)) { |
|
|
ifHasChannel.value = true |
|
|
ifHasChannel.value = true |
|
|
} else { |
|
|
} else { |
|
|
@ -533,11 +553,8 @@ const permissionEditRole = async function () { |
|
|
const res = await API({ |
|
|
const res = await API({ |
|
|
url: '/menu/update', |
|
|
url: '/menu/update', |
|
|
data: { |
|
|
data: { |
|
|
"id": permissionEditRoleObj.value.id, |
|
|
|
|
|
"roleName": permissionEditRoleObj.value.roleName, |
|
|
|
|
|
"menuIds": finalCheckedKeys, |
|
|
|
|
|
"fatherId": permissionEditRoleObj.value.parentId, |
|
|
|
|
|
"market": permissionEditRoleObj.value.market |
|
|
|
|
|
|
|
|
...permissionEditRoleObj.value, |
|
|
|
|
|
menuIds: finalCheckedKeys |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
@ -617,6 +634,7 @@ const canEdit = findMenuById(menuTree.value, permissionMapping.edit_role_informa |
|
|
onMounted(async function () { |
|
|
onMounted(async function () { |
|
|
await getRoleList() |
|
|
await getRoleList() |
|
|
await getRoleArea() |
|
|
await getRoleArea() |
|
|
|
|
|
await getChannelList() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
@ -725,7 +743,7 @@ onMounted(async function () { |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-show="ifHasChannel" prop="channel" label="频道名称:" required> |
|
|
<el-form-item v-show="ifHasChannel" prop="channel" label="频道名称:" required> |
|
|
<el-select v-model="addRole.channel" placeholder="请选择频道" style="width: 220px" clearable> |
|
|
|
|
|
|
|
|
<el-select v-model="addRole.channel" placeholder="请选择频道" style="width: 220px" filterable clearable> |
|
|
<el-option v-for="item in channelList" :key="item" :label="item" :value="item" /> |
|
|
<el-option v-for="item in channelList" :key="item" :label="item" :value="item" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|