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