agilebuilder-ui 1.1.13 → 1.1.14
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/lib/401-8eb9481a.js +11 -0
- package/lib/404-9fca116f.js +8 -0
- package/lib/authredirect-294d14ef.js +7 -0
- package/lib/iframe-page-fadda1f8.js +12 -0
- package/lib/index-1cc4db24.js +8 -0
- package/lib/index-42d5d61b.js +72070 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +39 -67693
- package/lib/super-ui.umd.cjs +121 -83
- package/lib/tab-content-iframe-index-12527a41.js +12 -0
- package/lib/tab-content-index-56d7113b.js +115 -0
- package/lib/tache-subprocess-history-b289d758.js +12 -0
- package/package.json +6 -2
- package/packages/fs-preview/src/fs-preview.vue +24 -36
- package/packages/super-grid/src/apis.js +46 -3
- package/packages/super-grid/src/components/mobile-table-card.jsx +463 -0
- package/packages/super-grid/src/dynamic-input.vue +1 -1
- package/packages/super-grid/src/normal-column-content.vue +6 -2
- package/packages/super-grid/src/super-grid.vue +247 -143
- package/packages/super-grid/src/utils.js +1 -1
- package/src/components/Card/index.jsx +155 -0
- package/src/components/Scrollbar/index.vue +197 -0
- package/src/mixins/resizeMixin.js +49 -0
- package/src/store/getters.js +3 -0
- package/src/store/modules/app.js +41 -0
- package/src/styles/display-layout.scss +252 -0
- package/src/styles/index.scss +1 -0
- package/src/utils/guid.js +13 -0
- package/src/views/layout/tab-content-index.vue +1 -1
- package/vite.config.js +10 -6
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/** @jsxImportSource vue */
|
|
2
|
+
import { defineComponent, ref, computed, watch, defineEmits } from 'vue';
|
|
3
|
+
import { ElCard, ElDrawer, ElTag,ElDescriptions, ElDescriptionsItem, ElButton, ElIcon, ElCheckbox, ElCheckboxGroup, ElBreadcrumb, ElLink, ElEmpty, ElDivider } from 'element-plus';
|
|
4
|
+
import NormalColumnContent from '../normal-column-content.vue';
|
|
5
|
+
import CardView from '../../../../src/components/Card';
|
|
6
|
+
import Scrollbar from '../../../../src/components/Scrollbar';
|
|
7
|
+
import store from '../store';
|
|
8
|
+
import { apisMixin } from '../apis'
|
|
9
|
+
|
|
10
|
+
import { ArrowLeft, Bottom, CirclePlus, Loading, Tickets } from '@element-plus/icons-vue';
|
|
11
|
+
// import { $emit, $off, $on } from '@/utils/gogocodeTransfer'
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'MobileTableCard',
|
|
15
|
+
components: {
|
|
16
|
+
NormalColumnContent,
|
|
17
|
+
CardView,
|
|
18
|
+
Scrollbar
|
|
19
|
+
},
|
|
20
|
+
mixins: [apisMixin],
|
|
21
|
+
props: {
|
|
22
|
+
// 展示字段限制
|
|
23
|
+
showFieldCount: {
|
|
24
|
+
type: [Number, undefined],
|
|
25
|
+
default: () => 5
|
|
26
|
+
},
|
|
27
|
+
// 列字段数据
|
|
28
|
+
columns: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
// 表格数据
|
|
33
|
+
data: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
// 字段事件 v-bind 与 v-on 集成
|
|
38
|
+
getColumnComponentData: {
|
|
39
|
+
type: [Function, undefined],
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
// 选中页
|
|
43
|
+
currentPage: {
|
|
44
|
+
type: [Number],
|
|
45
|
+
default: 1
|
|
46
|
+
},
|
|
47
|
+
// 一页展示数量
|
|
48
|
+
pageSize: {
|
|
49
|
+
type: [Number],
|
|
50
|
+
default: 20
|
|
51
|
+
},
|
|
52
|
+
// 一页展示数量
|
|
53
|
+
pageTotal: {
|
|
54
|
+
type: [Number],
|
|
55
|
+
default: 0
|
|
56
|
+
},
|
|
57
|
+
// 是否开启 堆积分页数据
|
|
58
|
+
isStackingPaginatedData: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: () => false
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
setup(props, setupData) {
|
|
64
|
+
const $emits = defineEmits(['currentChange', 'update:current-page', 'select']);
|
|
65
|
+
|
|
66
|
+
const { attrs, emit, expose } = setupData
|
|
67
|
+
|
|
68
|
+
console.log('*mobile-table-card.JSX**********************************************=>', props, attrs, setupData, expose)
|
|
69
|
+
|
|
70
|
+
// 分页加载状态
|
|
71
|
+
const isPaginationLoading = ref(false)
|
|
72
|
+
|
|
73
|
+
const paginationList = ref([])
|
|
74
|
+
// 选中数据
|
|
75
|
+
const checkedList = ref([]);
|
|
76
|
+
// 当前勾选ID
|
|
77
|
+
const checkedClickId = ref(undefined);
|
|
78
|
+
// 当前选中数据
|
|
79
|
+
const isCheckedIndex = ref(undefined);
|
|
80
|
+
|
|
81
|
+
// 是否打开子表弹窗
|
|
82
|
+
const isChildrenDrawer = ref(false);
|
|
83
|
+
|
|
84
|
+
// 子表打开历史数据
|
|
85
|
+
const childrenBreadcrumbData = ref([]);
|
|
86
|
+
|
|
87
|
+
const setPaginationList = (data) => {
|
|
88
|
+
if (props.isStackingPaginatedData) {
|
|
89
|
+
paginationList.value[(props.currentPage ?? 1) - 1] = data
|
|
90
|
+
} else {
|
|
91
|
+
paginationList.value[0] = data
|
|
92
|
+
}
|
|
93
|
+
isPaginationLoading.value = false
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
setPaginationList(props.data)
|
|
97
|
+
|
|
98
|
+
const addColumnBtn = computed(() => {
|
|
99
|
+
const gridParams = store.get(attrs.listCode)
|
|
100
|
+
const showOperationButton = gridParams?.options?.showOperationButton ?? false
|
|
101
|
+
const isFormSubTable = gridParams?.options?.isFormSubTable ?? false
|
|
102
|
+
const subTableCanAdd = gridParams?.options?.subTableCanAdd ?? false
|
|
103
|
+
const isOperation = componentDatas.value?.some(({ prop }) => ['operation'].includes(prop))
|
|
104
|
+
return showOperationButton && isFormSubTable && subTableCanAdd && isOperation
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
// 列表数据
|
|
108
|
+
const dataList = computed(() => {
|
|
109
|
+
if (props.isStackingPaginatedData) {
|
|
110
|
+
return paginationList.value.flatMap((data, index) => index + 1 <= props.currentPage ? data : [] )
|
|
111
|
+
} else {
|
|
112
|
+
return paginationList.value[0] ?? []
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// 获取包含所有子表数据 LIST 一般用于勾选
|
|
117
|
+
const dataChildrenList = computed(() => {
|
|
118
|
+
const getChildrenData = (data) => {
|
|
119
|
+
return data?.flatMap(item => {
|
|
120
|
+
if (item?.children?.length) return [item, ...getChildrenData(item.children)]
|
|
121
|
+
return [item]
|
|
122
|
+
}) ?? []
|
|
123
|
+
}
|
|
124
|
+
return getChildrenData(dataList.value)
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const isLoadPaginationData = computed(() => {
|
|
128
|
+
if (props.isStackingPaginatedData) {
|
|
129
|
+
return (paginationList.value[props.currentPage - 1]?.length ?? 0) > 0
|
|
130
|
+
} else {
|
|
131
|
+
return dataList.value.length < props.pageSize * props.currentPage && pagesNumber.value >= props.currentPage
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
// 面包屑数据
|
|
136
|
+
const childrenList = computed(() => {
|
|
137
|
+
return childrenBreadcrumbData.value[childrenBreadcrumbData.value.length - 1]?.children ?? []
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const componentDatas = computed(() => {
|
|
141
|
+
const getChildrenData = (data) => {
|
|
142
|
+
return data?.flatMap(item => {
|
|
143
|
+
if (item?.children?.length) return getChildrenData(item.children)
|
|
144
|
+
return [item]
|
|
145
|
+
}) ?? []
|
|
146
|
+
}
|
|
147
|
+
return getChildrenData(props.columns.filter((column) => !column ? false : !['$selection', '$index'].includes(column?.prop)))
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const layoutData = computed(() => {
|
|
151
|
+
const contentData = componentDatas.value.map((data, index) => {
|
|
152
|
+
if (data.operations) {
|
|
153
|
+
data.layoutModelType = 'footer'
|
|
154
|
+
} else {
|
|
155
|
+
data.layoutModelType = 'content'
|
|
156
|
+
}
|
|
157
|
+
return data
|
|
158
|
+
});
|
|
159
|
+
const content = contentData.filter(({ layoutModelType}) => ['content'].includes(layoutModelType))
|
|
160
|
+
return {
|
|
161
|
+
header: content[0] ? [content[0]] : [],
|
|
162
|
+
content,
|
|
163
|
+
footer: contentData.filter(({ layoutModelType}) => ['footer'].includes(layoutModelType))
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// 获取最大 label 字符长度
|
|
168
|
+
const getLongestStringLength = (strArray) => {
|
|
169
|
+
return strArray.reduce((maxLen, str) => {
|
|
170
|
+
return Math.max(maxLen, [...str].reduce((len, char) => /[\u4e00-\u9fff]/.test(char) ? len + 2 : len + 1, 0));
|
|
171
|
+
}, 0);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// 分页数量
|
|
175
|
+
const pagesNumber = computed(() => {
|
|
176
|
+
if (!props.pageTotal) return 0
|
|
177
|
+
return Math.ceil(props.pageTotal / props.pageSize)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
// 字段更多 是否开启
|
|
181
|
+
const isShowDetailsMore = computed(() => {
|
|
182
|
+
if (props.showFieldCount && layoutData.value.content.length > props.showFieldCount) return true
|
|
183
|
+
return false
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
// 是否显示卡片底部控件
|
|
187
|
+
const isShowFooter = computed(() => {
|
|
188
|
+
return layoutData.value.footer.length > 0
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const maxLabelWidth = computed(() => {
|
|
192
|
+
return getLongestStringLength(layoutData.value.content.map((column) => column?.label ?? 0)) * 7 + 15
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
const isCheck = computed(() => {
|
|
196
|
+
return props.columns.some((column) => ['$selection'].includes(column?.prop));
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const isIndex = computed(() => {
|
|
200
|
+
return props.columns.some((column) => ['$index'].includes(column?.prop));
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const detailsFormData = computed(() => {
|
|
204
|
+
return dataList.value[isCheckedIndex.value]
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// 写入选中
|
|
208
|
+
const setCheckedList = (value) => {
|
|
209
|
+
debugger;
|
|
210
|
+
if (!isCheck.value) return
|
|
211
|
+
if (checkedList.value.includes(value)) {
|
|
212
|
+
checkedList.value = checkedList.value.filter(v => v !== value)
|
|
213
|
+
} else {
|
|
214
|
+
checkedList.value = [...new Set([...checkedList.value, value])]
|
|
215
|
+
}
|
|
216
|
+
checkedClickId.value = value
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* 字段渲染展示
|
|
221
|
+
* @param {当前字段数据} columnData
|
|
222
|
+
* @param {当前行的数据} columnFormData
|
|
223
|
+
* @param {所在行的$index} columnIndex
|
|
224
|
+
* @param {是否只显示文本} isViewText
|
|
225
|
+
* @returns
|
|
226
|
+
*/
|
|
227
|
+
const columnViewDom = (columnData, columnFormData, columnIndex, isViewText = false) => {
|
|
228
|
+
const {$bind = {}, $on = {}} = props.getColumnComponentData?.(columnData) ?? {}
|
|
229
|
+
const gridParams = store.get($bind['list-code'])
|
|
230
|
+
const options = gridParams?.options
|
|
231
|
+
const lineEdit = gridParams.lineEdit ?? false
|
|
232
|
+
const attrs = {
|
|
233
|
+
...$bind,
|
|
234
|
+
options,
|
|
235
|
+
row: columnFormData,
|
|
236
|
+
rowIndex: columnIndex,
|
|
237
|
+
'right-click-menu-arr': options?.rightClickMenuArr,
|
|
238
|
+
'line-edit': lineEdit
|
|
239
|
+
}
|
|
240
|
+
const onAttrs = {
|
|
241
|
+
...Object.fromEntries(Object.keys($on).map(key => [`on${key.charAt(0).toUpperCase()}${key.slice(1).replace(/-([a-z])/g, (match, letter) => letter.toUpperCase())}`, $on[key]]))
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return <NormalColumnContent isContentViewText={isViewText} {...attrs} {...onAttrs} />
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* @param {字段columns List} layoutDatas
|
|
250
|
+
* @param {当前行的数据} columnFormData
|
|
251
|
+
* @param {所在行的$index} columnIndex
|
|
252
|
+
* @param {限制显示字段} showFieldCount
|
|
253
|
+
* @returns .filter((_, index) => !props.showFieldCount || props.showFieldCount > index + 1)
|
|
254
|
+
*/
|
|
255
|
+
const getElDescriptions = (layoutDatas, columnFormData = detailsFormData.value, columnIndex = isCheckedIndex.value, showFieldCount = undefined) => {
|
|
256
|
+
// const propertyData = columnData?.find(({ property }) => property)
|
|
257
|
+
return <ElDescriptions column={1} label-width={maxLabelWidth.value} align="right" direction="horizontal" layout='form'>
|
|
258
|
+
{(showFieldCount ? layoutDatas?.slice?.(0, showFieldCount) : layoutDatas)?.map((columnCol, index) => (
|
|
259
|
+
<ElDescriptionsItem
|
|
260
|
+
key={columnCol.label + index}
|
|
261
|
+
v-slots={
|
|
262
|
+
{
|
|
263
|
+
label: () => <div v-html={columnCol.label ? `${columnCol.label}:` : ''} />
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// onRowDblclick={(event) => {
|
|
267
|
+
// console.log('我双击了', columnCol?.property )
|
|
268
|
+
// // if (isViewText) return
|
|
269
|
+
// event.stopPropagation()
|
|
270
|
+
// // emit('rowDblclick', columnFormData, columnData, event)
|
|
271
|
+
// }}
|
|
272
|
+
>
|
|
273
|
+
{columnViewDom(columnCol, columnFormData, columnIndex) || '-'}
|
|
274
|
+
</ElDescriptionsItem>
|
|
275
|
+
))}
|
|
276
|
+
</ElDescriptions>
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
watch(() => attrs.selection, (newValue) => {
|
|
280
|
+
console.log('表格勾选数据监听', newValue)
|
|
281
|
+
checkedList.value = newValue.map(({ $rowDataGuId }) => $rowDataGuId)
|
|
282
|
+
}, { deep: true });
|
|
283
|
+
|
|
284
|
+
// 勾选监听
|
|
285
|
+
watch(checkedList, (newValue , oldValue) => {
|
|
286
|
+
console.log(newValue , oldValue)
|
|
287
|
+
if (attrs.selection.length === newValue.length) {
|
|
288
|
+
if (attrs.selection.every(({ $rowDataGuId }) => newValue.includes($rowDataGuId ) )) return
|
|
289
|
+
}
|
|
290
|
+
const selectData = dataChildrenList.value.filter(({ $rowDataGuId }) => newValue?.includes($rowDataGuId))
|
|
291
|
+
const findData = checkedClickId.value ? dataChildrenList.value.find(({ $rowDataGuId }) => checkedClickId.value === $rowDataGuId) : undefined
|
|
292
|
+
// 新增选中
|
|
293
|
+
if (newValue.length > oldValue?.length && findData) {
|
|
294
|
+
emit('select', selectData, findData)
|
|
295
|
+
}
|
|
296
|
+
// 移除选中
|
|
297
|
+
if (newValue.length < oldValue?.length && findData) {
|
|
298
|
+
emit('select', selectData, findData)
|
|
299
|
+
}
|
|
300
|
+
emit('selectionChange', selectData)
|
|
301
|
+
checkedClickId.value = undefined
|
|
302
|
+
}, { deep: true });
|
|
303
|
+
|
|
304
|
+
// 滚动数据加载监听
|
|
305
|
+
watch(() => props.data, (newValue) => {
|
|
306
|
+
console.log('props.data =======================> 更新', newValue)
|
|
307
|
+
setPaginationList(newValue)
|
|
308
|
+
}, { deep: true });
|
|
309
|
+
|
|
310
|
+
// 滚动到底部监听
|
|
311
|
+
const scrollLoad = () => {
|
|
312
|
+
console.log('分页', pagesNumber.value, props.currentPage)
|
|
313
|
+
if (pagesNumber.value > 1 && pagesNumber.value > props.currentPage) {
|
|
314
|
+
// paginationList.value[props.currentPage - 1]?.length ||
|
|
315
|
+
console.log(dataList.value.length, props.pageSize * props.currentPage)
|
|
316
|
+
if (dataList.value.length === props.pageSize * props.currentPage ) {
|
|
317
|
+
isPaginationLoading.value = true
|
|
318
|
+
const currentPage = props.currentPage + 1
|
|
319
|
+
console.log('开始滚动了', currentPage, pagesNumber.value)
|
|
320
|
+
emit('update:current-page', currentPage)
|
|
321
|
+
emit('currentChange', currentPage)
|
|
322
|
+
} else {
|
|
323
|
+
console.log('等待数据加载')
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
console.log('到底了')
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const getAddBtn = (Fun) => addColumnBtn.value && <ElButton type="primary" plain icon={<CirclePlus />} onClick={() => Fun?.(attrs.listCode)}>Add</ElButton>
|
|
331
|
+
|
|
332
|
+
return {
|
|
333
|
+
getAddBtn,
|
|
334
|
+
renderDom: (AddBtn) => (
|
|
335
|
+
<Scrollbar onScrollToBottom={scrollLoad} set-max-height={data => {
|
|
336
|
+
if (data?.windowHeight) {
|
|
337
|
+
const height = data?.windowHeight - 160
|
|
338
|
+
return height > 400 ? height : 400
|
|
339
|
+
}
|
|
340
|
+
}}>
|
|
341
|
+
{(<ElDrawer v-model={isChildrenDrawer.value} modal-class='yx-drawer yx-scrollbar-body' with-header={true} direction="btt" append-to-body size='90vh' v-slots={{
|
|
342
|
+
header: () => (<div class="yx-flex-wrap" style={{gap: '10px'}}>
|
|
343
|
+
{layoutData.value.header[0] && `${layoutData.value.header[0].label}: `}
|
|
344
|
+
<ElBreadcrumb separator-icon={<ArrowRight></ArrowRight>}>
|
|
345
|
+
{childrenBreadcrumbData.value.map((columnFormData, i) => {
|
|
346
|
+
const label = columnViewDom(layoutData.value.header[0], columnFormData, undefined, true)
|
|
347
|
+
return (
|
|
348
|
+
<ElBreadcrumbItem>
|
|
349
|
+
{
|
|
350
|
+
childrenBreadcrumbData.value.length - 1 === i ? label : <ElLink onClick={() => childrenBreadcrumbData.value = childrenBreadcrumbData.value.slice(0, i + 1)}>{ label }</ElLink>
|
|
351
|
+
}
|
|
352
|
+
</ElBreadcrumbItem>
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
})}
|
|
356
|
+
</ElBreadcrumb>
|
|
357
|
+
</div>)
|
|
358
|
+
}}
|
|
359
|
+
onClosed={() => childrenBreadcrumbData.value = []}
|
|
360
|
+
>
|
|
361
|
+
|
|
362
|
+
<Scrollbar scrollable-main max-height='100%' style={{ 'flex': '1 1 auto'}}>
|
|
363
|
+
<div class="yx-flex-wrap" vertical style={{ gap: '15px'}}>
|
|
364
|
+
{ childrenList.value.map((columnFormData, columnIndex) => {
|
|
365
|
+
// 开启编辑后禁止选中
|
|
366
|
+
const onChecked = () => !columnFormData.$editing && setCheckedList(columnFormData.$rowDataGuId)
|
|
367
|
+
|
|
368
|
+
// 是否选中
|
|
369
|
+
const isChecked = checkedList.value.includes(columnFormData.$rowDataGuId)
|
|
370
|
+
|
|
371
|
+
// 是否有子表
|
|
372
|
+
const isSubTable = !!((columnFormData?.children?.length ?? 0) > 0)
|
|
373
|
+
|
|
374
|
+
const clickPropertyData = layoutData.value.content?.find(({ property }) => property) ?? layoutData.value.content[0]
|
|
375
|
+
|
|
376
|
+
return (<CardView
|
|
377
|
+
form={columnFormData}
|
|
378
|
+
no={ isIndex ? columnIndex + 1 : undefined}
|
|
379
|
+
isChecked={isChecked}
|
|
380
|
+
isSubTable={isSubTable}
|
|
381
|
+
isCheck={isCheck.value}
|
|
382
|
+
isMore={!columnFormData.$editing}
|
|
383
|
+
isShowDetailsMore={isShowDetailsMore.value}
|
|
384
|
+
onChecked={onChecked}
|
|
385
|
+
onShowSubTable={() => {
|
|
386
|
+
childrenBreadcrumbData.value =[...childrenBreadcrumbData.value, columnFormData];
|
|
387
|
+
}}
|
|
388
|
+
onRowClick={(event) => emit('rowClick', columnFormData, clickPropertyData, event)}
|
|
389
|
+
onRowDblclick={(event) => emit('rowDblclick', columnFormData, clickPropertyData, event)}
|
|
390
|
+
v-slots={{
|
|
391
|
+
titleSlot: layoutData.value.header && layoutData.value.header?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex, true)),
|
|
392
|
+
children: ({ isMore }) => getElDescriptions(layoutData.value.content, columnFormData, columnIndex, !isMore ? undefined : props.showFieldCount),
|
|
393
|
+
footerSlot: isShowFooter.value && (<div class="yx-flex-wrap" wrap style={{gap: '15px'}}>
|
|
394
|
+
{layoutData.value.footer?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex))}
|
|
395
|
+
</div>)
|
|
396
|
+
}}
|
|
397
|
+
/>)
|
|
398
|
+
}) }
|
|
399
|
+
</div>
|
|
400
|
+
</Scrollbar>
|
|
401
|
+
</ElDrawer>)}
|
|
402
|
+
<div
|
|
403
|
+
class="yx-flex-wrap"
|
|
404
|
+
vertical
|
|
405
|
+
style="overflow: auto; gap: 15px;"
|
|
406
|
+
>
|
|
407
|
+
{dataList.value.length === 0 && <ElEmpty>{AddBtn}</ElEmpty>}
|
|
408
|
+
|
|
409
|
+
{dataList.value.map((columnFormData, columnIndex) => {
|
|
410
|
+
|
|
411
|
+
// 开启编辑后禁止选中
|
|
412
|
+
const onChecked = () => !columnFormData.$editing && setCheckedList(columnFormData.$rowDataGuId)
|
|
413
|
+
|
|
414
|
+
// 是否选中
|
|
415
|
+
const isChecked = checkedList.value.includes(columnFormData.$rowDataGuId)
|
|
416
|
+
|
|
417
|
+
// 是否有子表
|
|
418
|
+
const isSubTable = !!(columnFormData?.children?.length ?? false)
|
|
419
|
+
|
|
420
|
+
const clickPropertyData = layoutData.value.content?.find(({ property }) => property) ?? layoutData.value.content[0]
|
|
421
|
+
|
|
422
|
+
return (<CardView
|
|
423
|
+
form={columnFormData}
|
|
424
|
+
no={ isIndex ? columnIndex + 1 : undefined}
|
|
425
|
+
isChecked={isChecked}
|
|
426
|
+
isSubTable={isSubTable}
|
|
427
|
+
isCheck={isCheck.value}
|
|
428
|
+
isMore={!columnFormData.$editing}
|
|
429
|
+
isShowDetailsMore={isShowDetailsMore.value}
|
|
430
|
+
onChecked={onChecked}
|
|
431
|
+
onShowSubTable={() => {
|
|
432
|
+
childrenBreadcrumbData.value =[columnFormData];
|
|
433
|
+
isChildrenDrawer.value = true
|
|
434
|
+
}}
|
|
435
|
+
onRowClick={(event) => emit('rowClick', columnFormData, clickPropertyData, event)}
|
|
436
|
+
onRowDblclick={(event) => emit('rowDblclick', columnFormData, clickPropertyData, event)}
|
|
437
|
+
v-slots={{
|
|
438
|
+
titleSlot: layoutData.value.header && layoutData.value.header?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex, true)),
|
|
439
|
+
children: ({ isMore }) => getElDescriptions(layoutData.value.content, columnFormData, columnIndex, !isMore ? undefined : props.showFieldCount),
|
|
440
|
+
footerSlot: isShowFooter.value && (<div class="yx-flex-wrap" wrap style={{gap: '15px'}}>
|
|
441
|
+
{layoutData.value.footer?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex))}
|
|
442
|
+
</div>)
|
|
443
|
+
}}
|
|
444
|
+
/>)
|
|
445
|
+
})}
|
|
446
|
+
|
|
447
|
+
{dataList.value.length > 0 && AddBtn}
|
|
448
|
+
|
|
449
|
+
{
|
|
450
|
+
dataList.value.length > 0 && pagesNumber.value > 1 && (<ElDivider>
|
|
451
|
+
{ (pagesNumber.value > props.currentPage || isPaginationLoading.value) ? (<ElIcon loading-rotate size={25} color="#409eff" style={{ margin: '15px auto' }}><Loading></Loading></ElIcon>) : (pagesNumber.value <= props.currentPage && isLoadPaginationData.value) && 'END' }
|
|
452
|
+
</ElDivider>)
|
|
453
|
+
}
|
|
454
|
+
</div>
|
|
455
|
+
</Scrollbar>
|
|
456
|
+
)
|
|
457
|
+
};
|
|
458
|
+
},
|
|
459
|
+
render() {
|
|
460
|
+
// 为了 能兼容 使用 mixins 参数
|
|
461
|
+
return this.renderDom(this.getAddBtn(this.createRow))
|
|
462
|
+
}
|
|
463
|
+
});
|
|
@@ -648,8 +648,8 @@ export default {
|
|
|
648
648
|
userAgent = 'browser'
|
|
649
649
|
}
|
|
650
650
|
console.log('superGrid----window.location.protocol---', window.location.protocol)
|
|
651
|
-
const isShowScanIcon = isMobile && window.location.protocol === 'https:' ? true : false
|
|
652
651
|
const isApk = isMobile && userAgent && userAgent === 'app' ? true : false
|
|
652
|
+
const isShowScanIcon = isApk || (isMobile && scanEnable && window.location.protocol === 'https:' ? true : false)
|
|
653
653
|
|
|
654
654
|
let baseURL = gridParams.options.backendUrl
|
|
655
655
|
if (!baseURL) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div style="width: 100%">
|
|
3
3
|
<!--添加:key="column.prop+'_'+rowIndex"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
|
|
4
4
|
<dynamic-input
|
|
5
|
-
v-if="(lineEdit.editable && isEditable && row.$editing) || isShowForm"
|
|
5
|
+
v-if="(lineEdit.editable && isEditable && row.$editing && !isContentViewText) || isShowForm"
|
|
6
6
|
v-model:value="row[column.prop]"
|
|
7
7
|
:class="requiredClass"
|
|
8
8
|
:column="column"
|
|
@@ -388,6 +388,11 @@ export default {
|
|
|
388
388
|
},
|
|
389
389
|
name: 'NormalColumnContent',
|
|
390
390
|
props: {
|
|
391
|
+
// 强制文案方式展示
|
|
392
|
+
isContentViewText: {
|
|
393
|
+
type: Boolean,
|
|
394
|
+
default: false
|
|
395
|
+
},
|
|
391
396
|
column: {
|
|
392
397
|
type: Object,
|
|
393
398
|
default: null
|
|
@@ -969,7 +974,6 @@ export default {
|
|
|
969
974
|
}
|
|
970
975
|
},
|
|
971
976
|
isRequired(editing) {
|
|
972
|
-
console.log('isRequired---this.lineEdit=', this.lineEdit)
|
|
973
977
|
if (!this.isFormSubTable && this.lineEdit && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
|
|
974
978
|
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
975
979
|
return true
|