vue2-client 1.17.39 → 1.17.41

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 (24) hide show
  1. package/package.json +112 -112
  2. package/src/assets/svg/female.svg +1 -1
  3. package/src/assets/svg/male.svg +1 -1
  4. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +491 -491
  5. package/src/base-client/components/common/HIS/HFormGroup/index.js +3 -3
  6. package/src/base-client/components/common/HIS/HTab/HTab.vue +443 -443
  7. package/src/base-client/components/common/XCollapse/XCollapse.vue +830 -830
  8. package/src/base-client/components/common/XForm/XFormItem.vue +12 -4
  9. package/src/base-client/components/common/XFormTable/XFormTable.vue +4 -3
  10. package/src/base-client/components/common/XFormTable/demo.vue +33 -9
  11. package/src/base-client/components/common/XTable/XTable.vue +46 -0
  12. package/src/base-client/components/common/XTable/XTableWrapper.vue +37 -0
  13. package/src/base-client/components/common/XTimeline/XTimeline.vue +477 -477
  14. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +705 -705
  15. package/src/base-client/components/his/XList/XList.vue +938 -938
  16. package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +354 -354
  17. package/src/base-client/components/his/XTitle/XTitle.vue +314 -314
  18. package/src/base-client/components/his/XTreeRows/XTreeRows.vue +341 -341
  19. package/src/base-client/components/his/threeTestOrders/editor.vue +113 -113
  20. package/src/components/FileImageItem/FileItem.vue +320 -320
  21. package/src/pages/WorkflowDetail/WorkflowPageDetail/worklog.vue +98 -97
  22. package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -45
  23. package/src-base-client/components/common/HIS/HForm/HForm.vue +0 -347
  24. package/src-base-client/components/common/XCollapse/XCollapse.vue +0 -0
@@ -26,7 +26,8 @@
26
26
  @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
27
27
  @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
28
28
  :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
29
- :ref="`${attr.model}input`"/>
29
+ :ref="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"
30
+ :id="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"/>
30
31
  <a-button
31
32
  v-if="attr.inputOnAfterName && attr.inputOnAfterFunc && !attr.inputOnAfterName.includes('|')"
32
33
  style="width: auto; min-width: 4rem;max-width: 6rem"
@@ -61,7 +62,8 @@
61
62
  @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
62
63
  :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
63
64
  :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
64
- :ref="`${attr.model}input`"/>
65
+ :ref="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"
66
+ :id="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"/>
65
67
  <a-input
66
68
  v-else
67
69
  v-model="form[attr.model]"
@@ -74,7 +76,8 @@
74
76
  @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
75
77
  @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
76
78
  :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
77
- :ref="`${attr.model}input`"/>
79
+ :ref="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"
80
+ :id="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"/>
78
81
  </a-form-model-item>
79
82
  </x-form-col>
80
83
  <!-- 下拉框 -->
@@ -666,7 +669,7 @@
666
669
  style="width:100%"
667
670
  @blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
668
671
  :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
669
- :ref="`${attr.model}input`"/>
672
+ :ref="rowIndex !== undefined ? `${rowIndex}-${attr.model}input` : `${attr.model}input`"/>
670
673
  <x-license-plate
671
674
  v-else
672
675
  v-model="form[attr.model]"
@@ -884,6 +887,11 @@ export default {
884
887
  () => {
885
888
  return undefined
886
889
  }
890
+ },
891
+ // 行索引(行编辑模式下使用)
892
+ rowIndex: {
893
+ type: Number,
894
+ default: undefined
887
895
  }
888
896
  },
889
897
  provide () {
@@ -68,6 +68,7 @@
68
68
  :externalSelectedRowKeys="externalSelectedRowKeys"
69
69
  :customPagination="customPagination"
70
70
  :hiddenFunctionalArea="hiddenFunctionalArea"
71
+ @x-form-item-emit-func="emitFunc"
71
72
  @add="add"
72
73
  @move="move"
73
74
  @edit="edit"
@@ -881,9 +882,9 @@ export default {
881
882
  callback()
882
883
  }
883
884
  },
