af-mobile-client-vue3 1.0.84-1 → 1.0.84-3

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.0.84-1",
4
+ "version": "1.0.84-3",
5
5
  "description": "Vue + Vite component lib",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -502,6 +502,8 @@ function addOption() {
502
502
  display: flex;
503
503
  align-items: center;
504
504
  justify-content: center;
505
+ height: 100%; // 确保高度与搜索框一致
506
+ padding: var(--van-search-padding); // 使用与搜索框相同的内边距
505
507
  }
506
508
  :deep(.van-search__content) {
507
509
  border-radius: 8px;
@@ -534,8 +536,9 @@ function addOption() {
534
536
  }
535
537
 
536
538
  :deep(.van-dropdown-menu__item) {
537
- align-items: flex-start;
538
- justify-content: flex-start;
539
+ display: flex;
540
+ align-items: center;
541
+ justify-content: center;
539
542
  }
540
543
  }
541
544
 
@@ -106,7 +106,7 @@ onMounted(() => {
106
106
  <VanDropdownMenu :close-on-click-outside="false">
107
107
  <VanDropdownItem ref="listFilterMenu">
108
108
  <template #title>
109
- <VanIcon name="filter-o" size="20" />
109
+ <VanIcon name="filter-o" size="23" />
110
110
  </template>
111
111
  <div class="order-condition">
112
112
  <template v-if="props.orderList.length > 0">
@@ -1,51 +1,24 @@
1
- <template>
2
- <van-dialog
3
- v-model:show="visible"
4
- :before-close="close"
5
- :confirm-loading="loading"
6
- width="80%"
7
- :show-confirm-button="true"
8
- confirm-text="提交"
9
- @confirm="onSubmit"
10
- v-bind="attr"
11
- >
12
- <div v-if="showReport" style="max-height: 70vh; overflow-y: auto; overflow-x: hidden;">
13
- <XReport
14
- ref="mainRef"
15
- :env="env"
16
- :use-oss-for-img="false"
17
- :config-name="configName"
18
- :show-img-in-cell="true"
19
- :display-only="displayOnly"
20
- :edit-mode="false"
21
- :show-save-button="false"
22
- :dont-format="true"
23
- @update-img="updateImg"
24
- @select-row="selectRow"
25
- />
26
- </div>
27
- </van-dialog>
28
- </template>
29
-
30
1
  <script setup lang="ts">
31
- import { ref, provide, inject, computed } from 'vue'
2
+ import { inject, provide, ref } from 'vue'
32
3
  import { storeToRefs } from 'pinia'
33
- import { useUserStore } from '@/stores/modules/user'
34
4
  import { Dialog as VanDialog, showDialog } from 'vant'
35
- import { executeStrFunctionByContext } from '@/utils/runEvalFunction'
36
- import { runLogic } from '@/services/api/common'
37
- import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@/utils/microAppUtils'
38
- import { getRealKeyData } from '@/utils/util'
39
- import XReport from '../XReport.vue'
5
+ import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
6
+ import { executeStrFunctionByContext } from '@af-mobile-client-vue3/utils/runEvalFunction'
7
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
40
8
 
41
9
  // Props
42
10
  const props = defineProps({
43
11
  env: {
44
12
  type: String,
45
- default: 'prod'
46
- }
13
+ default: 'prod',
14
+ },
47
15
  })
48
16
 
17
+ // Emits
18
+ const emit = defineEmits<{
19
+ (e: 'close'): void
20
+ (e: 'selectRow', keys: any[], rows: any[]): void
21
+ }>()
49
22
  // 状态管理
50
23
  const showReport = ref(true)
51
24
  const configName = ref('')
@@ -79,7 +52,7 @@ provide('isInAModal', () => true)
79
52
  provide('currUser', currUser)
80
53
 
81
54
  // Methods
82
- const init = (params: {
55
+ function init(params: {
83
56
  configName?: string
84
57
  serverName?: string
85
58
  displayOnly?: boolean
@@ -87,7 +60,7 @@ const init = (params: {
87
60
  outEnv?: Record<string, any>
88
61
  mixinData?: Record<string, any>
89
62
  attr?: Record<string, any>
90
- }) => {
63
+ }) {
91
64
  const {
92
65
  configName: initConfigName = 'medicalRecordCover',
93
66
  serverName: initServerName = process.env.VUE_APP_SYSTEM_NAME,
@@ -95,7 +68,7 @@ const init = (params: {
95
68
  selectedId: initSelectedId = null,
96
69
  outEnv: initOutEnv = {},
97
70
  mixinData: initMixinData = {},
98
- attr: initAttr = {}
71
+ attr: initAttr = {},
99
72
  } = params
100
73
 
101
74
  configName.value = initConfigName
@@ -104,51 +77,49 @@ const init = (params: {
104
77
  visible.value = true
105
78
  attr.value = initAttr
106
79
 
107
- if (initSelectedId) {
80
+ if (initSelectedId)
108
81
  selectedId.value = initSelectedId
109
- }
82
+
110
83
  mixinData.value = initMixinData
111
84
  outEnv.value = initOutEnv
112
85
  }
113
86
 
114
- const getSelectedId = () => {
87
+ function getSelectedId() {
115
88
  if (typeof selectedId.value === 'object') {
116
- if (selectedId.value?.selectedId) {
89
+ if (selectedId.value?.selectedId)
117
90
  return selectedId.value.selectedId
118
- }
119
- if (Object.keys(selectedId.value).length > 0) {
91
+
92
+ if (Object.keys(selectedId.value).length > 0)
120
93
  return selectedId.value[Object.keys(selectedId.value)[0]]
121
- }
122
94
  }
123
95
  return selectedId.value
124
96
  }
125
97
 
126
- const selectRow = (selectedRowKeys: any[], selectedRows: any[]) => {
98
+ function selectRow(selectedRowKeys: any[], selectedRows: any[]) {
127
99
  console.log('XAddReport')
128
100
  emit('selectRow', selectedRowKeys, selectedRows)
129
101
  }
130
102
 
131
- const close = () => {
103
+ function close() {
132
104
  loading.value = false
133
105
  visible.value = false
134
106
  emit('close')
135
107
  }
136
108
 
137
- const getComponentByName = (name: string) => {
109
+ function getComponentByName(name: string) {
138
110
  const innerRef = getParentComponentByName?.(name)
139
- if (innerRef) {
111
+ if (innerRef)
140
112
  return innerRef
141
- }
113
+
142
114
  return mainRef.value?.getComponentByName(name)
143
115
  }
144
116
 
145
- const onSubmit = async () => {
117
+ async function onSubmit() {
146
118
  if (mainRef.value?.config?.confirmFunction) {
147
119
  console.info('执行自定义确认逻辑')
148
120
  let func = mainRef.value.config.confirmFunction
149
- if (func && func.startsWith('function')) {
121
+ if (func && func.startsWith('function'))
150
122
  func = func.replace('function', 'async function')
151
- }
152
123
 
153
124
  try {
154
125
  const result = await executeStrFunctionByContext(null, func, [])
@@ -161,48 +132,71 @@ const onSubmit = async () => {
161
132
 
162
133
  if (result?.name) {
163
134
  const waitRefreshRef = getComponentByName(result.name)
164
- if (waitRefreshRef) {
135
+ if (waitRefreshRef)
165
136
  waitRefreshRef.refresh()
166
- } else {
137
+ else
167
138
  console.warn(`未找到组件${result.name}无法刷新`)
168
- }
169
139
  }
170
140
 
171
- if (result?.messageType) {
141
+ if (result?.messageType)
172
142
  messageType = result.messageType
173
- }
174
143
 
175
144
  if (result?.message) {
176
145
  showDialog({
177
146
  message: result.message,
178
- type: messageType
147
+ type: messageType,
179
148
  })
180
149
  }
181
150
 
182
151
  close()
183
- } catch (error) {
152
+ }
153
+ catch (error) {
184
154
  console.error('确认逻辑执行失败:', error)
185
155
  close()
186
156
  }
187
- } else {
157
+ }
158
+ else {
188
159
  console.warn('未配置modal确认按钮逻辑')
189
160
  close()
190
161
  }
191
162
  }
192
163
 
193
- const updateImg = (data: any) => {
164
+ function updateImg(data: any) {
194
165
  console.log(data)
195
166
  }
196
167
 
197
- // Emits
198
- const emit = defineEmits<{
199
- (e: 'close'): void
200
- (e: 'selectRow', keys: any[], rows: any[]): void
201
- }>()
202
-
203
168
  // 暴露方法
204
169
  defineExpose({
205
170
  init,
206
- getComponentByName
171
+ getComponentByName,
207
172
  })
208
173
  </script>
174
+
175
+ <template>
176
+ <VanDialog
177
+ v-model:show="visible"
178
+ :before-close="close"
179
+ :confirm-loading="loading"
180
+ width="80%"
181
+ :show-confirm-button="true"
182
+ confirm-text="提交"
183
+ v-bind="attr"
184
+ @confirm="onSubmit"
185
+ >
186
+ <div v-if="showReport" style="max-height: 70vh; overflow-y: auto; overflow-x: hidden;">
187
+ <XReport
188
+ ref="mainRef"
189
+ :env="env"
190
+ :use-oss-for-img="false"
191
+ :config-name="configName"
192
+ :show-img-in-cell="true"
193
+ :display-only="displayOnly"
194
+ :edit-mode="false"
195
+ :show-save-button="false"
196
+ :dont-format="true"
197
+ @update-img="updateImg"
198
+ @select-row="selectRow"
199
+ />
200
+ </div>
201
+ </VanDialog>
202
+ </template>
@@ -93,7 +93,7 @@ const props = defineProps({
93
93
  },
94
94
  isWidget: {
95
95
  type: Boolean,
96
- default: false,
96
+ default: true,
97
97
  },
98
98
  useOssForImg: {
99
99
  type: Boolean,
@@ -137,17 +137,24 @@ const globalData = ref({})
137
137
  // Computed
138
138
  const widget = computed(() => props.isWidget)
139
139
 
140
- // Provide
141
- // provide('runLogic', runLogic)
142
- // provide('openDialog', openDialog)
143
- // provide('registerComponent', registerComponent)
144
- // provide('getComponentByName', getComponentByName)
145
- // provide('getParentComponentByName', getComponentByName)
146
- // provide('getConfigByName', getConfigByName)
147
- // provide('isWidget', widget)
148
- // // provide('currUser', currUser)
149
- // provide('getGlobalData', getGlobalData)
150
- // provide('setGlobalData', setGlobalData)
140
+ // 在provide之前定义getGlobalData函数
141
+ const getGlobalData = () => globalData.value
142
+
143
+ const setGlobalData = (obj: any) => {
144
+ globalData.value = obj
145
+ }
146
+
147
+ // 然后再进行provide
148
+ provide('runLogic', runLogic)
149
+ provide('openDialog', openDialog)
150
+ provide('registerComponent', registerComponent)
151
+ provide('getComponentByName', getComponentByName)
152
+ provide('getParentComponentByName', getComponentByName)
153
+ provide('getConfigByName', getConfigByName)
154
+ provide('isWidget', widget)
155
+ // provide('currUser', currUser)
156
+ provide('setGlobalData', setGlobalData)
157
+ provide('getGlobalData', getGlobalData)
151
158
 
152
159
  // Methods
153
160
  function slotRendered() {
@@ -238,12 +245,6 @@ function getComponentByName(componentName: string) {
238
245
  return XReportDesign.value?.[componentName]
239
246
  }
240
247
 
241
- const getGlobalData = () => globalData.value
242
-
243
- function setGlobalData(obj: any) {
244
- globalData.value = obj
245
- }
246
-
247
248
  // 对话框操作
248
249
  function openDialog(configName: string, selectedId: any, mixinData: any, outEnv = {}, attr = {}) {
249
250
  console.log('openDialog', configName, selectedId)
@@ -1,46 +1,23 @@
1
- <template>
2
- <van-popup
3
- v-model:show="visible"
4
- position="right"
5
- :style="{ width: '85vw', height: '100%' }"
6
- @close="close"
7
- v-bind="attr"
8
- >
9
- <XReport
10
- ref="mainRef"
11
- :env="env"
12
- :use-oss-for-img="false"
13
- :config-name="configName"
14
- :show-img-in-cell="true"
15
- :display-only="displayOnly"
16
- :edit-mode="false"
17
- :show-save-button="false"
18
- :dont-format="true"
19
- @update-img="updateImg"
20
- @select-row="selectRow"
21
- />
22
- </van-popup>
23
- </template>
24
-
25
1
  <script setup lang="ts">
26
- import { ref, provide, inject } from 'vue'
2
+ import { inject, provide, ref } from 'vue'
27
3
  import { storeToRefs } from 'pinia'
28
- import { useUserStore } from '@/stores/modules/user'
29
4
  import { Popup as VanPopup } from 'vant'
30
- import { executeStrFunctionByContext } from '@/utils/runEvalFunction'
31
- import { runLogic } from '@/services/api/common'
32
- import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@/utils/microAppUtils'
33
- import { getRealKeyData } from '@/utils/util'
34
- import XReport from '../XReport.vue'
5
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
6
+ import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
35
7
 
36
8
  // Props
37
9
  const props = defineProps({
38
10
  env: {
39
11
  type: String,
40
- default: 'prod'
41
- }
12
+ default: 'prod',
13
+ },
42
14
  })
43
15
 
16
+ // Emits
17
+ const emit = defineEmits<{
18
+ (e: 'close'): void
19
+ (e: 'selectRow', keys: any[], rows: any[]): void
20
+ }>()
44
21
  // 状态管理
45
22
  const configName = ref('')
46
23
  const displayOnly = ref(true)
@@ -73,7 +50,7 @@ provide('isInAModal', () => true)
73
50
  provide('currUser', currUser)
74
51
 
75
52
  // Methods
76
- const init = (params: {
53
+ function init(params: {
77
54
  configName?: string
78
55
  serverName?: string
79
56
  displayOnly?: boolean
@@ -81,7 +58,7 @@ const init = (params: {
81
58
  outEnv?: Record<string, any>
82
59
  mixinData?: Record<string, any>
83
60
  attr?: Record<string, any>
84
- }) => {
61
+ }) {
85
62
  const {
86
63
  configName: initConfigName = '',
87
64
  serverName: initServerName = process.env.VUE_APP_SYSTEM_NAME,
@@ -89,7 +66,7 @@ const init = (params: {
89
66
  selectedId: initSelectedId = null,
90
67
  outEnv: initOutEnv = {},
91
68
  mixinData: initMixinData = {},
92
- attr: initAttr = {}
69
+ attr: initAttr = {},
93
70
  } = params
94
71
 
95
72
  configName.value = initConfigName
@@ -98,57 +75,74 @@ const init = (params: {
98
75
  visible.value = true
99
76
  attr.value = initAttr
100
77
 
101
- if (initSelectedId) {
78
+ if (initSelectedId)
102
79
  selectedId.value = initSelectedId
103
- }
80
+
104
81
  mixinData.value = initMixinData
105
82
  outEnv.value = initOutEnv
106
83
  }
107
84
 
108
- const getSelectedId = () => {
85
+ function getSelectedId() {
109
86
  if (typeof selectedId.value === 'object') {
110
- if (selectedId.value?.selectedId) {
87
+ if (selectedId.value?.selectedId)
111
88
  return selectedId.value.selectedId
112
- }
113
- if (Object.keys(selectedId.value).length > 0) {
89
+
90
+ if (Object.keys(selectedId.value).length > 0)
114
91
  return selectedId.value[Object.keys(selectedId.value)[0]]
115
- }
116
92
  }
117
93
  return selectedId.value
118
94
  }
119
95
 
120
- const selectRow = (selectedRowKeys: any[], selectedRows: any[]) => {
96
+ function selectRow(selectedRowKeys: any[], selectedRows: any[]) {
121
97
  console.log('XReportDrawer')
122
98
  emit('selectRow', selectedRowKeys, selectedRows)
123
99
  }
124
100
 
125
- const close = () => {
101
+ function close() {
126
102
  loading.value = false
127
103
  visible.value = false
128
104
  emit('close')
129
105
  }
130
106
 
131
- const getComponentByName = (name: string) => {
107
+ function getComponentByName(name: string) {
132
108
  const innerRef = getParentComponentByName?.(name)
133
- if (innerRef) {
109
+ if (innerRef)
134
110
  return innerRef
135
- }
111
+
136
112
  return mainRef.value?.getComponentByName(name)
137
113
  }
138
114
 
139
- const updateImg = (data: any) => {
115
+ function updateImg(data: any) {
140
116
  console.log(data)
141
117
  }
142
118
 
143
- // Emits
144
- const emit = defineEmits<{
145
- (e: 'close'): void
146
- (e: 'selectRow', keys: any[], rows: any[]): void
147
- }>()
148
-
149
119
  // 暴露方法
150
120
  defineExpose({
151
121
  init,
152
- getComponentByName
122
+ getComponentByName,
153
123
  })
154
124
  </script>
125
+
126
+ <template>
127
+ <VanPopup
128
+ v-model:show="visible"
129
+ position="right"
130
+ :style="{ width: '85vw', height: '100%' }"
131
+ v-bind="attr"
132
+ @close="close"
133
+ >
134
+ <XReport
135
+ ref="mainRef"
136
+ :env="env"
137
+ :use-oss-for-img="false"
138
+ :config-name="configName"
139
+ :show-img-in-cell="true"
140
+ :display-only="displayOnly"
141
+ :edit-mode="false"
142
+ :show-save-button="false"
143
+ :dont-format="true"
144
+ @update-img="updateImg"
145
+ @select-row="selectRow"
146
+ />
147
+ </VanPopup>
148
+ </template>
@@ -564,21 +564,24 @@ defineExpose({
564
564
  }
565
565
 
566
566
  .tdNoBorder {
567
- border-left: 1px solid #000;
568
- border-right: 1px solid #000;
567
+ border: none;
568
+ //border-left: 1px solid #000;
569
+ //border-right: 1px solid #000;
569
570
  padding: 8px;
570
571
  }
571
-
572
+ // 手机端显示边框线很奇怪 先去掉
572
573
  .tdWithBorder {
573
- border: 1px solid #000;
574
+ border: none;
575
+ //border: 1px solid #000;
574
576
  padding: 8px;
575
577
  }
576
578
 
577
579
  .tdWithNoTopBorder {
578
- border-top-style: none;
579
- border-left: 1px solid #000;
580
- border-right: 1px solid #000;
581
- border-bottom: 1px solid #000;
580
+ border: none;
581
+ //border-top-style: none;
582
+ //border-left: 1px solid #000;
583
+ //border-right: 1px solid #000;
584
+ //border-bottom: 1px solid #000;
582
585
  padding: 8px;
583
586
  }
584
587
 
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
4
+ import { useRoute } from 'vue-router'
5
+
6
+ const route = useRoute()
7
+ const serverName = ref(import.meta.env.VITE_APP_SYSTEM_NAME)
8
+ const configName = ref(route.query.configName ? route.query.configName as string : 'ReportGridTest')
9
+ </script>
10
+
11
+ <template>
12
+ <XReport :config-name="configName" :server-name="serverName" />
13
+ </template>
14
+
15
+ <style scoped lang="less">
16
+ </style>
@@ -13,6 +13,7 @@ import SingleLayout from '@af-mobile-client-vue3/layout/SingleLayout.vue'
13
13
  import XFormGroupView from '@af-mobile-client-vue3/views/component/XFormGroupView/index.vue'
14
14
  import XSignatureView from '@af-mobile-client-vue3/views/component/XSignatureView/index.vue'
15
15
  import XReportGridView from '@af-mobile-client-vue3/views/component/XReportGridView/index.vue'
16
+ import GridView from '@af-mobile-client-vue3/layout/GridView/index.vue'
16
17
  import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
17
18
  import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
18
19
 
@@ -110,6 +111,11 @@ const routes: Array<RouteRecordRaw> = [
110
111
  name: 'XReport',
111
112
  component: XReport,
112
113
  },
114
+ {
115
+ path: '/GridView',
116
+ name: 'GridView',
117
+ component: GridView,
118
+ },
113
119
  ],
114
120
  },
115
121
  {
@@ -1,13 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
3
  import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
4
+ import { useRoute } from 'vue-router'
4
5
 
6
+ const route = useRoute()
7
+ const serverName = ref('af-gaslink')
5
8
  // const configName = ref('detailsaddChargesCover')
6
- const configName = ref('outpatientNurseCover')
9
+ const configName = ref(route.query.configName ? route.query.configName : 'ReportGridTest')
10
+ console.log('route==configName', configName)
7
11
  </script>
8
12
 
9
13
  <template>
10
- <XReport :config-name="configName" server-name="af-his" />
14
+ <XReport :config-name="configName" :server-name="serverName" />
11
15
  </template>
12
16
 
13
17
  <style scoped lang="less">
@@ -1,10 +0,0 @@
1
- import type { App } from 'vue'
2
- import XReport from './XReport.vue'
3
-
4
- export { XReport }
5
-
6
- export default {
7
- install(app: App) {
8
- app.component('XReport', XReport)
9
- }
10
- }