跟香港
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
:rules="props.rules"
|
||||
:inline="props.inline"
|
||||
label-position="right"
|
||||
:disabled="props.disabled"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="(item,idx) in props.formList"
|
||||
@ -63,7 +64,12 @@
|
||||
/>
|
||||
<!-- 部门department -->
|
||||
<template v-else-if="item.type === 'department'">
|
||||
<MOSTY.Department style="width: 100%;" clearable v-model="listQuery[item.prop]" />
|
||||
<MOSTY.Department
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
v-model="listQuery[item.prop]"
|
||||
:placeholder="listQuery[item.prop] ? listQuery[item.prop+'mc']:''"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<!-- 上传 upload -->
|
||||
@ -165,7 +171,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import * as MOSTY from "@/components/MyComponents/index";
|
||||
import { ref, defineProps, defineEmits, defineExpose, watch } from "vue";
|
||||
import { ref, defineProps, defineEmits, defineExpose, watch, watchEffect } from "vue";
|
||||
const props = defineProps({
|
||||
//循环的值
|
||||
formList: {
|
||||
@ -204,24 +210,18 @@ const reset = () =>{
|
||||
elform.value.resetFields()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => listQuery.value,
|
||||
(newVal) => {
|
||||
emits("update:modelValue", newVal);
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
watch(() => listQuery.value,(newVal) => {
|
||||
if(newVal) emits("update:modelValue", newVal);
|
||||
},{ immediate: true, deep: true });
|
||||
|
||||
watch(() => props.modelValue,(newVal) => {
|
||||
// 只有在新值确实变化时才更新(避免空值覆盖)
|
||||
if (newVal && Object.keys(newVal).length > 0) {
|
||||
listQuery.value = { ...newVal };
|
||||
}
|
||||
},{ immediate: true, deep: true });
|
||||
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
// 只有在新值确实变化时才更新(避免空值覆盖)
|
||||
if (newVal && Object.keys(newVal).length > 0) {
|
||||
listQuery.value = { ...newVal };
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
defineExpose({ submit,reset });
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user