This commit is contained in:
2026-02-03 21:41:12 +08:00
parent b81cad2f56
commit 551bc65785
5 changed files with 32 additions and 26 deletions

View File

@@ -1,5 +1,4 @@
import { download, get, post } from '@/api/request';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;
@@ -13,11 +12,7 @@ const PREFIX = env.VITE_API_PREFIX_PROJECT;
* @returns
*/
export const addDemandApi = (params: any) => {
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
return post(`${PREFIX}demand/addDemandNoPermission`, params);
} else {
return post(`${PREFIX}demand/addDemand`, params);
}
return post(`${PREFIX}demand/addDemand`, params);
};
/**
*
@@ -29,18 +24,10 @@ export const demandListApi = (params: any) => {
return get(`${PREFIX}demand/list`, params);
};
export const editDemandApi = (params: any) => {
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
return post(`${PREFIX}demand/editDemandNoPermission`, params);
} else {
return post(`${PREFIX}demand/editDemand`, params);
}
return post(`${PREFIX}demand/editDemand`, params);
};
export const deleteDemandApi = (params: any) => {
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
return post(`${PREFIX}demand/deleteDemandNoPermission`, params);
} else {
return post(`${PREFIX}demand/deleteDemand`, params);
}
return post(`${PREFIX}demand/deleteDemand`, params);
};
export const issuedTaskApi = (params: any) => {

View File

@@ -1,5 +1,4 @@
import { download, get, post } from '@/api/request';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;
@@ -8,12 +7,14 @@ export const addNodeApi = (params: any) => {
return post(`${PREFIX}node/addNode`, params);
};
// 项目列表
export const queryNodeListApi = (params: any) => {
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
return post(`${PREFIX}node/listNoPermission`, params);
} else {
return post(`${PREFIX}node/list`, params);
}
return post(`${PREFIX}node/list`, params);
};
// 项目列表(不鉴权)
export const queryNodeListNoPermissionApi = (params: any) => {
return post(`${PREFIX}node/listNoPermission`, params);
};
export const getChildrenNodeListApi = (params: any) => {

View File

@@ -18,7 +18,7 @@
</template>
<script lang="ts" setup>
import { queryNodeListApi } from '@/api/project/node';
import { queryNodeListApi, queryNodeListNoPermissionApi } from '@/api/project/node';
import { debounce } from 'lodash-es';
import { ref, onMounted, watch, inject, type Ref } from 'vue';
@@ -29,6 +29,7 @@ interface Props {
fitInputWidth?: boolean;
resStr?: string; // 下拉选择绑定的字段 默认是用uuid
showCodeList?: boolean; // 下拉选择展示的是否是项目编号, 默认展示项目名称
auth?: boolean; // 是否鉴权
}
const props = withDefaults(defineProps<Props>(), {
@@ -38,6 +39,7 @@ const props = withDefaults(defineProps<Props>(), {
fitInputWidth: false,
resStr: 'uuid',
showCodeList: false,
auth: true,
});
const listData = ref<any>([]);
const choseList = ref<any>([]);
@@ -68,7 +70,11 @@ const getlistDataFun = () => {
current: 1,
size: 9999,
};
queryNodeListApi(params).then((res: any) => {
let api: any = queryNodeListApi;
if (!props.auth) {
api = queryNodeListNoPermissionApi;
}
api(params).then((res: any) => {
if (res.code === 200) {
const build = res.data?.data?.map((item: any) => {
return {

View File

@@ -148,6 +148,7 @@
:showCodeList="item.inputMode === 'projectSelect' ? false : true"
:attrs="attrs"
v-model="formData[item.searchKey || item.key]"
:auth="attrs.auth"
:disabled="attrs.disabled || (item.disabled && showDisabled)"
@change="(val: any) => changeFun(item.key, val)"
@clear="clearFun"
@@ -168,6 +169,7 @@
:attrs="attrs"
v-model="formData[item.searchKey || item.key]"
multiple
:auth="attrs.auth"
:disabled="attrs.disabled || (item.disabled && showDisabled)"
@change="(val: any) => changeFun(item.key, val)"
@clear="clearFun"

View File

@@ -7,6 +7,11 @@
tableName="SIMULATION_TASK_DEMAND_CREATE"
:params="demandParams"
:api="demandListApi"
:searchAttrs="{
projectId: {
auth: false,
},
}"
exportFileName="新增待办需求"
:actionList="actionList"
@show="showTaskDetailFun"
@@ -58,11 +63,16 @@
<TableForm
ref="tableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
@change="changeFun($event, 'form')"
@load="loadTableForm"
:formAttrs="{
projectId: {
auth: false,
},
}"
:colNum="2"
:hideKeys="hideKeys.concat(formHideKeys)"
v-model:data="editFormInfo"
@change="changeFun($event, 'form')"
@load="loadTableForm"
>
<template #form-pMemberList>
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">