vue2-client 1.16.47 → 1.16.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145434.vue +641 -0
  2. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145453.vue +641 -0
  3. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145610.vue +647 -0
  4. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145629.vue +647 -0
  5. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145901.vue +645 -0
  6. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145907.vue +651 -0
  7. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145920.vue +651 -0
  8. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926150047.vue +651 -0
  9. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926151820.vue +646 -0
  10. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926151827.vue +646 -0
  11. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152115.vue +646 -0
  12. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152212.vue +653 -0
  13. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152215.vue +653 -0
  14. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152337.vue +657 -0
  15. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152341.vue +657 -0
  16. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152826.vue +657 -0
  17. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152828.vue +646 -0
  18. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153121.vue +654 -0
  19. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153242.vue +654 -0
  20. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153318.vue +646 -0
  21. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153415.vue +646 -0
  22. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153435.vue +655 -0
  23. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153606.vue +655 -0
  24. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153653.vue +655 -0
  25. package/package.json +112 -112
  26. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +47 -45
  27. package/src/base-client/components/common/HIS/HFormGroup/HFormGroup.vue +120 -120
  28. package/src/base-client/components/common/HIS/HFormGroup/index.js +3 -3
  29. package/src/base-client/components/common/HIS/HFormTable/HFormTable.vue +257 -256
  30. package/src/base-client/components/common/HIS/demo.vue +61 -61
  31. package/src/base-client/components/common/XCollapse/XCollapse.vue +461 -461
  32. package/src/base-client/components/common/XDataCard/XDataCard.vue +44 -18
  33. package/src/base-client/components/common/XDataCard/test.vue +367 -0
  34. package/src/base-client/components/common/XInput/XInput.vue +147 -147
  35. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +824 -824
  36. package/src/base-client/components/common/XTable/XTable.vue +1610 -1610
  37. package/src/base-client/components/common/XTimeline/XTimeline.vue +454 -454
  38. package/src/base-client/components/his/XHDescriptions/XHDescriptions.vue +6 -1
  39. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +705 -705
  40. package/src/base-client/components/his/threeTestOrders/editor.vue +113 -113
  41. package/src/pages/WorkflowDetail/WorkFlowDemo3.vue +225 -203
  42. package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -45
  43. package/src/router/async/router.map.js +129 -129
  44. package/src/services/api/common.js +2 -0
