fix(全局): bug 修复

This commit is contained in:
baiqi 2024-04-25 13:39:17 +08:00 committed by 刘瑞斌
parent 1fadd7b397
commit 42aba71826
10 changed files with 54 additions and 38 deletions

View File

@ -383,18 +383,20 @@
saveFilePopoverVisible.value = true; saveFilePopoverVisible.value = true;
} }
function handleSaveFileFinish(fileId: string) { function handleSaveFileFinish(fileId: string, fileName: string) {
if (savingFile.value) { if (savingFile.value) {
inputFiles.value = inputFiles.value.map((e) => { inputFiles.value = inputFiles.value.map((e) => {
if (e.value === savingFile.value?.fileId || e.value === savingFile.value?.uid) { if (e.value === savingFile.value?.fileId || e.value === savingFile.value?.uid) {
// uidfileId uidfileId // uidfileId uidfileId
e.value = fileId; e.value = fileId;
e.local = false; e.local = false;
e.label = fileName;
} }
return e; return e;
}); });
savingFile.value.fileId = fileId; savingFile.value.fileId = fileId;
savingFile.value.local = false; savingFile.value.local = false;
savingFile.value.name = fileName;
} }
} }
</script> </script>

View File

@ -42,7 +42,12 @@
</a-tree-select> </a-tree-select>
<div class="flex items-center justify-end gap-[12px]"> <div class="flex items-center justify-end gap-[12px]">
<a-button type="secondary" @click="handleSaveFileCancel">{{ t('common.cancel') }}</a-button> <a-button type="secondary" @click="handleSaveFileCancel">{{ t('common.cancel') }}</a-button>
<a-button type="primary" :loading="saveLoading" @click="handleSaveFileConfirm"> <a-button
type="primary"
:loading="saveLoading"
:disabled="saveFileForm.name.trim() === ''"
@click="handleSaveFileConfirm"
>
{{ t('common.confirm') }} {{ t('common.confirm') }}
</a-button> </a-button>
</div> </div>
@ -75,7 +80,7 @@
} }
); );
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'finish', fileId: string): void; (e: 'finish', fileId: string, fileName: string): void;
}>(); }>();
const appStore = useAppStore(); const appStore = useAppStore();
@ -86,7 +91,7 @@
}); });
const saveFileForm = ref({ const saveFileForm = ref({
name: '', name: '',
moduleId: '', moduleId: 'root',
}); });
const saveLoading = ref(false); const saveLoading = ref(false);
const moduleTree = ref<ModuleTreeNode[]>([]); const moduleTree = ref<ModuleTreeNode[]>([]);
@ -115,6 +120,7 @@
(visible) => { (visible) => {
if (visible) { if (visible) {
initModuleOptions(); initModuleOptions();
saveFileForm.value.name = props.savingFile?.name || '';
} }
}, },
{ {
@ -128,7 +134,7 @@
function handleSaveFileCancel() { function handleSaveFileCancel() {
saveFileForm.value = { saveFileForm.value = {
name: '', name: '',
moduleId: '', moduleId: 'root',
}; };
saveFilePopoverVisible.value = false; saveFilePopoverVisible.value = false;
} }
@ -147,8 +153,9 @@
local: true, local: true,
moduleId: saveFileForm.value.moduleId, moduleId: saveFileForm.value.moduleId,
fileName: saveFileForm.value.name, fileName: saveFileForm.value.name,
originalName: props.savingFile.name || '',
}); });
emit('finish', res); emit('finish', res, `${saveFileForm.value.name}.${props.savingFile.name?.split('.').pop()}`);
Message.success(t('ms.add.attachment.saveAsSuccess')); Message.success(t('ms.add.attachment.saveAsSuccess'));
handleSaveFileCancel(); handleSaveFileCancel();
} }

View File

