af-mobile-client-vue3 1.2.59 → 1.3.2

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.
Files changed (56) hide show
  1. package/.editorconfig +5 -34
  2. package/.env +1 -1
  3. package/.env.development +0 -3
  4. package/.env.production +1 -7
  5. package/build/vite/index.ts +2 -12
  6. package/build/vite/optimize.ts +2 -2
  7. package/compress.js +36 -0
  8. package/package.json +37 -37
  9. package/src/App.vue +3 -5
  10. package/src/assets/img/banner/appraise-banner-1.png +0 -0
  11. package/src/assets/img/banner/appraise-banner-2.png +0 -0
  12. package/src/components/core/BeautifulLoading/index.vue +1 -2
  13. package/src/components/core/ImageUploader/index.vue +3 -2
  14. package/src/components/core/NavBar/index.vue +23 -13
  15. package/src/components/core/Tabbar/index.vue +5 -3
  16. package/src/components/data/XBadge/index.vue +2 -2
  17. package/src/components/data/XCellList/index.vue +17 -14
  18. package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
  19. package/src/components/data/XFormGroup/index.vue +11 -1
  20. package/src/components/data/XFormItem/index.vue +2 -22
  21. package/src/components/data/XOlMap/utils/wgs84ToGcj02.js +154 -154
  22. package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
  23. package/src/components/data/XReportForm/index.vue +23 -14
  24. package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
  25. package/src/components/data/XReportGrid/XReport.vue +3 -3
  26. package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
  27. package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
  28. package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
  29. package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
  30. package/src/components/layout/NormalDataLayout/index.vue +2 -3
  31. package/src/config/routes.ts +6 -2
  32. package/src/constants/index.ts +2 -0
  33. package/src/locales/en-US.json +52 -28
  34. package/src/locales/zh-CN.json +57 -33
  35. package/src/main.ts +0 -2
  36. package/src/router/routes.ts +0 -6
  37. package/src/router/types.ts +0 -2
  38. package/src/types/vue-router.d.ts +0 -2
  39. package/src/utils/mobileUtil.ts +2 -2
  40. package/src/utils/queryFormDefaultRangePicker.ts +57 -57
  41. package/src/utils/set-page-title.ts +3 -5
  42. package/src/views/common/LoadError.vue +1 -2
  43. package/src/views/common/NotFound.vue +2 -3
  44. package/src/views/component/XCellListView/index.vue +15 -142
  45. package/src/views/component/XFormGroupView/index.vue +15 -11
  46. package/src/views/component/XFormView/index.vue +17 -2
  47. package/src/views/component/XFormView/oldindex.vue +70 -0
  48. package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
  49. package/tsconfig.json +5 -8
  50. package/uno.config.ts +32 -1
  51. package/vite.config.ts +1 -1
  52. package/.env.envoiceShow +0 -7
  53. package/src/components/core/App/MicroAppView.vue +0 -59
  54. package/src/components/core/SvgIcon/index.vue +0 -61
  55. package/src/utils/local-storage.ts +0 -9
  56. package/src/views/component/XFormGroupView/xformgroup222.vue +0 -97
@@ -2,7 +2,6 @@
2
2
  import type { FieldType } from 'vant'
3
3
  import type { Numeric } from 'vant/es/utils'
4
4
  import ImageUploader from '@af-mobile-client-vue3/components/core/ImageUploader/index.vue'
5
- import Uploader from '@af-mobile-client-vue3/components/core/Uploader/index.vue'
6
5
  import XGridDropOption from '@af-mobile-client-vue3/components/core/XGridDropOption/index.vue'
7
6
  import XMultiSelect from '@af-mobile-client-vue3/components/core/XMultiSelect/index.vue'
8
7
  import XSelect from '@af-mobile-client-vue3/components/core/XSelect/index.vue'
