hookehuyr

新增集合组组件功能

...@@ -16,7 +16,7 @@ VITE_PIN = ...@@ -16,7 +16,7 @@ VITE_PIN =
16 16
17 # 反向代理服务器地址 17 # 反向代理服务器地址
18 # VITE_PROXY_TARGET = https://oa.anxinchashi.com/ 18 # VITE_PROXY_TARGET = https://oa.anxinchashi.com/
19 -VITE_PROXY_TARGET = http://oa.onwall.cn 19 +VITE_PROXY_TARGET = http://oa-dev.onwall.cn
20 # VITE_PROXY_TARGET = https://www.wxgzjs.cn/ 20 # VITE_PROXY_TARGET = https://www.wxgzjs.cn/
21 21
22 # PC端地址 22 # PC端地址
......
...@@ -21,6 +21,7 @@ declare module '@vue/runtime-core' { ...@@ -21,6 +21,7 @@ declare module '@vue/runtime-core' {
21 EmailField: typeof import('./src/components/EmailField/index.vue')['default'] 21 EmailField: typeof import('./src/components/EmailField/index.vue')['default']
22 FileUploaderField: typeof import('./src/components/FileUploaderField/index.vue')['default'] 22 FileUploaderField: typeof import('./src/components/FileUploaderField/index.vue')['default']
23 GenderField: typeof import('./src/components/GenderField/index.vue')['default'] 23 GenderField: typeof import('./src/components/GenderField/index.vue')['default']
24 + GroupField: typeof import('./src/components/GroupField/index.vue')['default']
24 IdentityField: typeof import('./src/components/IdentityField/index.vue')['default'] 25 IdentityField: typeof import('./src/components/IdentityField/index.vue')['default']
25 ImageUploaderField: typeof import('./src/components/ImageUploaderField/index.vue')['default'] 26 ImageUploaderField: typeof import('./src/components/ImageUploaderField/index.vue')['default']
26 MarqueeField: typeof import('./src/components/MarqueeField/index.vue')['default'] 27 MarqueeField: typeof import('./src/components/MarqueeField/index.vue')['default']
......
This diff is collapsed. Click to expand it.
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: 2023-02-01 11:21:00 4 + * @LastEditTime: 2024-05-27 17:47:52
5 * @FilePath: /data-table/src/components/NameField/index.vue 5 * @FilePath: /data-table/src/components/NameField/index.vue
6 * @Description: 姓名输入框 6 * @Description: 姓名输入框
7 --> 7 -->
8 <template> 8 <template>
9 <div v-if="HideShow" class="name-field-page"> 9 <div v-if="HideShow" class="name-field-page">
10 - <div class="label"> 10 + <div :class="[isGroup ? 'group-label' : 'label']">
11 <span v-if="item.component_props.required">&nbsp;*</span> 11 <span v-if="item.component_props.required">&nbsp;*</span>
12 {{ item.component_props.label }} 12 {{ item.component_props.label }}
13 </div> 13 </div>
...@@ -29,10 +29,17 @@ ...@@ -29,10 +29,17 @@
29 const props = defineProps({ 29 const props = defineProps({
30 item: Object, 30 item: Object,
31 }); 31 });
32 +
32 // 隐藏显示 33 // 隐藏显示
33 const HideShow = computed(() => { 34 const HideShow = computed(() => {
34 return !props.item.component_props.disabled 35 return !props.item.component_props.disabled
35 -}) 36 +});
37 +
38 +// 集合组标识
39 +const isGroup = computed(() => {
40 + return props.item.component_props.is_field_group
41 +});
42 +
36 onMounted(() => { 43 onMounted(() => {
37 props.item.value = props.item.component_props.default; 44 props.item.value = props.item.component_props.default;
38 }) 45 })
...@@ -48,6 +55,20 @@ onMounted(() => { ...@@ -48,6 +55,20 @@ onMounted(() => {
48 color: red; 55 color: red;
49 } 56 }
50 } 57 }
58 +
59 + .group-label {
60 + padding: 0.75rem 0 0.75rem 1rem;
61 + font-size: 0.9rem;
62 + font-weight: bold;
63 + background-color: #f9f9f9;
64 + color: #666;
65 + border-top: 1px solid #eee;
66 + border-bottom: 1px solid #eee;
67 +
68 + span {
69 + color: red;
70 + }
71 + }
51 } 72 }
52 73
53 :deep(.van-field__body) { 74 :deep(.van-field__body) {
......
1 <!-- 1 <!--
2 * @Date: 2022-08-30 11:34:19 2 * @Date: 2022-08-30 11:34:19
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-03-28 16:19:08 4 + * @LastEditTime: 2024-05-27 14:27:25
5 * @FilePath: /data-table/src/components/RadioField/index.vue 5 * @FilePath: /data-table/src/components/RadioField/index.vue
6 * @Description: 单项选择控件 6 * @Description: 单项选择控件
7 --> 7 -->
......
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: 2023-05-25 18:29:39 4 + * @LastEditTime: 2024-05-28 10:05:08
5 * @FilePath: /data-table/src/components/TextField/index.vue 5 * @FilePath: /data-table/src/components/TextField/index.vue
6 * @Description: 单行文本输入框(微信扫描功能) 6 * @Description: 单行文本输入框(微信扫描功能)
7 --> 7 -->
8 <template> 8 <template>
9 <div v-if="HideShow" class="text-field-page"> 9 <div v-if="HideShow" class="text-field-page">
10 - <div class="label"> 10 + <div :class="[isGroup ? 'group-label' : 'label']">
11 <span v-if="item.component_props.required">&nbsp;*</span> 11 <span v-if="item.component_props.required">&nbsp;*</span>
12 {{ item.component_props.label }} 12 {{ item.component_props.label }}
13 </div> 13 </div>
...@@ -30,10 +30,16 @@ import wx from 'weixin-js-sdk' ...@@ -30,10 +30,16 @@ import wx from 'weixin-js-sdk'
30 const props = defineProps({ 30 const props = defineProps({
31 item: Object, 31 item: Object,
32 }); 32 });
33 +
33 // 隐藏显示 34 // 隐藏显示
34 const HideShow = computed(() => { 35 const HideShow = computed(() => {
35 return !props.item.component_props.disabled 36 return !props.item.component_props.disabled
36 -}) 37 +});
38 +
39 +// 集合组标识
40 +const isGroup = computed(() => {
41 + return props.item.component_props.is_field_group
42 +});
37 43
38 const $route = useRoute(); 44 const $route = useRoute();
39 // 默认识别类型 45 // 默认识别类型
...@@ -92,16 +98,30 @@ const clickRightIcon = async () => { ...@@ -92,16 +98,30 @@ const clickRightIcon = async () => {
92 span { 98 span {
93 color: red; 99 color: red;
94 } 100 }
101 + }
95 102
96 - .note-wrapper { 103 + .group-label {
97 - font-size: 0.9rem; 104 + padding: 0.75rem 0 0.75rem 1rem;
98 - margin-left: 1rem; 105 + font-size: 0.9rem;
99 - color: gray; 106 + font-weight: bold;
100 - padding-bottom: 0.5rem; 107 + background-color: #f9f9f9;
101 - padding-top: 0.25rem; 108 + color: #666;
102 - white-space: pre-wrap; 109 + border-top: 1px solid #eee;
110 + border-bottom: 1px solid #eee;
111 +
112 + span {
113 + color: red;
103 } 114 }
104 } 115 }
116 +
117 + .note-wrapper {
118 + font-size: 0.9rem;
119 + margin-left: 1rem;
120 + color: gray;
121 + padding-bottom: 0.5rem;
122 + padding-top: 0.25rem;
123 + white-space: pre-wrap;
124 + }
105 } 125 }
106 126
107 :deep(.van-field__body) { 127 :deep(.van-field__body) {
......
...@@ -31,6 +31,7 @@ import NameField from '@/components/NameField/index.vue'; ...@@ -31,6 +31,7 @@ import NameField from '@/components/NameField/index.vue';
31 import GenderField from '@/components/GenderField/index.vue'; 31 import GenderField from '@/components/GenderField/index.vue';
32 import AppointmentField from '@/components/AppointmentField/index.vue'; 32 import AppointmentField from '@/components/AppointmentField/index.vue';
33 import CustomField from '@/components/CustomField/index.vue'; 33 import CustomField from '@/components/CustomField/index.vue';
34 +import GroupField from '@/components/GroupField/index.vue';
34 35
35 /** 36 /**
36 * 生成自定义组件类型 37 * 生成自定义组件类型
...@@ -61,6 +62,7 @@ import CustomField from '@/components/CustomField/index.vue'; ...@@ -61,6 +62,7 @@ import CustomField from '@/components/CustomField/index.vue';
61 * @type name 姓名控件 NameField 62 * @type name 姓名控件 NameField
62 * @type gender 性别控件 GenderField 63 * @type gender 性别控件 GenderField
63 * @type appointment 预约控件 AppointmentField 64 * @type appointment 预约控件 AppointmentField
65 + * @type group 组集合输入控件 GroupField
64 */ 66 */
65 export function createComponentType(data) { 67 export function createComponentType(data) {
66 // 判断类型和使用组件 68 // 判断类型和使用组件
...@@ -189,5 +191,9 @@ export function createComponentType(data) { ...@@ -189,5 +191,9 @@ export function createComponentType(data) {
189 item.name = item.key; 191 item.name = item.key;
190 item.component = CustomField; 192 item.component = CustomField;
191 } 193 }
194 + if (item.component_props.tag === 'group') {
195 + item.name = item.key;
196 + item.component = GroupField;
197 + }
192 }) 198 })
193 } 199 }
......
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: 2024-05-13 14:24:11 4 + * @LastEditTime: 2024-05-28 10:39:05
5 * @FilePath: /data-table/src/views/index.vue 5 * @FilePath: /data-table/src/views/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -240,6 +240,59 @@ onMounted(async () => { ...@@ -240,6 +240,59 @@ onMounted(async () => {
240 visible: !page_commit.invisible, 240 visible: !page_commit.invisible,
241 }; 241 };
242 } 242 }
243 + // TODO:待完善,集合组保存的字段和值怎么处理,都是单条数据都要合并到相应的 group_field_name 下面?
244 + // page_form.unshift({
245 + // data_type : "text",
246 + // default : "",
247 + // disabled : false,
248 + // field_id : 1414832,
249 + // field_name : "field_4",
250 + // index : 41,
251 + // interaction_type : "h5edit",
252 + // label : "物品详情",
253 + // name : "name_41",
254 + // placeholder : "请输入",
255 + // readonly : false,
256 + // required : false,
257 + // tag : "group",
258 + // unique : false,
259 + // field_groups: [{
260 + // "tag": "input",
261 + // "name": "input_21",
262 + // "index": 2,
263 + // "label": "物品描述",
264 + // "unique": false,
265 + // "default": "",
266 + // "disabled": false,
267 + // "field_id": 7985071,
268 + // "readonly": false,
269 + // "required": false,
270 + // "data_type": "text",
271 + // "field_name": "field_21",
272 + // "placeholder": "请输入",
273 + // "is_camera_scan": false,
274 + // "camera_scan_type": "",
275 + // "interaction_type": "h5edit",
276 + // "is_edit_camera_scan_result": false,
277 + // "group_field_name" : "field_4",
278 + // },{
279 + // "tag": "name",
280 + // "name": "name_71",
281 + // "index": 7,
282 + // "label": "序列号",
283 + // "unique": false,
284 + // "default": "",
285 + // "disabled": false,
286 + // "field_id": 7995031,
287 + // "readonly": false,
288 + // "required": true,
289 + // "data_type": "text",
290 + // "field_name": "field_91",
291 + // "placeholder": "请输入",
292 + // "interaction_type": "h5edit",
293 + // "group_field_name" : "field_4",
294 + // },]
295 + // });
243 formData.value = formatData(page_form); 296 formData.value = formatData(page_form);
244 // TODO:再次提交测试, 需要获取原来表单数据 297 // TODO:再次提交测试, 需要获取原来表单数据
245 // formData.value.forEach((item) => { 298 // formData.value.forEach((item) => {
...@@ -315,7 +368,7 @@ onMounted(async () => { ...@@ -315,7 +368,7 @@ onMounted(async () => {
315 }, 368 },
316 ]; 369 ];
317 // 生成自定义组件 370 // 生成自定义组件
318 - createComponentType(mockData.value); 371 + // createComponentType(mockData.value);
319 createComponentType(formData.value); 372 createComponentType(formData.value);
320 // 过期时间显示 373 // 过期时间显示
321 notice_text.value = `表单报名将在 ${formSetting.value.sjsj_end_time} 后结束`; 374 notice_text.value = `表单报名将在 ${formSetting.value.sjsj_end_time} 后结束`;
......