@ -81,22 +81,22 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref} from 'vue'; import { ref } from 'vue';
import MsButton from '@/components/pure/ms-button/index.vue'; import MsButton from '@/components/pure/ms-button/index.vue';
import MsDrawer from '@/components/pure/ms-drawer/index.vue'; import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsSplitBox from '@/components/pure/ms-split-box/index.vue'; import MsSplitBox from '@/components/pure/ms-split-box/index.vue';
import FileTree from './fileTree.vue'; import FileTree from './fileTree.vue';
import LinkFileTable from './linkFileTable.vue'; import LinkFileTable from './linkFileTable.vue';
import StorageList from './storageList.vue'; import StorageList from './storageList.vue';
import {useI18n} from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import type {AssociatedList} from '@/models/caseManagement/featureCase'; import type { AssociatedList } from '@/models/caseManagement/featureCase';
import type {CommonList, ModuleTreeNode, TableQueryParams} from '@/models/common'; import type { CommonList, ModuleTreeNode, TableQueryParams } from '@/models/common';
import {FileListQueryParams, Repository} from '@/models/projectManagement/file'; import { FileListQueryParams, Repository } from '@/models/projectManagement/file';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps<{ const props = defineProps<{
visible: boolean; visible: boolean;
@ -178,9 +178,9 @@ const { t } = useI18n();
modulesCount.value = await props.getCountRequest(params); modulesCount.value = await props.getCountRequest(params);
myFileCount.value = modulesCount.value.my || 0; myFileCount.value = modulesCount.value.my || 0;
allFileCount.value = modulesCount.value.all; allFileCount.value = modulesCount.value.all;
if(showType.value === 'Storage'){ if (showType.value === 'Storage') {
fileAllCountByStorage.value = modulesCount.value.git; fileAllCountByStorage.value = modulesCount.value.git;
}else { } else {
fileAllCountByStorage.value = modulesCount.value.minio; fileAllCountByStorage.value = modulesCount.value.minio;
} }
} catch (error) { } catch (error) {

View File

@ -111,8 +111,8 @@
<div v-else class="ms-message-item"> <div v-else class="ms-message-item">
<MSAvatar v-if="item.avatar" :avatar="item.avatar" :word="item.userName" /> <MSAvatar v-if="item.avatar" :avatar="item.avatar" :word="item.userName" />
<div class="ml-[8px] flex flex-col"> <div class="ml-[8px] flex flex-col">
<div class="flex items-center overflow-x-hidden"> <div class="flex items-center">
<a-badge v-if="item.status === 'UNREAD'" :count="9" dot :offset="[6, -2]" class="w-full"> <a-badge v-if="item.status === 'UNREAD'" :count="9" dot :offset="[5, 2]">
<a-tooltip :content="item.subject"> <a-tooltip :content="item.subject">
<div class="one-line-text max-w-[300px] font-medium leading-[22px] text-[var(--color-text-1)]"> <div class="one-line-text max-w-[300px] font-medium leading-[22px] text-[var(--color-text-1)]">
{{ item.subject }} {{ item.subject }}

View File

@ -21,7 +21,11 @@
</template> </template>
<template #title="_props"> <template #title="_props">
<div class="flex w-full items-center gap-[4px] overflow-hidden"> <div class="flex w-full items-center gap-[4px] overflow-hidden">
<div v-if="_props.children && _props.children.length > 0" @click.stop="handleExpand(_props)"> <div
v-if="_props.children && _props.children.length > 0"
class="cursor-pointer"
@click.stop="handleExpand(_props)"
>
<icon-caret-down v-if="_props.expanded" class="text-[var(--color-text-4)]" /> <icon-caret-down v-if="_props.expanded" class="text-[var(--color-text-4)]" />
<icon-caret-right v-else class="text-[var(--color-text-4)]" /> <icon-caret-right v-else class="text-[var(--color-text-4)]" />
</div> </div>

View File

@ -93,4 +93,5 @@ export interface TransferFileParams {
fileId: string; fileId: string;
local: true; local: true;
moduleId: string; moduleId: string;
originalName?: string;
} }

View File

@ -217,7 +217,7 @@
:multiple="true" :multiple="true"
:fields="{ :fields="{
id: 'fileId', id: 'fileId',
name: 'fileName', name: 'fileAlias',
}" }"
:file-save-as-source-id="props.fileSaveAsSourceId" :file-save-as-source-id="props.fileSaveAsSourceId"
:file-save-as-api="props.fileSaveAsApi" :file-save-as-api="props.fileSaveAsApi"
@ -329,9 +329,9 @@
class="ms-form-table-input" class="ms-form-table-input"
@change="() => addTableLine(rowIndex, columnConfig.addLineDisabled)" @change="() => addTableLine(rowIndex, columnConfig.addLineDisabled)"
> >
<a-option v-for="item in columnConfig.options" :key="item.value" :value="item.value">{{ <a-option v-for="item in columnConfig.options" :key="item.value" :value="item.value">
t(item.label) {{ t(item.label) }}
}}</a-option> </a-option>
</a-select> </a-select>
</template> </template>
<!-- 匹配值 --> <!-- 匹配值 -->

View File

@ -132,6 +132,7 @@
() => innerVisible.value, () => innerVisible.value,
(val) => { (val) => {
if (val && appStore.currentEnvConfig?.id) { if (val && appStore.currentEnvConfig?.id) {
selectedKey.value = props.selectedKey || '';
initEnvironment(appStore.currentEnvConfig?.id); initEnvironment(appStore.currentEnvConfig?.id);
} }
} }

View File

@ -10,7 +10,7 @@
@adv-search="searchCase" @adv-search="searchCase"
@refresh="searchCase" @refresh="searchCase"
> >
<template #right> <!-- <template #right>
<div class="flex items-center"> <div class="flex items-center">
<a-radio-group v-model:model-value="showType" type="button" class="case-show-type"> <a-radio-group v-model:model-value="showType" type="button" class="case-show-type">
<a-radio value="list" class="show-type-icon p-[2px]"> <a-radio value="list" class="show-type-icon p-[2px]">
@ -21,7 +21,7 @@
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</div> </div>
</template> </template> -->
</MsAdvanceFilter> </MsAdvanceFilter>
</div> </div>
<ms-base-table <ms-base-table
@ -354,7 +354,7 @@
const { t } = useI18n(); const { t } = useI18n();
const { openModal } = useModal(); const { openModal } = useModal();
const keyword = ref(''); const keyword = ref('');
const showType = ref<'list' | 'mind'>('list'); // const showType = ref<'list' | 'mind'>('list');
const filterRowCount = ref(0); const filterRowCount = ref(0);
const filterConfigList = ref<FilterFormItem[]>([]); const filterConfigList = ref<FilterFormItem[]>([]);
const tableParams = ref<Record<string, any>>({}); const tableParams = ref<Record<string, any>>({});
@ -483,6 +483,9 @@
keyword: keyword.value, keyword: keyword.value,
viewFlag: props.onlyMine, viewFlag: props.onlyMine,
filter: { status: statusFilters.value, caseLevel: caseFilters.value }, filter: { status: statusFilters.value, caseLevel: caseFilters.value },
current: propsRes.value.msPagination?.current,
pageSize: propsRes.value.msPagination?.pageSize,
total: propsRes.value.msPagination?.total,
combine: filter combine: filter
? { ? {
...filter.combine, ...filter.combine,
@ -493,9 +496,6 @@
loadList(); loadList();
emit('init', { emit('init', {
...tableParams.value, ...tableParams.value,
current: propsRes.value.msPagination?.current,
pageSize: propsRes.value.msPagination?.pageSize,
total: propsRes.value.msPagination?.total,
moduleIds: [], moduleIds: [],
}); });
} }
@ -581,7 +581,7 @@
try { try {
disassociateLoading.value = true; disassociateLoading.value = true;
await disassociateReviewCase(route.query.id as string, record.caseId); await disassociateReviewCase(route.query.id as string, record.caseId);
emit('refresh'); emit('refresh', tableParams.value);
if (done) { if (done) {
done(); done();
} }
@ -642,7 +642,7 @@
Message.success(t('common.updateSuccess')); Message.success(t('common.updateSuccess'));
resetSelector(); resetSelector();
loadList(); loadList();
emit('refresh'); emit('refresh', tableParams.value);
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(error); console.log(error);
@ -678,7 +678,7 @@
Message.success(t('common.updateSuccess')); Message.success(t('common.updateSuccess'));
dialogVisible.value = false; dialogVisible.value = false;
resetSelector(); resetSelector();
emit('refresh'); emit('refresh', tableParams.value);
loadList(); loadList();
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
@ -737,7 +737,7 @@
Message.success(t('caseManagement.caseReview.reviewSuccess')); Message.success(t('caseManagement.caseReview.reviewSuccess'));
dialogVisible.value = false; dialogVisible.value = false;
resetSelector(); resetSelector();
emit('refresh'); emit('refresh', tableParams.value);
loadList(); loadList();
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console

View File

@ -385,7 +385,8 @@
}); });
} }
function handleRefresh() { function handleRefresh(params: ReviewDetailCaseListQueryParams) {
initModulesCount(params);
initDetail(); initDetail();
} }