Browse Source

频道频道完成

zhangrenyuan/feature-20251104133449-现金管理二期
ZhangYong 3 weeks ago
parent
commit
25234e9b70
  1. 36
      src/views/permissions/rolePermission.vue

36
src/views/permissions/rolePermission.vue

@ -10,7 +10,7 @@ const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore);
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js"
import { tr } from 'element-plus/es/locales.mjs'
// ref
const Ref = ref(null)
const roleData = ref([])
@ -36,7 +36,7 @@ const addRole = ref({
market: ''
})
const addRoleMarket = ref([])
const channelList = ref(['美股', '港股', 'hc第一频道'])
const channelList = ref(['全部'])
const getRoleList = async function (val) {
if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) {
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([
permissionMapping.gold_bean_audit,
@ -411,7 +428,8 @@ const permissionEditRoleObj = ref({
market: '',
parentId: null,
parentName: '',
checkedKeys: []
checkedKeys: [],
channel:''
})
//
@ -458,6 +476,8 @@ const permissionEditRoleInit = async function (row) {
permissionEditRoleObj.value.parentId = row.fatherId
permissionEditRoleObj.value.parentName = row.fatherName
permissionEditRoleObj.value.channel = row.channel
console.log('permissionEditRoleObj.value',permissionEditRoleObj.value);
if (EditIds.includes(124)) {
ifHasChannel.value = true
} else {
@ -533,11 +553,8 @@ const permissionEditRole = async function () {
const res = await API({
url: '/menu/update',
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) {
@ -617,6 +634,7 @@ const canEdit = findMenuById(menuTree.value, permissionMapping.edit_role_informa
onMounted(async function () {
await getRoleList()
await getRoleArea()
await getChannelList()
})
</script>
@ -725,7 +743,7 @@ onMounted(async function () {
</div>
</el-form-item>
<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-select>
</el-form-item>

Loading…
Cancel
Save