af-mobile-client-vue3 1.3.1 → 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.
package/compress.js CHANGED
@@ -1,36 +1,36 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
- import { fileURLToPath } from 'node:url'
4
- import * as tar from 'tar'
5
-
6
- // 当前文件所在目录
7
- const __filename = fileURLToPath(import.meta.url)
8
- const __dirname = path.dirname(__filename)
9
-
10
- // 压缩源目录名(即 build 后生成的目录名)
11
- const outputName = `dist_af-library-mobile-web`
12
-
13
- // 源目录路径
14
- const cwd = path.join(__dirname, 'dist', outputName)
15
-
16
- // 输出 tar.gz 文件路径
17
- const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
18
-
19
- if (!fs.existsSync(cwd)) {
20
- console.error('❌ 目录不存在:', cwd)
21
- // eslint-disable-next-line node/prefer-global/process
22
- process.exit(1)
23
- }
24
-
25
- tar.c(
26
- {
27
- gzip: true,
28
- file: outputPath,
29
- cwd,
30
- },
31
- ['.'],
32
- ).then(() => {
33
- console.log(`✅ 压缩完成: ${outputPath}`)
34
- }).catch((err) => {
35
- console.error('❌ 压缩失败:', err)
36
- })
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+ import * as tar from 'tar'
5
+
6
+ // 当前文件所在目录
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ // 压缩源目录名(即 build 后生成的目录名)
11
+ const outputName = `dist_af-library-mobile-web`
12
+
13
+ // 源目录路径
14
+ const cwd = path.join(__dirname, 'dist', outputName)
15
+
16
+ // 输出 tar.gz 文件路径
17
+ const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
18
+
19
+ if (!fs.existsSync(cwd)) {
20
+ console.error('❌ 目录不存在:', cwd)
21
+ // eslint-disable-next-line node/prefer-global/process
22
+ process.exit(1)
23
+ }
24
+
25
+ tar.c(
26
+ {
27
+ gzip: true,
28
+ file: outputPath,
29
+ cwd,
30
+ },
31
+ ['.'],
32
+ ).then(() => {
33
+ console.log(`✅ 压缩完成: ${outputPath}`)
34
+ }).catch((err) => {
35
+ console.error('❌ 压缩失败:', err)
36
+ })
package/package.json CHANGED
@@ -1,114 +1,114 @@
1
- {
2
- "name": "af-mobile-client-vue3",
3
- "type": "module",
4
- "version": "1.3.1",
5
- "packageManager": "pnpm@10.13.1",
6
- "description": "Vue + Vite component lib",
7
- "engines": {
8
- "node": ">=20.19.0"
9
- },
10
- "scripts": {
11
- "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
12
- "compress": "node ./compress.js",
13
- "build:dev": "vue-tsc --noEmit && vite build --mode development",
14
- "build:pro": "vue-tsc --noEmit && vite build --mode production && pnpm run compress",
15
- "preview": "vite preview",
16
- "lint": "eslint .",
17
- "lint:fix": "eslint . --fix",
18
- "release": "bumpp --commit --push --tag",
19
- "typecheck": "vue-tsc --noEmit",
20
- "commitlint": "commitlint --edit",
21
- "prepare": "simple-git-hooks"
22
- },
23
- "dependencies": {
24
- "@iconify/vue": "4.3.0",
25
- "@micro-zoe/micro-app": "1.0.0-rc.26",
26
- "@unhead/vue": "2.0.12",
27
- "@vant/area-data": "^2.0.0",
28
- "@vant/touch-emulator": "^1.4.0",
29
- "@vant/use": "^1.6.0",
30
- "@vueuse/core": "^13.5.0",
31
- "axios": "^1.10.0",
32
- "crypto-js": "^4.2.0",
33
- "dayjs": "^1.11.13",
34
- "echarts": "^5.6.0",
35
- "lodash-es": "^4.17.21",
36
- "nprogress": "^0.2.0",
37
- "ol": "^10.5.0",
38
- "pinia": "^3.0.3",
39
- "pinia-plugin-persistedstate": "^4.4.1",
40
- "resize-detector": "^0.3.0",
41
- "vant": "^4.9.21",
42
- "vconsole": "^3.15.1",
43
- "vue": "^3.5.17",
44
- "vue-i18n": "^11.1.10",
45
- "vue-router": "^4.5.1",
46
- "vue3-hash-calendar": "^1.1.3"
47
- },
48
- "devDependencies": {
49
- "@antfu/eslint-config": "4.17.0",
50
- "@commitlint/cli": "^19.8.1",
51
- "@commitlint/config-conventional": "^19.8.1",
52
- "@commitlint/types": "^19.8.1",
53
- "@iconify/json": "2.2.318",
54
- "@iconify/utils": "^2.3.0",
55
- "@intlify/unplugin-vue-i18n": "^6.0.8",
56
- "@types/crypto-js": "^4.2.2",
57
- "@types/lodash-es": "^4.17.12",
58
- "@types/node": "^24.0.14",
59
- "@types/nprogress": "^0.2.3",
60
- "@unocss/eslint-config": "66.3.3",
61
- "@vitejs/plugin-legacy": "^7.0.1",
62
- "@vitejs/plugin-vue": "^6.0.0",
63
- "autoprefixer": "^10.4.21",
64
- "bumpp": "^10.2.0",
65
- "consola": "^3.4.2",
66
- "cross-env": "^7.0.3",
67
- "eslint": "^9.31.0",
68
- "eslint-plugin-format": "^1.0.1",
69
- "less": "^4.4.0",
70
- "lint-staged": "^16.1.2",
71
- "mockjs": "^1.1.0",
72
- "postcss-mobile-forever": "^5.0.0",
73
- "rollup": "^4.45.1",
74
- "simple-git-hooks": "^2.13.0",
75
- "tar": "^7.4.3",
76
- "terser": "^5.43.1",
77
- "typescript": "^5.8.3",
78
- "unocss": "66.3.3",
79
- "vite": "^7.0.5",
80
- "vite-plugin-compression": "^0.5.1",
81
- "vite-plugin-mock-dev-server": "^1.9.1",
82
- "vite-plugin-pwa": "^1.0.1",
83
- "vite-plugin-sitemap": "^0.8.2",
84
- "vite-plugin-vconsole": "^2.1.1",
85
- "vite-plugin-vue-devtools": "^7.7.7",
86
- "vue-tsc": "^3.0.2"
87
- },
88
- "pnpm": {
89
- "allowedDeprecatedVersions": {
90
- "glob": "7.2.3",
91
- "inflight": "1.0.6",
92
- "sourcemap-codec": "1.4.8"
93
- },
94
- "peerDependencyRules": {
95
- "allowedVersions": {}
96
- },
97
- "onlyBuiltDependencies": [
98
- "core-js",
99
- "esbuild",
100
- "simple-git-hooks",
101
- "unrs-resolver"
102
- ]
103
- },
104
- "resolutions": {
105
- "vite": "^7.0.5"
106
- },
107
- "simple-git-hooks": {
108
- "pre-commit": "pnpm lint-staged",
109
- "commit-msg": "pnpm commitlint $1"
110
- },
111
- "lint-staged": {
112
- "*": "eslint --fix"
113
- }
114
- }
1
+ {
2
+ "name": "af-mobile-client-vue3",
3
+ "type": "module",
4
+ "version": "1.3.2",
5
+ "packageManager": "pnpm@10.13.1",
6
+ "description": "Vue + Vite component lib",
7
+ "engines": {
8
+ "node": ">=20.19.0"
9
+ },
10
+ "scripts": {
11
+ "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
12
+ "compress": "node ./compress.js",
13
+ "build:dev": "vue-tsc --noEmit && vite build --mode development",
14
+ "build:pro": "vue-tsc --noEmit && vite build --mode production && pnpm run compress",
15
+ "preview": "vite preview",
16
+ "lint": "eslint .",
17
+ "lint:fix": "eslint . --fix",
18
+ "release": "bumpp --commit --push --tag",
19
+ "typecheck": "vue-tsc --noEmit",
20
+ "commitlint": "commitlint --edit",
21
+ "prepare": "simple-git-hooks"
22
+ },
23
+ "dependencies": {
24
+ "@iconify/vue": "4.3.0",
25
+ "@micro-zoe/micro-app": "1.0.0-rc.26",
26
+ "@unhead/vue": "2.0.12",
27
+ "@vant/area-data": "^2.0.0",
28
+ "@vant/touch-emulator": "^1.4.0",
29
+ "@vant/use": "^1.6.0",
30
+ "@vueuse/core": "^13.5.0",
31
+ "axios": "^1.10.0",
32
+ "crypto-js": "^4.2.0",
33
+ "dayjs": "^1.11.13",
34
+ "echarts": "^5.6.0",
35
+ "lodash-es": "^4.17.21",
36
+ "nprogress": "^0.2.0",
37
+ "ol": "^10.5.0",
38
+ "pinia": "^3.0.3",
39
+ "pinia-plugin-persistedstate": "^4.4.1",
40
+ "resize-detector": "^0.3.0",
41
+ "vant": "^4.9.21",
42
+ "vconsole": "^3.15.1",
43
+ "vue": "^3.5.17",
44
+ "vue-i18n": "^11.1.10",
45
+ "vue-router": "^4.5.1",
46
+ "vue3-hash-calendar": "^1.1.3"
47
+ },
48
+ "devDependencies": {
49
+ "@antfu/eslint-config": "4.17.0",
50
+ "@commitlint/cli": "^19.8.1",
51
+ "@commitlint/config-conventional": "^19.8.1",
52
+ "@commitlint/types": "^19.8.1",
53
+ "@iconify/json": "2.2.318",
54
+ "@iconify/utils": "^2.3.0",
55
+ "@intlify/unplugin-vue-i18n": "^6.0.8",
56
+ "@types/crypto-js": "^4.2.2",
57
+ "@types/lodash-es": "^4.17.12",
58
+ "@types/node": "^24.0.14",
59
+ "@types/nprogress": "^0.2.3",
60
+ "@unocss/eslint-config": "66.3.3",
61
+ "@vitejs/plugin-legacy": "^7.0.1",
62
+ "@vitejs/plugin-vue": "^6.0.0",
63
+ "autoprefixer": "^10.4.21",
64
+ "bumpp": "^10.2.0",
65
+ "consola": "^3.4.2",
66
+ "cross-env": "^7.0.3",
67
+ "eslint": "^9.31.0",
68
+ "eslint-plugin-format": "^1.0.1",
69
+ "less": "^4.4.0",
70
+ "lint-staged": "^16.1.2",
71
+ "mockjs": "^1.1.0",
72
+ "postcss-mobile-forever": "^5.0.0",
73
+ "rollup": "^4.45.1",
74
+ "simple-git-hooks": "^2.13.0",
75
+ "tar": "^7.4.3",
76
+ "terser": "^5.43.1",
77
+ "typescript": "^5.8.3",
78
+ "unocss": "66.3.3",
79
+ "vite": "^7.0.5",
80
+ "vite-plugin-compression": "^0.5.1",
81
+ "vite-plugin-mock-dev-server": "^1.9.1",
82
+ "vite-plugin-pwa": "^1.0.1",
83
+ "vite-plugin-sitemap": "^0.8.2",
84
+ "vite-plugin-vconsole": "^2.1.1",
85
+ "vite-plugin-vue-devtools": "^7.7.7",
86
+ "vue-tsc": "^3.0.2"
87
+ },
88
+ "pnpm": {
89
+ "allowedDeprecatedVersions": {
90
+ "glob": "7.2.3",
91
+ "inflight": "1.0.6",
92
+ "sourcemap-codec": "1.4.8"
93
+ },
94
+ "peerDependencyRules": {
95
+ "allowedVersions": {}
96
+ },
97
+ "onlyBuiltDependencies": [
98
+ "core-js",
99
+ "esbuild",
100
+ "simple-git-hooks",
101
+ "unrs-resolver"
102
+ ]
103
+ },
104
+ "resolutions": {
105
+ "vite": "^7.0.5"
106
+ },
107
+ "simple-git-hooks": {
108
+ "pre-commit": "pnpm lint-staged",
109
+ "commit-msg": "pnpm commitlint $1"
110
+ },
111
+ "lint-staged": {
112
+ "*": "eslint --fix"
113
+ }
114
+ }
@@ -31,6 +31,7 @@ const {
31
31
  scanOptions,
32
32
  customAdd = false,
33
33
  customEdit = false,
34
+ hideAllActions = false,
34
35
  } = defineProps<{
35
36
  configName?: string
36
37
  fixQueryForm?: object
@@ -44,6 +45,8 @@ const {
44
45
  // 是否自定义新增、编辑按钮
45
46
  customAdd?: boolean
46
47
  customEdit?: boolean
48
+ // 是否隐藏所有操作按钮
49
+ hideAllActions?: boolean
47
50
  }>()
48
51
 
49
52
  const emit = defineEmits<{
@@ -151,7 +154,7 @@ const currInst = getCurrentInstance()
151
154
 
152
155
  // 列表底部的文字显示
153
156
  function finishedBottomText() {
154
- if (buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
157
+ if (!hideAllActions && buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
155
158
  return '已加载全部内容,如需新增请点击右上角的 + 号'
156
159
  else
157
160
  return '已加载全部内容'
@@ -560,7 +563,7 @@ defineExpose({
560
563
  />
561
564
  </VanCol>
562
565
  <!-- 新增按钮,放在查询框后、查询条件下拉按钮前 -->
563
- <VanCol v-if="buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
566
+ <VanCol v-if="!hideAllActions && buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
564
567
  <VanButton
565
568
  icon="add"
566
569
  type="primary"
@@ -629,7 +632,7 @@ defineExpose({
629
632
  />
630
633
  </p>
631
634
  </div>
632
- <div class="action-buttons">
635
+ <div v-if="!hideAllActions" class="action-buttons">
633
636
  <VanButton
634
637
  v-for="btn in btnList"
635
638
  :key="btn.dataIndex"
@@ -704,7 +707,7 @@ defineExpose({
704
707
  </VanRow>
705
708
  <!-- 添加详情插槽 -->
706
709
  <slot name="item-detail" :item="item" />
707
- <VanRow v-if="allActions.length > 0" gutter="20" class="card_item_bottom">
710
+ <VanRow v-if="!hideAllActions && allActions.length > 0" gutter="20" class="card_item_bottom">
708
711
  <VanCol span="4">
709
712
  <VanPopover
710
713
  v-if="getActionGroups(item, index).more.length"
@@ -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)
@@ -1,107 +1,29 @@
1
1
  <script setup lang="ts">
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
3
  import { defineEmits, ref } from 'vue'
5
4
  import { useRouter } from 'vue-router'
6
5
 
7
- // 定义事件
8
- const emit = defineEmits(['deleteRow'])
9
- // 访问路由
6
+ const emit = defineEmits(['addressSelected'])
10
7
  const router = useRouter()
11
- // 获取默认值
12
- const idKey = ref('o_id')
13
-
14
- // 简易crud表单测试
15
- const configName = ref('lngChargeAuditMobileCRUD')
16
- const serviceName = ref('af-gaslink')
17
-
18
- // 资源权限测试
19
- // const configName = ref('crud_sources_test')
20
- // const serviceName = ref('af-system')
21
-
22
- // 实际业务测试
23
- // const configName = ref('lngChargeAuditMobileCRUD')
24
- // const serviceName = ref('af-gaslink')
25
-
26
- // 跳转到详情页面
27
- // function toDetail(item) {
28
- // router.push({
29
- // name: 'XCellDetailView',
30
- // params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
31
- // query: {
32
- // operName: item[operNameKey.value],
33
- // method:item[methodKey.value],
34
- // requestMethod:item[requestMethodKey.value],
35
- // operatorType:item[operatorTypeKey.value],
36
- // operUrl:item[operUrlKey.value],
37
- // operIp:item[operIpKey.value],
38
- // costTime:item[costTimeKey.value],
39
- // operTime:item[operTimeKey.value],
40
- //
41
- // title: item[titleKey.value],
42
- // businessType: item[businessTypeKey.value],
43
- // status:item[statusKey.value]
44
- // }
45
- // })
46
- // }
47
-
48
- // 跳转到表单——以表单组来渲染纯表单
49
- function toDetail(item) {
50
- router.push({
51
- name: 'XFormGroupView',
52
- query: {
53
- id: item[idKey.value],
54
- // id: item.rr_id,
55
- // o_id: item.o_id,
56
- },
8
+ const configName = ref('ApplyContractPhoneCRUD')
9
+ const xCellListRefPatrolPlan = ref()
10
+ // 详情
11
+ function toDetail(row) {
12
+ emit('addressSelected', {
13
+ f_address: row.tua_f_address,
14
+ f_address_id: row.tua_id,
57
15
  })
58
16
  }
59
-
60
- // 新增功能
61
- // function addOption(totalCount) {
62
- // router.push({
63
- // name: 'XFormView',
64
- // params: { id: totalCount, openid: totalCount },
65
- // query: {
66
- // configName: configName.value,
67
- // serviceName: serviceName.value,
68
- // mode: '新增',
69
- // },
70
- // })
71
- // }
72
-
73
- // 修改功能
74
- // function updateRow(result) {
75
- // router.push({
76
- // name: 'XFormView',
77
- // params: { id: result.o_id, openid: result.o_id },
78
- // query: {
79
- // configName: configName.value,
80
- // serviceName: serviceName.value,
81
- // mode: '修改',
82
- // },
83
- // })
84
- // }
85
-
86
- // 删除功能
87
- function deleteRow(result) {
88
- emit('deleteRow', result.o_id)
89
- }
90
17
  </script>
91
18
 
92
19
  <template>
93
- <NormalDataLayout id="XCellListView" title="工作计划">
94
- <template #layout_content>
95
- <XCellList
96
- :config-name="configName"
97
- :service-name="serviceName"
98
- :fix-query-form="{ o_f_oper_name: 'edu_test' }"
99
- :id-key="idKey"
100
- @to-detail="toDetail"
101
- @delete-row="deleteRow"
102
- />
103
- </template>
104
- </NormalDataLayout>
20
+ <XCellList
21
+ ref="xCellListRefPatrolPlan"
22
+ service-name="af-apply"
23
+ :config-name="configName"
24
+ :hide-all-actions="true"
25
+ @to-detail="toDetail"
26
+ />
105
27
  </template>
106
28
 
107
29
  <style scoped lang="less">
@@ -6,8 +6,8 @@ import { ref } from 'vue'
6
6
  import { useRoute } from 'vue-router'
7
7
 
8
8
  // 纯表单
9
- const configName = ref('form_check_test')
10
- const serviceName = ref('af-system')
9
+ const configName = ref('appapplyuserinfoFormGroup')
10
+ const serviceName = ref('af-apply')
11
11
 
12
12
  // const configName = ref("计划下发Form")
13
13
  // const serviceName = ref("af-linepatrol")
@@ -20,6 +20,12 @@ const formData = ref({})
20
20
  const formGroup = ref(null)
21
21
  const route = useRoute()
22
22
  const isInit = ref(false)
23
+
24
+ const formShow = {
25
+ showt_userinfo: true,
26
+ showdevices: true
27
+ }
28
+
23
29
  function submit(_result) {
24
30
  showDialog({ message: '提交成功' }).then(() => {
25
31
  history.back()
@@ -66,7 +72,9 @@ function submit(_result) {
66
72
  :config-name="configName"
67
73
  :service-name="serviceName"
68
74
  :group-form-data="formData"
75
+ :form-show="formShow"
69
76
  mode="新增"
77
+ :is-scrollspy="true"
70
78
  @submit="submit"
71
79
  />
72
80
  </template>
@@ -7,8 +7,19 @@ const configName = ref('AddConstructionForm')
7
7
  const serviceName = ref('af-linepatrol')
8
8
 
9
9
  const formGroupAddConstruction = ref(null)
10
+ function emitFunc(func, data) {
11
+ if (func === 'selectAddress') {
12
+ const add = 'ccss'
13
+ // 设置单个字段
14
+ formGroupAddConstruction.value?.setForm({ address: '你的字符串' })
15
+ }
16
+ }
17
+ function submit(data) {
18
+ console.log('>>>> data: ', JSON.stringify(data))
19
+ }
10
20
  </script>
11
21
 
22
+ <!-- workflowId -->
12
23
  <template>
13
24
  <NormalDataLayout id="XFormGroupView" title="纯表单">
14
25
  <template #layout_content>
@@ -17,6 +28,10 @@ const formGroupAddConstruction = ref(null)
17
28
  mode="新增"
18
29
  :config-name="configName"
19
30
  :service-name="serviceName"
31
+ :param-logic-name-param="{ aa: 123 }"
32
+ :form-data="{ f_project_name: 333 }"
33
+ @x-form-item-emit-func="emitFunc"
34
+ @on-submit="submit"
20
35
  />
21
36
  </template>
22
37
  </NormalDataLayout>
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
+ import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
5
+ import { onBeforeMount, ref, toRaw } from 'vue'
6
+
7
+ const configName = ref('AddConstructionForm')
8
+ const serviceName = ref('af-linepatrol')
9
+ const formGroup = ref(null)
10
+ const formConfig = ref(null)
11
+ const submitSimple = ref(null)
12
+ const isLoading = ref(true)
13
+
14
+ function safeStringify(obj) {
15
+ const seen = new WeakSet()
16
+ return JSON.stringify(toRaw(obj), (key, val) => {
17
+ if (typeof val === 'object' && val !== null) {
18
+ if (seen.has(val))
19
+ return
20
+ seen.add(val)
21
+ }
22
+ return val
23
+ }, 2)
24
+ }
25
+
26
+ function submit(result) {
27
+ console.log('>>>> result: ', safeStringify(result))
28
+ }
29
+
30
+ function loadConfig() {
31
+ return new Promise((resolve) => {
32
+ getConfigByName(configName.value, (result) => {
33
+ submitSimple.value = result.showSubmitBtn
34
+ formConfig.value = result
35
+ resolve(result)
36
+ }, serviceName.value)
37
+ })
38
+ }
39
+
40
+ onBeforeMount(async () => {
41
+ try {
42
+ await loadConfig()
43
+ }
44
+ finally {
45
+ isLoading.value = false
46
+ }
47
+ })
48
+ </script>
49
+
50
+ <template>
51
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
52
+ <template #layout_content>
53
+ <van-loading v-if="isLoading" />
54
+ <XForm
55
+ v-else
56
+ ref="formGroup"
57
+ mode="查询"
58
+ :service-name="serviceName"
59
+ :group-form-items="formConfig"
60
+ :form-data="{}"
61
+ :form-name="formConfig?.groupName || '11111'"
62
+ :submit-button="submitSimple"
63
+ @on-submit="submit"
64
+ />
65
+ </template>
66
+ </NormalDataLayout>
67
+ </template>
68
+
69
+ <style scoped lang="less">
70
+ </style>
@@ -1,118 +1,118 @@
1
- <script setup lang="ts">
2
- import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
3
- import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
4
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
5
- import { showNotify } from 'vant'
6
- import { ref } from 'vue'
7
-
8
- const selectedLocation = ref<LocationResult>()
9
-
10
- // 处理位置选择
11
- function handleLocationConfirm(location: LocationResult) {
12
- // console.log('选择的位置:', location)
13
- // selectedLocation.value = location
14
- showNotify({ type: 'success', message: '位置已选择' })
15
- }
16
- </script>
17
-
18
- <template>
19
- <NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
20
- <template #layout_content>
21
- <div class="location-picker-demo">
22
- <!-- 页面标题 -->
23
- <div class="page-header">
24
- <div class="title">
25
- 位置选择
26
- </div>
27
- </div>
28
-
29
- <!-- 选择结果展示 -->
30
- <div v-if="selectedLocation" class="location-result">
31
- <div class="label">
32
- 已选位置:
33
- </div>
34
- <div class="value">
35
- {{ selectedLocation.address }}
36
- </div>
37
- <div class="coordinates">
38
- 经度: {{ selectedLocation.longitude.toFixed(6) }},
39
- 纬度: {{ selectedLocation.latitude.toFixed(6) }}
40
- </div>
41
- </div>
42
-
43
- <!-- 地图组件 -->
44
- <div class="map-container">
45
- <LocationPicker
46
- v-model="selectedLocation"
47
- :default-center="[108.948024, 34.263161]"
48
- :default-zoom="12"
49
- @confirm="handleLocationConfirm"
50
- />
51
- </div>
52
- </div>
53
- </template>
54
- </NormalDataLayout>
55
- </template>
56
-
57
- <style scoped lang="less">
58
- .location-picker-demo {
59
- width: 100%;
60
- height: 100%;
61
- position: relative;
62
- display: flex;
63
- flex-direction: column;
64
- background-color: #f7f8fa;
65
- }
66
-
67
- .page-header {
68
- height: 44px;
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
- background: white;
73
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
74
- position: relative;
75
- z-index: 1;
76
-
77
- .title {
78
- font-size: 16px;
79
- color: #333;
80
- font-weight: 500;
81
- }
82
- }
83
-
84
- .location-result {
85
- background: white;
86
- padding: 12px 16px;
87
- margin: 10px;
88
- border-radius: 8px;
89
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
90
-
91
- .label {
92
- font-size: 14px;
93
- color: #666;
94
- margin-bottom: 4px;
95
- }
96
-
97
- .value {
98
- font-size: 16px;
99
- color: #333;
100
- margin-bottom: 8px;
101
- word-break: break-all;
102
- }
103
-
104
- .coordinates {
105
- font-size: 12px;
106
- color: #999;
107
- }
108
- }
109
-
110
- .map-container {
111
- flex: 1;
112
- position: relative;
113
- margin: 0 10px 10px 10px;
114
- border-radius: 8px;
115
- overflow: hidden;
116
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
117
- }
118
- </style>
1
+ <script setup lang="ts">
2
+ import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
3
+ import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
4
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
5
+ import { showNotify } from 'vant'
6
+ import { ref } from 'vue'
7
+
8
+ const selectedLocation = ref<LocationResult>()
9
+
10
+ // 处理位置选择
11
+ function handleLocationConfirm(location: LocationResult) {
12
+ // console.log('选择的位置:', location)
13
+ // selectedLocation.value = location
14
+ showNotify({ type: 'success', message: '位置已选择' })
15
+ }
16
+ </script>
17
+
18
+ <template>
19
+ <NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
20
+ <template #layout_content>
21
+ <div class="location-picker-demo">
22
+ <!-- 页面标题 -->
23
+ <div class="page-header">
24
+ <div class="title">
25
+ 位置选择
26
+ </div>
27
+ </div>
28
+
29
+ <!-- 选择结果展示 -->
30
+ <div v-if="selectedLocation" class="location-result">
31
+ <div class="label">
32
+ 已选位置:
33
+ </div>
34
+ <div class="value">
35
+ {{ selectedLocation.address }}
36
+ </div>
37
+ <div class="coordinates">
38
+ 经度: {{ selectedLocation.longitude.toFixed(6) }},
39
+ 纬度: {{ selectedLocation.latitude.toFixed(6) }}
40
+ </div>
41
+ </div>
42
+
43
+ <!-- 地图组件 -->
44
+ <div class="map-container">
45
+ <LocationPicker
46
+ v-model="selectedLocation"
47
+ :default-center="[108.948024, 34.263161]"
48
+ :default-zoom="12"
49
+ @confirm="handleLocationConfirm"
50
+ />
51
+ </div>
52
+ </div>
53
+ </template>
54
+ </NormalDataLayout>
55
+ </template>
56
+
57
+ <style scoped lang="less">
58
+ .location-picker-demo {
59
+ width: 100%;
60
+ height: 100%;
61
+ position: relative;
62
+ display: flex;
63
+ flex-direction: column;
64
+ background-color: #f7f8fa;
65
+ }
66
+
67
+ .page-header {
68
+ height: 44px;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ background: white;
73
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
74
+ position: relative;
75
+ z-index: 1;
76
+
77
+ .title {
78
+ font-size: 16px;
79
+ color: #333;
80
+ font-weight: 500;
81
+ }
82
+ }
83
+
84
+ .location-result {
85
+ background: white;
86
+ padding: 12px 16px;
87
+ margin: 10px;
88
+ border-radius: 8px;
89
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
90
+
91
+ .label {
92
+ font-size: 14px;
93
+ color: #666;
94
+ margin-bottom: 4px;
95
+ }
96
+
97
+ .value {
98
+ font-size: 16px;
99
+ color: #333;
100
+ margin-bottom: 8px;
101
+ word-break: break-all;
102
+ }
103
+
104
+ .coordinates {
105
+ font-size: 12px;
106
+ color: #999;
107
+ }
108
+ }
109
+
110
+ .map-container {
111
+ flex: 1;
112
+ position: relative;
113
+ margin: 0 10px 10px 10px;
114
+ border-radius: 8px;
115
+ overflow: hidden;
116
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
117
+ }
118
+ </style>