Showing
4 changed files
with
24 additions
and
3 deletions
| ... | @@ -75,6 +75,8 @@ const $route = useRoute(); | ... | @@ -75,6 +75,8 @@ const $route = useRoute(); |
| 75 | const props = defineProps({ | 75 | const props = defineProps({ |
| 76 | item: Object, | 76 | item: Object, |
| 77 | }); | 77 | }); |
| 78 | +const emit = defineEmits(["blur"]); | ||
| 79 | + | ||
| 78 | // 隐藏显示 | 80 | // 隐藏显示 |
| 79 | const HideShow = computed(() => { | 81 | const HideShow = computed(() => { |
| 80 | return !props.item.component_props.disabled | 82 | return !props.item.component_props.disabled |
| ... | @@ -327,6 +329,9 @@ const onBlur = (item) => { | ... | @@ -327,6 +329,9 @@ const onBlur = (item) => { |
| 327 | // 如果Cookie不存在,新增它 | 329 | // 如果Cookie不存在,新增它 |
| 328 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); | 330 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); |
| 329 | } | 331 | } |
| 332 | + | ||
| 333 | + // 触发自定义失焦操作 | ||
| 334 | + emit("blur", item); | ||
| 330 | } | 335 | } |
| 331 | </script> | 336 | </script> |
| 332 | 337 | ... | ... |
| ... | @@ -79,6 +79,8 @@ const $route = useRoute(); | ... | @@ -79,6 +79,8 @@ const $route = useRoute(); |
| 79 | const props = defineProps({ | 79 | const props = defineProps({ |
| 80 | item: Object, | 80 | item: Object, |
| 81 | }); | 81 | }); |
| 82 | +const emit = defineEmits(["blur"]); | ||
| 83 | + | ||
| 82 | // 隐藏显示 | 84 | // 隐藏显示 |
| 83 | const HideShow = computed(() => { | 85 | const HideShow = computed(() => { |
| 84 | return !props.item.component_props.disabled | 86 | return !props.item.component_props.disabled |
| ... | @@ -188,6 +190,9 @@ const onBlur = (item) => { | ... | @@ -188,6 +190,9 @@ const onBlur = (item) => { |
| 188 | // 如果Cookie不存在,新增它 | 190 | // 如果Cookie不存在,新增它 |
| 189 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); | 191 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); |
| 190 | } | 192 | } |
| 193 | + | ||
| 194 | + // 触发自定义失焦操作 | ||
| 195 | + emit("blur", item); | ||
| 191 | } | 196 | } |
| 192 | </script> | 197 | </script> |
| 193 | 198 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-08-29 14:31:20 | 2 | * @Date: 2022-08-29 14:31:20 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-11-21 09:25:23 | 4 | + * @LastEditTime: 2025-02-13 14:30:31 |
| 5 | * @FilePath: /data-table/src/components/TextField/index.vue | 5 | * @FilePath: /data-table/src/components/TextField/index.vue |
| 6 | * @Description: 单行文本输入框(微信扫描功能) | 6 | * @Description: 单行文本输入框(微信扫描功能) |
| 7 | --> | 7 | --> |
| ... | @@ -38,6 +38,7 @@ const $route = useRoute(); | ... | @@ -38,6 +38,7 @@ const $route = useRoute(); |
| 38 | const props = defineProps({ | 38 | const props = defineProps({ |
| 39 | item: Object, | 39 | item: Object, |
| 40 | }); | 40 | }); |
| 41 | +const emit = defineEmits(["blur"]); | ||
| 41 | 42 | ||
| 42 | // 隐藏显示 | 43 | // 隐藏显示 |
| 43 | const HideShow = computed(() => { | 44 | const HideShow = computed(() => { |
| ... | @@ -82,6 +83,9 @@ const onBlur = (item) => { | ... | @@ -82,6 +83,9 @@ const onBlur = (item) => { |
| 82 | // 如果Cookie不存在,新增它 | 83 | // 如果Cookie不存在,新增它 |
| 83 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); | 84 | Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue }), { expires: 1 }); |
| 84 | } | 85 | } |
| 86 | + | ||
| 87 | + // 触发自定义失焦操作 | ||
| 88 | + emit("blur", item); | ||
| 85 | }; | 89 | }; |
| 86 | 90 | ||
| 87 | // 默认识别类型 | 91 | // 默认识别类型 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-02-13 10:38:24 | 4 | + * @LastEditTime: 2025-02-13 14:31:19 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | <van-form ref="myForm" @submit="onSubmit" @failed="onFailed" :scroll-to-error="true"> | 26 | <van-form ref="myForm" @submit="onSubmit" @failed="onFailed" :scroll-to-error="true"> |
| 27 | <van-cell-group :border="false"> | 27 | <van-cell-group :border="false"> |
| 28 | <component v-for="(item, index) in formData" :id="item.key" :ref="(el) => setRefMap(el, item)" :key="index" | 28 | <component v-for="(item, index) in formData" :id="item.key" :ref="(el) => setRefMap(el, item)" :key="index" |
| 29 | - :is="item.component" :item="item" @active="onActive" @remove="onRemove" /> | 29 | + :is="item.component" :item="item" @active="onActive" @remove="onRemove" @blur="onBlur" /> |
| 30 | </van-cell-group> | 30 | </van-cell-group> |
| 31 | <!-- 非流程版表单 --> | 31 | <!-- 非流程版表单 --> |
| 32 | <div v-if="formData.length && PCommit.visible && !formSetting.is_flow" style="margin: 16px"> | 32 | <div v-if="formData.length && PCommit.visible && !formSetting.is_flow" style="margin: 16px"> |
| ... | @@ -603,6 +603,13 @@ onMounted(async () => { | ... | @@ -603,6 +603,13 @@ onMounted(async () => { |
| 603 | }, false); | 603 | }, false); |
| 604 | }); | 604 | }); |
| 605 | 605 | ||
| 606 | +// 自定义失焦操作 | ||
| 607 | +const onBlur = (item) => { | ||
| 608 | + // TODO: 之后新增判断逻辑 | ||
| 609 | + // TODO:数据变化获取后台数据填充 | ||
| 610 | + console.warn(item); | ||
| 611 | +} | ||
| 612 | + | ||
| 606 | // 打开轮询用户是否关注 | 613 | // 打开轮询用户是否关注 |
| 607 | const onTap = () => { | 614 | const onTap = () => { |
| 608 | if (localStorage.getItem('weixin_subscribe') === '0') { | 615 | if (localStorage.getItem('weixin_subscribe') === '0') { | ... | ... |
-
Please register or login to post a comment