fix(全局): 问题修复

This commit is contained in:
baiqi 2024-02-03 15:01:30 +08:00 committed by Craftsman
parent 0e5a05d499
commit c6a73e6804
6 changed files with 243 additions and 133 deletions

View File

@ -1,24 +0,0 @@
<svg width="193" height="40" viewBox="0 0 193 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M62.3111 31.1105L61.1382 19.3784L57.8421 31.1105H54.0036L50.7837 19.3784L49.5689 31.1105L44.2632 31.0657L46.8526 13.7484H53.6121L55.9296 21.9887L58.2694 13.7484H64.8706L67.5048 31.112H62.3111V31.1105Z" fill="#783887"/>
<path d="M80.3396 23.8429V26.0363H73.3574L73.3439 26.4353C73.3439 27.272 73.6771 27.7546 74.1896 27.9354C74.5886 28.049 75.0413 28.1043 75.5463 28.1043H75.8511C77.2078 28.1043 79.1906 27.798 80.6145 27.5051H80.6369L80.0632 30.6025C80.0632 30.6399 79.3968 30.9237 78.1013 31.1344C77.287 31.2256 76.3532 31.2704 75.2983 31.2704C72.5849 31.2704 70.8337 30.3545 70.0418 28.5241C69.7475 27.801 69.4771 27.0464 69.4771 26.256V23.2946C69.4771 21.1236 70.514 19.6772 72.3369 18.9615C73.1437 18.6985 74.0058 18.5656 74.9263 18.5656C77.4813 18.5656 79.1383 19.3978 79.9003 21.0638C80.1932 21.7167 80.3396 22.6446 80.3396 23.8429ZM76.6819 23.2662C76.6819 22.407 76.4249 21.8333 76.0558 21.6749C75.7764 21.4866 75.3461 21.4582 74.9472 21.4582C73.9296 21.4582 73.4216 21.9364 73.4216 22.8941L73.3589 23.4709H76.6834V23.2662H76.6819Z" fill="#783887"/>
<path d="M103.87 23.8429V26.0363H96.8877L96.8742 26.4353C96.8742 27.272 97.2074 27.7546 97.7199 27.9354C98.1188 28.049 98.5716 28.1043 99.0766 28.1043H99.3814C100.738 28.1043 102.721 27.798 104.145 27.5051H104.167L103.593 30.6025C103.593 30.6399 102.927 30.9237 101.632 31.1344C100.817 31.2256 99.8834 31.2704 98.8286 31.2704C96.1152 31.2704 94.364 30.3545 93.5721 28.5241C93.2778 27.801 93.0073 27.0464 93.0073 26.256V23.2946C93.0073 21.1236 94.0443 19.6772 95.8671 18.9615C96.674 18.6985 97.5361 18.5656 98.4565 18.5656C101.012 18.5656 102.669 19.3978 103.431 21.0638C103.723 21.7167 103.87 22.6446 103.87 23.8429ZM100.212 23.2662C100.212 22.407 99.9552 21.8333 99.5861 21.6749C99.3067 21.4866 98.8764 21.4582 98.4774 21.4582C97.4599 21.4582 96.9519 21.9364 96.9519 22.8941L96.8891 23.4709H100.214V23.2662H100.212Z" fill="#783887"/>
<path d="M168.813 23.8429V26.0363H161.831L161.817 26.4353C161.817 27.272 162.15 27.7546 162.663 27.9354C163.062 28.049 163.515 28.1043 164.02 28.1043H164.324C165.681 28.1043 167.664 27.798 169.088 27.5051H169.11L168.536 30.6025C168.536 30.6399 167.87 30.9237 166.575 31.1344C165.76 31.2256 164.826 31.2704 163.772 31.2704C161.058 31.2704 159.307 30.3545 158.515 28.5241C158.221 27.801 157.95 27.0464 157.95 26.256V23.2946C157.95 21.1236 158.986 19.6772 160.81 18.9615C161.617 18.6985 162.479 18.5656 163.4 18.5656C165.955 18.5656 167.612 19.3978 168.374 21.0638C168.666 21.7167 168.813 22.6446 168.813 23.8429ZM165.155 23.2662C165.155 22.407 164.898 21.8333 164.529 21.6749C164.25 21.4866 163.819 21.4582 163.42 21.4582C162.403 21.4582 161.895 21.9364 161.895 22.8941L161.832 23.4709H165.157V23.2662H165.155Z" fill="#783887"/>
<path d="M192.345 23.8429V26.0363H185.363L185.35 26.4353C185.35 27.272 185.683 27.7546 186.195 27.9354C186.594 28.049 187.047 28.1043 187.552 28.1043H187.857C189.214 28.1043 191.196 27.798 192.62 27.5051H192.643L192.069 30.6025C192.069 30.6399 191.403 30.9237 190.107 31.1344C189.293 31.2256 188.359 31.2704 187.304 31.2704C184.591 31.2704 182.839 30.3545 182.048 28.5241C181.753 27.801 181.483 27.0464 181.483 26.256V23.2946C181.483 21.1236 182.52 19.6772 184.343 18.9615C185.149 18.6985 186.012 18.5656 186.932 18.5656C189.487 18.5656 191.144 19.3978 191.906 21.0638C192.197 21.7167 192.345 22.6446 192.345 23.8429ZM188.688 23.2662C188.688 22.407 188.431 21.8333 188.062 21.6749C187.782 21.4866 187.352 21.4582 186.953 21.4582C185.935 21.4582 185.427 21.9364 185.427 22.8941L185.365 23.4709H188.689V23.2662H188.688Z" fill="#783887"/>
<path d="M91.4874 31.1569H89.2402C88.8487 31.1569 88.5126 31.145 88.2347 31.1226C87.4891 31.0703 86.878 30.9298 86.4028 30.7042C85.8231 30.4263 85.3823 29.9989 85.0805 29.4267C84.7413 28.7782 84.5725 27.9116 84.5725 26.8268L84.5501 21.9439H82.6958V18.7673H84.5501V16.308L86.4058 16.2557L88.3482 16.0106V18.7673H91.2424L90.8464 21.9439H88.3482V26.6132C88.3482 26.7193 88.3512 26.8089 88.3602 26.8851C88.3751 27.0809 88.405 27.2437 88.4513 27.3707C88.5649 27.68 88.8054 27.8952 89.1745 28.0147C89.4614 28.1357 91.1752 28.1118 91.1752 28.1118L91.4874 31.1569Z" fill="#783887"/>
<path d="M114.991 18.7882L114.935 21.7377C114.609 21.7212 113.685 21.7242 112.719 21.9454C111.856 22.1426 110.959 22.546 110.447 22.7343V31.1105H106.671V18.6761H110.134C110.134 18.6761 110.051 19.3246 110.118 19.5801L111 19.2529C111.527 19.0721 112.096 18.9466 112.803 18.8569C113.871 18.721 114.514 18.7792 114.991 18.7882Z" fill="#783887"/>
<path d="M180.223 18.7882L180.167 21.7377C179.842 21.7212 178.917 21.7242 177.952 21.9454C177.088 22.1426 176.191 22.546 175.679 22.7343V31.1105H171.903V18.6761H175.367C175.367 18.6761 175.283 19.3246 175.35 19.5801L176.232 19.2529C176.759 19.0721 177.328 18.9466 178.035 18.8569C179.102 18.721 179.746 18.7792 180.223 18.7882Z" fill="#783887"/>
<path d="M122.347 31.6365C121.458 31.6365 120.483 31.5797 119.42 31.4676C119.014 31.4228 118.596 31.369 118.165 31.3092L116.502 31.1508L116.538 26.8716L119.145 27.2795C119.145 27.2795 120.17 27.4259 120.638 27.4722C121.195 27.5245 121.701 27.5514 122.153 27.5514C123.795 27.5514 124.746 27.1779 125.003 26.4323C125.146 26.123 125.139 25.8212 124.98 25.5283C124.822 25.2041 124.487 24.9262 123.975 24.6916C123.756 24.5945 123.482 24.4914 123.15 24.3868L122.177 24.0924C121.747 23.9864 121.363 23.8818 121.024 23.7757C120.586 23.6397 120.187 23.4963 119.825 23.3454C118.929 22.9688 118.231 22.531 117.734 22.0335C117.258 21.5285 116.954 20.9114 116.818 20.1792C116.719 19.6593 116.709 19.0676 116.783 18.4042C116.986 16.4902 117.804 15.1753 119.237 14.4596C119.772 14.1727 120.416 13.9665 121.17 13.838C121.464 13.7932 121.799 13.7558 122.176 13.7245L123.148 13.6572H123.804C124.55 13.6572 125.372 13.7021 126.268 13.7932L127.365 13.9172L128.639 14.0861L128.665 17.8409C128.175 17.7198 127.558 17.6108 126.811 17.5137C125.853 17.3777 124.986 17.3104 124.211 17.3104C122.492 17.3104 121.899 17.675 121.597 18.452C121.484 18.7762 121.476 19.1019 121.509 19.4202C121.55 19.7982 121.526 19.8983 122.289 20.2943C122.522 20.4004 122.817 20.5124 123.171 20.6335L125.409 21.2999C125.839 21.4358 126.223 21.5748 126.563 21.7182C127.384 22.0649 128.006 22.4638 128.427 22.9165C128.925 23.4141 129.245 24.0357 129.388 24.7812C129.485 25.3162 129.497 25.8974 129.422 26.5219C129.219 28.421 128.27 30.1259 126.837 30.8565C126.31 31.1434 125.666 31.3466 124.904 31.4676C124.61 31.5124 124.275 31.5498 123.898 31.5812L123.027 31.6379H122.347V31.6365Z" fill="#783887"/>
<path d="M131.877 18.7224H135.315L135.212 19.5368C135.559 19.356 135.898 19.2021 136.23 19.0736C136.636 18.9152 137.04 18.7986 137.44 18.7224C138.42 18.5192 139.366 18.5611 140.277 18.8465C140.865 19.0347 141.37 19.3664 141.792 19.8416C141.951 20.0149 142.094 20.2106 142.221 20.4288L142.368 20.6888C142.405 20.7635 142.442 20.8427 142.481 20.9263C142.64 21.3551 142.804 21.8407 142.873 22.3607C142.955 22.9479 143.034 23.695 143.034 24.6438V25.3475C143.034 27.1943 142.924 28.1909 142.568 28.8723C142.078 30.0258 140.9 30.6115 138.625 30.6832C138.319 30.6922 137.833 30.6847 137.328 30.6697L136.484 30.6473C136.171 30.6488 135.95 30.6324 135.701 30.6399V35.9949L131.88 36.2459V18.7224H131.877ZM135.698 27.4528C136.424 27.5888 136.839 27.5783 137.455 27.5425L138.091 27.4603C138.8 27.3019 139.101 26.8223 139.101 26.0603V23.683C139.101 23.3364 139.072 23.0809 139.01 22.9151C138.785 22.1471 138.159 21.8452 137.134 22.0111L136.715 22.0783L135.992 22.2815L135.698 22.3831V27.4528Z" fill="#783887"/>
<path d="M156.277 24.3779V31.1345H152.434V23.7907C152.434 23.329 152.165 22.6596 151.627 22.3443C151.243 22.1187 150.596 22.1576 150.384 22.1919C149.873 22.2741 149.3 22.5834 149.032 22.8299V31.1345H145.212V13.2733L149.032 13.2494V19.5622C149.5 19.4038 150 19.2066 150.535 19.1244C150.972 19.0572 151.433 18.981 151.802 18.981C153.996 18.981 155.161 19.6011 155.696 20.7471C155.989 21.1759 156.277 22.434 156.277 24.3779Z" fill="#783887"/>
<g clip-path="url(#clip0_690_192454)">
<path d="M17.3111 0.531247L34.1408 10.2484V29.6811L17.3111 39.3983L0.481388 29.6811V10.2484L17.3111 0.531247ZM17.3111 0L0.0206299 9.98195V29.9458L17.3111 39.9278L34.6016 29.9458V9.98195L17.3111 0Z" fill="#783887"/>
<path d="M2.73364 11.2302L17.3094 2.81445L31.8869 11.2302L17.3094 19.6459L2.73364 11.2302Z" fill="#783887"/>
<path d="M2.4585 11.7081V28.5396L17.0343 36.9553V20.1238L2.4585 11.7081ZM12.4576 30.7952L12.449 24.8655L10.3206 29.5402L8.48446 28.4639L7.49761 21.96L6.36463 27.2192L3.82874 25.7097L5.88324 18.1708L9.11542 20.0671L9.83578 24.6506L11.3436 21.3737L14.5001 23.2254L14.9419 32.2514L12.4576 30.7952Z" fill="#783887"/>
<path d="M17.5862 20.1238V36.9553L32.162 28.5396V11.7081L17.5862 20.1238ZM29.0742 25.8455C28.9899 26.975 28.4725 28.1665 27.6593 28.9161C27.3601 29.2015 26.9922 29.468 26.5555 29.7121C26.387 29.8066 26.1945 29.9046 25.9778 30.0095L25.4775 30.2433L25.0873 30.4015C24.5749 30.6078 24.011 30.8021 23.3972 30.9843C23.1617 31.0531 22.9193 31.1201 22.6717 31.1855L21.7107 31.4812L21.6574 29.0347L23.1669 28.6616C23.1669 28.6616 23.76 28.5069 24.0299 28.4244C24.3514 28.3247 24.6437 28.2232 24.905 28.1183C25.8523 27.7367 26.3939 27.3034 26.528 26.8186C26.6054 26.6088 26.595 26.4386 26.4988 26.308C26.4025 26.1601 26.203 26.0793 25.9039 26.0656C25.7767 26.0604 25.6151 26.0673 25.4225 26.0828L24.8569 26.1412C24.6076 26.1808 24.3841 26.21 24.1864 26.2289C23.9319 26.253 23.6998 26.265 23.4884 26.2616C22.9657 26.2547 22.5548 26.167 22.2608 26.0002C21.9789 25.8231 21.7915 25.5412 21.7003 25.1561C21.635 24.8827 21.6178 24.5475 21.6505 24.152C21.7347 23.0139 22.1834 22.0752 22.9967 21.3342C23.301 21.0471 23.6689 20.7789 24.1004 20.5313C24.2689 20.4367 24.4614 20.3387 24.6781 20.2339L25.2368 19.9691L25.6151 19.8161C26.0449 19.6425 26.5194 19.4774 27.0386 19.321L27.673 19.137L28.4106 18.9376L28.4896 21.0711C28.2043 21.1158 27.8466 21.1967 27.4151 21.3153C26.8615 21.4597 26.3595 21.623 25.9125 21.8035C24.9222 22.2024 24.5852 22.548 24.4253 23.0603C24.3652 23.2718 24.3669 23.4592 24.391 23.6328C24.4202 23.8391 24.4082 23.901 24.8552 23.9509C24.991 23.956 25.1629 23.9526 25.3692 23.9389L26.6707 23.7996C26.92 23.7772 27.1452 23.7669 27.3429 23.7704C27.8226 23.7772 28.1871 23.8598 28.4381 24.0197C28.7338 24.1881 28.9281 24.4684 29.0243 24.8586C29.0897 25.144 29.1069 25.4707 29.0742 25.8455Z" fill="#783887"/>
</g>
<defs>
<clipPath id="clip0_690_192454">
<rect width="34.6136" height="40" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -11,7 +11,7 @@
<div class="float-left">
<a-select
v-if="props?.moduleOptions"
v-model="caseType"
v-model:model-value="caseType"
class="ml-2 max-w-[100px]"
:placeholder="t('caseManagement.featureCase.PleaseSelect')"
>
@ -88,7 +88,8 @@
</div>
</div>
</template>
<template #right>
<!--TODO:暂无版本-->
<!-- <template #right>
<a-select
v-model:model-value="version"
:options="versionOptions"
@ -96,7 +97,7 @@
class="w-[200px]"
allow-clear
/>
</template>
</template> -->
</MsAdvanceFilter>
<ms-base-table v-bind="propsRes" no-disable class="mt-[16px]" v-on="propsEvent">
<template #caseLevel="{ record }">
@ -191,7 +192,7 @@
};
});
const activeFolder = ref('');
const activeFolder = ref('all');
const activeFolderName = ref(t('ms.case.associate.allCase'));
const filterRowCount = ref(0);
@ -291,20 +292,20 @@
const keyword = ref('');
const version = ref('');
const versionOptions = ref([
{
label: '全部',
value: 'all',
},
{
label: '版本1',
value: '1',
},
{
label: '版本2',
value: '2',
},
]);
// const versionOptions = ref([
// {
// label: '',
// value: 'all',
// },
// {
// label: '1',
// value: '1',
// },
// {
// label: '2',
// value: '2',
// },
// ]);
const columns: MsTableColumn = [
{
@ -555,6 +556,13 @@
function cancel() {
innerVisible.value = false;
keyword.value = '';
version.value = '';
searchParams.value = {
moduleIds: [],
version: '',
};
activeFolder.value = 'all';
resetSelector();
emit('close');
}
@ -567,6 +575,8 @@
initModules();
searchCase();
initFilter();
} else {
cancel();
}
}
);
@ -590,7 +600,6 @@
searchCase();
resetSelector();
initModules();
searchCase();
}
}
);

