fix: 前端搜索框点击叉号自动搜索
This commit is contained in:
parent
f9f38e945d
commit
b89e6ec53f
|
@ -189,9 +189,9 @@ export function getUserByProjectByOrg(organizationId: string, projectId: string,
|
|||
}
|
||||
|
||||
// 系统或组织-获取项目下的资源池options
|
||||
export function getPoolOptionsByOrgOrSystem(moduleIds: string[], rganizationId?: string) {
|
||||
export function getPoolOptionsByOrgOrSystem(modulesIds: string[], rganizationId?: string) {
|
||||
return MSR.post({
|
||||
url: orgUrl.getProjectPoolByOrgOrSystemUrl,
|
||||
data: { rganizationId, moduleIds },
|
||||
data: { rganizationId, modulesIds },
|
||||
});
|
||||
}
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
|
||||
import { getPoolOptionsByOrgOrSystem } from '@/api/modules/setting/organizationAndProject';
|
||||
|
||||
const showPoolModuleIds = ['uiTest', 'apiTest', 'loadTest'];
|
||||
const options = ref([]);
|
||||
const fieldNames = { value: 'id', label: 'name' };
|
||||
const props = defineProps<{ organizationId?: string; modelValue: string[] }>();
|
||||
const props = defineProps<{ organizationId?: string; modelValue: string[]; moduleIds?: string[] }>();
|
||||
const loading = ref(false);
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: string[]): void;
|
||||
|
@ -23,8 +22,6 @@
|
|||
emit('update:modelValue', v);
|
||||
},
|
||||
});
|
||||
const showPool = computed(() => showPoolModuleIds.some((item) => props.modelValue.includes(item)));
|
||||
|
||||
const loadList = async (arr: string[], id?: string) => {
|
||||
try {
|
||||
loading.value = true;
|
||||
|
@ -38,6 +35,6 @@
|
|||
}
|
||||
};
|
||||
watchEffect(() => {
|
||||
loadList(showPool.value ? props.modelValue : [], props.organizationId);
|
||||
loadList(props.moduleIds || [], props.organizationId);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
allow-clear
|
||||
@press-enter="enterData"
|
||||
@search="searchData"
|
||||
@clear="searchData('')"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="showSystem" v-permission="['SYSTEM_USER_ROLE:READ']" class="mt-2">
|
||||
|
|
|
@ -205,7 +205,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
component: () => import('@/views/project-management/template/components/workFlowTableIndex.vue'),
|
||||
meta: {
|
||||
locale: 'menu.settings.organization.templateManagementWorkFlow',
|
||||
roles: ['*'],
|
||||
roles: ['PROJECT_TEMPLATE:READ+ADD'],
|
||||
breadcrumbs: [
|
||||
{
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE,
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
class="w-[230px]"
|
||||
@search="searchUser"
|
||||
@press-enter="searchUser"
|
||||
@clear="searchUser"
|
||||
></a-input-search>
|
||||
</div>
|
||||
<ms-base-table class="mt-[16px]" v-bind="propsRes" v-on="propsEvent">
|
||||
|
|
|
@ -57,7 +57,11 @@
|
|||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="showPool" field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<MsSystemPool v-model:modelValue="form.resourcePoolIds" :organization-id="currentOrgId" />
|
||||
<MsSystemPool
|
||||
v-model:modelValue="form.resourcePoolIds"
|
||||
:module-ids="form.moduleIds"
|
||||
:organization-id="currentOrgId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item field="description" :label="t('system.organization.description')">
|
||||
<a-textarea
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
class="w-[230px]"
|
||||
@search="searchUser"
|
||||
@press-enter="searchUser"
|
||||
@clear="searchUser"
|
||||
></a-input-search>
|
||||
</div>
|
||||
<ms-base-table class="mt-[16px]" v-bind="propsRes" v-on="propsEvent">
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
allow-clear
|
||||
@press-enter="fetchData"
|
||||
@search="fetchData"
|
||||
@clear="fetchData"
|
||||
></a-input-search>
|
||||
</div>
|
||||
<MsBaseTable v-bind="propsRes" v-on="propsEvent">
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
allow-clear
|
||||
@search="searchUser"
|
||||
@press-enter="searchUser"
|
||||
@clear="searchUser"
|
||||
></a-input-search>
|
||||
</div>
|
||||
<ms-base-table v-bind="propsRes" v-on="propsEvent">
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
allow-clear
|
||||
@search="searchUser"
|
||||
@press-enter="searchUser"
|
||||
@clear="searchUser"
|
||||
></a-input-search>
|
||||
</div>
|
||||
<ms-base-table class="mt-[16px]" v-bind="propsRes" v-on="propsEvent">
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
allow-clear
|
||||
@press-enter="handleEnter"
|
||||
@search="handleSearch"
|
||||
@clear="handleSearch('')"
|
||||
></a-input-search>
|
||||
<a-radio-group v-model="currentTable" class="ml-[14px]" type="button">
|
||||
<a-radio value="organization">{{
|
||||
|
@ -107,7 +108,6 @@
|
|||
currentKeyword.value = (eve.target as HTMLInputElement).value;
|
||||
tableSearch();
|
||||
};
|
||||
|
||||
const handleAddOrganization = () => {
|
||||
if (currentTable.value === 'organization') {
|
||||
organizationVisible.value = true;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
allow-clear
|
||||
@press-enter="handleEnter"
|
||||
@search="handleSearch"
|
||||
@clear="handleSearch('')"
|
||||
></a-input-search>
|
||||
<a-radio-group
|
||||
v-if="couldShowUser && couldShowAuth"
|
||||
|
|
Loading…
Reference in New Issue