884
- emitFunc (func, data, value) {
885
- this.$emit(func, data, value)
886
- this.$emit('getEmitFuncData', func, data, value)
885
+ emitFunc (func, ...args) {
886
+ this.$emit(func, ...args)
887
+ this.$emit('getEmitFuncData', func, ...args)
887
888
  },
888
889
  // 直接转发事件的函数
889
890
  emitEvent (event, ...args) {
@@ -8,8 +8,10 @@
8
8
  @action="action"
9
9
  @selectRow="selectRow"
10
10
  @columnClick="columnClick"
11
+ @ceshi="ceshi"
11
12
  serviceName="af-revenue"
12
- ref="xFormTable">
13
+ ref="xFormTable"
14
+ >
13
15
  </x-form-table>
14
16
  </a-card>
15
17
  </template>
@@ -21,7 +23,7 @@ import { microDispatch } from '@vue2-client/utils/microAppUtils'
21
23
  export default {
22
24
  name: 'Demo',
23
25
  components: {
24
- XFormTable
26
+ XFormTable,
25
27
  },
26
28
  data () {
27
29
  return {
@@ -39,11 +41,35 @@ export default {
39
41
  selectedKeys: [],
40
42
  selected: {
41
43
  keys: [],
42
- rows: []
43
- }
44
+ rows: [],
45
+ },
44
46
  }
45
47
  },
46
48
  methods: {
49
+ // input框 行編輯參數傳遞
50
+ ceshi (...args) {
51
+ // attr, value, currentRecord, currentIndex, nextRecord, nextIndex
52
+ const [attr, value, currentRecord, currentIndex, nextRecord, nextIndex] =
53
+ args
54
+ console.log(
55
+ 'ceshi',
56
+ attr,
57
+ value,
58
+ currentRecord,
59
+ currentIndex,
60
+ nextRecord,
61
+ nextIndex
62
+ )
63
+ // 示例:当按下 Enter 键且有下一行时,跳转到下一行的同一列
64
+ // 可以在这里执行业务逻辑(例如:保存数据)
65
+ console.log('当前行:', currentIndex, '下一行:', nextIndex)
66
+ if (!nextIndex) {
67
+ this.$message.warning('没有下一行')
68
+ return
69
+ }
70
+ // 跳转到下一行的同一列
71
+ this.$refs.xFormTable.$refs.xTable.focusInput(nextIndex, attr.model)
72
+ },
47
73
  test () {
48
74
  this.$refs.xFormTable.setTableData([])
49
75
  },
@@ -60,7 +86,7 @@ export default {
60
86
  microDispatch({
61
87
  type: 'v3route',
62
88
  path: '/bingliguanli/dianzibingliluru',
63
- props: { selected: arguments[0].his_f_admission_id }
89
+ props: { selected: arguments[0].his_f_admission_id },
64
90
  })
65
91
  },
66
92
  action (record, id, actionType) {
@@ -75,7 +101,7 @@ export default {
75
101
  selectRow (selectedRowKeys, selectedRows) {
76
102
  this.selected = {
77
103
  keys: selectedRowKeys,
78
- rows: selectedRows
104
+ rows: selectedRows,
79
105
  }
80
106
  console.log('selectedDemo', this.selected)
81
107
  },
@@ -84,6 +110,4 @@ export default {
84
110
  }
85
111
  </script>
86
112
 
87
- <style scoped>
88
-
89
- </style>
113
+ <style scoped></style>
@@ -715,6 +715,52 @@ export default {
715
715
  Object.assign(record, obj)
716
716
  this.$forceUpdate()
717
717
  },
718
+ /**
719
+ * 聚焦到指定行和字段的 input
720
+ * @param {Number} rowIndex 行索引
721
+ * @param {String} fieldName 字段名
722
+ */
723
+ focusInput (rowIndex, fieldName) {
724
+ this.$nextTick(() => {
725
+ // 构造 ID:{rowIndex}-{fieldName}input
726
+ const inputId = `${rowIndex}-${fieldName}input`
727
+
728
+ // 使用 ID 查找元素(因为 input 在子组件中,无法通过 this.$refs 访问)
729
+ const inputContainer = document.getElementById(inputId)
730
+
731
+ if (inputContainer) {
732
+ // 如果找到的是容器元素(Ant Design Vue 组件会包装一层),查找内部的 input
733
+ const inputElement = inputContainer.tagName === 'INPUT'
734
+ ? inputContainer
735
+ : inputContainer.querySelector('input')
736
+
737
+ if (inputElement) {
738
+ // 聚焦并选中文本
739
+ inputElement.focus()
740
+ // 延迟选中,确保焦点已经设置
741
+ this.$nextTick(() => {
742
+ if (inputElement.select) {
743
+ inputElement.select()
744
+ }
745
+ })
746
+ } else {
747
+ console.warn(`未找到实际的 input 元素,容器 ID: ${inputId}`)
748
+ }
749
+ } else {
750
+ console.warn(`未找到 input 元素,ID: ${inputId}`)
751
+ }
752
+ })
753
+ },
754
+ /**
755
+ * 处理表单项事件,向外抛出事件供开发者处理
756
+ * @param {Object} context 增强的上下文数据
757
+ */
758
+ handleFormItemEvent (context) {
759
+ const { func, attr, value, currentRecord, currentIndex, nextRecord, nextIndex } = context
760
+
761
+ // 向外抛出事件,参数顺序:func, attr, value, currentRecord, currentIndex, nextRecord, nextIndex
762
+ this.$emit('x-form-item-emit-func', func, attr, value, currentRecord, currentIndex, nextRecord, nextIndex)
763
+ },
718
764
  handleResize () {
719
765
  this.setScrollYHeight({})
720
766
  },
@@ -41,8 +41,10 @@
41
41
  :env="tableContext.env"
42
42
  :setForm="(obj)=>tableContext.setForm(record,obj)"
43
43
  @rowChoose="(row, attr, callback) => tableContext.rowChoose(row, attr, callback, record)"
44
+ @x-form-item-emit-func="(func, attr, value) => handleFormItemEvent(func, attr, value, record, index)"
44
45
  :showLabel="false"
45
46
  :key="'editRow-' + c_index"
47
+ :row-index="index"
46
48
  />
47
49
  </template>
48
50
  <span v-else-if="item.slotType === 'rate'" :key="'rate-' + c_index">
@@ -178,8 +180,10 @@
178
180
  :env="tableContext.env"
179
181
  :setForm="(obj)=>tableContext.setForm(record,obj)"
180
182
  @rowChoose="(row, attr, callback) => tableContext.rowChoose(row, attr, callback, record)"
183
+ @x-form-item-emit-func="(func, attr, value) => handleFormItemEvent(func, attr, value, record, index)"
181
184
  :showLabel="false"
182
185
  :key="'editRow-' + c_index"
186
+ :row-index="index"
183
187
  />
184
188
  </template>
185
189
  <span v-else-if="item.slotType === 'rate'" :key="'rate-' + c_index">
@@ -596,6 +600,39 @@ export default {
596
600
  this.$set(record, dataIndex, data.value)
597
601
  }
598
602
  },
603
+ /**
604
+ * 处理表单项事件,增强事件数据
605
+ * @param {String} func 事件函数名
606
+ * @param {Object} attr 字段配置
607
+ * @param {*} value 字段值
608
+ * @param {Object} record 当前行数据
609
+ * @param {Number} index 当前行索引
610
+ */
611
+ handleFormItemEvent (func, attr, value, record, index) {
612
+ // 获取表格数据源
613
+ const dataSource = this.localDataSource || []
614
+
615
+ // 计算下一行的索引和数据
616
+ const nextIndex = index + 1
617
+ const nextRecord = nextIndex < dataSource.length ? dataSource[nextIndex] : null
618
+
619
+ // 构建增强的上下文数据
620
+ const enhancedContext = {
621
+ func,
622
+ attr,
623
+ value,
624
+ currentRecord: record,
625
+ currentIndex: index,
626
+ nextRecord,
627
+ nextIndex: nextRecord ? nextIndex : null,
628
+ tableContext: this.tableContext
629
+ }
630
+
631
+ // 调用 tableContext 的事件处理方法
632
+ if (this.tableContext && typeof this.tableContext.handleFormItemEvent === 'function') {
633
+ this.tableContext.handleFormItemEvent(enhancedContext)
634
+ }
635
+ }
599
636
  }
600
637
  }
601
638
  </script>