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) + }" >