vue2-client 1.15.78 → 1.15.80

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 (141) hide show
  1. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +0 -6
  2. package/package.json +1 -1
  3. package/public/index.html +1 -1
  4. package/src/base-client/components/common/Recording/Recording.vue +1 -1
  5. package/src/base-client/components/common/XButtons/XButtons.vue +203 -12
  6. package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -1
  7. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +7 -7
  8. package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
  9. package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
  10. package/src/base-client/plugins/Recording.js +1 -1
  11. package/src/pages/WorkflowDetail/WorkFlowDemo.vue +1 -1
  12. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +6 -1
  13. package/src/router/async/router.map.js +1 -2
  14. package/vue.config.js +1 -1
  15. package/.history/public/his/editor/editor_20250606134713.html +0 -51
  16. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
  17. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
  18. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
  19. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
  20. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
  21. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
  22. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
  23. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
  24. package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
  25. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
  26. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
  27. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
  28. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
  29. package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
  30. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
  31. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
  32. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
  33. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
  34. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
  35. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
  36. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
  37. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
  38. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
  39. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
  40. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
  41. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
  42. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
  43. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
  44. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
  45. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
  46. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
  47. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
  48. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
  49. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
  50. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
  51. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
  52. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
  53. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
  54. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
  55. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
  56. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
  57. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
  58. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
  59. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
  60. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
  61. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
  62. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
  63. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
  64. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
  65. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
  66. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
  67. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
  68. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
  69. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
  70. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
  71. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
  72. package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
  73. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
  74. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
  75. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
  76. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
  77. package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
  78. package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
  79. package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
  80. package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
  81. package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
  82. package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
  83. package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
  84. package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
  85. package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
  86. package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
  87. package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
  88. package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
  89. package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
  90. package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
  91. package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
  92. package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
  93. package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
  94. package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
  95. package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
  96. package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
  97. package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
  98. package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
  99. package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
  100. package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
  101. package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
  102. package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
  103. package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
  104. package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
  105. package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
  106. package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
  107. package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
  108. package/.history/src/base-client/components/his/XList/XList_20250704142024.vue +0 -495
  109. package/.history/src/base-client/components/his/XList/XList_20250704142033.vue +0 -495
  110. package/.history/src/base-client/components/his/XList/XList_20250704142040.vue +0 -494
  111. package/.history/src/base-client/components/his/XList/XList_20250704142211.vue +0 -494
  112. package/.history/src/base-client/components/his/XList/XList_20250704142214.vue +0 -494
  113. package/.history/src/base-client/components/his/XList/XList_20250704143010.vue +0 -495
  114. package/.history/src/base-client/components/his/XList/XList_20250704143203.vue +0 -495
  115. package/.history/src/base-client/components/his/XList/XList_20250707095101.vue +0 -492
  116. package/.history/src/base-client/components/his/XList/XList_20250707100152.vue +0 -492
  117. package/.history/src/base-client/components/his/XList/XList_20250707100200.vue +0 -485
  118. package/.history/src/base-client/components/his/XList/XList_20250707100208.vue +0 -485
  119. package/.history/src/base-client/components/his/XList/XList_20250707100259.vue +0 -488
  120. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250609151519.vue +0 -222
  121. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155514.vue +0 -183
  122. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155556.vue +0 -183
  123. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155600.vue +0 -183
  124. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181609.vue +0 -206
  125. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181629.vue +0 -209
  126. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095553.vue +0 -242
  127. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095610.vue +0 -242
  128. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095612.vue +0 -242
  129. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100041.vue +0 -251
  130. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100047.vue +0 -251
  131. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100054.vue +0 -250
  132. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100105.vue +0 -250
  133. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100107.vue +0 -250
  134. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100114.vue +0 -250
  135. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140844.vue +0 -238
  136. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140910.vue +0 -238
  137. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140912.vue +0 -238
  138. package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
  139. package/src/base-client/components/TreeList/TreeList.vue +0 -91
  140. package/src/base-client/components/TreeList/TreeNode.vue +0 -81
  141. package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
