refactor [P-36]: декомпозиция конструктора + адаптация под создания тестов

This commit is contained in:
Denzel committed 2025-02-28 13:31:17 +03:00
1 parent 06439dc5d6
commit da5bd45b0b
1 file changed
+8 -2
@@ -30,7 +30,7 @@
:label="localForm.createnews ? 'да' : 'нет'"
></v-switch>
</div>
<div class="pt-2 d-flex align-center">
<div class="pt-2 d-flex align-center" v-if="isTestRoute">
<span class="text-overline text-grey text-center">Назначить: </span>
<v-switch
v-model="localForm.appoint"
@@ -143,6 +143,7 @@ import DateSelect from '@/components/UI/date-select.vue';
import { ref, watch, computed } from 'vue';
import { checkremote } from '@/utils/universal_functions.js';
import { getEmployees, spravURL } from '@/utils/axios-api.js';
import { useRoute } from 'vue-router';
export default {
methods: {
@@ -161,6 +162,10 @@ export default {
},
emits: ['update:form'],
setup(props, { emit }) {
const route = useRoute();
const isTestRoute = computed(() => {
return route.path && String(route.path).includes('test');
});
// Если form не передан, создаём объект с дефолтными значениями
const localForm = ref(
props.form
@@ -275,7 +280,8 @@ export default {
selectedEmployees,
allEmployees,
onEmployeesChange,
handleSelectAll
handleSelectAll,
isTestRoute
};
},
};