vue2-client 1.16.36 → 1.16.38

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,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.16.36",
3
+ "version": "1.16.38",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -214,7 +214,8 @@ defineExpose({
214
214
  border: 1px solid #CDCDCD;
215
215
  color: #5D5C5C;
216
216
  width: auto;
217
- flex: 0 0 auto;
217
+ flex: 1 1 auto;
218
+ max-width: 180px;
218
219
  min-width: 124px;
219
220
  white-space: nowrap;
220
221
  overflow: hidden;
@@ -51,7 +51,7 @@ defineExpose({
51
51
  v-bind="$attrs"
52
52
  v-on="$listeners"
53
53
  >
54
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
54
+ <template v-for="(_, name) in $slots" #[name]="slotData">
55
55
  <slot :name="name" v-bind="slotData" />
56
56
  </template>
57
57
  </x-add-native-form>
@@ -0,0 +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>
@@ -0,0 +1,3 @@
1
+ import HFormGroup from './HFormGroup.vue'
2
+
3
+ export default HFormGroup
@@ -23,7 +23,13 @@
23
23
  serviceName="af-his"
24
24
  />
25
25
  </a-card>
26
-
26
+ <!-- <a-card title="HFormGroup" style="margin-top: 20px;">-->
27
+ <!-- <h-form-group-->
28
+ <!-- queryParamsName="surgeryApplicationFormGroup"-->
29
+ <!-- serviceName="af-his"-->
30
+ <!-- :left-hide="true"-->
31
+ <!-- />-->
32
+ <!-- </a-card>-->
27
33
  <!-- &lt;!&ndash; HButtons &ndash;&gt;-->
28
34
  <!-- <a-card title="HButtons" style="margin-top: 20px;">-->
29
35
  <!-- <h-buttons-->
@@ -39,6 +45,7 @@
39
45
  import HFormTable from './HFormTable/HFormTable.vue'
40
46
  // import HButtons from './HButtons/HButtons.vue'
41
47
  import HAddNativeForm from '@vue2-client/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm.vue'
48
+ // import HFormGroup from './HFormGroup/HFormGroup.vue'
42
49
  </script>
43
50
 
44
51
  <style scoped lang="less">
@@ -36,6 +36,7 @@
36
36
  'x-tab',
37
37
  'h-tab',
38
38
  'x-form-group',
39
+ 'h-form-group',
39
40
  'x-report',
40
41
  'x-buttons',
41
42
  'h-buttons',
@@ -112,6 +113,7 @@
112
113
  'x-tab',
113
114
  'h-tab',
114
115
  'x-form-group',
116
+ 'h-form-group',
115
117
  'x-report',
116
118
  'x-buttons',
117
119
  'h-buttons',
@@ -181,6 +183,7 @@ export default {
181
183
  XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
182
184
  HAddNativeForm: () => import('@vue2-client/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm.vue'),
183
185
  XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
186
+ HFormGroup: () => import('@vue2-client/base-client/components/common/HIS/HFormGroup/HFormGroup.vue'),
184
187
  XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
185
188
  XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
186
189
  XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
@@ -865,6 +865,10 @@ export default {
865
865
  if (item.slotType === 'action') {
866
866
  item.fixed = 'right'
867
867
  item.width = 70
868
+ } else if (item.slotType === 'index') {
869
+ item.fixed = 'left'
870
+ } else if (item.slotType === 'fixed') {
871
+ item.fixed = item.fixedType
868
872
  }
869
873
  // 设置表格宽度
870
874
  if (item.width) {
@@ -10,14 +10,14 @@ export default {
10
10
  default: () => undefined
11
11
  }
12
12
  },
13
- mounted() {
13
+ mounted () {
14
14
  this.$refs.xFormTable.refresh(true)
15
15
  },
16
- data() {
16
+ data () {
17
17
  return {
18
18
  // 查询配置名称
19
19
  queryParamsName: 'ExceptionRecordQueryCRUD',
20
- fixedQueryForm: {ex_f_userfiles_id: this.currUserInfo.f_userfiles_id},
20
+ fixedQueryForm: { ex_f_userfiles_id: this.currUserInfo.f_userfiles_id },
21
21
  // 新增表单固定值
22
22
  fixedAddForm: {},
23
23
  // 是否显示详情抽屉
@@ -60,7 +60,7 @@ path: 'example',
60
60
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
62
62
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
63
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
63
+ component: () => import('@vue2-client/base-client/components/common/HIS/demo.vue'),
64
64
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
65
65
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
66
66
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),