refactor: refs #6919 drop useless code
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
94c8f538ea
commit
0f48b6fa4d
|
@ -4,7 +4,6 @@ import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
@ -22,8 +21,6 @@ const { t } = useI18n();
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
where: { id: entityId },
|
where: { id: entityId },
|
||||||
|
@ -46,8 +43,7 @@ const hasAccount = ref(false);
|
||||||
module="Account"
|
module="Account"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="AccountId"
|
data-key="AccountId"
|
||||||
:title="data.title"
|
title="nickname"
|
||||||
:subtitle="data.subtitle"
|
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<AccountDescriptorMenu :has-account="hasAccount" />
|
<AccountDescriptorMenu :has-account="hasAccount" />
|
||||||
|
|
|
@ -8,7 +8,6 @@ import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
|
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
|
@ -39,10 +38,8 @@ const STATE_COLOR = {
|
||||||
function stateColor(code) {
|
function stateColor(code) {
|
||||||
return STATE_COLOR[code];
|
return STATE_COLOR[code];
|
||||||
}
|
}
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => {
|
const setData = (entity) => {
|
||||||
if (!entity) return;
|
if (!entity) return;
|
||||||
data.value = useCardDescription(entity?.client?.name, entity.id);
|
|
||||||
state.set('ClaimDescriptor', entity);
|
state.set('ClaimDescriptor', entity);
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
@ -5,8 +5,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
|
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
|
||||||
|
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
|
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
|
@ -34,17 +32,12 @@ const { t } = useI18n();
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity?.name, entity?.id));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Customer"
|
module="Customer"
|
||||||
:url="`Clients/${entityId}/getCard`"
|
:url="`Clients/${entityId}/getCard`"
|
||||||
:title="data.title"
|
|
||||||
:subtitle="data.subtitle"
|
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="Client"
|
data-key="Client"
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
@ -32,15 +31,6 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const department = ref();
|
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
|
||||||
|
|
||||||
const setData = (entity) => {
|
|
||||||
if (!entity) return;
|
|
||||||
data.value = useCardDescription(entity.name, entity.id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const removeDepartment = async () => {
|
const removeDepartment = async () => {
|
||||||
try {
|
try {
|
||||||
await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
|
await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
|
||||||
|
@ -58,16 +48,8 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
ref="DepartmentDescriptorRef"
|
ref="DepartmentDescriptorRef"
|
||||||
module="Department"
|
module="Department"
|
||||||
:url="`Departments/${entityId}`"
|
:url="`Departments/${entityId}`"
|
||||||
:title="data.title"
|
|
||||||
:subtitle="data.subtitle"
|
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
:to-module="{ name: 'WorkerDepartment' }"
|
:to-module="{ name: 'WorkerDepartment' }"
|
||||||
@on-fetch="
|
|
||||||
(data) => {
|
|
||||||
department = data;
|
|
||||||
setData(data);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
data-key="department"
|
data-key="department"
|
||||||
>
|
>
|
||||||
<template #menu="{}">
|
<template #menu="{}">
|
||||||
|
|
Loading…
Reference in New Issue