fix: 收口管理端页面权限与工作流运行授权
- 页面选项接口改用所属页面权限并返回最小数据视图 - 统一校验工作流引用、租户、状态与定时任务执行主体 - 补充聊天记录权限迁移和权限隔离回归测试
This commit is contained in:
@@ -5,7 +5,15 @@ import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { EasyFlowFormModal } from '@easyflow/common-ui';
|
||||
|
||||
import { ElAlert, ElForm, ElFormItem, ElInput, ElMessage } from 'element-plus';
|
||||
import {
|
||||
ElAlert,
|
||||
ElForm,
|
||||
ElFormItem,
|
||||
ElInput,
|
||||
ElMessage,
|
||||
ElOption,
|
||||
ElSelect,
|
||||
} from 'element-plus';
|
||||
|
||||
import { api } from '#/api/request';
|
||||
import CronPicker from '#/components/cron/CronPicker.vue';
|
||||
@@ -39,6 +47,8 @@ const initEntity = {
|
||||
};
|
||||
const entity = ref<any>(initEntity);
|
||||
const btnLoading = ref(false);
|
||||
const workflowOptions = ref<any[]>([]);
|
||||
let workflowOptionsLoaded = false;
|
||||
// 基础验证规则
|
||||
const baseRules = ref({
|
||||
jobName: [
|
||||
@@ -85,8 +95,22 @@ function openDialog(row: any) {
|
||||
} else {
|
||||
entity.value = { ...initEntity };
|
||||
}
|
||||
void ensureWorkflowOptions();
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
async function ensureWorkflowOptions() {
|
||||
if (workflowOptionsLoaded) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await api.get('/api/v1/sysJob/workflowOptions');
|
||||
workflowOptions.value = Array.isArray(res.data) ? res.data : [];
|
||||
workflowOptionsLoaded = true;
|
||||
} catch {
|
||||
workflowOptions.value = [];
|
||||
ElMessage.error('工作流列表加载失败');
|
||||
}
|
||||
}
|
||||
function save() {
|
||||
if (btnLoading.value || workflowParamsSubmissionBlocked.value) {
|
||||
return;
|
||||
@@ -146,7 +170,9 @@ async function getWorkflowParams(v: any) {
|
||||
workflowParams.value = [];
|
||||
workflowParamsLoadError.value = '';
|
||||
try {
|
||||
const res = await api.get(`/api/v1/workflow/getRunningParameters?id=${v}`);
|
||||
const res = await api.get('/api/v1/sysJob/workflowRunningParameters', {
|
||||
params: { id: v },
|
||||
});
|
||||
if (requestId !== workflowParamsRequestId) {
|
||||
return;
|
||||
}
|
||||
@@ -209,11 +235,19 @@ const str = '"param"';
|
||||
{ required: true, message: $t('message.required'), trigger: 'blur' },
|
||||
]"
|
||||
>
|
||||
<DictSelect
|
||||
<ElSelect
|
||||
v-model="entity.jobParams.workflowId"
|
||||
dict-code="aiWorkFlow"
|
||||
clearable
|
||||
filterable
|
||||
@change="workflowChange"
|
||||
/>
|
||||
>
|
||||
<ElOption
|
||||
v-for="workflow in workflowOptions"
|
||||
:key="workflow.id"
|
||||
:label="workflow.title"
|
||||
:value="workflow.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElAlert
|
||||
v-if="workflowParamsLoadError"
|
||||
|
||||
Reference in New Issue
Block a user