@@ -964,29 +963,9 @@ function findOptionInTree(options, value) {
964
963
  </VanField>
965
964
 
966
965
  <!-- 文件上传 -->
967
- <VanField
968
- v-if="attr.type === 'file' && showItem"
969
- name="uploader"
970
- :label="labelData"
971
- :label-align="labelAlign"
972
- :input-align="attr.inputAlign ? attr.inputAlign : 'left'"
973
- :rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
974
- :required="attr.rule.required === 'true'"
975
- >
976
- <template #input>
977
- <!-- <van-uploader v-model="localValue" /> -->
978
- <Uploader
979
- upload-mode="server"
980
- :image-list="(modelData as any[])"
981
- authority="admin"
982
- @update-file-list="updateFile"
983
- />
984
- </template>
985
- </VanField>
986
-
987
966
  <!-- 图片上传, 手机端拍照 -->
988
967
  <VanField
989
- v-if="attr.type === 'image' && showItem"
968
+ v-if="(attr.type === 'image' || attr.type === 'file') && showItem"
990
969
  name="image"
991
970
  :label="labelData"
992
971
  :label-align="labelAlign"
@@ -1000,6 +979,7 @@ function findOptionInTree(options, value) {
1000
979
  :image-list="(modelData as any[])"
1001
980
  authority="admin"
1002
981
  :attr="attr"
982
+ :mode="props.mode"
1003
983
  @update-file-list="updateFile"
1004
984
  />
1005
985
  </template>
@@ -1,154 +1,154 @@
1
- // 导入proj控件
2
- import * as proj from 'ol/proj'
3
-
4
- function forEachPoint(func) {
5
- return function (input, opt_output, opt_dimension) {
6
- const len = input.length
7
-
8
- const dimension = opt_dimension || 2
9
- let output
10
-
11
- if (opt_output) {
12
- output = opt_output
13
- }
14
- else {
15
- if (dimension !== 2) {
16
- output = input.slice()
17
- }
18
- else {
19
- output = [len]
20
- }
21
- }
22
- for (let offset = 0; offset < len; offset += dimension) {
23
- func(input, output, offset)
24
- }
25
- return output
26
- }
27
- }
28
-
29
- const gcj02 = {}
30
- const PI = Math.PI
31
- const AXIS = 6378245.0
32
- // eslint-disable-next-line no-loss-of-precision
33
- const OFFSET = 0.00669342162296594323 // (a^2 - b^2) / a^2
34
-
35
- function delta(wgLon, wgLat) {
36
- let dLat = transformLat(wgLon - 105.0, wgLat - 35.0)
37
- let dLon = transformLon(wgLon - 105.0, wgLat - 35.0)
38
- const radLat = (wgLat / 180.0) * PI
39
- let magic = Math.sin(radLat)
40
- magic = 1 - OFFSET * magic * magic
41
- const sqrtMagic = Math.sqrt(magic)
42
- dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI)
43
- dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI)
44
- return [dLon, dLat]
45
- }
46
-
47
- function outOfChina(lon, lat) {
48
- if (lon < 72.004 || lon > 137.8347) {
49
- return true
50
- }
51
- return lat < 0.8293 || lat > 55.8271
52
- }
53
-
54
- function transformLat(x, y) {
55
- let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
56
- ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
57
- ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0
58
- ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0
59
- return ret
60
- }
61
-
62
- function transformLon(x, y) {
63
- let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
64
- ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
65
- ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0
66
- ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0
67
- return ret
68
- }
69
-
70
- gcj02.toWGS84 = forEachPoint((input, output, offset) => {
71
- let lng = input[offset]
72
- let lat = input[offset + 1]
73
- if (!outOfChina(lng, lat)) {
74
- const deltaD = delta(lng, lat)
75
- lng = lng - deltaD[0] // 改回减法
76
- lat = lat - deltaD[1] // 改回减法
77
- }
78
- output[offset] = lng
79
- output[offset + 1] = lat
80
- })
81
-
82
- gcj02.fromWGS84 = forEachPoint((input, output, offset) => {
83
- let lng = input[offset]
84
- let lat = input[offset + 1]
85
- if (!outOfChina(lng, lat)) {
86
- const deltaD = delta(lng, lat)
87
- lng = lng + deltaD[0] // 改回加法
88
- lat = lat + deltaD[1] // 改回加法
89
- }
90
- output[offset] = lng
91
- output[offset + 1] = lat
92
- })
93
-
94
- const sphericalMercator = {}
95
- const RADIUS = 6378137
96
- const MAX_LATITUDE = 85.0511287798
97
- const RAD_PER_DEG = Math.PI / 180
98
-
99
- sphericalMercator.forward = forEachPoint((input, output, offset) => {
100
- const lat = Math.max(Math.min(MAX_LATITUDE, input[offset + 1]), -MAX_LATITUDE)
101
- const sin = Math.sin(lat * RAD_PER_DEG)
102
- output[offset] = RADIUS * input[offset] * RAD_PER_DEG
103
- output[offset + 1] = (RADIUS * Math.log((1 + sin) / (1 - sin))) / 2
104
- })
105
-
106
- sphericalMercator.inverse = forEachPoint((input, output, offset) => {
107
- output[offset] = input[offset] / RADIUS / RAD_PER_DEG
108
- output[offset + 1] = (2 * Math.atan(Math.exp(input[offset + 1] / RADIUS)) - Math.PI / 2) / RAD_PER_DEG
109
- })
110
-
111
- const projzh = {}
112
-
113
- projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
114
- const output = gcj02.toWGS84(input, opt_output, opt_dimension) // 改用 toWGS84
115
- return projzh.ll2smerc(output, output, opt_dimension)
116
- }
117
-
118
- projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
119
- const output = projzh.smerc2ll(input, input, opt_dimension)
120
- return gcj02.fromWGS84(output, opt_output, opt_dimension) // 改用 fromWGS84
121
- }
122
-
123
- // smerc2gmerc 需要修改
124
-
125
- projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
126
- let output = projzh.smerc2ll(input, input, opt_dimension)
127
- output = gcj02.toWGS84(output, output, opt_dimension) // 这里应该用 toWGS84
128
- return projzh.ll2smerc(output, output, opt_dimension)
129
- }
130
-
131
- // gmerc2smerc 需要修改
132
-
133
- projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
134
- let output = projzh.smerc2ll(input, input, opt_dimension)
135
- output = gcj02.fromWGS84(output, output, opt_dimension) // 这里应该用 fromWGS84
136
- return projzh.ll2smerc(output, output, opt_dimension)
137
- }
138
-
139
- projzh.ll2smerc = sphericalMercator.forward
140
- projzh.smerc2ll = sphericalMercator.inverse
141
-
142
- // 定义WGS84转GCJ02的投影
143
- const extent = [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]
144
- export const wgs84ToGcj02Projection = new proj.Projection({
145
- code: 'WGS84-TO-GCJ02',
146
- extent,
147
- units: 'm',
148
- })
149
-
150
- // 添加投影和转换方法
151
- proj.addProjection(wgs84ToGcj02Projection)
152
- // 注意这里转换方法的顺序与原来相反
153
- proj.addCoordinateTransforms('EPSG:4326', wgs84ToGcj02Projection, projzh.ll2gmerc, projzh.gmerc2ll)
154
- proj.addCoordinateTransforms('EPSG:3857', wgs84ToGcj02Projection, projzh.smerc2gmerc, projzh.gmerc2smerc)
1
+ // 导入proj控件
2
+ import * as proj from 'ol/proj'
3
+
4
+ function forEachPoint(func) {
5
+ return function (input, opt_output, opt_dimension) {
6
+ const len = input.length
7
+
8
+ const dimension = opt_dimension || 2
9
+ let output
10
+
11
+ if (opt_output) {
12
+ output = opt_output
13
+ }
14
+ else {
15
+ if (dimension !== 2) {
16
+ output = input.slice()
17
+ }
18
+ else {
19
+ output = [len]
20
+ }
21
+ }
22
+ for (let offset = 0; offset < len; offset += dimension) {
23
+ func(input, output, offset)
24
+ }
25
+ return output
26
+ }
27
+ }
28
+
29
+ const gcj02 = {}
30
+ const PI = Math.PI
31
+ const AXIS = 6378245.0
32
+ // eslint-disable-next-line no-loss-of-precision
33
+ const OFFSET = 0.00669342162296594323 // (a^2 - b^2) / a^2
34
+
35
+ function delta(wgLon, wgLat) {
36
+ let dLat = transformLat(wgLon - 105.0, wgLat - 35.0)
37
+ let dLon = transformLon(wgLon - 105.0, wgLat - 35.0)
38
+ const radLat = (wgLat / 180.0) * PI
39
+ let magic = Math.sin(radLat)
40
+ magic = 1 - OFFSET * magic * magic
41
+ const sqrtMagic = Math.sqrt(magic)
42
+ dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI)
43
+ dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI)
44
+ return [dLon, dLat]
45
+ }
46
+
47
+ function outOfChina(lon, lat) {
48
+ if (lon < 72.004 || lon > 137.8347) {
49
+ return true
50
+ }
51
+ return lat < 0.8293 || lat > 55.8271
52
+ }
53
+
54
+ function transformLat(x, y) {
55
+ let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
56
+ ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
57
+ ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0
58
+ ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0
59
+ return ret
60
+ }
61
+
62
+ function transformLon(x, y) {
63
+ let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
64
+ ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
65
+ ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0
66
+ ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0
67
+ return ret
68
+ }
69
+
70
+ gcj02.toWGS84 = forEachPoint((input, output, offset) => {
71
+ let lng = input[offset]
72
+ let lat = input[offset + 1]
73
+ if (!outOfChina(lng, lat)) {
74
+ const deltaD = delta(lng, lat)
75
+ lng = lng - deltaD[0] // 改回减法
76
+ lat = lat - deltaD[1] // 改回减法
77
+ }
78
+ output[offset] = lng
79
+ output[offset + 1] = lat
80
+ })
81
+
82
+ gcj02.fromWGS84 = forEachPoint((input, output, offset) => {
83
+ let lng = input[offset]
84
+ let lat = input[offset + 1]
85
+ if (!outOfChina(lng, lat)) {
86
+ const deltaD = delta(lng, lat)
87
+ lng = lng + deltaD[0] // 改回加法
88
+ lat = lat + deltaD[1] // 改回加法
89
+ }
90
+ output[offset] = lng
91
+ output[offset + 1] = lat
92
+ })
93
+
94
+ const sphericalMercator = {}
95
+ const RADIUS = 6378137
96
+ const MAX_LATITUDE = 85.0511287798
97
+ const RAD_PER_DEG = Math.PI / 180
98
+
99
+ sphericalMercator.forward = forEachPoint((input, output, offset) => {
100
+ const lat = Math.max(Math.min(MAX_LATITUDE, input[offset + 1]), -MAX_LATITUDE)
101
+ const sin = Math.sin(lat * RAD_PER_DEG)
102
+ output[offset] = RADIUS * input[offset] * RAD_PER_DEG
103
+ output[offset + 1] = (RADIUS * Math.log((1 + sin) / (1 - sin))) / 2
104
+ })
105
+
106
+ sphericalMercator.inverse = forEachPoint((input, output, offset) => {
107
+ output[offset] = input[offset] / RADIUS / RAD_PER_DEG
108
+ output[offset + 1] = (2 * Math.atan(Math.exp(input[offset + 1] / RADIUS)) - Math.PI / 2) / RAD_PER_DEG
109
+ })
110
+
111
+ const projzh = {}
112
+
113
+ projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
114
+ const output = gcj02.toWGS84(input, opt_output, opt_dimension) // 改用 toWGS84
115
+ return projzh.ll2smerc(output, output, opt_dimension)
116
+ }
117
+
118
+ projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
119
+ const output = projzh.smerc2ll(input, input, opt_dimension)
120
+ return gcj02.fromWGS84(output, opt_output, opt_dimension) // 改用 fromWGS84
121
+ }
122
+
123
+ // smerc2gmerc 需要修改
124
+
125
+ projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
126
+ let output = projzh.smerc2ll(input, input, opt_dimension)
127
+ output = gcj02.toWGS84(output, output, opt_dimension) // 这里应该用 toWGS84
128
+ return projzh.ll2smerc(output, output, opt_dimension)
129
+ }
130
+
131
+ // gmerc2smerc 需要修改
132
+
133
+ projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
134
+ let output = projzh.smerc2ll(input, input, opt_dimension)
135
+ output = gcj02.fromWGS84(output, output, opt_dimension) // 这里应该用 fromWGS84
136
+ return projzh.ll2smerc(output, output, opt_dimension)
137
+ }
138
+
139
+ projzh.ll2smerc = sphericalMercator.forward
140
+ projzh.smerc2ll = sphericalMercator.inverse
141
+
142
+ // 定义WGS84转GCJ02的投影
143
+ const extent = [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]
144
+ export const wgs84ToGcj02Projection = new proj.Projection({
145
+ code: 'WGS84-TO-GCJ02',
146
+ extent,
147
+ units: 'm',
148
+ })
149
+
150
+ // 添加投影和转换方法
151
+ proj.addProjection(wgs84ToGcj02Projection)
152
+ // 注意这里转换方法的顺序与原来相反
153
+ proj.addCoordinateTransforms('EPSG:4326', wgs84ToGcj02Projection, projzh.ll2gmerc, projzh.gmerc2ll)
154
+ proj.addCoordinateTransforms('EPSG:3857', wgs84ToGcj02Projection, projzh.smerc2gmerc, projzh.gmerc2smerc)
@@ -81,10 +81,10 @@ initComponent()
81
81
  function initComponent() {
82
82
  for (let i = 0; i < props.jsonConfig.content.length; i++) {
83
83
  receivedFunction.push({
84
- // eslint-disable-next-line no-eval
85
- labelFunction: eval(`(${props.jsonConfig.content[i].customFunctionForLabel})`),
86
- // eslint-disable-next-line no-eval
87
- valueFunction: eval(`(${props.jsonConfig.content[i].customFunctionForValue})`),
84
+ // eslint-disable-next-line no-new-func
85
+ labelFunction: new Function(`return ${props.jsonConfig.content[i].customFunctionForLabel}`)(),
86
+ // eslint-disable-next-line no-new-func
87
+ valueFunction: new Function(`return ${props.jsonConfig.content[i].customFunctionForValue}`)(),
88
88
  })
89
89
  }
90
90
  formatConfig()
@@ -127,25 +127,25 @@ function initComponent() {
127
127
  </template>
128
128
 
129
129
  <style scoped lang="less">
130
- .main{
130
+ .main {
131
131
  padding-top: 4vh;
132
132
  width: 100vw;
133
133
  height: 100vh;
134
134
  background-color: #eff2f5;
135
135
 
136
- .title{
136
+ .title {
137
137
  padding-bottom: 2vh;
138
138
  color: rgb(50, 50, 51);
139
139
  text-align: center;
140
140
  margin: 0 0 3vh;
141
141
  }
142
142
 
143
- .text_box{
143
+ .text_box {
144
144
  margin-top: 2vh;
145
145
  margin-bottom: 2vh;
146
146
  }
147
147
 
148
- .main_text{
148
+ .main_text {
149
149
  padding-left: 16px;
150
150
  font-weight: 400;
151
151
  line-height: 1.6;
@@ -154,53 +154,53 @@ function initComponent() {
154
154
  font-size: 14px;
155
155
  }
156
156
 
157
- .show_value_item{
157
+ .show_value_item {
158
158
  text-align: center;
159
159
  font-size: 1.2em;
160
160
  }
161
161
 
162
- .cell_group{
162
+ .cell_group {
163
163
  margin-top: 2vh;
164
164
  margin-bottom: 2vh;
165
165
  }
166
166
 
167
- .form_item{
167
+ .form_item {
168
168
  margin-top: 2vh;
169
169
  }
170
170
 
171
- .button_group{
171
+ .button_group {
172
172
  text-align: center;
173
173
  margin-top: 3vh;
174
174
  margin-bottom: 3vh;
175
175
  }
176
176
 
177
- .button_group>:first-child {
177
+ .button_group > :first-child {
178
178
  margin-right: 3vw;
179
179
  }
180
180
 
181
- .divider{
181
+ .divider {
182
182
  color: #1989fa;
183
183
  border-color: #1989fa;
184
- padding: 0 16px
184
+ padding: 0 16px;
185
185
  }
186
186
 
187
- .submit_button{
187
+ .submit_button {
188
188
  background-color: #eff2f5;
189
189
  padding: 5vh;
190
190
  }
191
191
  }
192
192
 
193
- .skeleton{
194
- margin-top: 5vh
193
+ .skeleton {
194
+ margin-top: 5vh;
195
195
  }
196
- .my-cell-group{
197
- margin: 0 0 10px 0
196
+ .my-cell-group {
197
+ margin: 0 0 10px 0;
198
198
  }
199
199
  :deep(.van-collapse-item__content) {
200
200
  background-color: #eff2f5;
201
201
  padding: 10px 0;
202
202
  }
203
- :deep(.van-cell-group__title){
203
+ :deep(.van-cell-group__title) {
204
204
  padding-top: 10px;
205
205
  padding-bottom: 10px;
206
206
  }
@@ -210,7 +210,7 @@ function initComponent() {
210
210
  :deep(.van-cell__title) {
211
211
  font-weight: 600;
212
212
  }
213
- :deep(.van-uploader__wrapper){
213
+ :deep(.van-uploader__wrapper) {
214
214
  padding: 10px;
215
215
  display: flex;
216
216
  flex-wrap: wrap;
@@ -143,10 +143,7 @@ function isFieldEmpty(value: any): boolean {
143
143
  if (Array.isArray(value) && value.length === 0) {
144
144
  return true
145
145
  }
146
- if (typeof value === 'object' && Object.keys(value).length === 0) {
147
- return true
148
- }
149
- return false
146
+ return typeof value === 'object' && Object.keys(value).length === 0
150
147
  }
151
148
 
152
149
  // 表单校验
@@ -432,16 +429,28 @@ function getConfigAndJoin(config: configDefine, outerLock: getConfigLock): void
432
429
  }
433
430
  }
434
431
 
435
- function deserializeFunctionAndRun(functionStr, value) {
436
- // eslint-disable-next-line no-eval
437
- const fun = eval(`(${functionStr})`)
438
- return fun(value, activatedConfig)
432
+ function deserializeFunctionAndRun(functionStr: string, value: any) {
433
+ try {
434
+ // eslint-disable-next-line no-new-func
435
+ const fun = new Function('value', 'activatedConfig', `return (${functionStr})(value, activatedConfig)`)
436
+ return fun(value, activatedConfig)
437
+ }
438
+ catch (err) {
439
+ console.error('Failed to deserialize and run function:', err)
440
+ return null
441
+ }
439
442
  }
440
443
 
441
- function deserializeFunctionAndRunWithConfig(functionStr) {
442
- // eslint-disable-next-line no-eval
443
- const fun = eval(`(${functionStr})`)
444
- return fun(activatedConfig)
444
+ function deserializeFunctionAndRunWithConfig(functionStr: string) {
445
+ try {
446
+ // eslint-disable-next-line no-new-func
447
+ const fun = new Function('activatedConfig', `return (${functionStr})(activatedConfig)`)
448
+ return fun(activatedConfig)
449
+ }
450
+ catch (err) {
451
+ console.error('Failed to deserialize and run function with config:', err)
452
+ return null
453
+ }
445
454
  }
446
455
 
447
456
  // 将table配置的表格转换为适合Form展示的格式
@@ -1009,9 +1018,9 @@ function getNow() {
1009
1018
  <van-cell-group v-else-if="row.type === 'signature'" inset style="margin-top: 4vh">
1010
1019
  <van-field
1011
1020
  :label="row.valueText ? `${row.valueText}:` : ''"
1012
- readonly
1021
+
1013
1022
  rows="1"
1014
- autosize
1023
+ autosize readonly
1015
1024
  >
1016
1025
  <template #button>
1017
1026
  <XSignature v-model="activatedConfig.data[row.dataIndex]" />
@@ -33,7 +33,7 @@ const attr = ref({})
33
33
 
34
34
  // Store
35
35
  const userStore = useUserStore()
36
- const { user: currUser } = storeToRefs(userStore)
36
+ const currUser = storeToRefs(userStore)
37
37
 
38
38
  // Refs
39
39
  const mainRef = ref()
@@ -142,7 +142,6 @@ async function onSubmit() {
142
142
  if (result?.message) {
143
143
  showDialog({
144
144
  message: result.message,
145
- type: messageType,
146
145
  })
147
146
  }
148
147
 
@@ -295,7 +295,7 @@ function exportData() {
295
295
  }
296
296
 
297
297
  function printDocument() {
298
- const printContent = window.rawDocument.getElementById('printReady')
298
+ const printContent = (window as any).rawDocument.getElementById('printReady')
299
299
  // printElement(printContent)
300
300
  showDialog({ message: '操作成功!' })
301
301
  }
@@ -321,8 +321,8 @@ function configInit() {
321
321
  activeConfig.value.columns.forEach((row: any[]) => {
322
322
  row.forEach((cell) => {
323
323
  if (cell.dynamicDataIndex === true) {
324
- // eslint-disable-next-line no-eval
325
- const func = eval(`(${cell.customFunctionForDynamicDataIndex})`)
324
+ // eslint-disable-next-line no-new-func
325
+ const func = new Function(`return ${cell.customFunctionForDynamicDataIndex}`)()
326
326
  cell.dataIndex = func(config.value)
327
327
  }
328
328
  if (['action', 'click'].includes(cell.eventType) && cell.customFunction && !cell.events) {
@@ -151,7 +151,7 @@ onMounted(() => {
151
151
  })
152
152
 
153
153
  // 监听
154
- watch(() => props.config, (newVal) => {
154
+ watch(() => props.config, () => {
155
155
  // 配置变化时的处理
156
156
  }, { deep: true })
157
157
 
@@ -248,10 +248,10 @@ watch(() => activatedConfig.value, (val) => {
248
248
  <span class="inputsDivItemLabel">{{ displayFormatStartText(item.format) }}</span>
249
249
  <template v-if="!forDisplay">
250
250
  <template v-if="item.inputReadOnly === true">
251
- <a-input v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" :disabled="true" />
251
+ <van-field v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" :disabled="true" />
252
252
  </template>
253
253
  <template v-else>
254
- <a-input v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" />
254
+ <van-field v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" />
255
255
  </template>
256
256
  </template>
257
257
  <template v-else>
@@ -446,7 +446,7 @@ watch(() => activatedConfig.value, (val) => {
446
446
  </template>
447
447
 
448
448
  <style lang="less" scoped>
449
- .img{
449
+ .img {
450
450
  width: 95%;
451
451
  height: 180px;
452
452
  object-fit: cover;
@@ -490,8 +490,8 @@ watch(() => activatedConfig.value, (val) => {
490
490
  .reportTable {
491
491
  width: 100%;
492
492
  border-collapse: collapse;
493
- table-layout:fixed;
494
- word-break:break-all;
493
+ table-layout: fixed;
494
+ word-break: break-all;
495
495
  }
496
496
  }
497
497
  .reportMainForDisplay {
@@ -532,8 +532,8 @@ watch(() => activatedConfig.value, (val) => {
532
532
  .reportTable {
533
533
  width: 100%;
534
534
  border-collapse: collapse;
535
- table-layout:fixed;
536
- word-break:break-all;
535
+ table-layout: fixed;
536
+ word-break: break-all;
537
537
  }
538
538
  }
539
539
  .reportMainNoPadding {
@@ -544,7 +544,7 @@ watch(() => activatedConfig.value, (val) => {
544
544
  // background-color: #fff;
545
545
  border-radius: 8px;
546
546
  height: auto;
547
- min-height : 20vh;
547
+ min-height: 20vh;
548
548
  overflow-y: auto;
549
549
  overflow-x: hidden;
550
550
 
@@ -578,17 +578,17 @@ watch(() => activatedConfig.value, (val) => {
578
578
  .reportTable {
579
579
  width: 100%;
580
580
  border-collapse: collapse;
581
- table-layout:fixed;
582
- word-break:break-all;
581
+ table-layout: fixed;
582
+ word-break: break-all;
583
583
  }
584
584
  }
585
- .tools{
585
+ .tools {
586
586
  position: fixed;
587
587
  right: 2%;
588
588
  text-align: right;
589
589
  width: 60%;
590
590
  cursor: pointer;
591
- .toolsItem{
591
+ .toolsItem {
592
592
  width: 15%;
593
593
  margin-right: 3%;
594
594
  display: inline-block;
@@ -31,7 +31,7 @@ const attr = ref({})
31
31
 
32
32
  // Store
33
33
  const userStore = useUserStore()
34
- const { user: currUser } = storeToRefs(userStore)
34
+ const currUser = storeToRefs(userStore)
35
35
 
36
36
  // Refs
37
37
  const mainRef = ref()