async function fetchList() { | async function fetchList() { | ||||
const params = { | const params = { | ||||
...unref(data.searchParams), | ...unref(data.searchParams), | ||||
menuType: 1 | |||||
menuType: 2 | |||||
} | } | ||||
const res = await getMenuList(params) | const res = await getMenuList(params) | ||||
const { menuListVoList, permissionList } = res.data | const { menuListVoList, permissionList } = res.data |
@update:checked-row-keys="handleCheck" | @update:checked-row-keys="handleCheck" | ||||
> | > | ||||
<template #tableTitle> | <template #tableTitle> | ||||
<n-button v-if="permissionStore.includes('task:all:create')" type="primary" @click="handleModal"> 新建 </n-button> | |||||
<n-button v-if="permissionList.includes('task:all:create')" type="primary" @click="handleModal"> {{ getPermissionLabel('task:all:create') }} </n-button> | |||||
</template> | </template> | ||||
</data-table> | </data-table> | ||||
</n-card> | </n-card> | ||||
components: { dataTable, UserModal, headSearch, DrawComp }, | components: { dataTable, UserModal, headSearch, DrawComp }, | ||||
setup() { | setup() { | ||||
getPlatform() | getPlatform() | ||||
const permissionStore = usePermissionStore()// 按钮权限 | |||||
const data = reactive({ | const data = reactive({ | ||||
...toRefs(table), | ...toRefs(table), | ||||
...toRefs(search) | |||||
...toRefs(search), | |||||
permissionList: permissionStore.accessPermissionCodes | |||||
}) | }) | ||||
const permissionStore = usePermissionStore().accessPermissionCodes // 按钮权限 | |||||
const getPermissionLabel = (code) => { | |||||
return permissionStore.accessPermissions.find((item) => { | |||||
return item.code === code | |||||
})?.name || '' | |||||
} | |||||
const status = ['任务待分配', '任务已分配', '飞手已接单', '任务飞行中', '任务已完成'] | const status = ['任务待分配', '任务已分配', '飞手已接单', '任务飞行中', '任务已完成'] | ||||
const loadDataTable = async(res) => { | const loadDataTable = async(res) => { | ||||
const _params = { | const _params = { | ||||
...unref(data.searchParams), | ...unref(data.searchParams), | ||||
handleModal, | handleModal, | ||||
selectedIds, | selectedIds, | ||||
// deleteComplex, | // deleteComplex, | ||||
permissionStore, | |||||
getPermissionLabel, | |||||
handleCheck, | handleCheck, | ||||
roleType | roleType | ||||
} | } |
text: true, | text: true, | ||||
onClick: getRowData.bind(null, row) | onClick: getRowData.bind(null, row) | ||||
}, | }, | ||||
auth: 'basic_list' | |||||
auth: '' | |||||
}, | }, | ||||
{ | { | ||||
label: '编辑', | label: '编辑', |
size="large" | size="large" | ||||
> | > | ||||
<template #tableTitle> | <template #tableTitle> | ||||
<n-button v-if="permissionStore.includes('user:menber:create')" type="primary" @click="handleModal"> 新建 </n-button> | |||||
<n-button v-if="permissionList.includes('user:menber:create')" type="primary" @click="handleModal"> {{ getPermissionLabel('user:menber:create') }} </n-button> | |||||
</template> | </template> | ||||
</data-table> | </data-table> | ||||
</n-card> | </n-card> | ||||
name: 'UserManage', | name: 'UserManage', | ||||
components: { dataTable, UserModal, headSearch }, | components: { dataTable, UserModal, headSearch }, | ||||
setup() { | setup() { | ||||
const permissionStore = usePermissionStore()// 按钮权限 | |||||
const data = reactive({ | const data = reactive({ | ||||
...toRefs(tableData), | ...toRefs(tableData), | ||||
search | |||||
search, | |||||
permissionList: permissionStore.accessPermissionCodes | |||||
}) | }) | ||||
const permissionStore = usePermissionStore().accessPermissionCodes // 按钮权限 | |||||
const getPermissionLabel = (code) => { | |||||
return permissionStore.accessPermissions.find((item) => { | |||||
return item.code === code | |||||
})?.name || '' | |||||
} | |||||
getRoleOptions() | getRoleOptions() | ||||
const loadDataTable = async(res) => { | const loadDataTable = async(res) => { | ||||
...toRefs(data), | ...toRefs(data), | ||||
loadDataTable, | loadDataTable, | ||||
handleModal, | handleModal, | ||||
permissionStore | |||||
getPermissionLabel | |||||
} | } | ||||
} | } | ||||
} | } |