af-mobile-client-vue3 1.2.55 → 1.2.57

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.2.55",
4
+ "version": "1.2.57",
5
5
  "packageManager": "pnpm@10.12.3",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import XBadge from '@af-mobile-client-vue3/components/data/XBadge/index.vue'
3
3
  import XCellListFilter from '@af-mobile-client-vue3/components/data/XCellListFilter/index.vue'
4
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
4
5
  import { getConfigByName, query } from '@af-mobile-client-vue3/services/api/common'
5
6
  import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
6
7
  import { getRangeByType } from '@af-mobile-client-vue3/utils/queryFormDefaultRangePicker'
@@ -14,6 +15,7 @@ import {
14
15
  Icon as VanIcon,
15
16
  List as VanList,
16
17
  Popover as VanPopover,
18
+ Popup as VanPopup,
17
19
  PullRefresh as VanPullRefresh,
18
20
  Row as VanRow,
19
21
  Search as VanSearch,
@@ -149,6 +151,9 @@ const slots = useSlots()
149
151
  // 当前组件实例(不推荐使用,可能会在后续的版本更迭中调整,暂时用来绑定函数的上下文)
150
152
  const currInst = getCurrentInstance()
151
153
 
154
+ // 控制抽屉显示
155
+ const showDrawer = ref(false)
156
+
152
157
  // 列表底部的文字显示
153
158
  function finishedBottomText() {
154
159
  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))))))
@@ -464,16 +469,7 @@ function addOption() {
464
469
  emit('add')
465
470
  }
466
471
  else {
467
- // 默认行为 - 导航到XForm页面
468
- router.push({
469
- name: 'XForm',
470
- query: {
471
- groupFormItems: JSON.stringify(groupFormItems.value),
472
- serviceName,
473
- formData: JSON.stringify({}),
474
- mode: '新增',
475
- },
476
- })
472
+ showDrawer.value = true
477
473
  }
478
474
  }
479
475
 
@@ -748,6 +744,23 @@ defineExpose({
748
744
  </VanPullRefresh>
749
745
  <VanBackTop />
750
746
  </div>
747
+ <VanPopup v-model:show="showDrawer" position="bottom" :style="{ height: '90vh', borderTopLeftRadius: '10px', borderTopRightRadius: '10px', overflow: 'hidden', padding: 0 }">
748
+ <div class="drawer-header">
749
+ <span class="drawer-title">{{ title || '新增' }}</span>
750
+ <van-icon name="cross" class="drawer-close" @click="showDrawer = false" />
751
+ </div>
752
+ <div class="drawer-content-scroll">
753
+ <XForm
754
+ :config-name="configName"
755
+ :service-name="serviceName"
756
+ :form-data="{}"
757
+ :group-form-items="groupFormItems"
758
+ mode="新增"
759
+ @on-submit="showDrawer = false"
760
+ @close="showDrawer = false"
761
+ />
762
+ </div>
763
+ </VanPopup>
751
764
  </div>
752
765
  </template>
753
766
 
@@ -1068,4 +1081,37 @@ defineExpose({
1068
1081
  }
1069
1082
  }
1070
1083
  }
1084
+ .drawer-header {
1085
+ position: sticky;
1086
+ top: 0;
1087
+ left: 0;
1088
+ right: 0;
1089
+ z-index: 2;
1090
+ display: flex;
1091
+ align-items: center;
1092
+ justify-content: center;
1093
+ height: 48px;
1094
+ border-bottom: 1px solid #f0f0f0;
1095
+ background: #fff;
1096
+ box-shadow: 0 2px 8px rgba(0,0,0,0.03);
1097
+ }
1098
+ .drawer-title {
1099
+ font-size: 18px;
1100
+ font-weight: 600;
1101
+ color: #222;
1102
+ }
1103
+ .drawer-close {
1104
+ position: absolute;
1105
+ right: 16px;
1106
+ top: 50%;
1107
+ transform: translateY(-50%);
1108
+ font-size: 22px;
1109
+ color: #888;
1110
+ cursor: pointer;
1111
+ }
1112
+ .drawer-content-scroll {
1113
+ height: calc(90vh - 48px);
1114
+ overflow-y: auto;
1115
+ background: #fff;
1116
+ }
1071
1117
  </style>
@@ -119,4 +119,4 @@ onUnmounted(() => {
119
119
  color: #ff976a;
120
120
  }
121
121
  }
122
- </style>
122
+ </style>
@@ -99,4 +99,4 @@ onUnmounted(() => {
99
99
  .user-form {
100
100
  padding: 16px;
101
101
  }
102
- </style>
102
+ </style>
@@ -373,7 +373,7 @@ function formTypeCheck(attr, value) {
373
373
  switch (attr.rule.type) {
374
374
  case 'string':
375
375
  if (value.length === 0) {
376
- errorMessage.value = `${attr.name}必须为有效的字符串`
376
+ errorMessage.value = `请输入${attr.name}`
377
377
  return
378
378
  }
379
379
  break
@@ -1216,9 +1216,9 @@ function findOptionInTree(options, value) {
1216
1216
 
1217
1217
  <!-- 文本输入框 -->
1218
1218
  <VanField
1219
- style="align-items: center"
1220
1219
  v-if="(attr.type === 'input' || attr.type === 'intervalPicker') && showItem"
1221
1220
  v-model="(modelData as string)"
1221
+ style="align-items: center"
1222
1222
  :label="labelData"
1223
1223
  :label-align="labelAlign"
1224
1224
  :input-align="attr.inputAlign ? attr.inputAlign : 'left'"
@@ -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,33 +1,33 @@
1
- <script setup lang="ts">
2
- import { onMounted, ref } from 'vue'
3
- import XReport from './XReport.vue'
4
-
5
- const mainRef = ref()
6
-
7
- onMounted(() => {
8
- // 初始化逻辑
9
- })
10
- </script>
11
-
12
- <template>
13
- <div id="test">
14
- <van-card :bordered="false">
15
- <XReport
16
- ref="mainRef"
17
- :use-oss-for-img="false"
18
- config-name="nurseWorkstationCover"
19
- server-name="af-his"
20
- :show-img-in-cell="true"
21
- :display-only="true"
22
- :edit-mode="false"
23
- :show-save-button="false"
24
- :no-padding="true"
25
- :dont-format="true"
26
- />
27
- </van-card>
28
- </div>
29
- </template>
30
-
31
- <style scoped>
32
-
33
- </style>
1
+ <script setup lang="ts">
2
+ import { onMounted, ref } from 'vue'
3
+ import XReport from './XReport.vue'
4
+
5
+ const mainRef = ref()
6
+
7
+ onMounted(() => {
8
+ // 初始化逻辑
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <div id="test">
14
+ <van-card :bordered="false">
15
+ <XReport
16
+ ref="mainRef"
17
+ :use-oss-for-img="false"
18
+ config-name="nurseWorkstationCover"
19
+ server-name="af-his"
20
+ :show-img-in-cell="true"
21
+ :display-only="true"
22
+ :edit-mode="false"
23
+ :show-save-button="false"
24
+ :no-padding="true"
25
+ :dont-format="true"
26
+ />
27
+ </van-card>
28
+ </div>
29
+ </template>
30
+
31
+ <style scoped>
32
+
33
+ </style>