package/package.json CHANGED
@@ -1,112 +1,112 @@
1
- {
2
- "name": "vue2-client",
3
- "version": "1.16.47",
4
- "private": false,
5
- "scripts": {
6
- "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
- "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
- "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
- "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
- "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
- "serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
12
- "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
13
- "serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
14
- "serve:message": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode message",
15
- "serve:apply": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode apply",
16
- "mac-serve": "vue-cli-service serve --no-eslint --mode his",
17
- "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
18
- "test:unit": "vue-cli-service test:unit",
19
- "lint": "vue-cli-service lint",
20
- "build:preview": "vue-cli-service build --mode preview",
21
- "lint:nofix": "vue-cli-service lint --no-fix",
22
- "test": "jest"
23
- },
24
- "dependencies": {
25
- "@afwenming123/vue-easy-tree": "^1.0.1",
26
- "@afwenming123/vue-plugin-hiprint": "^0.0.70",
27
- "@amap/amap-jsapi-loader": "^1.0.1",
28
- "@antv/data-set": "^0.11.8",
29
- "@antv/g2plot": "^2.4.31",
30
- "@hufe921/canvas-editor": "^0.9.49",
31
- "@microsoft/fetch-event-source": "^2.0.1",
32
- "@vue/babel-preset-jsx": "^1.4.0",
33
- "animate.css": "^4.1.1",
34
- "ant-design-vue": "^1.7.8",
35
- "axios": "^0.27.2",
36
- "clipboard": "^2.0.11",
37
- "core-js": "^3.33.0",
38
- "crypto-js": "^4.1.1",
39
- "date-fns": "^2.29.3",
40
- "default-passive-events": "^2.0.0",
41
- "dotenv": "^16.3.1",
42
- "echarts": "^5.5.0",
43
- "enquire.js": "^2.1.6",
44
- "file-saver": "^2.0.5",
45
- "highlight.js": "^11.7.0",
46
- "html2canvas": "^1.4.1",
47
- "js-base64": "^3.7.5",
48
- "js-cookie": "^2.2.1",
49
- "jsencrypt": "^3.3.2",
50
- "jspdf": "^2.5.1",
51
- "lodash.clonedeep": "^4.5.0",
52
- "lodash.debounce": "^4",
53
- "lodash.get": "^4.4.2",
54
- "marked": "^4",
55
- "mockjs": "^1.1.0",
56
- "nprogress": "^0.2.0",
57
- "qs": "^6.11.2",
58
- "regenerator-runtime": "^0.14.0",
59
- "splitpanes": "^2.4.1",
60
- "videojs-contrib-hls": "^5.15.0",
61
- "viser-vue": "^2.4.8",
62
- "vue": "^2.7.14",
63
- "vue-codemirror": "4.0.6",
64
- "vue-color": "2.7.0",
65
- "vue-draggable-resizable": "^2.3.0",
66
- "vue-i18n": "^8.28.2",
67
- "vue-json-viewer": "^2.2.22",
68
- "vue-router": "^3.6.5",
69
- "vue-video-player": "^5.0.2",
70
- "vue-virtual-scroller": "^1.1.2",
71
- "vuedraggable": "^2.24.3",
72
- "vuex": "^3.6.2",
73
- "xlsx": "0.18.5"
74
- },
75
- "devDependencies": {
76
- "@ant-design/colors": "^7.0.0",
77
- "@babel/core": "^7.22.20",
78
- "@babel/eslint-parser": "^7.22.15",
79
- "@babel/preset-env": "^7.22.20",
80
- "@vue/cli-plugin-babel": "^5.0.8",
81
- "@vue/cli-plugin-eslint": "^5.0.8",
82
- "@vue/cli-service": "^5.0.8",
83
- "@vue/eslint-config-standard": "^8.0.1",
84
- "@vue/test-utils": "^1.3.6",
85
- "babel-plugin-transform-remove-console": "^6.9.4",
86
- "compression-webpack-plugin": "^10.0.0",
87
- "css-minimizer-webpack-plugin": "^5.0.1",
88
- "deepmerge": "^4.3.1",
89
- "eslint": "^8.51.0",
90
- "eslint-plugin-vue": "^9.17.0",
91
- "fast-deep-equal": "^3.1.3",
92
- "ignore-loader": "^0.1.2",
93
- "jest": "^29.7.0",
94
- "jest-environment-jsdom": "^29.7.0",
95
- "jest-transform-stub": "^2.0.0",
96
- "less-loader": "^6.2.0",
97
- "script-loader": "^0.7.2",
98
- "style-resources-loader": "^1.5.0",
99
- "vue-cli-plugin-style-resources-loader": "^0.1.5",
100
- "vue-jest": "^4.0.1",
101
- "vue-template-compiler": "^2.7.14",
102
- "webpack": "^5.88.2",
103
- "webpack-theme-color-replacer": "^1.4.7",
104
- "whatwg-fetch": "^3.6.19"
105
- },
106
- "browserslist": [
107
- "> 1%",
108
- "last 2 versions",
109
- "not dead",
110
- "not ie 11"
111
- ]
112
- }
1
+ {
2
+ "name": "vue2-client",
3
+ "version": "1.16.49",
4
+ "private": false,
5
+ "scripts": {
6
+ "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
7
+ "serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
8
+ "serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
9
+ "serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
10
+ "serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
11
+ "serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
12
+ "serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
13
+ "serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
14
+ "serve:message": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode message",
15
+ "serve:apply": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode apply",
16
+ "mac-serve": "vue-cli-service serve --no-eslint --mode his",
17
+ "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
18
+ "test:unit": "vue-cli-service test:unit",
19
+ "lint": "vue-cli-service lint",
20
+ "build:preview": "vue-cli-service build --mode preview",
21
+ "lint:nofix": "vue-cli-service lint --no-fix",
22
+ "test": "jest"
23
+ },
24
+ "dependencies": {
25
+ "@afwenming123/vue-easy-tree": "^1.0.1",
26
+ "@afwenming123/vue-plugin-hiprint": "^0.0.70",
27
+ "@amap/amap-jsapi-loader": "^1.0.1",
28
+ "@antv/data-set": "^0.11.8",
29
+ "@antv/g2plot": "^2.4.31",
30
+ "@hufe921/canvas-editor": "^0.9.49",
31
+ "@microsoft/fetch-event-source": "^2.0.1",
32
+ "@vue/babel-preset-jsx": "^1.4.0",
33
+ "animate.css": "^4.1.1",
34
+ "ant-design-vue": "^1.7.8",
35
+ "axios": "^0.27.2",
36
+ "clipboard": "^2.0.11",
37
+ "core-js": "^3.33.0",
38
+ "crypto-js": "^4.1.1",
39
+ "date-fns": "^2.29.3",
40
+ "default-passive-events": "^2.0.0",
41
+ "dotenv": "^16.3.1",
42
+ "echarts": "^5.5.0",
43
+ "enquire.js": "^2.1.6",
44
+ "file-saver": "^2.0.5",
45
+ "highlight.js": "^11.7.0",
46
+ "html2canvas": "^1.4.1",
47
+ "js-base64": "^3.7.5",
48
+ "js-cookie": "^2.2.1",
49
+ "jsencrypt": "^3.3.2",
50
+ "jspdf": "^2.5.1",
51
+ "lodash.clonedeep": "^4.5.0",
52
+ "lodash.debounce": "^4",
53
+ "lodash.get": "^4.4.2",
54
+ "marked": "^4",
55
+ "mockjs": "^1.1.0",
56
+ "nprogress": "^0.2.0",
57
+ "qs": "^6.11.2",
58
+ "regenerator-runtime": "^0.14.0",
59
+ "splitpanes": "^2.4.1",
60
+ "videojs-contrib-hls": "^5.15.0",
61
+ "viser-vue": "^2.4.8",
62
+ "vue": "^2.7.14",
63
+ "vue-codemirror": "4.0.6",
64
+ "vue-color": "2.7.0",
65
+ "vue-draggable-resizable": "^2.3.0",
66
+ "vue-i18n": "^8.28.2",
67
+ "vue-json-viewer": "^2.2.22",
68
+ "vue-router": "^3.6.5",
69
+ "vue-video-player": "^5.0.2",
70
+ "vue-virtual-scroller": "^1.1.2",
71
+ "vuedraggable": "^2.24.3",
72
+ "vuex": "^3.6.2",
73
+ "xlsx": "0.18.5"
74
+ },
75
+ "devDependencies": {
76
+ "@ant-design/colors": "^7.0.0",
77
+ "@babel/core": "^7.22.20",
78
+ "@babel/eslint-parser": "^7.22.15",
79
+ "@babel/preset-env": "^7.22.20",
80
+ "@vue/cli-plugin-babel": "^5.0.8",
81
+ "@vue/cli-plugin-eslint": "^5.0.8",
82
+ "@vue/cli-service": "^5.0.8",
83
+ "@vue/eslint-config-standard": "^8.0.1",
84
+ "@vue/test-utils": "^1.3.6",
85
+ "babel-plugin-transform-remove-console": "^6.9.4",
86
+ "compression-webpack-plugin": "^10.0.0",
87
+ "css-minimizer-webpack-plugin": "^5.0.1",
88
+ "deepmerge": "^4.3.1",
89
+ "eslint": "^8.51.0",
90
+ "eslint-plugin-vue": "^9.17.0",
91
+ "fast-deep-equal": "^3.1.3",
92
+ "ignore-loader": "^0.1.2",
93
+ "jest": "^29.7.0",
94
+ "jest-environment-jsdom": "^29.7.0",
95
+ "jest-transform-stub": "^2.0.0",
96
+ "less-loader": "^6.2.0",
97
+ "script-loader": "^0.7.2",
98
+ "style-resources-loader": "^1.5.0",
99
+ "vue-cli-plugin-style-resources-loader": "^0.1.5",
100
+ "vue-jest": "^4.0.1",
101
+ "vue-template-compiler": "^2.7.14",
102
+ "webpack": "^5.88.2",
103
+ "webpack-theme-color-replacer": "^1.4.7",
104
+ "whatwg-fetch": "^3.6.19"
105
+ },
106
+ "browserslist": [
107
+ "> 1%",
108
+ "last 2 versions",
109
+ "not dead",
110
+ "not ie 11"
111
+ ]
112
+ }
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import XButtons from '@vue2-client/base-client/components/common/XButtons/XButtons.vue'
3
- import { ref } from 'vue'
3
+ import { ref, computed, useAttrs } from 'vue'
4
4
 
