vue2-client 1.14.94 → 1.14.97

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 (145) hide show
  1. package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +0 -1
  2. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +2 -4
  3. package/package.json +1 -1
  4. package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -0
  5. package/src/base-client/components/common/XTab/XTab.vue +40 -8
  6. package/src/base-client/components/common/XTable/XTable.vue +30 -23
  7. package/src/base-client/components/common/XTable/XTableWrapper.vue +13 -6
  8. package/src/base-client/components/common/XUploadFilesView/index.vue +485 -485
  9. package/src/base-client/components/his/XList/XList.vue +35 -35
  10. package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.json +0 -34
  11. package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.vue +51 -23
  12. package/src/base-client/components/his/XQuestionnaire/XQuestionnaireDemo.vue +19 -2
  13. package/src/base-client/components/his/XQuestionnaire/XQuestionnaireItem.vue +39 -56
  14. package/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +1 -1
  15. package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
  16. package/src/base-client/components/his/XTreeRows/TreeNode.vue +100 -100
  17. package/src/base-client/components/his/XTreeRows/XTreeRows.vue +197 -197
  18. package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
  19. package/src/base-client/components/layout/XPageView/RenderRow.vue +88 -90
  20. package/src/base-client/components/layout/XPageView/XPageRowTemplate.vue +37 -0
  21. package/src/base-client/components/layout/XPageView/XPageView.vue +223 -222
  22. package/src/base-client/components/layout/XPageView/XTab/XTab.vue +96 -0
  23. package/src/base-client/components/layout/XPageView/XTab/index.js +3 -0
  24. package/src/base-client/components/layout/XPageView/componentTypes.js +22 -0
  25. package/src/base-client/components/layout/XPageView/index.js +1 -0
  26. package/src/base-client/components/layout/XPageView/index.md +19 -0
  27. package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +388 -388
  28. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +10 -4
  29. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +1 -1
  30. package/src/pages/XPageViewExample/index.vue +149 -71
  31. package/.history/public/his/editor/editor_20250606134713.html +0 -51
  32. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
  33. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
  34. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
  35. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
  36. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
  37. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
  38. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
  39. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
  40. package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
  41. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
  42. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
  43. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
  44. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
  45. package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
  46. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
  47. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
  48. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
  49. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
  50. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
  51. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
  52. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
  53. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
  54. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
  55. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
  56. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
  57. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
  58. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
  59. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
  60. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
  61. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
  62. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
  63. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
  64. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
  65. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
  66. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
  67. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
  68. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
  69. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
  70. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
  71. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
  72. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
  73. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
  74. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
  75. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
  76. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
  77. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
  78. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
  79. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
  80. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
  81. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
  82. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
  83. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
  84. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
  85. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
  86. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
  87. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
  88. package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
  89. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
  90. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
  91. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
  92. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
  93. package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
  94. package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
  95. package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
  96. package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
  97. package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
  98. package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
  99. package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
  100. package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
  101. package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
  102. package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
  103. package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
  104. package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
  105. package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
  106. package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
  107. package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
  108. package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
  109. package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
  110. package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
  111. package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
  112. package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
  113. package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
  114. package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
  115. package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
  116. package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
  117. package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
  118. package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
  119. package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
  120. package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
  121. package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
  122. package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
  123. package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
  124. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250609151519.vue +0 -222
  125. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155514.vue +0 -183
  126. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155556.vue +0 -183
  127. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155600.vue +0 -183
  128. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181609.vue +0 -206
  129. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181629.vue +0 -209
  130. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095553.vue +0 -242
  131. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095610.vue +0 -242
  132. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095612.vue +0 -242
  133. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100041.vue +0 -251
  134. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100047.vue +0 -251
  135. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100054.vue +0 -250
  136. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100105.vue +0 -250
  137. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100107.vue +0 -250
  138. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100114.vue +0 -250
  139. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140844.vue +0 -238
  140. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140910.vue +0 -238
  141. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140912.vue +0 -238
  142. package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
  143. package/src/base-client/components/TreeList/TreeList.vue +0 -91
  144. package/src/base-client/components/TreeList/TreeNode.vue +0 -81
  145. package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
@@ -10,46 +10,46 @@
10
10
  @mouseleave="handleMouseLeave"
