vue2-client 1.15.106 → 1.15.109
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/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114001.vue +342 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114005.vue +342 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114014.vue +345 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114020.vue +345 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114028.vue +345 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114108.vue +345 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114115.vue +345 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114333.vue +346 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114339.vue +350 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114344.vue +355 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114351.vue +355 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114408.vue +355 -0
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114410.vue +355 -0
- package/package.json +1 -1
- package/src/base-client/components/common/XForm/XFormItem.vue +8 -26
- package/src/base-client/components/his/XImportExcelButton/XFrontImportExcelDemo.vue +3 -1
- package/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +39 -26
- package/src/utils/routerUtil.js +7 -0
package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250811114410.vue
ADDED
@@ -0,0 +1,355 @@
|
|
1
|
+
<template>
|
2
|
+
<div v-if="pattern == 'schedule'">
|
3
|
+
<a-table
|
4
|
+
:columns="columns"
|
5
|
+
:data-source="data"
|
6
|
+
:rowSelection="rowSelection"
|
7
|
+
:scroll="{ y: configData.height == null? '70%' : configData.height }">
|
8
|
+
<span slot="time" class="time-title">
|
9
|
+
<span v-for="(item, index) in configData.timePeriod" :key="index">{{ item }}</span>
|
10
|
+
</span>
|
11
|
+
<div v-for="(item, index) in weekDays" :key="index" :slot="item.key" class="week_last_next_btn">
|
12
|
+
<a-button slot="lastWeek" icon="left" size="large" @click="handleLastWeek" v-if="item.title == '周一'" />
|
13
|
+
<div class="time-title">
|
14
|
+
<span>{{ item.title }}</span>
|
15
|
+
<span>{{ currentWeekDates[index].toLocaleDateString() }}</span>
|
16
|
+
</div>
|
17
|
+
<a-button slot="nextWeek" icon="right" size="large" @click="handleNextWeek" v-if="item.title == '周日'"/>
|
18
|
+
</div>
|
19
|
+
<template :slot="day.key" slot-scope="text, record" v-for="day in shiftTable">
|
20
|
+
<div class="time-title" :key="day.key">
|
21
|
+
<a-button v-for="(item, index) in record[day.key]" :key="index" @click="handleShiftChange(day.key, index, record)">{{ item === 1 || item === '1' ? '坐诊' : '休息' }}</a-button>
|
22
|
+
</div>
|
23
|
+
</template>
|
24
|
+
<template slot="sk_limit" slot-scope="text, record">
|
25
|
+
<a-input-number id="inputNumber" v-model="record.sk_limit" :min="configData.sk_limitMin" :max="configData.sk_limitMax" />
|
26
|
+
</template>
|
27
|
+
</a-table>
|
28
|
+
</div>
|
29
|
+
<div v-else-if="pattern == 'form'">
|
30
|
+
<a-table :columns="columns" :data-source='data' :row-selection="rowSelection" bordered :scroll="{ y: configData.height == null? '70%' : configData.height }">
|
31
|
+
<template v-for="(n, i) in inputColumns" :slot="n.dataIndex" slot-scope="text, record">
|
32
|
+
<div class="a-div" :key="i">
|
33
|
+
<a-input
|
34
|
+
v-for="(item, index) in n.row"
|
35
|
+
:key="index"
|
36
|
+
placeholder=""
|
37
|
+
class="ant-input"
|
38
|
+
v-model="record[n.dataIndex][index + 1]"
|
39
|
+
@input="handleInputChange(record, n.dataIndex, index + 1, $event.target.value)"
|
40
|
+
:disabled="!isRowSelected(record.key)"
|
41
|
+
/>
|
42
|
+
</div>
|
43
|
+
</template>
|
44
|
+
<div class="a-div" v-for="(n, i) in numberColumns" :slot="n.dataIndex" :key="i">
|
45
|
+
<div v-for="(item, index) in n.row" :key="index" class="number">{{item}}</div>
|
46
|
+
</div>
|
47
|
+
</a-table>
|
48
|
+
</div>
|
49
|
+
</template>
|
50
|
+
<script>
|
51
|
+
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
52
|
+
|
53
|
+
export default {
|
54
|
+
data () {
|
55
|
+
return {
|
56
|
+
// 高度
|
57
|
+
height: '70%',
|
58
|
+
// 输入框数据
|
59
|
+
inputData: [],
|
60
|
+
// 模式
|
61
|
+
pattern: 'schedule',
|
62
|
+
data: [],
|
63
|
+
// 列配置
|
64
|
+
columns: [],
|
65
|
+
// 列名
|
66
|
+
columnNames: [],
|
67
|
+
// 选中的行键值集合
|
68
|
+
selectedRows: [],
|
69
|
+
// 选中的行信息集合
|
70
|
+
selectedRowKeys: [],
|
71
|
+
// 原始数据备份
|
72
|
+
originalData: [],
|
73
|
+
// 配置参数
|
74
|
+
configData: {},
|
75
|
+
// 当前显示的周次日期
|
76
|
+
currentWeekDates: [],
|
77
|
+
weekDays: [...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
|
78
|
+
const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
|
79
|
+
return { title, key }
|
80
|
+
})],
|
81
|
+
// 排班时间表
|
82
|
+
shiftTable: [...['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((title, index) => {
|
83
|
+
const key = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][index]
|
84
|
+
return {
|
85
|
+
key, dataIndex: key, scopedSlots: { customRender: key }, slots: { title: key }, align: 'center', width: key === 'Monday' || key === 'Sunday' ? 170 : 120
|
86
|
+
}
|
87
|
+
}),
|
88
|
+
{
|
89
|
+
title: '排班数',
|
90
|
+
key: 'sk_limit',
|
91
|
+
dataIndex: 'sk_limit',
|
92
|
+
scopedSlots: { customRender: 'sk_limit' },
|
93
|
+
align: 'center'
|
94
|
+
}
|
95
|
+
]
|
96
|
+
}
|
97
|
+
},
|
98
|
+
props: {
|
99
|
+
// 配置名
|
100
|
+
queryParamsName: {
|
101
|
+
type: String,
|
102
|
+
default: ''
|
103
|
+
},
|
104
|
+
// 服务名
|
105
|
+
serviceName: {
|
106
|
+
type: String,
|
107
|
+
default: 'af-his'
|
108
|
+
}
|
109
|
+
},
|
110
|
+
computed: {
|
111
|
+
rowSelection () {
|
112
|
+
return {
|
113
|
+
selectedRowKeys: this.selectedRowKeys,
|
114
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
115
|
+
this.onSelectChange(selectedRowKeys, selectedRows)
|
116
|
+
}
|
117
|
+
}
|
118
|
+
},
|
119
|
+
inputColumns () {
|
120
|
+
return this.columns.filter(col => col.type === 'input')
|
121
|
+
},
|
122
|
+
numberColumns () {
|
123
|
+
return this.columns.filter(col => col.type === 'number')
|
124
|
+
}
|
125
|
+
},
|
126
|
+
mounted () {
|
127
|
+
this.initWeekDates()
|
128
|
+
},
|
129
|
+
methods: {
|
130
|
+
handleShiftChange (day, index, record) {
|
131
|
+
// 找到当前记录在data中的索引
|
132
|
+
const dataIndex = this.data.findIndex(item => item.id === record.id)
|
133
|
+
if (dataIndex === -1) return
|
134
|
+
// 获取当前状态
|
135
|
+
const currentValue = record[day][index]
|
136
|
+
const newValue = currentValue === 1 || currentValue === '1' ? 0 : 1
|
137
|
+
// 更新按钮显示
|
138
|
+
this.$set(record[day], index, newValue)
|
139
|
+
// 同步更新data中的数据
|
140
|
+
this.$set(this.data[dataIndex][day], index, newValue)
|
141
|
+
},
|
142
|
+
onSelectChange (selectedRowKeys, selectedRows) {
|
143
|
+
this.selectedRowKeys = selectedRowKeys
|
144
|
+
this.selectedRows = selectedRows
|
145
|
+
},
|
146
|
+
// 处理输入框数据变化
|
147
|
+
handleInputChange (record, field, index, value) {
|
148
|
+
// 更新数据
|
149
|
+
this.$set(record[field], index, value)
|
150
|
+
},
|
151
|
+
// 获取选中的行数据
|
152
|
+
getSelectedRowData () {
|
153
|
+
if (this.pattern === 'form') {
|
154
|
+
// 在form模式下,返回包含输入框数据的完整信息
|
155
|
+
return this.selectedRows.map(row => {
|
156
|
+
const result = { ...row }
|
157
|
+
// 将对象格式的输入框数据转换为数组格式
|
158
|
+
this.inputColumns.forEach(col => {
|
159
|
+
if (row[col.dataIndex] && typeof row[col.dataIndex] === 'object') {
|
160
|
+
const fieldData = row[col.dataIndex]
|
161
|
+
const arrayData = []
|
162
|
+
// 将对象转换为数组,保持键的顺序
|
163
|
+
Object.keys(fieldData).forEach(key => {
|
164
|
+
arrayData.push(fieldData[key])
|
165
|
+
})
|
166
|
+
result[col.dataIndex] = arrayData
|
167
|
+
}
|
168
|
+
})
|
169
|
+
return result
|
170
|
+
})
|
171
|
+
}
|
172
|
+
return this.selectedRows
|
173
|
+
},
|
174
|
+
// 获取全部数据
|
175
|
+
getAllTable () {
|
176
|
+
return this.data
|
177
|
+
},
|
178
|
+
// 初始化数据
|
179
|
+
async init (queryParamsName) {
|
180
|
+
getConfigByName(queryParamsName, this.serviceName, result => {
|
181
|
+
this.configData = result
|
182
|
+
runLogic(result.dataSource, {}, this.serviceName).then(res => {
|
183
|
+
this.columns = []
|
184
|
+
this.columns = JSON.parse(JSON.stringify(this.configData.columns))
|
185
|
+
this.pattern = result.pattern
|
186
|
+
if (this.pattern == 'schedule') {
|
187
|
+
for (let i = 0; i < this.shiftTable.length; i++) {
|
188
|
+
this.columns.push(this.shiftTable[i])
|
189
|
+
}
|
190
|
+
if (res && Array.isArray(res)) {
|
191
|
+
const weekDays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
|
192
|
+
const shifts = ['am', 'pm', 'evening']
|
193
|
+
let key = 0
|
194
|
+
this.data = res.map(item => {
|
195
|
+
const scheduleData = {
|
196
|
+
key: key++
|
197
|
+
}
|
198
|
+
this.configData.columnsName.forEach(columnName => { scheduleData[columnName] = item[columnName] })
|
199
|
+
weekDays.forEach(day => {
|
200
|
+
scheduleData[day.charAt(0).toUpperCase() + day.slice(1)] = shifts.map(shift => item[`f_${day}_${shift}`] === '1' ? 1 : 0)
|
201
|
+
})
|
202
|
+
return scheduleData
|
203
|
+
})
|
204
|
+
// 保存原始数据
|
205
|
+
this.originalData = JSON.parse(JSON.stringify(this.data))
|
206
|
+
}
|
207
|
+
} else if (this.pattern == 'form') {
|
208
|
+
const inputFields = this.configData.columns.filter(col => col.type === 'input').map(col => col.dataIndex)
|
209
|
+
this.data = res.map((item, index) => {
|
210
|
+
const newItem = {
|
211
|
+
...item,
|
212
|
+
key: item.id || `form_row_${index}_${Date.now()}` // 确保每行有唯一的key
|
213
|
+
}
|
214
|
+
inputFields.forEach(field => {
|
215
|
+
const column = this.configData.columns.find(col => col.dataIndex === field)
|
216
|
+
if (column && column.type === 'input' && column.row) {
|
217
|
+
const rowCount = column.row.length || 1 // 默认长度1
|
218
|
+
// 创建对象格式的数据,键为1,2,3...,值为空字符串
|
219
|
+
const fieldData = {}
|
220
|
+
for (let i = 1; i <= rowCount; i++) {
|
221
|
+
fieldData[i] = ''
|
222
|
+
}
|
223
|
+
newItem[field] = fieldData
|
224
|
+
} else {
|
225
|
+
newItem[field] = item[field] || ''
|
226
|
+
}
|
227
|
+
})
|
228
|
+
return newItem
|
229
|
+
})
|
230
|
+
}
|
231
|
+
})
|
232
|
+
})
|
233
|
+
},
|
234
|
+
// 查询数据函数
|
235
|
+
filterTableData (filters) {
|
236
|
+
if (!filters || Object.keys(filters).length === 0) {
|
237
|
+
// 如果没有过滤条件,恢复原始数据
|
238
|
+
this.data = JSON.parse(JSON.stringify(this.originalData))
|
239
|
+
return
|
240
|
+
}
|
241
|
+
// 从原始数据开始过滤
|
242
|
+
this.data = this.originalData.filter(item => {
|
243
|
+
// 检查每一项是否满足所有过滤条件
|
244
|
+
return Object.entries(filters).every(([key, value]) => {
|
245
|
+
// 如果过滤值是字符串,进行模糊匹配
|
246
|
+
if (typeof value === 'string') {
|
247
|
+
return item[key] && item[key].toString().toLowerCase().includes(value.toLowerCase())
|
248
|
+
}
|
249
|
+
// 如果过滤值是数字,进行精确匹配
|
250
|
+
return item[key] === value
|
251
|
+
})
|
252
|
+
}).map((item, index) => ({
|
253
|
+
...item,
|
254
|
+
key: item.key || item.id || `filtered_row_${index}_${Date.now()}` // 确保过滤后的数据也有唯一key
|
255
|
+
}))
|
256
|
+
},
|
257
|
+
// 初始化周次日期
|
258
|
+
initWeekDates () {
|
259
|
+
const today = new Date()
|
260
|
+
const currentDay = today.getDay() || 7 // 将周日的0转换为7
|
261
|
+
const monday = new Date(today)
|
262
|
+
monday.setDate(today.getDate() - currentDay + 1) // 设置为本周一
|
263
|
+
this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
|
264
|
+
const date = new Date(monday)
|
265
|
+
date.setDate(monday.getDate() + index)
|
266
|
+
return date
|
267
|
+
})
|
268
|
+
},
|
269
|
+
// 切换到上一周
|
270
|
+
handleLastWeek () {
|
271
|
+
const monday = new Date(this.currentWeekDates[0])
|
272
|
+
monday.setDate(monday.getDate() - 7)
|
273
|
+
this.updateWeekDates(monday)
|
274
|
+
},
|
275
|
+
// 切换到下一周
|
276
|
+
handleNextWeek () {
|
277
|
+
const monday = new Date(this.currentWeekDates[0])
|
278
|
+
monday.setDate(monday.getDate() + 7)
|
279
|
+
this.updateWeekDates(monday)
|
280
|
+
},
|
281
|
+
// 更新周次日期
|
282
|
+
updateWeekDates (monday) {
|
283
|
+
this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
|
284
|
+
const date = new Date(monday)
|
285
|
+
date.setDate(monday.getDate() + index)
|
286
|
+
return date
|
287
|
+
})
|
288
|
+
},
|
289
|
+
// 判断某行是否被选中
|
290
|
+
isRowSelected (rowKey) {
|
291
|
+
return this.selectedRowKeys.includes(rowKey)
|
292
|
+
}
|
293
|
+
},
|
294
|
+
watch: {
|
295
|
+
queryParamsName: {
|
296
|
+
handler (newValue) {
|
297
|
+
this.init(newValue)
|
298
|
+
},
|
299
|
+
deep: true,
|
300
|
+
immediate: true
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}
|
304
|
+
</script>
|
305
|
+
|
306
|
+
<style scoped>
|
307
|
+
.time-title {
|
308
|
+
display: flex !important;
|
309
|
+
flex-direction: column !important;
|
310
|
+
align-items: center !important;
|
311
|
+
}
|
312
|
+
.week_last_next_btn {
|
313
|
+
display: flex;
|
314
|
+
flex-direction: row;
|
315
|
+
align-items: center;
|
316
|
+
justify-content: center;
|
317
|
+
gap: 16px;
|
318
|
+
}
|
319
|
+
::v-deep .ant-table-thead > tr > th,
|
320
|
+
::v-deep .ant-table-tbody > tr > td {
|
321
|
+
padding: 8px 16px !important;
|
322
|
+
overflow-wrap: break-word;
|
323
|
+
}
|
324
|
+
.ant-input {
|
325
|
+
width: 100%;
|
326
|
+
}
|
327
|
+
.ant-input[disabled] {
|
328
|
+
background-color: #f5f5f5;
|
329
|
+
color: #999;
|
330
|
+
cursor: not-allowed;
|
331
|
+
}
|
332
|
+
.a-div{
|
333
|
+
display: flex;
|
334
|
+
flex-direction: column;
|
335
|
+
}
|
336
|
+
.number{
|
337
|
+
box-sizing: border-box;
|
338
|
+
margin: 0;
|
339
|
+
padding: 0;
|
340
|
+
font-variant: tabular-nums;
|
341
|
+
list-style: none;
|
342
|
+
font-feature-settings: 'tnum';
|
343
|
+
position: relative;
|
344
|
+
display: inline-block;
|
345
|
+
width: 100%;
|
346
|
+
height: 32px;
|
347
|
+
padding: 4px 11px;
|
348
|
+
color: rgba(0, 0, 0, 0.65);
|
349
|
+
font-size: 14px;
|
350
|
+
line-height: 1.5;
|
351
|
+
background-image: none;
|
352
|
+
border-radius: 4px;
|
353
|
+
transition: all 0.3s;
|
354
|
+
}
|
355
|
+
</style>
|
package/package.json
CHANGED
@@ -887,7 +887,7 @@ export default {
|
|
887
887
|
if (this.attr.showQueryFormItemFunc) {
|
888
888
|
this.debouncedShowQueryFormItemFunc = debounce(this.showQueryFormItemFunc, 100)
|
889
889
|
// 执行一次
|
890
|
-
this.
|
890
|
+
this.showFormItemFunc()
|
891
891
|
}
|
892
892
|
// 人员联动框增加监听
|
893
893
|
if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动人员')) {
|
@@ -906,12 +906,7 @@ export default {
|
|
906
906
|
queryParamsName () {
|
907
907
|
if (this.attr.keyName.startsWith('function')) {
|
908
908
|
// 调用异步函数获取内容
|
909
|
-
|
910
|
-
// 处理同步返回值
|
911
|
-
return this.handleQueryParamsResult(obj)
|
912
|
-
} else if (this.attr.keyName.startsWith('async ')) {
|
913
|
-
console.warn('此处不支持异步操作')
|
914
|
-
return ''
|
909
|
+
return executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
|
915
910
|
} else {
|
916
911
|
// 按现有方式处理
|
917
912
|
return this.attr.keyName.split('@')[this.attr.keyName.split('@').length - 1]
|
@@ -1003,24 +998,6 @@ export default {
|
|
1003
998
|
}
|
1004
999
|
},
|
1005
1000
|
methods: {
|
1006
|
-
// 处理 queryParams 结果并更新 rowChooseFixedQueryValue
|
1007
|
-
handleQueryParamsResult (obj) {
|
1008
|
-
let configName = ''
|
1009
|
-
if (obj && typeof obj === 'object') {
|
1010
|
-
// obj 是一个对象,并且不是数组
|
1011
|
-
if (Object.prototype.hasOwnProperty.call(obj, 'configName')) {
|
1012
|
-
configName = obj?.configName
|
1013
|
-
}
|
1014
|
-
if (Object.prototype.hasOwnProperty.call(obj, 'fixedQueryForm')) {
|
1015
|
-
if (obj?.fixedQueryForm && typeof obj?.fixedQueryForm === 'object') {
|
1016
|
-
this.rowChooseFixedQueryValue = Object.assign({}, this.rowChooseFixedQueryValue, obj.fixedQueryForm)
|
1017
|
-
}
|
1018
|
-
}
|
1019
|
-
} else if (obj && typeof obj === 'string') {
|
1020
|
-
configName = obj
|
1021
|
-
}
|
1022
|
-
return configName
|
1023
|
-
},
|
1024
1001
|
// 根据selectValueType预处理options数据
|
1025
1002
|
processOptionsForValueType (options) {
|
1026
1003
|
return this.selectValueTypeHandler.processOptions(options, this.attr.selectValueType)
|
@@ -1178,12 +1155,17 @@ export default {
|
|
1178
1155
|
filter: filterValues,
|
1179
1156
|
filterType: fromModel.indexOf('org') > -1 ? 'org' : 'dep'
|
1180
1157
|
}
|
1158
|
+
const tempArray = []
|
1181
1159
|
await searchToListOption(searchData, res => {
|
1182
1160
|
this.getDataCallback(
|
1183
1161
|
res.filter(h => {
|
1184
1162
|
if (fromModel.indexOf('org') > -1) {
|
1185
1163
|
if (type === '部门') {
|
1186
|
-
|
1164
|
+
if (filterValues?.includes(h.orgid || h.f_organization_id) || filterValues?.includes(h.parentid) || tempArray.includes(h.parentid)) {
|
1165
|
+
tempArray.push(h.value)
|
1166
|
+
return true
|
1167
|
+
}
|
1168
|
+
return false
|
1187
1169
|
} else {
|
1188
1170
|
return filterValues?.includes(h.orgid || h.f_organization_id || h.parentid)
|
1189
1171
|
}
|
@@ -14,7 +14,9 @@ export default {
|
|
14
14
|
</script>
|
15
15
|
|
16
16
|
<template>
|
17
|
-
<
|
17
|
+
<div>
|
18
|
+
<x-import-excel-button :queryParamsName="queryParamsName"></x-import-excel-button>
|
19
|
+
</div>
|
18
20
|
</template>
|
19
21
|
|
20
22
|
<style scoped>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
:columns="columns"
|
5
5
|
:data-source="data"
|
6
6
|
:rowSelection="rowSelection"
|
7
|
-
:scroll="{ y: height == null? '70%' : height }">
|
7
|
+
:scroll="{ y: configData.height == null? '70%' : configData.height }">
|
8
8
|
<span slot="time" class="time-title">
|
9
9
|
<span v-for="(item, index) in configData.timePeriod" :key="index">{{ item }}</span>
|
10
10
|
</span>
|
@@ -27,18 +27,18 @@
|
|
27
27
|
</a-table>
|
28
28
|
</div>
|
29
29
|
<div v-else-if="pattern == 'form'">
|
30
|
-
<a-table :columns="columns" :data-source='data' :row-selection="rowSelection" bordered :scroll="{ y: height == null? '70%' : height }">
|
30
|
+
<a-table :columns="columns" :data-source='data' :row-selection="rowSelection" bordered :scroll="{ y: configData.height == null? '70%' : configData.height }">
|
31
31
|
<template v-for="(n, i) in inputColumns" :slot="n.dataIndex" slot-scope="text, record">
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
<div class="a-div" :key="i">
|
33
|
+
<a-input
|
34
|
+
v-for="(item, index) in n.row"
|
35
|
+
:key="index"
|
36
|
+
placeholder=""
|
37
|
+
class="ant-input"
|
38
|
+
v-model="record[n.dataIndex][index + 1]"
|
39
|
+
@input="handleInputChange(record, n.dataIndex, index + 1, $event.target.value)"
|
40
|
+
:disabled="!isRowSelected(record.key)"/>
|
41
|
+
</div>
|
42
42
|
</template>
|
43
43
|
<div class="a-div" v-for="(n, i) in numberColumns" :slot="n.dataIndex" :key="i">
|
44
44
|
<div v-for="(item, index) in n.row" :key="index" class="number">{{item}}</div>
|
@@ -204,11 +204,12 @@ export default {
|
|
204
204
|
this.originalData = JSON.parse(JSON.stringify(this.data))
|
205
205
|
}
|
206
206
|
} else if (this.pattern == 'form') {
|
207
|
-
const inputFields = this.configData.columns
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
207
|
+
const inputFields = this.configData.columns.filter(col => col.type === 'input').map(col => col.dataIndex)
|
208
|
+
this.data = res.map((item, index) => {
|
209
|
+
const newItem = {
|
210
|
+
...item,
|
211
|
+
key: item.id || `form_row_${index}_${Date.now()}` // 确保每行有唯一的key
|
212
|
+
}
|
212
213
|
inputFields.forEach(field => {
|
213
214
|
const column = this.configData.columns.find(col => col.dataIndex === field)
|
214
215
|
if (column && column.type === 'input' && column.row) {
|
@@ -247,7 +248,10 @@ export default {
|
|
247
248
|
// 如果过滤值是数字,进行精确匹配
|
248
249
|
return item[key] === value
|
249
250
|
})
|
250
|
-
})
|
251
|
+
}).map((item, index) => ({
|
252
|
+
...item,
|
253
|
+
key: item.key || item.id || `filtered_row_${index}_${Date.now()}` // 确保过滤后的数据也有唯一key
|
254
|
+
}))
|
251
255
|
},
|
252
256
|
// 初始化周次日期
|
253
257
|
initWeekDates () {
|
@@ -273,14 +277,18 @@ export default {
|
|
273
277
|
monday.setDate(monday.getDate() + 7)
|
274
278
|
this.updateWeekDates(monday)
|
275
279
|
},
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
280
|
+
// 更新周次日期
|
281
|
+
updateWeekDates (monday) {
|
282
|
+
this.currentWeekDates = Array.from({ length: 7 }, (_, index) => {
|
283
|
+
const date = new Date(monday)
|
284
|
+
date.setDate(monday.getDate() + index)
|
285
|
+
return date
|
286
|
+
})
|
287
|
+
},
|
288
|
+
// 判断某行是否被选中
|
289
|
+
isRowSelected (rowKey) {
|
290
|
+
return this.selectedRowKeys.includes(rowKey)
|
291
|
+
}
|
284
292
|
},
|
285
293
|
watch: {
|
286
294
|
queryParamsName: {
|
@@ -315,6 +323,11 @@ export default {
|
|
315
323
|
.ant-input {
|
316
324
|
width: 100%;
|
317
325
|
}
|
326
|
+
.ant-input[disabled] {
|
327
|
+
background-color: #f5f5f5;
|
328
|
+
color: #999;
|
329
|
+
cursor: not-allowed;
|
330
|
+
}
|
318
331
|
.a-div{
|
319
332
|
display: flex;
|
320
333
|
flex-direction: column;
|
package/src/utils/routerUtil.js
CHANGED
@@ -471,6 +471,13 @@ function parsefunc (func) {
|
|
471
471
|
route.meta.type = row.component
|
472
472
|
}
|
473
473
|
}
|
474
|
+
if (row.extend && row.extend.length > 0) {
|
475
|
+
row.extend.forEach(item => {
|
476
|
+
if (item.key && item.value !== undefined) {
|
477
|
+
route.meta[item.key] = item.value
|
478
|
+
}
|
479
|
+
})
|
480
|
+
}
|
474
481
|
if (row.children && row.children.length > 0) {
|
475
482
|
route.children = parsefunc(row.children)
|
476
483
|
}
|