5
5
  defineProps({
6
6
  // HButtons特有的属性
@@ -13,6 +13,24 @@ defineProps({
13
13
  // 内部 XButtons 实例引用
14
14
  const xButtonsRef = ref()
15
15
 
16
+ // 兼容多种样式配置
17
+ const attrs = useAttrs()
18
+ const wrapperClassObject = computed(() => {
19
+ const a = attrs
20
+ const classes = {}
21
+
22
+ // 通用布尔样式开关(以存在/空字符串/'true' 为真)
23
+ const booleanStyleKeys = [
24
+ 'max-width200'
25
+ ]
26
+ for (const key of booleanStyleKeys) {
27
+ const val = a[key]
28
+ const truthy = val === true || val === '' || val === 'true'
29
+ if (truthy) classes[`h-buttons-${key}`] = true
30
+ }
31
+ return classes
32
+ })
33
+
16
34
  // 暴露方法:获取内部 XButtons 实例
17
35
  defineExpose({
18
36
  getXButtonsInstance: function () { return xButtonsRef.value }
@@ -23,7 +41,8 @@ defineExpose({
23
41
  <div
24
42
  class="h-buttons-wrapper"
25
43
  :class="[
26
- `h-buttons-${buttonStyle}`
44
+ `h-buttons-${buttonStyle}`,
45
+ wrapperClassObject
27
46
  ]"
28
47
  >
29
48
  <x-buttons
@@ -31,7 +50,7 @@ defineExpose({
31
50
  v-bind="$attrs"
32
51
  v-on="$listeners"
33
52
  >
34
- <template v-for="(_, name) in $slots" #[name]="slotData">
53
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
35
54
  <slot :name="name" v-bind="slotData" />
36
55
  </template>
37
56
  </x-buttons>
@@ -145,20 +164,21 @@ defineExpose({
145
164
  }
146
165
  }
147
166
  }
148
- // button-left样式 - 按钮从左到右排列
149
- &.h-buttons-button-left {
167
+ // 按钮布局样式公共部分
168
+ &.h-buttons-button-left,
169
+ &.h-buttons-button-center,
170
+ &.h-buttons-button-right,
171
+ &.h-buttons-button-space-between {
150
172
  :deep(.ant-btn-group) {
151
173
  width: 100%;
152
174
  display: flex;
153
175
  flex-wrap: nowrap;
154
- justify-content: flex-start;
155
- gap: 12px;
156
176
  .ant-btn {
157
177
  border: 1px solid #CDCDCD;
158
178
  color: #5D5C5C;
159
- flex: 0 0 auto;
160
- min-width: 124px;
161
179
  width: auto;
180
+ min-width: 124px;
181
+ max-width: 170px;
162
182
  white-space: nowrap;
163
183
  overflow: hidden;
164
184
  margin-right: 0px;
@@ -166,69 +186,51 @@ defineExpose({
166
186
  }
167
187
  }
168
188
  }
189
+ &.h-buttons-max-width200 {
190
+ :deep(.ant-btn) {
191
+ max-width: 200px !important;
192
+ }
193
+ }
194
+ // button-left样式 - 按钮从左到右排列
195
+ &.h-buttons-button-left {
196
+ :deep(.ant-btn-group) {
197
+ justify-content: flex-start;
198
+ gap: 12px;
199
+ .ant-btn {
200
+ flex: 1 1 auto;
201
+ }
202
+ }
203
+ }
169
204
  // button-center样式 - 按钮居中排列
170
205
  &.h-buttons-button-center {
171
206
  :deep(.ant-btn-group) {
172
- width: 100%;
173
- display: flex;
174
- flex-wrap: nowrap;
175
207
  justify-content: center;
176
208
  gap: 12px;
177
209
  .ant-btn {
178
- border: 1px solid #CDCDCD;
179
- color: #5D5C5C;
180
- flex: 0 0 auto;
181
- min-width: 124px;
182
- width: auto;
183
- white-space: nowrap;
184
- overflow: hidden;
185
- margin-right: 0px;
186
- text-overflow: ellipsis;
210
+ flex: 1 1 auto;
187
211
  }
188
212
  }
189
213
  }
190
214
  // button-right样式 - 按钮从右到左排列
191
215
  &.h-buttons-button-right {
192
216
  :deep(.ant-btn-group) {
193
- width: 100%;
194
- display: flex;
195
- flex-wrap: nowrap;
196
217
  justify-content: flex-end;
197
218
  gap: 12px;
198
219
  .ant-btn {
199
- border: 1px solid #CDCDCD;
200
- color: #5D5C5C;
201
- flex: 0 0 auto;
202
- width: auto;
203
- min-width: 124px;
204
- white-space: nowrap;
205
- overflow: hidden;
206
- margin-right: 0px;
207
- text-overflow: ellipsis;
220
+ flex: 1 1 auto;
208
221
  }
209
222
  }
210
223
  }
211
224
  // button-space-between样式 - 按钮两端对齐(两个按钮时分布在两端)
212
225
  &.h-buttons-button-space-between {
213
226
  :deep(.ant-btn-group) {
214
- width: 100%;
215
- display: flex;
216
- flex-wrap: nowrap;
217
227
  justify-content: space-between;
218
228
  .ant-btn {
219
- border: 1px solid #CDCDCD;
220
- color: #5D5C5C;
221
- width: auto;
222
229
  flex: 1 1 auto;
223
- max-width: 180px;
224
- min-width: 124px;
225
- white-space: nowrap;
226
- overflow: hidden;
227
- margin-right: 0px;
228
- text-overflow: ellipsis;
229
230
  }
230
231
  }
231
232
  }
233
+
232
234
  // button-icon-tiles样式 - 左侧彩色图标块 + 右侧文字
233
235
  &.h-buttons-button-icon-tiles {
234
236
  :deep(.ant-btn-group) {
@@ -1,120 +1,120 @@
1
- <script setup lang="ts">
2
- import XFormGroup from '@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'
3
- import { ref, onMounted, getCurrentInstance, watch } from 'vue'
4
- import { getConfigByNameAsync } from '@vue2-client/services/api/common'
5
-
6
- // 与 HTab 保持一致的样式开关
7
- defineProps({
8
- hasTopMargin: { type: Boolean, default: true },
9
- // 隐藏左侧索引栏(样式控制)
10
- leftHide: { type: Boolean, default: false }
11
- })
12
-
13
- // 内部 XFormGroup 实例引用
14
- const xFormGroupRef = ref()
15
-
16
- // 暴露方法:对齐 XFormGroup 的外部可用方法
17
- defineExpose({
18
- getXFormGroupInstance: () => xFormGroupRef.value,
19
- init: (params) => xFormGroupRef.value && xFormGroupRef.value.init && xFormGroupRef.value.init(params),
20
- asyncSubmit: () => xFormGroupRef.value && xFormGroupRef.value.asyncSubmit && xFormGroupRef.value.asyncSubmit(),
21
- getNativeFormRef: (group) => xFormGroupRef.value && xFormGroupRef.value.getNativeFormRef && xFormGroupRef.value.getNativeFormRef(group),
22
- getNativeForm: (group) => xFormGroupRef.value && xFormGroupRef.value.getNativeForm && xFormGroupRef.value.getNativeForm(group)
23
- })
24
-
25
- // 自动初始化:当外部传入 queryParamsName 时,自动加载配置并调用 XFormGroup.init
26
- const vm = getCurrentInstance()
27
- const autoInit = async () => {
28
- try {
29
- const a = vm?.proxy?.$attrs || {}
30
- const queryParamsName = a.queryParamsName
31
- if (!queryParamsName) return
32
- const serviceName = a.serviceName || process.env.VUE_APP_SYSTEM_NAME
33
- const env = a.env || 'prod'
34
- const showLeftTab = a.showLeftTab || false
35
- const businessType = a.businessType || '新增'
36
- const modifyModelData = a.modifyModelData || {}
37
-
38
- const isDev = env === 'dev'
39
- const res = await getConfigByNameAsync(queryParamsName, serviceName, isDev)
40
-
41
- const payload = {
42
- ...res,
43
- serviceName,
44
- env,
45
- showLeftTab,
46
- businessType,
47
- modifyModelData
48
- }
49
- if (xFormGroupRef.value && typeof xFormGroupRef.value.init === 'function') {
50
- xFormGroupRef.value.init(payload)
51
- } else {
52
- // do nothing
53
- }
54
- } catch (e) {
55
- // swallow
56
- }
57
- }
58
-
59
- onMounted(() => {
60
- autoInit()
61
- })
62
-
63
- // 当关键 attrs 变更时,重新初始化
64
- watch(() => [vm?.proxy?.$attrs?.queryParamsName, vm?.proxy?.$attrs?.serviceName, vm?.proxy?.$attrs?.env], () => {
65
- autoInit()
66
- })
67
- </script>
68
-
69
- <template>
70
- <div
71
- class="h-form-group-wrapper"
72
- :class="{
73
- 'h-form-group-has-top-margin': hasTopMargin,
74
- 'left-hide': leftHide
75
- }"
76
- >
77
- <x-form-group
78
- ref="xFormGroupRef"
79
- v-bind="$attrs"
80
- v-on="$listeners"
81
- >
82
- <template v-for="(_, name) in $slots" #[name]="slotData">
83
- <slot :name="name" v-bind="slotData" />
84
- </template>
85
- </x-form-group>
86
- </div>
87
-
88
- </template>
89
-
90
- <style scoped lang="less">
91
- .h-form-group-wrapper {
92
- // XFormGroup 自身容器
93
- :deep(.XFormGroupClass) {
94
- height: 100%;
95
-
96
- .heigth100 { height: 100%; }
97
- :deep(.ant-spin-container) { height: 100%; }
98
-
99
- // 默认分组标题样式,参考 XFormGroup
100
- .xFormGroupTitle {
101
- font-size: 15px;
102
- font-weight: bold;
103
- color: @primary-color;
104
- }
105
-
106
- .formGroupContext {
107
- height: 100%;
108
- overflow-y: auto;
109
- }
110
- }
111
- // 隐藏左侧(索引栏)
112
- &.left-hide {
113
- :deep(.ant-spin-container) {
114
- .ant-row {
115
- .ant-col-3 { display: none; }
116
- }
117
- }
118
- }
119
- }
120
- </style>
1
+ <script setup lang="ts">
2
+ import XFormGroup from '@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'
3
+ import { ref, onMounted, getCurrentInstance, watch } from 'vue'
4
+ import { getConfigByNameAsync } from '@vue2-client/services/api/common'
5
+
6
+ // 与 HTab 保持一致的样式开关
7
+ defineProps({
8
+ hasTopMargin: { type: Boolean, default: true },
9
+ // 隐藏左侧索引栏(样式控制)
10
+ leftHide: { type: Boolean, default: false }
11
+ })
12
+
13
+ // 内部 XFormGroup 实例引用
14
+ const xFormGroupRef = ref()
15
+
16
+ // 暴露方法:对齐 XFormGroup 的外部可用方法
17
+ defineExpose({
18
+ getXFormGroupInstance: () => xFormGroupRef.value,
19
+ init: (params) => xFormGroupRef.value && xFormGroupRef.value.init && xFormGroupRef.value.init(params),
20
+ asyncSubmit: () => xFormGroupRef.value && xFormGroupRef.value.asyncSubmit && xFormGroupRef.value.asyncSubmit(),
21
+ getNativeFormRef: (group) => xFormGroupRef.value && xFormGroupRef.value.getNativeFormRef && xFormGroupRef.value.getNativeFormRef(group),
22
+ getNativeForm: (group) => xFormGroupRef.value && xFormGroupRef.value.getNativeForm && xFormGroupRef.value.getNativeForm(group)
23
+ })
24
+
25
+ // 自动初始化:当外部传入 queryParamsName 时,自动加载配置并调用 XFormGroup.init
26
+ const vm = getCurrentInstance()
27
+ const autoInit = async () => {
28
+ try {
29
+ const a = vm?.proxy?.$attrs || {}
30
+ const queryParamsName = a.queryParamsName
31
+ if (!queryParamsName) return
32
+ const serviceName = a.serviceName || process.env.VUE_APP_SYSTEM_NAME
33
+ const env = a.env || 'prod'
34
+ const showLeftTab = a.showLeftTab || false
35
+ const businessType = a.businessType || '新增'
36
+ const modifyModelData = a.modifyModelData || {}
37
+
38
+ const isDev = env === 'dev'
39
+ const res = await getConfigByNameAsync(queryParamsName, serviceName, isDev)
40
+
41
+ const payload = {
42
+ ...res,
43
+ serviceName,
44
+ env,
45
+ showLeftTab,
46
+ businessType,
47
+ modifyModelData
48
+ }
49
+ if (xFormGroupRef.value && typeof xFormGroupRef.value.init === 'function') {
50
+ xFormGroupRef.value.init(payload)
51
+ } else {
52
+ // do nothing
53
+ }
54
+ } catch (e) {
55
+ // swallow
56
+ }
57
+ }
58
+
59
+ onMounted(() => {
60
+ autoInit()
61
+ })
62
+
63
+ // 当关键 attrs 变更时,重新初始化
64
+ watch(() => [vm?.proxy?.$attrs?.queryParamsName, vm?.proxy?.$attrs?.serviceName, vm?.proxy?.$attrs?.env], () => {
65
+ autoInit()
66
+ })
67
+ </script>
68
+
69
+ <template>
70
+ <div
71
+ class="h-form-group-wrapper"
72
+ :class="{
73
+ 'h-form-group-has-top-margin': hasTopMargin,
74
+ 'left-hide': leftHide
75
+ }"
76
+ >
77
+ <x-form-group
78
+ ref="xFormGroupRef"
79
+ v-bind="$attrs"
80
+ v-on="$listeners"
81
+ >
82
+ <template v-for="(_, name) in $slots" #[name]="slotData">
83
+ <slot :name="name" v-bind="slotData" />
84
+ </template>
85
+ </x-form-group>
86
+ </div>
87
+
88
+ </template>
89
+
90
+ <style scoped lang="less">
91
+ .h-form-group-wrapper {
92
+ // XFormGroup 自身容器
93
+ :deep(.XFormGroupClass) {
94
+ height: 100%;
95
+
96
+ .heigth100 { height: 100%; }
97
+ :deep(.ant-spin-container) { height: 100%; }
98
+
99
+ // 默认分组标题样式,参考 XFormGroup
100
+ .xFormGroupTitle {
101
+ font-size: 15px;
102
+ font-weight: bold;
103
+ color: @primary-color;
104
+ }
105
+
106
+ .formGroupContext {
107
+ height: 100%;
108
+ overflow-y: auto;
109
+ }
110
+ }
111
+ // 隐藏左侧(索引栏)
112
+ &.left-hide {
113
+ :deep(.ant-spin-container) {
114
+ .ant-row {
115
+ .ant-col-3 { display: none; }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ </style>
@@ -1,3 +1,3 @@
1
- import HFormGroup from './HFormGroup.vue'
2
-
3
- export default HFormGroup
1
+ import HFormGroup from './HFormGroup.vue'
2
+
3
+ export default HFormGroup