11
11
  :class="{ 'hover-active': enableHoverOptions && hoveredIndex === index }"
12
12
  >
13
- <i
14
- v-if="icon"
15
- class="icon-menu"
16
- :style="getIconStyle(item)"
17
- ></i>
18
- <span
19
- class="item-text">
20
- {{ item.number }} {{ item.name }}
21
- </span>
13
+ <i
14
+ v-if="icon"
15
+ class="icon-menu"
16
+ :style="getIconStyle(item)"
17
+ ></i>
18
+ <span
19
+ class="item-text">
20
+ {{ item.number }} {{ item.name }}
21
+ </span>
22
22
 
23
- <div v-if="button" class="button-group">
24
- <a-button
25
- v-for="(name, idx) in buttonNames"
23
+ <div v-if="button" class="button-group">
24
+ <a-button
25
+ v-for="(name, idx) in buttonNames"
26
+ :key="idx"
27
+ type="link"
28
+ :class="['confirm-btn', buttonMode ? 'hover-btn' : '']"
29
+ @click.stop="click(index, idx)"
30
+ >
31
+ <span :class="{ 'hover-active': enableHoverOptions && hoveredIndex === index }">{{ name }}</span>
32
+ </a-button>
33
+ </div>
34
+
35
+ <!-- 悬浮选项框 -->
36
+ <div
37
+ v-show="enableHoverOptions && hoveredIndex === index"
38
+ class="hover-options"
39
+ @mouseenter="handleOptionsEnter"
40
+ @mouseleave="handleOptionsLeave"
41
+ >
42
+ <div class="hover-options-content">
43
+ <div
44
+ v-for="(item, idx) in select_options"
26
45
  :key="idx"
27
- type="link"
28
- :class="['confirm-btn', buttonMode ? 'hover-btn' : '']"
29
- @click.stop="click(index, idx)"
46
+ class="option-item"
47
+ @click="handleOptionClick(index, item)"
30
48
  >
31
- <span :class="{ 'hover-active': enableHoverOptions && hoveredIndex === index }">{{ name }}</span>
32
- </a-button>
33
- </div>
34
-
35
- <!-- 悬浮选项框 -->
36
- <div
37
- v-show="enableHoverOptions && hoveredIndex === index"
38
- class="hover-options"
39
- @mouseenter="handleOptionsEnter"
40
- @mouseleave="handleOptionsLeave"
41
- >
42
- <div class="hover-options-content">
43
- <div
44
- v-for="(item, idx) in select_options"
45
- :key="idx"
46
- class="option-item"
47
- @click="handleOptionClick(index, item)"
48
- >
49
- {{ item }}
50
- </div>
49
+ {{ item }}
51
50
  </div>
52
51
  </div>
52
+ </div>
53
53
  </a-list-item>
54
54
  </a-list>
55
55
  </div>
@@ -1,37 +1,3 @@
1
- {
2
- "config":{
3
- "title":"",
4
- "split":"",
5
- "style":""//TODO 居中方式
6
- },
7
- "content": [
8
- {
9
- "key":"", //单行记录的标识
10
- "style":"",//居中方式
11
- "item": [
12
- {
13
- "type":"",
14
- "key": "",
15
- "value": {},
16
-
17
- "configName":"", // 通过后端获配置单选多选
18
- "button-type":"",
19
-
20
-
21
- }
22
- ]
23
- }
24
- ]
25
- }
26
1
  //常量取值 checkBox多选
27
2
  type [radio,selectionBox,text,input,time,describe,button]
28
3
  style = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around']
29
-
30
- "results": [{
31
- "row_key": "",
32
- "key": "value"
33
- }
34
- ]
35
-
36
-
37
-
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="list-container" style="display: flex;">
3
- <template v-for="(config, index) in configs">
4
- <x-questionnaire-item :fixedQueryForm="conditions[index]" :queryParamsName="config" :ref="el => setItemRef(el, index)" :key="`questionnaire-${index}`"></x-questionnaire-item>
3
+ <template v-for="(config) in configs">
4
+ <x-questionnaire-item :key="config.tmp_key" :fixedQueryForm="conditionsMap[config.tmp_key]" :queryParamsName="config" :ref="el => setItemRef(el, config)" @customizeEvent="customizeEvent"></x-questionnaire-item>
5
5
  </template>
6
6
  </div>
