From f6a60e672c24bc6d8336bda6adb5b97fef79a4ae Mon Sep 17 00:00:00 2001 From: Yesol Choi Date: Thu, 29 May 2025 22:35:47 +0900 Subject: [PATCH] =?UTF-8?q?com=20:=20VUser=20=EB=93=B1=EB=A1=9D=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EC=98=A4=EB=A5=98=20=EB=B0=9C=EC=83=9D=EB=95=8C?= =?UTF-8?q?=EB=AC=B8=EC=97=90=20=EC=9B=90=EB=B3=B5=20=EC=86=8C=EC=8A=A4=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/app-vuero/VUser.vue | 95 +++++++++++------- src/components/app-vuero/VUserTemp.vue | 130 +++++++++++++++++++++++++ 2 files changed, 192 insertions(+), 33 deletions(-) create mode 100644 src/components/app-vuero/VUserTemp.vue diff --git a/src/components/app-vuero/VUser.vue b/src/components/app-vuero/VUser.vue index fb85ea1..8b3d16a 100644 --- a/src/components/app-vuero/VUser.vue +++ b/src/components/app-vuero/VUser.vue @@ -22,6 +22,7 @@ const dataUser = reactive({ // model.value = sessioinData // }) const initiator = ref(null) +const approvers = ref([]) onBeforeMount(() => { dataUser.userSession = userSession.user.data @@ -35,6 +36,15 @@ onBeforeMount(() => { } }) +// 부모에게 넘길 결재선 전체 +const apprLine = computed(() => { + return initiator.value ? [initiator.value, ...approvers.value] : [...approvers.value] +}) + +watch(apprLine, (val) => { + model.value = val +}) + const props = defineProps({ label: { @@ -46,27 +56,11 @@ 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 tagsOptions = ref([]) + const onKeyup = async (e: any) => { const regex_jaeum = /[ㄱ-ㅎ]/g if (e.key === 'Enter') { @@ -75,6 +69,44 @@ const onKeyup = async (e: any) => { const res = await getUserList({params:{name : e.target.value}}) if (res.length > 0) { + res.forEach(u => { + if (model.value?.length > 0) { + const ignore = model.value.reduce((a: Person, b: Person) => { + return a.sabun + '|' + b.sabun + }) + + if (typeof ignore !== 'object') { + if (ignore.includes(u.sabun)) { + u['disabled'] = true + } + } else { + if (ignore.sabun.includes(u.sabun)) { + u['disabled'] = true + } + } + } + }) + // 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) { @@ -95,19 +127,16 @@ const onKeyup = async (e: any) => {