pukaad-ui-lib 1.224.0 → 1.226.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<div class="font-body-large-prominent">รายละเอียด</div>
|
|
8
8
|
<div class="flex flex-col gap-[4px]">
|
|
9
9
|
<InputAutocomplete name="businessName" v-model="modelValue.businessName" label="ชื่อสถานที่ธุรกิจ"
|
|
10
|
-
placeholder="กรอกชื่อสถานที่" required show-counter :limit="180" free-text :fetch-fn="fetchApprovedPlaces"
|
|
10
|
+
placeholder="กรอกชื่อสถานที่" required show-counter :limit="180" :free-text="true" :fetch-fn="fetchApprovedPlaces"
|
|
11
11
|
value-key="business_name" label-key="business_name" />
|
|
12
12
|
<InputTextField v-if="extraNameCount >= 1" name="nameTh" v-model="modelValue.nameTh" label="ชื่อภาษาไทย"
|
|
13
13
|
placeholder="ใส่ในกรณีที่ต่างจากชื่อหลัก" show-counter :limit="180" />
|
|
@@ -74,34 +74,43 @@
|
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<script setup>
|
|
77
|
-
import { ref, computed, onMounted, watch } from "vue";
|
|
77
|
+
import { ref, computed, onMounted, watch, reactive } from "vue";
|
|
78
78
|
import { useApi } from "@/runtime/composables/useApi";
|
|
79
79
|
import SuggestPlaceMap from "./suggest-place-map.vue";
|
|
80
80
|
const props = defineProps({
|
|
81
81
|
state: { type: String, required: false, default: "personal" }
|
|
82
82
|
});
|
|
83
83
|
const api = useApi();
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
const _model = defineModel({ type: Object, ...{ default: () => ({}) } });
|
|
85
|
+
const modelValue = reactive({
|
|
86
|
+
address: {},
|
|
87
|
+
extraPhones: [],
|
|
88
|
+
categories: [],
|
|
89
|
+
reviewPhotos: [],
|
|
90
|
+
photos: [],
|
|
91
|
+
videos: [],
|
|
92
|
+
..._model.value
|
|
93
|
+
});
|
|
94
|
+
watch(_model, (val) => {
|
|
95
|
+
if (val) Object.assign(modelValue, val);
|
|
96
|
+
}, { deep: false });
|
|
97
|
+
watch(modelValue, (val) => {
|
|
98
|
+
_model.value = { ...val };
|
|
99
|
+
}, { deep: true });
|
|
91
100
|
const extraNameCount = ref(
|
|
92
|
-
modelValue.
|
|
101
|
+
modelValue.nameEn ? 2 : modelValue.nameTh ? 1 : 0
|
|
93
102
|
);
|
|
94
103
|
const isAddressCompleted = computed(() => {
|
|
95
|
-
const v = modelValue.
|
|
104
|
+
const v = modelValue.address || {};
|
|
96
105
|
return !!(v.province_id && v.amphur_id && v.tambon_id && v.zipcode);
|
|
97
106
|
});
|
|
98
107
|
watch(
|
|
99
|
-
() => modelValue.
|
|
108
|
+
() => modelValue.isReview,
|
|
100
109
|
(newVal) => {
|
|
101
110
|
if (!newVal) {
|
|
102
|
-
modelValue.
|
|
103
|
-
modelValue.
|
|
104
|
-
modelValue.
|
|
111
|
+
modelValue.rating = void 0;
|
|
112
|
+
modelValue.reviewDescription = "";
|
|
113
|
+
modelValue.reviewPhotos = [];
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
116
|
);
|