7
7
  </template>
@@ -26,38 +26,66 @@ export default {
26
26
  data () {
27
27
  return {
28
28
  configs: [],
29
- questionnaireItemRefs: [], // 存储子组件实例
30
- conditions: []
29
+ questionnaireItemRefs: new Map(), // 存储子组件实例
30
+ conditionsMap: {}
31
31
  }
32
32
  },
33
33
  methods: {
34
34
  // 获取配置
35
- async getData (queryParamsName, conditions) {
36
- const that = this
35
+ async getData (queryParamsName, conditionData) {
37
36
  getConfigByName(queryParamsName, 'af-his', res => {
38
- if (res.configs) {
39
- that.configs = []
40
- }
41
- for (let i = 0; i < res.configs.length; i++) {
42
- const condition = i < conditions.length ? conditions[i] : {}
43
- that.configs.push(res.configs[i])
44
- that.conditions.push(condition)
45
- }
37
+ // 清空旧数据
38
+ this.configs = []
39
+ this.conditionsMap = { ...this.conditionsMap }
40
+ console.log(res)
41
+ res.configs.forEach(config => {
42
+ this.configs.push(config)
43
+ // 响应式更新条件映射
44
+ this.$set(this.conditionsMap, config.tmp_key,
45
+ conditionData[config.tmp_key] || {}
46
+ )
47
+ })
46
48
  })
47
49
  },
48
- setItemRef (el, index) {
49
- if (el) {
50
- this.questionnaireItemRefs[index] = el // 保存实例
50
+ customizeEvent (data, callback) {
51
+ console.log(this.$listeners)
52
+ if (data.customize.clickEventName && this.$listeners[data.customize.clickEventName]) {
53
+ // 交由父级处理
54
+ this.$emit(data.customize.clickEventName, data.customize, callback)
55
+ } else {
56
+ this.defaultAction(data.customize.clickEventName, data.customize, callback)
51
57
  }
52
58
  },
53
- init (conditions) {
54
- this.getData(this.queryParamsName, conditions)
59
+ defaultAction (clickEventName, item, callback) {
60
+ setTimeout(() => {
61
+ this.$message.warn(`已触发按钮 [${item.key}],注册事件名 [${clickEventName}],未实现事件函数`)
62
+ callback()
63
+ }, 200)
55
64
  },
56
- refreshList (index, condition) {
57
- if (index < this.conditions.length) {
58
- this.conditions[index] = condition
65
+ setItemRef (el, config) {
66
+ if (el) {
67
+ this.questionnaireItemRefs.set(config.tmp_key, el)
68
+ } else {
69
+ this.questionnaireItemRefs.delete(config.tmp_key) // 组件卸载时清理
59
70
  }
60
- }
71
+ },
72
+ async init (conditionData) { // 接收完整条件对象
73
+ await this.getData(this.queryParamsName, conditionData)
74
+ },
75
+ // init (configId, conditions) {
76
+ // this.getData(this.queryParamsName, conditions)
77
+ // // 初始化或更新时
78
+ // this.conditionsMap = {
79
+ // ...this.conditionsMap,
80
+ // [configId]: conditions // 响应式更新
81
+ // }
82
+ // },
83
+ refreshList (tmpKey, condition) {
84
+ // 更新条件映射
85
+ this.$set(this.conditionsMap, tmpKey, condition)
86
+ // 调用子组件刷新
87
+ this.questionnaireItemRefs.get(tmpKey)?.refreshList(condition)
88
+ },
61
89
  },
62
90
  }
63
91
  </script>
@@ -13,7 +13,19 @@ export default {
13
13
  methods: {
14
14
  init () {
15
15
  console.log(this)
16
- this.$refs.questionnaireRef.init([{ id: 10 }, { id: 20 }, { id: 10 }])
16
+ const conditionData = {
17
+ tmp_1: { tmp_id: 1 },
18
+ tmp_2: { tmp_id: 2 },
19
+ tmp_3: { tmp_id: 3 }
20
+ }
21
+ this.$refs.questionnaireRef.init(conditionData)
22
+ },
23
+ save () {
24
+ console.log(this)
25
+ console.log(this.$refs.questionnaireRef.questionnaireItemRefs.get('tmp_1').results)
26
+ },
27
+ refreshList () {
28
+ this.$refs.questionnaireRef.refreshList('tmp_2', { tmp_id: 3 })
17
29
  }
18
30
  }
19
31
  }
@@ -26,9 +38,14 @@ export default {
26
38
  <a-button type="primary" @click="init">
27
39
  初始化
28
40
  </a-button>
41
+ <a-button type="primary" @click="save">
42
+ 保存
43
+ </a-button>
44
+ <a-button type="primary" @click="refreshList">
45
+ 刷新
46
+ </a-button>
29
47
  </div>
30
48
  </template>
31
49
 
32
50
  <style scoped>
33
-
34
51
  </style>
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <div class="list-wrapper">
3
- <a-list size="large"
4
- :data-source="data"
5
- itemLayout="horizontal"
6
- class="list-container"
7
- ref="listRef"
8
- split="config.split"
3
+ <a-list
4
+ size="large"
5
+ :data-source="data"
6
+ itemLayout="horizontal"
7
+ class="list-container"
8
+ ref="listRef"
9
+ split="config.split"
9
10
  >
10
11
  <template v-if="config.header" #header>
11
12
  <div >{{ config.header }}</div>
@@ -18,23 +19,23 @@
18
19
  class="row-item"
19
20
  :style="{ justifyContent: getFlexJustify(item.style) }"
20
21
  >
21
- <template v-for="(column, idx) in item.item">
22
+ <template v-for="(column, idx) in item.columns">
22
23
  <template v-if="column.type === 'selectionBox'">
23
- <a-checkbox @change="handleChange($event,column,index)" v-model="column.value" :key="`row-${index}-item-${idx}`" :class="['column-item']"></a-checkbox>
24
+ <a-checkbox @change="handleChange($event,column)" v-model="column.value" :key="`row-${index}-item-${idx}`" :class="['column-item']"></a-checkbox>
24
25
  </template>
25
26
  <template v-else-if="column.type === 'input'">
26
- <a-input @change="handleChange($event,column,index)" :key="`row-${index}-item-${idx}`" :class="['column-item','item-input']" v-model="column.value" />
27
+ <a-input @change="handleChange($event,column)" :key="`row-${index}-item-${idx}`" :class="['column-item','item-input']" v-model="column.value" />
27
28
  </template>
28
29
  <template v-else-if="column.type === 'radio'">
29
30
  <x-radio
30
31
  :class="['column-item']"
31
32
  :key="`row-${index}-item-${idx}`"
32
33
  :queryParamsName="column.configName"
33
- @change="handleChange($event,column,index)">
34
+ @change="handleChange($event,column)">
34
35
  </x-radio>
35
36
  </template>
36
37
  <template v-else-if="column.type === 'time'">
37
- <x-time-select :key="`row-${index}-item-${idx}`" :class="['column-item']" @change="handleChange($event,column,index)" :queryParamsName="column.configName">
38
+ <x-time-select :key="`row-${index}-item-${idx}`" :class="['column-item']" @change="handleChange($event,column)" :queryParamsName="column.configName">
38
39
  </x-time-select>
39
40
  </template>
40
41
  <template v-else-if="column.type === 'text'">
@@ -50,13 +51,13 @@
50
51
  <a-button
51
52
  :class="['column-item']"
52
53
  :key="`row-${index}-item-${idx}`"
53
- :disabled="column.disabled"
54
- :icon="column.icon"
55
- :loading="column.loading"
56
- :type="column.buttonType || 'default'"
54
+ :disabled="column.customize.disabled"
55
+ :icon="column.customize.icon"
56
+ :loading="column.customize.loading"
57
+ :type="column.customize.buttonType || 'default'"
57
58
  @click="handleButtonClick(column)"
58
59
  >
59
- {{ column.label }}
60
+ {{ column.value }}
60
61
  </a-button>
61
62
  </template>
62
63
  <template v-else>
@@ -98,8 +99,8 @@ export default {
98
99
  split: true,
99
100
  header: null
100
101
  },
101
- results: [],
102
- mapping: [] // 行索引 results数据所在的行
102
+ results: {},
103
+ oldFixedQueryForm: null
103
104
  }
104
105
  },
105
106
  created () {
@@ -115,38 +116,33 @@ export default {
115
116
  ...config
116
117
  }
117
118
  runLogic(config.data, param, 'af-his').then(res => {
119
+ console.log('1', res)
118
120
  that.data = res || []
119
121
  // 将又返回值的数据创建到results
120
122
  for (let i = 0; i < res.length; i++) {
121
123
  const fields = res[i]
122
- if (!fields.item) {
124
+ if (!fields.columns) {
123
125
  continue
124
126
  }
125
- const value = {}
126
- let hasValidData = false // 标识是否有有效数据
127
- for (let j = 0; j < fields.item.length; j++) {
128
- const field = fields.item[j]
127
+ console.log('2', fields)
128
+ for (let j = 0; j < fields.columns.length; j++) {
129
+ const field = fields.columns[j]
130
+ console.log('3', field)
131
+ if (this.results[field.config_id]) {
132
+ console.error(`Config_id 冲突: ${field.config_id} 重复,同一个模板中不能有形同的配置项`)
133
+ return
134
+ }
129
135
  if (field.type === 'selectionBox' || field.type === 'input' || field.type === 'radio' || field.type === 'time') {
130
- value[field.key] = field.value
131
- hasValidData = true
136
+ this.results[field.config_id] = { value: field.value, data_id: field.data_id }
132
137
  }
133
- }
134
- if (hasValidData) {
135
- this.mapping.push(this.results.length)
136
- value.row_key = fields.key
137
- this.results.push(value)
138
- } else {
139
- this.mapping.push(undefined)
138
+ console.log(this.results)
140
139
  }
141
140
  }
142
141
  })
143
142
  },
144
143
  refreshList (param) {
145
- // 清空当前数据和映射关系
146
144
  this.data = []
147
- this.results = []
148
- this.mapping = []
149
- this.results = []
145
+ this.results = {}
150
146
  this.getData(this.queryParamsName, param)
151
147
  },
152
148
  // 行数据排量方式
@@ -158,34 +154,21 @@ export default {
158
154
  return validStyles.includes(style) ? style : 'flex-start'
159
155
  },
160
156
  // 数据发生改变--将修改后的值填充到results
161
- handleChange (e, column, rowIndex) {
162
- const resultIndex = this.mapping[rowIndex]
163
- if (resultIndex === undefined) return
157
+ handleChange (e, column) {
164
158
  if (column.type === 'selectionBox') {
165
- this.results[resultIndex][column.key] = e.target.checked
159
+ this.results[column.config_id].value = e.target.checked
166
160
  } else if (column.type === 'input') {
167
- this.results[resultIndex][column.key] = column.value
161
+ this.results[column.config_id].value = column.value
168
162
  } else if (column.type === 'radio' || column.type === 'time') {
169
- this.results[resultIndex][column.key] = e
163
+ this.results[column.config_id].value = e
170
164
  }
171
165
  },
172
166
  handleButtonClick (item) {
173
- item.loading = true
167
+ item.customize.loading = true
174
168
  const callback = () => {
175
- item.loading = false
169
+ item.customize.loading = false
176
170
  }
177
- if (item.clickEventName && this.$listeners[item.clickEventName]) {
178
- // 交由父级处理
179
- this.$emit(item.clickEventName, item, callback)
180
- } else {
181
- this.defaultAction(item.clickEventName, item, callback)
182
- }
183
- },
184
- defaultAction (clickEventName, item, callback) {
185
- setTimeout(() => {
186
- this.$message.warn(`已触发按钮 [${item.key}],注册事件名 [${clickEventName}],未实现事件函数`)
187
- callback()
188
- }, 200)
171
+ this.$emit('customizeEvent', item.customize, callback)
189
172
  }
190
173
  },
191
174
  watch: {
@@ -10,7 +10,7 @@
10
10
  <div v-for="(item, index) in weekDays" :key="index" :slot="item.key" class="week_last_next_btn">
11
11
  <a-button slot="lastWeek" icon="left" size="large" @click="handleLastWeek" v-if="item.title == '周一'" />
12
12
  <div class="time-title">
13
- <span>{{item.title}}</span>
13
+ <span>{{ item.title }}</span>
14
14
  <span>{{ currentWeekDates[index].toLocaleDateString() }}</span>
15
15
  </div>
16
16
  <a-button slot="nextWeek" icon="right" size="large" @click="handleNextWeek" v-if="item.title == '周日'"/>