View File

@ -16,9 +16,12 @@
import { useAppStore, useUserStore } from '@/store';
import useLicenseStore from '@/store/modules/setting/license';
import { openWindow, regexUrl } from '@/utils';
import { scrollIntoView } from '@/utils/dom';
import { getFisrtRouterNameByCurrentRoute } from '@/utils/permission';
import { listenerRouteChange } from '@/utils/route-listener';
import { SettingRouteEnum } from '@/enums/routeEnum';
import useMenuTree from './use-menu-tree';
import type { RouteMeta } from 'vue-router';
@ -126,6 +129,7 @@
const personalMenusVisible = ref(false);
const personalDrawerVisible = ref(false);
const switchOrgVisible = ref(false);
const menuSwitchOrgVisible = ref(false);
const orgKeyword = ref('');
const originOrgList = ref<{ id: string; name: string }[]>([]);
const orgList = computed(() => originOrgList.value.filter((e) => e.name.includes(orgKeyword.value)));
@ -190,16 +194,19 @@
const copyPersonalMenus = ref(cloneDeep(personalMenus));
const licenseStore = useLicenseStore();
const xPack = computed(() => licenseStore.hasLicense());
const orgListLoading = ref(false);
async function getOrgList() {
try {
orgListLoading.value = true;
const res = await getOrgOptions();
originOrgList.value = res || [];
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
orgListLoading.value = false;
}
}
@ -208,7 +215,6 @@
async (val) => {
if (val) {
personalMenus.value = [...copyPersonalMenus.value];
getOrgList();
} else {
personalMenus.value.splice(1, 1);
}
@ -226,31 +232,32 @@
}
}
);
const personalInfoMenu = () => {
return (
<a-trigger
v-model:popup-visible={personalMenusVisible.value}
trigger="click"
unmount-on-close={false}
popup-offset={4}
position="right"
class={['arco-trigger-menu absolute', personalMenusVisible.value ? 'block' : 'hidden']}
v-slots={{
content: () => (
<div class="arco-trigger-menu-inner">
{personalMenus.value.map((e) => {
if (e.divider) {
return e.divider;
watchEffect(() => {
if (switchOrgVisible.value || menuSwitchOrgVisible.value) {
getOrgList();
nextTick(() => {
//
const activeOrgDom = document.querySelector('.switch-org-dropdown-list')?.querySelector('.active-org');
if (activeOrgDom) {
scrollIntoView(activeOrgDom);
}
if (e.isTrigger) {
return (
});
} else {
orgKeyword.value = '';
}
});
// trigger
const orgTrigger = (e, visible: Ref, slot: (item) => VNode) => (
<a-trigger
v-model:popup-visible={switchOrgVisible.value}
v-model:popup-visible={visible.value}
trigger="click"
unmount-on-close={false}
unmount-on-close={true}
popup-offset={14}
position="right"
class={['arco-trigger-menu switch-org-dropdown', switchOrgVisible.value ? 'block' : 'hidden']}
mouse-enter-delay={500}
class={['arco-trigger-menu switch-org-dropdown', visible.value ? 'block' : 'hidden']}
v-slots={{
content: () => (
<div class="arco-trigger-menu-inner">
@ -259,6 +266,10 @@
placeholder={t('personal.searchOrgPlaceholder')}
/>
<a-divider margin="4px" />
<a-spin class="flex w-full" loading={orgListLoading.value}>
{orgList.value.length === 0 && orgKeyword.value !== '' ? (
<a-empty>{t('common.noData')}</a-empty>
) : (
<div class="switch-org-dropdown-list">
{orgList.value.map((item) => (
<div
@ -287,25 +298,48 @@
</div>
))}
</div>
)}
</a-spin>
</div>
),
}}
>
{slot(e)}
</a-trigger>
);
//
const personalInfoMenu = () => {
return (
<a-trigger
v-model:popup-visible={personalMenusVisible.value}
trigger="click"
unmount-on-close={false}
popup-offset={4}
position="right"
class={['arco-trigger-menu absolute', personalMenusVisible.value ? 'block' : 'hidden']}
v-slots={{
content: () => (
<div class="arco-trigger-menu-inner">
{personalMenus.value.map((e) => {
if (e.divider) {
return e.divider;
}
if (e.isTrigger) {
return orgTrigger(e, switchOrgVisible, (item) => (
<div
class={
isActiveSwitchOrg.value ? 'active-org arco-trigger-menu-item' : 'arco-trigger-menu-item'
}
onClick={() => {
if (typeof e.event === 'function') {
e.event();
if (typeof item.event === 'function') {
item.event();
}
}}
>
{e.icon()}
{e.label}
{item.icon()}
{item.label}
</div>
</a-trigger>
);
));
}
return (
<div
@ -336,6 +370,7 @@
</a-trigger>
);
};
//
const personalInfoDrawer = () => {
return (
<MsPersonInfoDrawer
@ -347,6 +382,40 @@
);
};
let mouseEnterTimer;
//
const renderMenuItem = (element, icon) =>
element?.name === SettingRouteEnum.SETTING_ORGANIZATION ? (
orgTrigger(element, menuSwitchOrgVisible, () => (
<a-menu-item
key={element?.name}
v-slots={{ icon }}
onClick={() => goto(element)}
onMouseenter={() => {
if (xPack.value) {
// xpack
mouseEnterTimer = setTimeout(() => {
menuSwitchOrgVisible.value = true;
}, 500);
}
}}
onMouseleave={() => {
clearTimeout(mouseEnterTimer);
}}
>
<div class="inline-flex w-[calc(100%-34px)] items-center justify-between !bg-transparent">
{t(element?.meta?.locale || '')}
<MsIcon type="icon-icon_switch_outlined1" class="text-[var(--color-text-4)]" />
</div>
</a-menu-item>
))
) : (
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={() => goto(element)}>
{t(element?.meta?.locale || '')}
</a-menu-item>
);
//
const renderSubMenu = () => {
function travel(_route: (RouteRecordRaw | null)[] | null, nodes = []) {
if (_route) {
@ -365,9 +434,7 @@
{travel(element?.children)}
</a-sub-menu>
) : (
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={() => goto(element)}>
{t(element?.meta?.locale || '')}
</a-menu-item>
renderMenuItem(element, icon)
);
nodes.push(node as never);
});
@ -439,6 +506,9 @@
.arco-icon:hover {
background-color: rgb(var(--primary-1)) !important;
}
.arco-menu-indent-list {
@apply !bg-transparent;
}
.arco-menu-item-inner,
.arco-menu-item-inner:hover {
@apply !bg-transparent;
@ -522,9 +592,10 @@
.arco-trigger-popup-wrapper {
@apply max-h-full;
.switch-org-dropdown-list {
@apply overflow-y-auto;
@apply w-full overflow-y-auto;
.ms-scroll-bar();
min-height: 30px;
max-height: 200px;
}
}

View File

@ -394,24 +394,65 @@ export default defineComponent(
tooltip = values.map((e) => e.tooltipContent || e[props.labelKey || 'label']).join('');
} else {
// 非对象模式下,需要根据 valueKey 取 label
tooltip = remoteOriginOptions.value
.filter((e) => values.includes(e[props.valueKey || 'value']))
.map((e) => e[props.labelKey || 'label'])
.join('');
for (let i = 0; i < values.length; i++) {
for (let j = 0; j < remoteOriginOptions.value.length; j++) {
const optItem = remoteOriginOptions.value[j];
if (optItem[props.valueKey || 'value'] === values[i]) {
tooltip += optItem[props.labelKey || 'label'];
if (i !== values.length - 1) {
tooltip += '';
}
break;
}
}
}
}
return tooltip;
});
const popupVisible = ref(false);
const disabledTooltip = computed(() => {
if (maxTagCount.value === 0 || maxTagCount.value === Infinity) {
// 不限制标签数量时不会出现 +N 隐藏已选项,展示单个标签的 tooltip 即可
return true;
}
if (popupVisible.value) {
// 弹出层展开时不展示 tooltip
return true;
}
if (typeof innerValue.value === 'string' && innerValue.value.trim() === '') {
return true;
}
if (Array.isArray(innerValue.value) && innerValue.value.length === 0) {
return true;
}
return false;
});
const allowClear = computed(() => {
if (props.atLeastOne && Array.isArray(innerValue.value)) {
return innerValue.value.length > 1 && props.allowClear;
}
return props.allowClear;
});
return () => (
<div class="w-full">
<a-tooltip content={selectFullTooltip.value} position="top" mouse-enter-delay={500} mini>
<a-tooltip
content={selectFullTooltip.value}
class={disabledTooltip.value ? 'opacity-0' : ''}
position="top"
mouse-enter-delay={300}
mini
>
<a-select
ref={selectRef}
class="ms-select"
default-value={innerValue}
default-value={innerValue.value}
input-value={inputValue.value}
popup-visible={popupVisible.value}
placeholder={t(props.placeholder || '')}
allow-clear={props.allowClear}
allow-clear={allowClear.value}
allow-search={props.allowSearch}
filter-option={true}
loading={loading.value}
@ -427,6 +468,7 @@ export default defineComponent(
onChange={handleChange}
onSearch={handleSearch}
onPopupVisibleChange={(val: boolean) => {
popupVisible.value = val;
if (val) {
handleSearch('', true);
} else {
@ -452,12 +494,15 @@ export default defineComponent(
{{
prefix: props.prefix ? () => t(props.prefix || '') : null,
label: ({ data }: { data: SelectOptionData }) => (
// 在不限制标签数量时展示 tooltip
<a-tooltip content={data.label} disabled={maxTagCount.value !== Infinity && maxTagCount.value !== 0}>
<div
class="one-line-text"
style={singleTagMaxWidth.value > 0 ? { maxWidth: `${singleTagMaxWidth.value}px` } : {}}
>
{slots.label ? slots.label(data) : data.label}
</div>
</a-tooltip>
),
...selectSlots(),
}}

View File

@ -50,8 +50,8 @@
:search-keys="['label']"
allow-search
allow-clear
multiple
class="w-[290px]"
:multiple="true"
class="!w-[290px]"
:loading="reviewerLoading"
>
<template #empty>
@ -166,6 +166,8 @@
if (val) {
//
initReviewers();
} else {
associateFormRef.value?.resetFields();
}
}
);

View File

@ -2,7 +2,12 @@
<MsCard simple>
<div class="mb-4 flex items-center justify-between">
<div>
<a-button v-permission="['SYSTEM_USER:READ+ADD']" class="mr-3" type="primary" @click="showUserModal('create')">
<a-button
v-permission="['SYSTEM_USER:READ+ADD', 'SYSTEM_USER_ROLE:READ']"
class="mr-3"
type="primary"
@click="showUserModal('create')"
>
{{ t('system.user.createUser') }}
</a-button>
<a-button v-permission="['SYSTEM_USER_INVITE']" class="mr-3" type="outline" @click="showEmailInviteModal">
@ -576,17 +581,17 @@
{
label: 'system.user.batchActionAddProject',
eventTag: 'batchAddProject',
permission: ['SYSTEM_USER:READ+ADD'],
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
},
{
label: 'system.user.batchActionAddUserGroup',
eventTag: 'batchAddUserGroup',
permission: ['SYSTEM_USER:READ+ADD'],
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_USER_ROLE:READ'],
},
{
label: 'system.user.batchActionAddOrganization',
eventTag: 'batchAddOrganization',
permission: ['SYSTEM_USER:READ+ADD'],
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
},
],
moreAction: [
@ -698,10 +703,12 @@
async function init() {
try {
if (hasAnyPermission(['SYSTEM_USER_ROLE:READ'])) {
userGroupOptions.value = await getSystemRoles();
if (userGroupOptions.value.length) {
userForm.value.userGroup = userGroupOptions.value.filter((e: SystemRole) => e.selected === true);
}
}
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
@ -841,7 +848,7 @@
}
function handleTagClick(record: UserListItem & Record<string, any>) {
if (hasAnyPermission(['SYSTEM_USER:READ+UPDATE'])) {
if (hasAnyPermission(['SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER_ROLE:READ'])) {
record.selectUserGroupVisible = true;
}
}