af-mobile-client-vue3 1.1.47 → 1.1.49
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/package.json
CHANGED
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "af-mobile-client-vue3",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
5
|
-
"description": "Vue + Vite component lib",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=18.12.0",
|
|
9
|
-
"pnpm": ">=8.15.0"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"dev": "cross-env MOCK_SERVER_PORT=8086 vite",
|
|
13
|
-
"build": "vue-tsc --noEmit && vite build",
|
|
14
|
-
"build:dev": "vue-tsc --noEmit && vite build --mode=development",
|
|
15
|
-
"preview": "vite preview",
|
|
16
|
-
"lint": "eslint . && vue-tsc --noEmit",
|
|
17
|
-
"lint:fix": "eslint . --fix",
|
|
18
|
-
"test": "vitest",
|
|
19
|
-
"release": "bumpp --commit --push --tag"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@iconify/vue": "4.3.0",
|
|
23
|
-
"@micro-zoe/micro-app": "1.0.0-rc.24",
|
|
24
|
-
"@unhead/vue": "^2.0.5",
|
|
25
|
-
"@vant/area-data": "^2.0.0",
|
|
26
|
-
"@vant/touch-emulator": "^1.4.0",
|
|
27
|
-
"@vant/use": "^1.6.0",
|
|
28
|
-
"@vueuse/core": "^13.1.0",
|
|
29
|
-
"animate.css": "^4.1.1",
|
|
30
|
-
"axios": "^1.8.4",
|
|
31
|
-
"crypto-js": "^4.2.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"pinia
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"vue
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/
|
|
55
|
-
"@
|
|
56
|
-
"@unocss/
|
|
57
|
-
"@
|
|
58
|
-
"@vitejs/plugin-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"eslint
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"unplugin-
|
|
77
|
-
"unplugin-vue-
|
|
78
|
-
"
|
|
79
|
-
"vite
|
|
80
|
-
"vite-plugin-
|
|
81
|
-
"vite-plugin-
|
|
82
|
-
"vite-plugin-
|
|
83
|
-
"vite-plugin-
|
|
84
|
-
"vite-plugin-
|
|
85
|
-
"vite-plugin-
|
|
86
|
-
"vite-plugin-vue-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "af-mobile-client-vue3",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.1.49",
|
|
5
|
+
"description": "Vue + Vite component lib",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18.12.0",
|
|
9
|
+
"pnpm": ">=8.15.0"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "cross-env MOCK_SERVER_PORT=8086 vite",
|
|
13
|
+
"build": "vue-tsc --noEmit && vite build",
|
|
14
|
+
"build:dev": "vue-tsc --noEmit && vite build --mode=development",
|
|
15
|
+
"preview": "vite preview",
|
|
16
|
+
"lint": "eslint . && vue-tsc --noEmit",
|
|
17
|
+
"lint:fix": "eslint . --fix",
|
|
18
|
+
"test": "vitest",
|
|
19
|
+
"release": "bumpp --commit --push --tag"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@iconify/vue": "4.3.0",
|
|
23
|
+
"@micro-zoe/micro-app": "1.0.0-rc.24",
|
|
24
|
+
"@unhead/vue": "^2.0.5",
|
|
25
|
+
"@vant/area-data": "^2.0.0",
|
|
26
|
+
"@vant/touch-emulator": "^1.4.0",
|
|
27
|
+
"@vant/use": "^1.6.0",
|
|
28
|
+
"@vueuse/core": "^13.1.0",
|
|
29
|
+
"animate.css": "^4.1.1",
|
|
30
|
+
"axios": "^1.8.4",
|
|
31
|
+
"crypto-js": "^4.2.0",
|
|
32
|
+
"dayjs": "^1.11.13",
|
|
33
|
+
"echarts": "^5.6.0",
|
|
34
|
+
"lodash-es": "^4.17.21",
|
|
35
|
+
"nprogress": "^0.2.0",
|
|
36
|
+
"ol": "^10.5.0",
|
|
37
|
+
"pinia": "^3.0.2",
|
|
38
|
+
"pinia-plugin-persistedstate": "^4.2.0",
|
|
39
|
+
"qs": "^6.14.0",
|
|
40
|
+
"resize-detector": "^0.3.0",
|
|
41
|
+
"store": "^2.0.12",
|
|
42
|
+
"vant": "^4.9.18",
|
|
43
|
+
"vconsole": "^3.15.1",
|
|
44
|
+
"vue": "^3.5.13",
|
|
45
|
+
"vue-router": "^4.5.0",
|
|
46
|
+
"vue3-hash-calendar": "^1.1.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@antfu/eslint-config": "^4.12.0",
|
|
50
|
+
"@iconify/json": "2.2.318",
|
|
51
|
+
"@types/crypto-js": "^4.2.2",
|
|
52
|
+
"@types/lodash-es": "^4.17.12",
|
|
53
|
+
"@types/node": "^22.14.1",
|
|
54
|
+
"@types/nprogress": "^0.2.3",
|
|
55
|
+
"@types/store": "^2.0.5",
|
|
56
|
+
"@unocss/eslint-plugin": "^66.1.0-beta.11",
|
|
57
|
+
"@unocss/preset-rem-to-px": "66.1.0-beta.11",
|
|
58
|
+
"@vitejs/plugin-legacy": "^6.0.2",
|
|
59
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
60
|
+
"autoprefixer": "^10.4.21",
|
|
61
|
+
"bumpp": "^10.1.0",
|
|
62
|
+
"commitizen": "^4.3.1",
|
|
63
|
+
"consola": "^3.4.2",
|
|
64
|
+
"cross-env": "^7.0.3",
|
|
65
|
+
"cz-emoji-chinese": "^0.3.1",
|
|
66
|
+
"eslint": "^9.24.0",
|
|
67
|
+
"eslint-ts-patch": "^8.57.0-0",
|
|
68
|
+
"husky": "^9.1.7",
|
|
69
|
+
"less": "^4.3.0",
|
|
70
|
+
"mockjs": "^1.1.0",
|
|
71
|
+
"postcss-mobile-forever": "^5.0.0",
|
|
72
|
+
"rollup": "^4.40.0",
|
|
73
|
+
"terser": "^5.39.0",
|
|
74
|
+
"typescript": "^5.8.3",
|
|
75
|
+
"unocss": "^66.1.0-beta.11",
|
|
76
|
+
"unplugin-auto-import": "^19.1.2",
|
|
77
|
+
"unplugin-vue-components": "^28.4.1",
|
|
78
|
+
"unplugin-vue-router": "^0.12.0",
|
|
79
|
+
"vite": "^6.2.6",
|
|
80
|
+
"vite-plugin-compression": "^0.5.1",
|
|
81
|
+
"vite-plugin-mock-dev-server": "^1.8.5",
|
|
82
|
+
"vite-plugin-pwa": "^1.0.0",
|
|
83
|
+
"vite-plugin-sitemap": "^0.7.1",
|
|
84
|
+
"vite-plugin-svg-icons": "^2.0.1",
|
|
85
|
+
"vite-plugin-vconsole": "^2.1.1",
|
|
86
|
+
"vite-plugin-vue-devtools": "^7.7.2",
|
|
87
|
+
"vite-plugin-vue-layouts": "^0.11.0",
|
|
88
|
+
"vitest": "^3.1.1",
|
|
89
|
+
"vue-tsc": "^2.2.8"
|
|
90
|
+
},
|
|
91
|
+
"pnpm": {
|
|
92
|
+
"peerDependencyRules": {
|
|
93
|
+
"ignoreMissing": [
|
|
94
|
+
"postcss",
|
|
95
|
+
"esbuild"
|
|
96
|
+
],
|
|
97
|
+
"allowedVersions": {
|
|
98
|
+
"rollup": "^4.x"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"config": {
|
|
103
|
+
"commitizen": {
|
|
104
|
+
"path": "./node_modules/cz-emoji-chinese"
|
|
105
|
+
},
|
|
106
|
+
"cz-emoji-chinese": {
|
|
107
|
+
"skipQuestions": [
|
|
108
|
+
"body",
|
|
109
|
+
"scope"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -14,6 +14,7 @@ import { getDict } from '@af-mobile-client-vue3/utils/dictUtil'
|
|
|
14
14
|
import { getRangeByType } from '@af-mobile-client-vue3/utils/queryFormDefaultRangePicker'
|
|
15
15
|
import { executeStrFunctionByContext } from '@af-mobile-client-vue3/utils/runEvalFunction'
|
|
16
16
|
import { areaList } from '@vant/area-data'
|
|
17
|
+
import dayjs from 'dayjs'
|
|
17
18
|
import { debounce } from 'lodash-es'
|
|
18
19
|
import {
|
|
19
20
|
Area as VanArea,
|
|
@@ -196,6 +197,71 @@ function getDefaultValue() {
|
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
|
|
200
|
+
function getDateRange({
|
|
201
|
+
type,
|
|
202
|
+
formDefault: defaultValue,
|
|
203
|
+
queryType,
|
|
204
|
+
queryValueFormat: defaultFormat,
|
|
205
|
+
name,
|
|
206
|
+
}: {
|
|
207
|
+
type: string
|
|
208
|
+
formDefault: string
|
|
209
|
+
queryType?: string
|
|
210
|
+
queryValueFormat?: string
|
|
211
|
+
name: string
|
|
212
|
+
}): string | [string, string] | undefined {
|
|
213
|
+
const formatMap: Record<string, string> = {
|
|
214
|
+
yearPicker: 'YYYY',
|
|
215
|
+
yearRangePicker: 'YYYY',
|
|
216
|
+
monthPicker: 'YYYY-MM',
|
|
217
|
+
monthRangePicker: 'YYYY-MM',
|
|
218
|
+
datePicker: 'YYYY-MM-DD HH:mm:ss',
|
|
219
|
+
rangePicker: 'YYYY-MM-DD HH:mm:ss',
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const format = defaultFormat || formatMap[type]
|
|
223
|
+
|
|
224
|
+
let start: string, end: string
|
|
225
|
+
|
|
226
|
+
switch (defaultValue) {
|
|
227
|
+
case 'curYear':
|
|
228
|
+
start = dayjs().startOf('year').format(format)
|
|
229
|
+
end = dayjs().endOf('year').format(format)
|
|
230
|
+
break
|
|
231
|
+
case 'curMonth':
|
|
232
|
+
start = dayjs().startOf('month').format(format)
|
|
233
|
+
end = dayjs().endOf('month').format(format)
|
|
234
|
+
break
|
|
235
|
+
case 'curDay':
|
|
236
|
+
start = dayjs().startOf('day').format(format)
|
|
237
|
+
end = dayjs().endOf('day').format(format)
|
|
238
|
+
break
|
|
239
|
+
case 'curTime':
|
|
240
|
+
start = dayjs().format(format)
|
|
241
|
+
end = dayjs().format(format)
|
|
242
|
+
break
|
|
243
|
+
default:
|
|
244
|
+
return undefined
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (['monthPicker', 'yearPicker', 'datePicker'].includes(type)) {
|
|
248
|
+
if (queryType === 'BETWEEN') {
|
|
249
|
+
return [start, end]
|
|
250
|
+
}
|
|
251
|
+
if (name.includes('开始') || name.includes('起始')) {
|
|
252
|
+
return start
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
return end
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (['rangePicker', 'yearRangePicker', 'monthRangePicker'].includes(type)) {
|
|
259
|
+
return [start, end]
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return [start, end]
|
|
263
|
+
}
|
|
264
|
+
|
|
199
265
|
// 改用 ref,并设置初始值
|
|
200
266
|
const localValue = ref(getDefaultValue())
|
|
201
267
|
|
|
@@ -209,7 +275,12 @@ watch(() => props.modelValue, (newVal) => {
|
|
|
209
275
|
if (attr.type === 'rangePicker') {
|
|
210
276
|
console.log('newVal', newVal)
|
|
211
277
|
pickerValue.value = newVal !== undefined ? `${newVal[0]} ~ ${newVal[1]}` : getDefaultValue()
|
|
212
|
-
|
|
278
|
+
}
|
|
279
|
+
else if (['datePicker', 'rangePicker', 'yearPicker', 'monthPicker', 'yearRangePicker', 'monthRangePicker'].includes(attr.type)) {
|
|
280
|
+
console.log('>>>> attr: ', JSON.stringify(attr))
|
|
281
|
+
const ss = getDateRange(attr)
|
|
282
|
+
console.log('>>>> ss: ', ss)
|
|
283
|
+
localValue.value = getDateRange(attr)
|
|
213
284
|
}
|
|
214
285
|
else {
|
|
215
286
|
console.log('newVal', newVal)
|
|
@@ -12,13 +12,14 @@ const formGroupAddConstruction = ref(null)
|
|
|
12
12
|
<template>
|
|
13
13
|
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
14
14
|
<template #layout_content>
|
|
15
|
-
<div class="form">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
<div class="form">
|
|
16
|
+
<XForm
|
|
17
|
+
ref="formGroupAddConstruction"
|
|
18
|
+
mode="新增"
|
|
19
|
+
:config-name="configName"
|
|
20
|
+
:service-name="serviceName"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
22
23
|
</template>
|
|
23
24
|
</NormalDataLayout>
|
|
24
25
|
</template>
|