@@ -1,250 +0,0 @@
1
- <template>
2
- <a-table
3
- :columns="columns"
4
- :data-source="data"
5
- :rowSelection="rowSelection"
6
- :scroll="{ y: '75vh' }">
7
- <span slot="time" class="time-title">
8
- <span v-for="(item, index) in configData.timePeriod" :key="index">{{ item }}</span>
9
- </span>
10
- <a-button slot="lastWeek" icon="left" size="large" @click="handleLastWeek" />
11
- <div v-for="(item, index) in weekDays" :key="index" :slot="item.key" class="time-title">
12
- <span>{{item.title}}</span>
13
- <span>{{ currentWeekDates[index].toLocaleDateString() }}</span>
14
- </div>
15
- <template :slot="day.key" slot-scope="text, record" v-for="day in shiftTable">
16
- <div class="time-title" :key="day.key">
17
- <a-button v-for="(item, index) in record[day.key]" :key="index" @click="handleShiftChange(day.key, index, record)">{{ item === 1 || item === '1' ? '坐诊' : '休息' }}</a-button>
18
- </div>
19
- </template>
20
- <a-button slot="nextWeek" icon="right" size="large" @click="handleNextWeek" />
21
- <template slot="sk_limit" slot-scope="text, record">
22
- <a-input-number id="inputNumber" v-model="record.sk_limit" :min="configData.sk_limitMin" :max="configData.sk_limitMax" />
23
- </template>
24
- </a-table>
25
- </template>
26
- <script>
27
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
28
-
29
- export default {
30
- data () {
31
- return {
32
- data: [],
33
- // 列配置
34
- columns: [],
35
- // 列名
36
- columnNames: [],
37
- // 选中的行键值集合
38
- selectedRows: [],
39
- // 选中的行信息集合
40
- selectedRowKeys: [],
41
- // 原始数据备份
42
- originalData: [],
43
- // 配置参数
44
- configData: {},
45
- // 当前显示的周次日期
46
- currentWeekDates: [],
47
- weekDays: [...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
48
- const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
49
- return { title, key }
50
- })],
51
- // 排班时间表
52
- shiftTable: [
53
- {
54
- dataIndex: 'lastWeek',
55
- key: 'lastWeek',
56
- slots: { title: 'lastWeek' },
57
- scopedSlots: { customRender: 'lastWeekTitle' },
58
- align: 'center',
59
- width: 80
60
- },
61
- ...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
62
- const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
63
- return {
64
- key, dataIndex: key, scopedSlots: { customRender: key }, slots: { title: key }, align: 'center', width: 120
65
- }
66
- }),
67
- {
68
- dataIndex: 'nextWeek',
69
- key: 'nextWeek',
70
- slots: { title: 'nextWeek' },
71
- scopedSlots: { customRender: 'nextWeekTitle' },
72
- align: 'center',
73
- width: 80
74
- },
75
- {
76
- title: '排班数',
77
- key: 'sk_limit',
78
- dataIndex: 'sk_limit',
79
- scopedSlots: { customRender: 'sk_limit' },
80
- align: 'center'
81
- }
82
- ]
83
- }
84
- },
85
- props: {
86
- // 配置名
87
- queryParamsName: {
88
- type: String,
89
- default: ''
90
- },
91
- // 服务名
92
- serviceName: {
93
- type: String,
94
- default: 'af-his'
95
- }
96
- },
97
- computed: {
98
- rowSelection () {
99
- return {
100
- selectedRowKeys: this.selectedRowKeys,
101
- onChange: (selectedRowKeys, selectedRows) => {
102
- this.onSelectChange(selectedRowKeys, selectedRows)
103
- }
104
- }
105
- }
106
- },
107
- mounted () {
108
- this.initWeekDates()
109
- },
110
- methods: {
111
- handleShiftChange (day, index, record) {
112
- // 找到当前记录在data中的索引
113
- const dataIndex = this.data.findIndex(item => item.id === record.id)
114
- if (dataIndex === -1) return
115
- // 获取当前状态
116
- const currentValue = record[day][index]
117
- const newValue = currentValue === 1 || currentValue === '1' ? 0 : 1
118
- // 更新按钮显示
119
- this.$set(record[day], index, newValue)
120
- // 同步更新data中的数据
121
- this.$set(this.data[dataIndex][day], index, newValue)
122
- },
123
- onSelectChange (selectedRowKeys, selectedRows) {
124
- this.selectedRowKeys = selectedRowKeys
125
- this.selectedRows = selectedRows
126
- },
127
- // 获取选中的行数据
128
- getSelectedRowData () {
129
- return this.selectedRows
130
- },
131
- // 获取全部数据
132
- getAllTable () {
133
- return this.data
134
- },
135
- // 初始化数据
136
- async init (queryParamsName) {
137
- getConfigByName(queryParamsName, this.serviceName, result => {
138
- this.configData = result
139
- runLogic(result.dataSource, {}, this.serviceName).then(res => {
140
- this.columns = []
141
- this.columns = JSON.parse(JSON.stringify(this.configData.columns))
142
- for (let i = 0; i < this.shiftTable.length; i++) {
143
- this.columns.push(this.shiftTable[i])
144
- }
145
- if (res && Array.isArray(res)) {
146
- const weekDays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
147
- const shifts = ['am', 'pm', 'evening']
148
- let key = 0
149
- this.data = res.map(item => {
150
- const scheduleData = {
151
- key: key++
152
- }
153
- this.configData.columnsName.forEach(columnName => { scheduleData[columnName] = item[columnName] })
154
- weekDays.forEach(day => {
155
- scheduleData[day.charAt(0).toUpperCase() + day.slice(1)] = shifts.map(shift => item[`f_${day}_${shift}`] === '1' ? 1 : 0)
156
- })
157
- return scheduleData
158
- })
159
- // 保存原始数据
160
- this.originalData = JSON.parse(JSON.stringify(this.data))
161
- }
162
- })
163
- })
164
- },
165
- // 查询数据函数
166
- filterTableData (filters) {
167
- if (!filters || Object.keys(filters).length === 0) {
168
- // 如果没有过滤条件,恢复原始数据
169
- this.data = JSON.parse(JSON.stringify(this.originalData))
170
- return
171
- }
172
- // 从原始数据开始过滤
173
- this.data = this.originalData.filter(item => {
174
- // 检查每一项是否满足所有过滤条件
175
- return Object.entries(filters).every(([key, value]) => {
176
- // 如果过滤值是字符串,进行模糊匹配
177
- if (typeof value === 'string') {
178
- return item[key] && item[key].toString().toLowerCase().includes(value.toLowerCase())
179
- }
180
- // 如果过滤值是数字,进行精确匹配
181
- return item[key] === value
182
- })
183
- })
184
- },
185
- // 初始化周次日期
186
- initWeekDates () {
187
- const today = new Date()
188
- const currentDay = today.getDay() || 7 // 将周日的0转换为7
189
- const monday = new Date(today)
190
- monday.setDate(today.getDate() - currentDay + 1) // 设置为本周一
191
-
192
- this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
193
- const date = new Date(monday)
194
- date.setDate(monday.getDate() + index)
195
- return date
196
- })
197
- },
198
- // 切换到上一周
199
- handleLastWeek () {
200
- const monday = new Date(this.currentWeekDates[0])
201
- monday.setDate(monday.getDate() - 7)
202
- this.updateWeekDates(monday)
203
- },
204
- // 切换到下一周
205
- handleNextWeek () {
206
- const monday = new Date(this.currentWeekDates[0])
207
- monday.setDate(monday.getDate() + 7)
208
- this.updateWeekDates(monday)
209
- },
210
- // 更新周次日期
211
- updateWeekDates (monday) {
212
- this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
213
- const date = new Date(monday)
214
- date.setDate(monday.getDate() + index)
215
- return date
216
- })
217
- }
218
- },
219
- watch: {
220
- queryParamsName: {
221
- handler (newValue) {
222
- this.init(newValue)
223
- },
224
- deep: true,
225
- immediate: true
226
- }
227
- }
228
- }
229
- </script>
230
-
231
- <style scoped>
232
- .time-title {
233
- display: flex !important;
234
- flex-direction: column !important;
235
- align-items: center !important;
236
- }
237
- ::v-deep .ant-table-thead > tr > th,
238
- ::v-deep .ant-table-tbody > tr > td {
239
- padding: 8px 16px !important;
240
- overflow-wrap: break-word;
241
- }
242
-
243
- ::v-deep .ant-table-thead > tr > th .ant-btn {
244
- margin: 0 4px;
245
- }
246
-
247
- ::v-deep .ant-table-thead > tr > th .time-title {
248
- margin: 0 -4px;
249
- }
250
- </style>
@@ -1,250 +0,0 @@
1
- <template>
2
- <a-table
3
- :columns="columns"
4
- :data-source="data"
5
- :rowSelection="rowSelection"
6
- :scroll="{ y: '75vh' }">
7
- <span slot="time" class="time-title">
8
- <span v-for="(item, index) in configData.timePeriod" :key="index">{{ item }}</span>
9
- </span>
10
- <a-button slot="lastWeek" icon="left" size="large" @click="handleLastWeek" />
11
- <div v-for="(item, index) in weekDays" :key="index" :slot="item.key" class="time-title">
12
- <span>{{item.title}}</span>
13
- <span>{{ currentWeekDates[index].toLocaleDateString() }}</span>
14
- </div>
15
- <template :slot="day.key" slot-scope="text, record" v-for="day in shiftTable">
16
- <div class="time-title" :key="day.key">
17
- <a-button v-for="(item, index) in record[day.key]" :key="index" @click="handleShiftChange(day.key, index, record)">{{ item === 1 || item === '1' ? '坐诊' : '休息' }}</a-button>
18
- </div>
19
- </template>
20
- <a-button slot="nextWeek" icon="right" size="large" @click="handleNextWeek" />
21
- <template slot="sk_limit" slot-scope="text, record">
22
- <a-input-number id="inputNumber" v-model="record.sk_limit" :min="configData.sk_limitMin" :max="configData.sk_limitMax" />
23
- </template>
24
- </a-table>
25
- </template>
26
- <script>
27
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
28
-
29
- export default {
30
- data () {
31
- return {
32
- data: [],
33
- // 列配置
34
- columns: [],
35
- // 列名
36
- columnNames: [],
37
- // 选中的行键值集合
38
- selectedRows: [],
39
- // 选中的行信息集合
40
- selectedRowKeys: [],
41
- // 原始数据备份
42
- originalData: [],
43
- // 配置参数
44
- configData: {},
45
- // 当前显示的周次日期
46
- currentWeekDates: [],
47
- weekDays: [...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
48
- const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
49
- return { title, key }
50
- })],
51
- // 排班时间表
52
- shiftTable: [
53
- {
54
- dataIndex: 'lastWeek',
55
- key: 'lastWeek',
56
- slots: { title: 'lastWeek' },
57
- scopedSlots: { customRender: 'lastWeekTitle' },
58
- align: 'center',
59
- width: 80
60
- },
61
- ...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
62
- const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
63
- return {
64
- key, dataIndex: key, scopedSlots: { customRender: key }, slots: { title: key }, align: 'center', width: 120
65
- }
66
- }),
67
- {
68
- dataIndex: 'nextWeek',
69
- key: 'nextWeek',
70
- slots: { title: 'nextWeek' },
71
- scopedSlots: { customRender: 'nextWeekTitle' },
72
- align: 'center',
73
- width: 80
74
- },
75
- {
76
- title: '排班数',
77
- key: 'sk_limit',
78
- dataIndex: 'sk_limit',
79
- scopedSlots: { customRender: 'sk_limit' },
80
- align: 'center'
81
- }
82
- ]
83
- }
84
- },
85
- props: {
86
- // 配置名
87
- queryParamsName: {
88
- type: String,
89
- default: ''
90
- },
91
- // 服务名
92
- serviceName: {
93
- type: String,
94
- default: 'af-his'
95
- }
96
- },
97
- computed: {
98
- rowSelection () {
99
- return {
100
- selectedRowKeys: this.selectedRowKeys,
101
- onChange: (selectedRowKeys, selectedRows) => {
102
- this.onSelectChange(selectedRowKeys, selectedRows)
103
- }
104
- }
105
- }
106
- },
107
- mounted () {
108
- this.initWeekDates()
109
- },
110
- methods: {
111
- handleShiftChange (day, index, record) {
112
- // 找到当前记录在data中的索引
113
- const dataIndex = this.data.findIndex(item => item.id === record.id)
114
- if (dataIndex === -1) return
115
- // 获取当前状态
116
- const currentValue = record[day][index]
117
- const newValue = currentValue === 1 || currentValue === '1' ? 0 : 1
118
- // 更新按钮显示
119
- this.$set(record[day], index, newValue)
120
- // 同步更新data中的数据
121
- this.$set(this.data[dataIndex][day], index, newValue)
122
- },
123
- onSelectChange (selectedRowKeys, selectedRows) {
124
- this.selectedRowKeys = selectedRowKeys
125
- this.selectedRows = selectedRows
126
- },
127
- // 获取选中的行数据
128
- getSelectedRowData () {
129
- return this.selectedRows
130
- },
131
- // 获取全部数据
132
- getAllTable () {
133
- return this.data
134
- },
135
- // 初始化数据
136
- async init (queryParamsName) {
137
- getConfigByName(queryParamsName, this.serviceName, result => {
138
- this.configData = result
139
- runLogic(result.dataSource, {}, this.serviceName).then(res => {
140
- this.columns = []
141
- this.columns = JSON.parse(JSON.stringify(this.configData.columns))
142
- for (let i = 0; i < this.shiftTable.length; i++) {
143
- this.columns.push(this.shiftTable[i])
144
- }
145
- if (res && Array.isArray(res)) {
146
- const weekDays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
147
- const shifts = ['am', 'pm', 'evening']
148
- let key = 0
149
- this.data = res.map(item => {
150
- const scheduleData = {
151
- key: key++
152
- }
153
- this.configData.columnsName.forEach(columnName => { scheduleData[columnName] = item[columnName] })
154
- weekDays.forEach(day => {
155
- scheduleData[day.charAt(0).toUpperCase() + day.slice(1)] = shifts.map(shift => item[`f_${day}_${shift}`] === '1' ? 1 : 0)
156
- })
157
- return scheduleData
158
- })
159
- // 保存原始数据
160
- this.originalData = JSON.parse(JSON.stringify(this.data))
161
- }
162
- })
163
- })
164
- },
165
- // 查询数据函数
166
- filterTableData (filters) {
167
- if (!filters || Object.keys(filters).length === 0) {
168
- // 如果没有过滤条件,恢复原始数据
169
- this.data = JSON.parse(JSON.stringify(this.originalData))
170
- return
171
- }
172
- // 从原始数据开始过滤
173
- this.data = this.originalData.filter(item => {
174
- // 检查每一项是否满足所有过滤条件
175
- return Object.entries(filters).every(([key, value]) => {
176
- // 如果过滤值是字符串,进行模糊匹配
177
- if (typeof value === 'string') {
178
- return item[key] && item[key].toString().toLowerCase().includes(value.toLowerCase())
179
- }
180
- // 如果过滤值是数字,进行精确匹配
181
- return item[key] === value
182
- })
183
- })
184
- },
185
- // 初始化周次日期
186
- initWeekDates () {
187
- const today = new Date()
188
- const currentDay = today.getDay() || 7 // 将周日的0转换为7
189
- const monday = new Date(today)
190
- monday.setDate(today.getDate() - currentDay + 1) // 设置为本周一
191
-
192
- this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
193
- const date = new Date(monday)
194
- date.setDate(monday.getDate() + index)
195
- return date
196
- })
197
- },
198
- // 切换到上一周
199
- handleLastWeek () {
200
- const monday = new Date(this.currentWeekDates[0])
201
- monday.setDate(monday.getDate() - 7)
202
- this.updateWeekDates(monday)
203
- },
204
- // 切换到下一周
205
- handleNextWeek () {
206
- const monday = new Date(this.currentWeekDates[0])
207
- monday.setDate(monday.getDate() + 7)
208
- this.updateWeekDates(monday)
209
- },
210
- // 更新周次日期
211
- updateWeekDates (monday) {
212
- this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
213
- const date = new Date(monday)
214
- date.setDate(monday.getDate() + index)
215
- return date
216
- })
217
- }
218
- },
219
- watch: {
220
- queryParamsName: {
221
- handler (newValue) {
222
- this.init(newValue)
223
- },
224
- deep: true,
225
- immediate: true
226
- }
227
- }
228
- }
229
- </script>
230
-
231
- <style scoped>
232
- .time-title {
233
- display: flex !important;
234
- flex-direction: column !important;
235
- align-items: center !important;
236
- }
237
- ::v-deep .ant-table-thead > tr > th,
238
- ::v-deep .ant-table-tbody > tr > td {
239
- padding: 8px 16px !important;
240
- overflow-wrap: break-word;
241
- }
242
-
243
- ::v-deep .ant-table-thead > tr > th .ant-btn {
244
- margin: 0 4px;
245
- }
246
-
247
- ::v-deep .ant-table-thead > tr > th .time-title {
248
- margin: 0 -4px;
249
- }
250
- </style>