fix: 收口管理端页面权限与工作流运行授权
- 页面选项接口改用所属页面权限并返回最小数据视图 - 统一校验工作流引用、租户、状态与定时任务执行主体 - 补充聊天记录权限迁移和权限隔离回归测试
This commit is contained in:
@@ -19,7 +19,6 @@ import {
|
||||
} from 'element-plus';
|
||||
|
||||
import { api } from '#/api/request';
|
||||
import DictSelect from '#/components/dict/DictSelect.vue';
|
||||
import UploadAvatar from '#/components/upload/UploadAvatar.vue';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
@@ -102,6 +101,8 @@ const normalizeEntity = (raw: any = {}) => {
|
||||
const entity = ref<any>(normalizeEntity(defaultEntity));
|
||||
|
||||
const btnLoading = ref(false);
|
||||
const categoryOptions = ref<any[]>([]);
|
||||
let categoryOptionsLoaded = false;
|
||||
const rules = ref({
|
||||
collectionType: [
|
||||
{ required: true, message: $t('message.required'), trigger: 'change' },
|
||||
@@ -145,7 +146,7 @@ const collectionTypeList = [
|
||||
},
|
||||
];
|
||||
|
||||
function openDialog(row: any = {}) {
|
||||
async function openDialog(row: any = {}) {
|
||||
if (row.id) {
|
||||
isAdd.value = false;
|
||||
entity.value = normalizeEntity(row);
|
||||
@@ -154,6 +155,17 @@ function openDialog(row: any = {}) {
|
||||
entity.value = normalizeEntity(defaultEntity);
|
||||
}
|
||||
dialogVisible.value = true;
|
||||
if (!categoryOptionsLoaded) {
|
||||
try {
|
||||
const res = await api.get(
|
||||
'/api/v1/documentCollectionCategory/visibleList',
|
||||
);
|
||||
categoryOptions.value = Array.isArray(res.data) ? res.data : [];
|
||||
categoryOptionsLoaded = true;
|
||||
} catch {
|
||||
categoryOptions.value = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function save() {
|
||||
@@ -251,10 +263,14 @@ defineExpose({
|
||||
prop="categoryId"
|
||||
:label="$t('documentCollection.categoryId')"
|
||||
>
|
||||
<DictSelect
|
||||
v-model="entity.categoryId"
|
||||
dict-code="aiDocumentCollectionCategory"
|
||||
/>
|
||||
<ElSelect v-model="entity.categoryId" clearable filterable>
|
||||
<ElOption
|
||||
v-for="category in categoryOptions"
|
||||
:key="category.id"
|
||||
:label="category.categoryName"
|
||||
:value="category.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem
|
||||
prop="visibilityScope"
|
||||
|
||||
Reference in New Issue
Block a user