From 70d9a9eb92c981e0989e970c1412f6f697d44182 Mon Sep 17 00:00:00 2001 From: Yesol Choi Date: Thu, 29 May 2025 20:35:31 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EB=8F=99=EC=9E=91=20=EC=9C=84?= =?UTF-8?q?=EC=95=84=EB=9E=98=EC=9D=B4=EB=8F=99,=20=EC=82=AD=EC=A0=9C=20,?= =?UTF-8?q?=20=EA=B2=B0=EC=A0=9C=202=EB=AA=85=20validation=EA=B9=8C?= =?UTF-8?q?=EC=A7=80=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VUser 오류 발생 중으로 수정 요함 --- src/components/app-vuero/VCustomButton.vue | 648 +++++++++++++++++++++ src/components/app-vuero/VUser.vue | 52 +- src/pages/app/priceUpdate.vue | 130 +++-- 3 files changed, 758 insertions(+), 72 deletions(-) create mode 100644 src/components/app-vuero/VCustomButton.vue diff --git a/src/components/app-vuero/VCustomButton.vue b/src/components/app-vuero/VCustomButton.vue new file mode 100644 index 0000000..2236183 --- /dev/null +++ b/src/components/app-vuero/VCustomButton.vue @@ -0,0 +1,648 @@ + + + diff --git a/src/components/app-vuero/VUser.vue b/src/components/app-vuero/VUser.vue index bf19bc0..fb85ea1 100644 --- a/src/components/app-vuero/VUser.vue +++ b/src/components/app-vuero/VUser.vue @@ -22,7 +22,6 @@ const dataUser = reactive({ // model.value = sessioinData // }) const initiator = ref(null) -const approvers = ref([]) onBeforeMount(() => { dataUser.userSession = userSession.user.data @@ -36,15 +35,6 @@ onBeforeMount(() => { } }) -// 부모에게 넘길 결재선 전체 -const apprLine = computed(() => { - return initiator.value ? [initiator.value, ...approvers.value] : [...approvers.value] -}) - -watch(apprLine, (val) => { - model.value = val -}) - const props = defineProps({ label: { @@ -56,11 +46,27 @@ const props = defineProps({ }, disabled: { type: Boolean - } + }, + modelValue: { + type: Object, + default: () => ({}), + }, }) +export interface VUserEmits { + (e: 'update:modelValue', value: any): void +} +const emits = defineEmits() const tagsOptions = ref([]) +const approvers = ref() + +watch(() => props.modelValue, (newVal) => { + if (newVal.length > 0) { + emits('update:modelValue', approvers) + approvers.value = [] + } +}) const onKeyup = async (e: any) => { const regex_jaeum = /[ㄱ-ㅎ]/g if (e.key === 'Enter') { @@ -69,27 +75,6 @@ const onKeyup = async (e: any) => { const res = await getUserList({params:{name : e.target.value}}) if (res.length > 0) { - // res.forEach(u => { 2명으로 제한 로직 풀기 25.05.29 - // if (model.value?.length > 0) { - // const ignore = model.value.reduce((a: Person, b: Person) => { - // console.log("aaaaa",a.sabun) - // console.log("bbbbbb",b.sabun) - // return a.sabun + '|' + b.sabun - // }) - // - // if (typeof ignore !== 'object') { - // if (ignore.includes(u.sabun)) { - // console.log("ignore 처리",u.sabun) - // u['disabled'] = true - // } - // } else { - // if (ignore.sabun.includes(u.sabun)) { - // console.log("ignore 처리222",u.sabun) - // u['disabled'] = true - // } - // } - // } - // }) tagsOptions.value = res } } catch (e) { @@ -120,6 +105,9 @@ const onKeyup = async (e: any) => { noOptionsText="검색된 결과가 없습니다." :placeholder="props.placeholder" @keyup="onKeyup" + @update:modelValue="(val) => { + emits('update:modelValue', val) + }" >