agilebuilder-ui 1.1.13-tmp4 → 1.1.13-tmp6
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-e6404818.js → 401-b72ce8b6.js} +1 -1
- package/lib/{404-3556013d.js → 404-3aabf44b.js} +1 -1
- package/lib/{iframe-page-1d95c5c4.js → iframe-page-2bd8a200.js} +1 -1
- package/lib/{index-1a87600f.js → index-c03eac61.js} +15904 -15888
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +81 -81
- package/lib/{tab-content-iframe-index-728fe039.js → tab-content-iframe-index-fc7d9146.js} +1 -1
- package/lib/{tab-content-index-5481253a.js → tab-content-index-552e53a1.js} +1 -1
- package/lib/{tache-subprocess-history-051a2d26.js → tache-subprocess-history-3ef2a115.js} +1 -1
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +46 -3
- package/packages/super-grid/src/components/mobile-table-card.jsx +463 -426
- package/packages/super-grid/src/super-grid.vue +7 -1
- package/packages/super-grid/src/utils.js +1 -1
- package/pnpm-lock.yaml +3467 -0
- package/src/components/Card/index.jsx +155 -146
- package/src/components/Scrollbar/index.vue +196 -196
- package/src/mixins/resizeMixin.js +48 -48
- package/src/styles/display-layout.scss +11 -0
- package/src/utils/guid.js +13 -13
|
@@ -1,146 +1,155 @@
|
|
|
1
|
-
/** @jsxImportSource vue */
|
|
2
|
-
import { defineComponent, ref, computed, watch, onMounted } from 'vue';
|
|
3
|
-
import { ElCard, ElTag, ElButton, ElIcon, ElCheckbox } from 'element-plus';
|
|
4
|
-
import { Bottom, Tickets } from '@element-plus/icons-vue';
|
|
5
|
-
import Scrollbar from '../Scrollbar';
|
|
6
|
-
// import { $emit, $off, $on } from '@/utils/gogocodeTransfer'
|
|
7
|
-
|
|
8
|
-
export default defineComponent({
|
|
9
|
-
name: 'CardView',
|
|
10
|
-
components: {
|
|
11
|
-
Scrollbar
|
|
12
|
-
},
|
|
13
|
-
props: {
|
|
14
|
-
// 当前行数据
|
|
15
|
-
form: {
|
|
16
|
-
type: Object,
|
|
17
|
-
default: () => {}
|
|
18
|
-
},
|
|
19
|
-
// 当前序号
|
|
20
|
-
no: {
|
|
21
|
-
type: [Number, String,undefined],
|
|
22
|
-
default: () => undefined
|
|
23
|
-
},
|
|
24
|
-
// 是否选中
|
|
25
|
-
isChecked: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: () => false
|
|
28
|
-
},
|
|
29
|
-
// 是否展示多选
|
|
30
|
-
isCheck: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: () => false
|
|
33
|
-
},
|
|
34
|
-
// 是否展示子表按钮
|
|
35
|
-
isSubTable: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: () => false
|
|
38
|
-
},
|
|
39
|
-
// 是否展示更多按钮
|
|
40
|
-
isShowDetailsMore: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: () => false
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{ props.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
})
|
|
1
|
+
/** @jsxImportSource vue */
|
|
2
|
+
import { defineComponent, ref, computed, watch, onMounted } from 'vue';
|
|
3
|
+
import { ElCard, ElTag, ElButton, ElIcon, ElCheckbox } from 'element-plus';
|
|
4
|
+
import { Bottom, Tickets } from '@element-plus/icons-vue';
|
|
5
|
+
import Scrollbar from '../Scrollbar';
|
|
6
|
+
// import { $emit, $off, $on } from '@/utils/gogocodeTransfer'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'CardView',
|
|
10
|
+
components: {
|
|
11
|
+
Scrollbar
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
// 当前行数据
|
|
15
|
+
form: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => {}
|
|
18
|
+
},
|
|
19
|
+
// 当前序号
|
|
20
|
+
no: {
|
|
21
|
+
type: [Number, String,undefined],
|
|
22
|
+
default: () => undefined
|
|
23
|
+
},
|
|
24
|
+
// 是否选中
|
|
25
|
+
isChecked: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: () => false
|
|
28
|
+
},
|
|
29
|
+
// 是否展示多选
|
|
30
|
+
isCheck: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: () => false
|
|
33
|
+
},
|
|
34
|
+
// 是否展示子表按钮
|
|
35
|
+
isSubTable: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: () => false
|
|
38
|
+
},
|
|
39
|
+
// 是否展示更多按钮
|
|
40
|
+
isShowDetailsMore: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: () => false
|
|
43
|
+
},
|
|
44
|
+
// 是否收起
|
|
45
|
+
isMore: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: () => true
|
|
48
|
+
},
|
|
49
|
+
setMaxHeight: {
|
|
50
|
+
type: [Function, undefined],
|
|
51
|
+
default: () => undefined
|
|
52
|
+
},
|
|
53
|
+
setHeight: {
|
|
54
|
+
type: [Function, undefined],
|
|
55
|
+
default: () => undefined
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
setup(props, { attrs, emit, slots }) {
|
|
59
|
+
console.log('*card-view.jsx**********************************************=>', props, attrs, slots)
|
|
60
|
+
const isMore = ref(props.isShowDetailsMore)
|
|
61
|
+
|
|
62
|
+
const scrollHeight = ref(undefined);
|
|
63
|
+
|
|
64
|
+
const scrollbarRef = ref(null);
|
|
65
|
+
|
|
66
|
+
// 点击了卡片事件
|
|
67
|
+
const onChecked = () => {
|
|
68
|
+
emit('checked')
|
|
69
|
+
}
|
|
70
|
+
const getSlotHtml = (slotFun) => {
|
|
71
|
+
const datas = {...props, isMore: isMore.value }
|
|
72
|
+
return ['function'].includes(typeof slotFun) ? slotFun(datas) : slotFun
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const footerSlot = computed(() => {
|
|
76
|
+
return getSlotHtml(slots.footerSlot).filter(item => item?.children) ?? []
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const setMaxHeight = data => {
|
|
80
|
+
if (props.setMaxHeight) return props.setMaxHeight(data)
|
|
81
|
+
if (data?.windowHeight) {
|
|
82
|
+
// const height = data?.windowHeight - 200
|
|
83
|
+
if (data.windowHeight * 0.4 <= scrollHeight.value) return 300
|
|
84
|
+
return scrollHeight.value && scrollHeight.value >= 300 ? scrollHeight : 300
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
watch(() => props.isShowDetailsMore, (newValue) => {
|
|
89
|
+
isMore.value = newValue
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
watch(() => props.isMore, (newValue) => {
|
|
93
|
+
isMore.value = newValue
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
onMounted(() => {
|
|
97
|
+
const scrollElement = scrollbarRef.value?.$el?.querySelector?.('.el-scrollbar__view');
|
|
98
|
+
if (scrollElement) {
|
|
99
|
+
scrollHeight.value = scrollElement.clientHeight
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// 点击事件
|
|
104
|
+
const onClick = (event) => {
|
|
105
|
+
onChecked()
|
|
106
|
+
emit('rowClick', event)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 双击事件
|
|
110
|
+
const onDblclick = (event) => {
|
|
111
|
+
emit('rowDblclick', event)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return () => (
|
|
116
|
+
<ElCard key={`card_${props.form?.$rowDataGuId || `${props.form?.id}_${props.no}`}`} header-padding body-padding shadow="hover" class={{ 'yx-card-main': true, 'is-checked': props.isChecked}} v-slots={{
|
|
117
|
+
header: () => (
|
|
118
|
+
<div class="yx-flex-wrap" justify='space-between' align='center' onClick={onClick} onDblclick={onDblclick}>
|
|
119
|
+
<div class="yx-flex-wrap" align='center' style={{gap: '10px' , flex: '1 1 auto',maxWidth: 'calc(100% - 80px)'}}>
|
|
120
|
+
{ props.no && <ElTag type="primary" size='small'>{props.no}</ElTag>}
|
|
121
|
+
<div layout-title class='ellipsis'>{ getSlotHtml(slots.titleSlot) }</div>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="yx-flex-wrap" align='center' style={{gap: '10px'}}>
|
|
124
|
+
{ getSlotHtml(slots.headerRightSlot) }
|
|
125
|
+
{ props.isSubTable && <ElButton text icon={<ElIcon><Tickets /></ElIcon>} onClick={event => {
|
|
126
|
+
event.stopPropagation()
|
|
127
|
+
emit('showSubTable', props.form)
|
|
128
|
+
}} /> }
|
|
129
|
+
{ props.isCheck && <ElCheckbox model-value={props.isChecked} disabled={!!props.form.$editing} style="height: auto;" onClick={(event) => {
|
|
130
|
+
event.stopPropagation()
|
|
131
|
+
}} onChange={onChecked} /> }
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
),
|
|
135
|
+
...(footerSlot.value.length > 0 ? {
|
|
136
|
+
footer: footerSlot.value
|
|
137
|
+
} : {})
|
|
138
|
+
}}>
|
|
139
|
+
<div class="yx-flex-wrap" vertical style={{gap: '0', height: '100%'}} onClick={onClick} onDblclick={onDblclick}>
|
|
140
|
+
<Scrollbar ref={scrollbarRef} scrollable-main max-height={!isMore.value ? '50vh' : '100%'} set-max-height={setMaxHeight} set-height={props.setHeight}>
|
|
141
|
+
<div class='yx-card-body'>
|
|
142
|
+
{ getSlotHtml(slots.children) }
|
|
143
|
+
</div>
|
|
144
|
+
</Scrollbar>
|
|
145
|
+
{
|
|
146
|
+
props.isShowDetailsMore && (<ElButton text icon={<ElIcon>{!isMore.value ? <Top /> : <Bottom /> }</ElIcon>} onClick={(event) => {
|
|
147
|
+
event.stopPropagation()
|
|
148
|
+
isMore.value = !isMore.value
|
|
149
|
+
}}>{ !isMore.value ? 'Less' : 'More'}</ElButton>)
|
|
150
|
+
}
|
|
151
|
+
</div>
|
|
152
|
+
</ElCard>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
});
|