agilebuilder-ui 1.1.12 → 1.1.13-tmp2
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/super-ui.css +1 -1
- package/lib/super-ui.js +24703 -23322
- package/lib/super-ui.umd.cjs +78 -72
- package/package.json +6 -2
- package/packages/fs-upload-list/src/fs-upload-list.vue +11 -10
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +14 -6
- package/packages/super-grid/src/apis.js +259 -403
- package/packages/super-grid/src/components/card-view.jsx +103 -0
- package/packages/super-grid/src/components/mobile-table-card.jsx +394 -0
- package/packages/super-grid/src/normal-column-content.vue +6 -2
- package/packages/super-grid/src/super-grid.vue +151 -72
- package/src/mixins/resizeMixin.js +49 -0
- package/src/store/modules/app.js +26 -0
- package/src/styles/display-layout.scss +132 -0
- package/src/styles/index.scss +1 -0
- package/src/utils/guid.js +13 -0
- package/vite.config.js +10 -6
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
@close="closeSearchFormDialog"
|
|
36
36
|
/>
|
|
37
37
|
<div :class="'grid-area ' + code">
|
|
38
|
+
<MobileCard v-if="isShowCard" :selection="selectionTableData" :columns="visibleColumns" :getColumnComponentData="getColumnComponentData" :data="tableDatas" v-model:current-page="currentPage" :page-size="pagination?.pageSizes?.[0]" :page-total="pagination?.total" @selection-change="cardSelectionChangeEvent" @current-change="handleCurrentChange" @row-dblclick="rowDblclickEvent" />
|
|
39
|
+
|
|
38
40
|
<el-table
|
|
39
41
|
v-if="refreshGrid && hasLoadedColumns"
|
|
40
42
|
ref="superGrid"
|
|
41
|
-
:data="
|
|
43
|
+
:data="tableDatas"
|
|
42
44
|
:row-key="getRowKeyProp"
|
|
43
45
|
:show-summary="showSummary"
|
|
44
46
|
:summary-method="getSummaries"
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
:span-method="rowSpan"
|
|
56
58
|
:max-height="maxHeight"
|
|
57
59
|
:height="tableHeight"
|
|
58
|
-
:class="tableClass"
|
|
60
|
+
:class="`${tableClass} ${isShowCard ? 'xs-hidden-opacity-only' : ''}`"
|
|
59
61
|
:tree-props="getTreeProps(parentProp, isSql, isLazy, dataSourceType)"
|
|
60
62
|
@sort-change="handleSortChange"
|
|
61
63
|
@select="selectRecord"
|
|
@@ -71,70 +73,18 @@
|
|
|
71
73
|
@cell-dblclick="cellDblClick"
|
|
72
74
|
>
|
|
73
75
|
<row-detail v-if="detailColumn" :column="detailColumn" :list-code="code" @show-detail="openRowForm" />
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
getComponentType(column) === 'GroupColumn' ? myCustomFormatter : myCustomFormatter[column.prop]
|
|
85
|
-
"
|
|
86
|
-
:new-width="newWidth"
|
|
87
|
-
:drag-column-prop="dragColumnProp"
|
|
88
|
-
:right-click-menu-arr="options.rightClickMenuArr"
|
|
89
|
-
:table-name="tableName"
|
|
90
|
-
:page-code="pageCode"
|
|
91
|
-
:list-name="listName"
|
|
92
|
-
:options="options"
|
|
93
|
-
:pagination="pagination"
|
|
94
|
-
:current-page="currentPage"
|
|
95
|
-
:grid-data="isSubTableShowPage ? subTableData : gridData"
|
|
96
|
-
:page-grid-data="isSubTableShowPage ? getSubTableGridData(subTableData) : gridData"
|
|
97
|
-
@refresh-list="refreshList"
|
|
98
|
-
@open-page="openPageDialog"
|
|
99
|
-
@refresPortData="refresPortData"
|
|
100
|
-
@refresPortsData="refresPortsData"
|
|
101
|
-
@refresMainTableFields="refresMainTableFields"
|
|
102
|
-
@prohibitToEdit="prohibitToEdit"
|
|
103
|
-
/>
|
|
104
|
-
</template>
|
|
105
|
-
<template v-else>
|
|
106
|
-
<component
|
|
107
|
-
:is="getComponentType(column)"
|
|
108
|
-
v-for="(column, index) in visibleColumns"
|
|
109
|
-
:ref="column.prop"
|
|
110
|
-
:key="column.label + index"
|
|
111
|
-
:is-sql="isSql"
|
|
112
|
-
:column="column"
|
|
113
|
-
:list-code="code"
|
|
114
|
-
:is-line-edit="lineEdit !== null && lineEdit.editable"
|
|
115
|
-
:new-width="newWidth"
|
|
116
|
-
:drag-column-prop="dragColumnProp"
|
|
117
|
-
:right-click-menu-arr="options.rightClickMenuArr"
|
|
118
|
-
:table-name="tableName"
|
|
119
|
-
:page-code="pageCode"
|
|
120
|
-
:list-toolbar-form-data="listToolbarFormData"
|
|
121
|
-
:list-name="listName"
|
|
122
|
-
:options="options"
|
|
123
|
-
:current-page="currentPage"
|
|
124
|
-
:pagination="pagination"
|
|
125
|
-
:grid-data="isSubTableShowPage ? subTableData : gridData"
|
|
126
|
-
:page-grid-data="isSubTableShowPage ? getSubTableGridData(subTableData) : gridData"
|
|
127
|
-
@open-page="openPageDialog"
|
|
128
|
-
@refresData="refresData"
|
|
129
|
-
@refresh-list="refreshList"
|
|
130
|
-
@refresPortData="refresPortData"
|
|
131
|
-
@refresPortsData="refresPortsData"
|
|
132
|
-
@refresMainTableFields="refresMainTableFields"
|
|
133
|
-
@prohibitToEdit="prohibitToEdit"
|
|
134
|
-
/>
|
|
135
|
-
</template>
|
|
76
|
+
|
|
77
|
+
<component
|
|
78
|
+
:is="getComponentType(column)"
|
|
79
|
+
v-for="({column, ...item}, index) in visibleColumnsComponentData"
|
|
80
|
+
:ref="column.prop"
|
|
81
|
+
:key="column.label + index"
|
|
82
|
+
v-bind="item.$bind"
|
|
83
|
+
v-on="item.$on"
|
|
84
|
+
/>
|
|
85
|
+
|
|
136
86
|
</el-table>
|
|
137
|
-
<div v-if="showPagination" style="position: relative; margin-top: 5px">
|
|
87
|
+
<div v-if="showPagination" style="position: relative; margin-top: 5px" :class="{ 'xs-hidden-opacity-only': isShowCard }">
|
|
138
88
|
<el-row>
|
|
139
89
|
<!-- <el-col
|
|
140
90
|
v-if="
|
|
@@ -254,6 +204,7 @@ import ColumnsConfig from './columns-config.vue'
|
|
|
254
204
|
import SearchForm from './search-form.vue'
|
|
255
205
|
import searchFormDialog from './search-form-dialog.vue'
|
|
256
206
|
import RowDetail from './row-detail.vue'
|
|
207
|
+
import MobileCard from './components/mobile-table-card.jsx'
|
|
257
208
|
import { getEntityFieldValueWithOutCase, setEntityFieldValue } from '../../../src/utils/util'
|
|
258
209
|
import eventBus from './eventBus'
|
|
259
210
|
import {
|
|
@@ -282,6 +233,8 @@ import apis from './apis'
|
|
|
282
233
|
import headerContextMenu from './header-context-menu.vue'
|
|
283
234
|
import { isMobileBrowser, isPromise } from '../../../src/utils/common-util'
|
|
284
235
|
import { checkPermission } from '../../../src/utils/permission'
|
|
236
|
+
import { getGuId } from '../../../src/utils/guid.js';
|
|
237
|
+
import resizeMixin from '../../../src/mixins/resizeMixin.js';
|
|
285
238
|
|
|
286
239
|
export default {
|
|
287
240
|
components: {
|
|
@@ -295,10 +248,17 @@ export default {
|
|
|
295
248
|
searchFormDialog,
|
|
296
249
|
ElIconSetting,
|
|
297
250
|
ElIconRefresh,
|
|
298
|
-
RowDetail
|
|
251
|
+
RowDetail,
|
|
252
|
+
MobileCard
|
|
299
253
|
},
|
|
300
254
|
name: 'SuperGrid',
|
|
255
|
+
mixins: [resizeMixin],
|
|
301
256
|
props: {
|
|
257
|
+
// 是否自适应卡片
|
|
258
|
+
isShowAutoCard: {
|
|
259
|
+
type: Boolean,
|
|
260
|
+
default: true
|
|
261
|
+
},
|
|
302
262
|
code: {
|
|
303
263
|
type: String,
|
|
304
264
|
default: ''
|
|
@@ -489,10 +449,15 @@ export default {
|
|
|
489
449
|
currentEditRowIndex: null, // 当前查看的行记录号
|
|
490
450
|
showRowForm: false, // 是否显示行记录详情
|
|
491
451
|
baseURL: null,
|
|
492
|
-
hasFilterDataEvent: false // 是否是表格过滤
|
|
452
|
+
hasFilterDataEvent: false, // 是否是表格过滤
|
|
453
|
+
selectionTableData: [], // 勾选数据
|
|
493
454
|
}
|
|
494
455
|
},
|
|
495
456
|
computed: {
|
|
457
|
+
// 是否显示卡片
|
|
458
|
+
isShowCard() {
|
|
459
|
+
return this.isShowAutoCard && this.isMobileResize
|
|
460
|
+
},
|
|
496
461
|
visibleColumns() {
|
|
497
462
|
const gridParams = store.get(this.code)
|
|
498
463
|
const operations = this.getOptionOperations()
|
|
@@ -555,6 +520,15 @@ export default {
|
|
|
555
520
|
})
|
|
556
521
|
}
|
|
557
522
|
},
|
|
523
|
+
visibleColumnsComponentData() {
|
|
524
|
+
return this.visibleColumns.map(data => this.getColumnComponentData(data, this.myCustomFormatter))
|
|
525
|
+
},
|
|
526
|
+
mobileColumns() {
|
|
527
|
+
return 'Layout'
|
|
528
|
+
},
|
|
529
|
+
tableDatas() {
|
|
530
|
+
return this.hasFilterDataEvent ? this.filterGridData : this.gridData
|
|
531
|
+
},
|
|
558
532
|
spanArr() {
|
|
559
533
|
const spanArr = []
|
|
560
534
|
for (const column of this.columns) {
|
|
@@ -597,6 +571,24 @@ export default {
|
|
|
597
571
|
// }
|
|
598
572
|
},
|
|
599
573
|
watch: {
|
|
574
|
+
// 是否为移动端尺寸
|
|
575
|
+
'isMobileResize': {
|
|
576
|
+
deep: true,
|
|
577
|
+
handler() {
|
|
578
|
+
// 是否开启卡片,如果开启则平台切换时候重新回到第一页
|
|
579
|
+
if(this.isShowAutoCard) {
|
|
580
|
+
this.currentPage = 1
|
|
581
|
+
this.handleCurrentChange()
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
'tableDatas': {
|
|
586
|
+
deep: true,
|
|
587
|
+
immediate: true,
|
|
588
|
+
handler(a, b) {
|
|
589
|
+
console.log('SGQ --- 表格监听数据修改============================》', a, b)
|
|
590
|
+
}
|
|
591
|
+
},
|
|
600
592
|
'options.SuperGrid': {
|
|
601
593
|
deep: true,
|
|
602
594
|
handler: function () {
|
|
@@ -1737,11 +1729,24 @@ export default {
|
|
|
1737
1729
|
.post(requestUrl, param)
|
|
1738
1730
|
.then((data) => {
|
|
1739
1731
|
if (typeof parentRowIds === 'undefined' || parentRowIds === null) {
|
|
1732
|
+
// 当开启卡片的时候,则开启滚动分页
|
|
1733
|
+
const getChildren = (data) => {
|
|
1734
|
+
return data?.map(item => {
|
|
1735
|
+
return {
|
|
1736
|
+
$rowDataGuId: getGuId(),
|
|
1737
|
+
...item,
|
|
1738
|
+
...(item?.children?.length ? {
|
|
1739
|
+
children: getChildren(item.children)
|
|
1740
|
+
} : {})
|
|
1741
|
+
}
|
|
1742
|
+
}) ?? []
|
|
1743
|
+
}
|
|
1744
|
+
const dataList = [...(this.isShowCard && this.currentPage > 1 ? this.gridData : []), ...getChildren(data?.data ?? [])]
|
|
1740
1745
|
let tableData = []
|
|
1741
1746
|
// 对数据做序列化,比如:处理xss攻击
|
|
1742
1747
|
if (isHasOptionFunction('gridDataLoaded', this.code)) {
|
|
1743
1748
|
const gridDataLoadedParam = {
|
|
1744
|
-
gridData:
|
|
1749
|
+
gridData: dataList,
|
|
1745
1750
|
columns: gridParams.columns,
|
|
1746
1751
|
additionalParamMap: gridParams.additionalParamMap,
|
|
1747
1752
|
pageContext: this.pageContext,
|
|
@@ -1755,10 +1760,10 @@ export default {
|
|
|
1755
1760
|
if (gridData) {
|
|
1756
1761
|
tableData = gridData
|
|
1757
1762
|
} else {
|
|
1758
|
-
tableData =
|
|
1763
|
+
tableData = dataList
|
|
1759
1764
|
}
|
|
1760
1765
|
} else {
|
|
1761
|
-
tableData =
|
|
1766
|
+
tableData = dataList
|
|
1762
1767
|
}
|
|
1763
1768
|
if (!tableData) {
|
|
1764
1769
|
tableData = []
|
|
@@ -2164,8 +2169,7 @@ export default {
|
|
|
2164
2169
|
},
|
|
2165
2170
|
getSearchParam() {
|
|
2166
2171
|
const searchParam = {
|
|
2167
|
-
code: this.code
|
|
2168
|
-
tableName: this.tableName
|
|
2172
|
+
code: this.code
|
|
2169
2173
|
}
|
|
2170
2174
|
const gridParams = store.get(this.code)
|
|
2171
2175
|
const pagination = this.getPaginationInfo()
|
|
@@ -2271,6 +2275,7 @@ export default {
|
|
|
2271
2275
|
}
|
|
2272
2276
|
},
|
|
2273
2277
|
changePage() {
|
|
2278
|
+
console.log('点击了分页')
|
|
2274
2279
|
// 翻页操作会导致筛选项发生变化,所以需要清空已有的
|
|
2275
2280
|
this.$refs.superGrid.clearFilter()
|
|
2276
2281
|
// TODO: 把当前页数、每页条数、查询条件、排序信息传回后台
|
|
@@ -2739,6 +2744,7 @@ export default {
|
|
|
2739
2744
|
return this.isSubTableShowPage ? this.subTableData : this.gridData
|
|
2740
2745
|
},
|
|
2741
2746
|
rowDblclickEvent(row, column, event) {
|
|
2747
|
+
console.log('+++++++++++++++++++++++++++++++++', row, column, event)
|
|
2742
2748
|
const gridParams = store.get(this.code)
|
|
2743
2749
|
if (gridParams.options && gridParams.options.isFormSubTable && gridParams.options.isPdfEditor) {
|
|
2744
2750
|
// 如果是子表并且是pdf模式
|
|
@@ -2778,6 +2784,7 @@ export default {
|
|
|
2778
2784
|
}
|
|
2779
2785
|
} else {
|
|
2780
2786
|
if (row) {
|
|
2787
|
+
debugger;
|
|
2781
2788
|
if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editable && gridParams.canntEdit) {
|
|
2782
2789
|
let index = this.gridData.findIndex(function (item) {
|
|
2783
2790
|
return (item.id && item.id === row.id) || (item.ID && item.ID === row.ID)
|
|
@@ -2785,6 +2792,7 @@ export default {
|
|
|
2785
2792
|
if (index < 0) {
|
|
2786
2793
|
index = 0
|
|
2787
2794
|
}
|
|
2795
|
+
console.log('我点击了。。。。。。。。。。。。。。。。。。。', index, this.code)
|
|
2788
2796
|
this.editRow(index, this.code)
|
|
2789
2797
|
}
|
|
2790
2798
|
}
|
|
@@ -2792,6 +2800,7 @@ export default {
|
|
|
2792
2800
|
this.rowDblClick(row, column, event)
|
|
2793
2801
|
},
|
|
2794
2802
|
rowDbClickEditRow(gridParams, row) {
|
|
2803
|
+
console.log('rowDbClickEditRow+++++++++++++++++++', gridParams, row)
|
|
2795
2804
|
// 取消上一行的编辑状态
|
|
2796
2805
|
let editRows
|
|
2797
2806
|
if (this.isSubTableShowPage) {
|
|
@@ -2973,6 +2982,7 @@ export default {
|
|
|
2973
2982
|
* @param entity 格式如:{'NAME':false,"DYM_COLUMN":true}。表示NAME字段不可编辑,DYM_COLUMN可以被编辑
|
|
2974
2983
|
*/
|
|
2975
2984
|
prohibitToEdit(entity) {
|
|
2985
|
+
console.log('我执行了 prohibitToEdit=================================》', entity)
|
|
2976
2986
|
this.fnProhibitToEdit(entity)
|
|
2977
2987
|
},
|
|
2978
2988
|
// 树形结构时数据展示
|
|
@@ -3013,6 +3023,8 @@ export default {
|
|
|
3013
3023
|
},
|
|
3014
3024
|
// 选择记录
|
|
3015
3025
|
selectRecord(selection, row) {
|
|
3026
|
+
console.log('selectRecord====>', selection, row)
|
|
3027
|
+
this.selectionTableData = row
|
|
3016
3028
|
let selectRecordEventResult = true
|
|
3017
3029
|
const gridParams = store.get(this.code)
|
|
3018
3030
|
if (isHasOptionFunction('selectRecord', this.code)) {
|
|
@@ -3034,9 +3046,11 @@ export default {
|
|
|
3034
3046
|
}
|
|
3035
3047
|
}
|
|
3036
3048
|
this.select(selection, row)
|
|
3049
|
+
console.log('查看页面数据', this, gridParams.options, this.row, this.selection)
|
|
3037
3050
|
},
|
|
3038
3051
|
// 取消选择记录
|
|
3039
3052
|
selectAllRecord(selection) {
|
|
3053
|
+
console.log('selectAllRecord====>', selection)
|
|
3040
3054
|
let selectAllRecordsEventResult = true
|
|
3041
3055
|
const gridParams = store.get(this.code)
|
|
3042
3056
|
if (isHasOptionFunction('selectAllRecords', this.code)) {
|
|
@@ -3058,8 +3072,22 @@ export default {
|
|
|
3058
3072
|
}
|
|
3059
3073
|
this.selectAll(selection)
|
|
3060
3074
|
},
|
|
3075
|
+
cardSelectionChangeEvent(newSelection) {
|
|
3076
|
+
try {
|
|
3077
|
+
this.$refs.superGrid.clearSelection()
|
|
3078
|
+
for(const i in newSelection) {
|
|
3079
|
+
const row = newSelection[i]
|
|
3080
|
+
this.$refs.superGrid.toggleRowSelection(row, true)
|
|
3081
|
+
}
|
|
3082
|
+
} catch (error) {
|
|
3083
|
+
console.error(error)
|
|
3084
|
+
}
|
|
3085
|
+
this.selectionChangeEvent(newSelection)
|
|
3086
|
+
},
|
|
3061
3087
|
// 选择记录发生改变时
|
|
3062
3088
|
selectionChangeEvent(newSelection) {
|
|
3089
|
+
this.selectionTableData = newSelection
|
|
3090
|
+
console.log('selectionChangeEvent====>', newSelection)
|
|
3063
3091
|
const gridParams = store.get(this.code)
|
|
3064
3092
|
if (isHasOptionFunction('selectionChange', this.code)) {
|
|
3065
3093
|
gridParams.options.selectionChange.call(this, {
|
|
@@ -3175,6 +3203,57 @@ export default {
|
|
|
3175
3203
|
} else {
|
|
3176
3204
|
return prop
|
|
3177
3205
|
}
|
|
3206
|
+
},
|
|
3207
|
+
getColumnComponentData(column, myCustomFormatter) {
|
|
3208
|
+
try {
|
|
3209
|
+
// if (!['[object Object]'].includes(Object.prototype.toString.call(column))) throw new Error('no column');
|
|
3210
|
+
const componentType = this.getComponentType(column)
|
|
3211
|
+
return {
|
|
3212
|
+
column,
|
|
3213
|
+
getComponentType: this.getComponentType,
|
|
3214
|
+
customFormat: myCustomFormatter,
|
|
3215
|
+
// props + attrs 参数
|
|
3216
|
+
$bind: {
|
|
3217
|
+
column,
|
|
3218
|
+
'ref': column.prop,
|
|
3219
|
+
// 'is': componentType,
|
|
3220
|
+
'is-sql': this.isSql,
|
|
3221
|
+
'list-code': this.code,
|
|
3222
|
+
'new-width': this.newWidth,
|
|
3223
|
+
'drag-column-prop': this.dragColumnProp,
|
|
3224
|
+
'right-click-menu-arr': this.options?.rightClickMenuArr,
|
|
3225
|
+
'table-name': this.tableName,
|
|
3226
|
+
'page-code': this.pageCode,
|
|
3227
|
+
'list-name': this.listName,
|
|
3228
|
+
'options': this.options,
|
|
3229
|
+
'current-page': this.currentPage,
|
|
3230
|
+
'pagination': this.pagination,
|
|
3231
|
+
'grid-data': this.isSubTableShowPage ? this.subTableData : this.gridData,
|
|
3232
|
+
'page-grid-data': this.isSubTableShowPage ? this.getSubTableGridData(this.subTableData) : this.gridData,
|
|
3233
|
+
...(myCustomFormatter ? {
|
|
3234
|
+
'custom-format': ['GroupColumn'].includes(componentType) ? myCustomFormatter : myCustomFormatter[column.prop],
|
|
3235
|
+
} : {
|
|
3236
|
+
'is-line-edit': this.lineEdit?.editable ?? false,
|
|
3237
|
+
'list-toolbar-form-data': this.listToolbarFormData,
|
|
3238
|
+
}),
|
|
3239
|
+
},
|
|
3240
|
+
// 事件绑定
|
|
3241
|
+
$on: {
|
|
3242
|
+
'open-page': this.openPageDialog,
|
|
3243
|
+
'refresData': this.refresData,
|
|
3244
|
+
'refresh-list': this.refreshList,
|
|
3245
|
+
'refresPortData': this.refresPortData,
|
|
3246
|
+
'refresPortsData': this.refresPortsData,
|
|
3247
|
+
'refresMainTableFields': this.refresMainTableFields,
|
|
3248
|
+
'prohibitToEdit': this.prohibitToEdit,
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
} catch (error) {
|
|
3252
|
+
console.error(error)
|
|
3253
|
+
return {
|
|
3254
|
+
column
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3178
3257
|
}
|
|
3179
3258
|
},
|
|
3180
3259
|
emits: [
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
const element = document.querySelector('.amb-design-board');
|
|
4
|
+
let designObserver
|
|
5
|
+
if (element) {
|
|
6
|
+
this.designObserver = new ResizeObserver(entries => {
|
|
7
|
+
for (const entry of entries) {
|
|
8
|
+
console.log(entry);
|
|
9
|
+
this.handleDesignResize(entry?.['target'])
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
designObserver.observe(element);
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
windowWidth: designObserver ? element.clientWidth : window.innerWidth,
|
|
16
|
+
windowHeight: designObserver ? element.clientHeight : window.innerHeight,
|
|
17
|
+
designObserver
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
isMobileResize() {
|
|
22
|
+
return (this.windowWidth ?? 0) <= 768
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
mounted() {
|
|
26
|
+
if (!this.designObserver) {
|
|
27
|
+
window.addEventListener('resize', this.handleWindowResize);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
beforeDestroy() {
|
|
31
|
+
if (this.designObserver) {
|
|
32
|
+
this.designObserver.disconnect();
|
|
33
|
+
} else {
|
|
34
|
+
window.removeEventListener('resize', this.handleWindowResize);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
handleWindowResize() {
|
|
39
|
+
this.windowWidth = window.innerWidth;
|
|
40
|
+
this.windowHeight = window.innerHeight;
|
|
41
|
+
},
|
|
42
|
+
handleDesignResize(element) {
|
|
43
|
+
if (element) {
|
|
44
|
+
this.windowWidth = element.clientWidth;
|
|
45
|
+
this.windowHeight = element.clientHeight;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
package/src/store/modules/app.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import System from "@zxing/library/esm/core/util/System"
|
|
2
|
+
|
|
1
3
|
const app = {
|
|
2
4
|
state: {
|
|
3
5
|
sidebar: {
|
|
@@ -7,8 +9,20 @@ const app = {
|
|
|
7
9
|
device: 'desktop',
|
|
8
10
|
preventReclick: false,
|
|
9
11
|
whiteList: [],
|
|
12
|
+
systemWidth: [],
|
|
13
|
+
windowWidth: window.innerWidth,
|
|
14
|
+
windowHeight: window.innerHeight,
|
|
15
|
+
targetDomWidth: 0,
|
|
16
|
+
isModel: false,
|
|
10
17
|
},
|
|
11
18
|
mutations: {
|
|
19
|
+
updateWindowSize(state, { width, height }) {
|
|
20
|
+
state.windowWidth = width;
|
|
21
|
+
state.windowHeight = height;
|
|
22
|
+
},
|
|
23
|
+
updateTargetDomWidth(state, width) {
|
|
24
|
+
state.targetDomWidth = width;
|
|
25
|
+
},
|
|
12
26
|
toggleSidebar: (state) => {
|
|
13
27
|
if (state.sidebar.opened) {
|
|
14
28
|
window.sessionStorage.setItem('sidebarStatus', 1)
|
|
@@ -36,6 +50,18 @@ const app = {
|
|
|
36
50
|
},
|
|
37
51
|
},
|
|
38
52
|
actions: {
|
|
53
|
+
startListeningToResize({ commit }) {
|
|
54
|
+
const handleResize = () => {
|
|
55
|
+
commit('updateWindowSize', {
|
|
56
|
+
width: window.innerWidth,
|
|
57
|
+
height: window.innerHeight
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
window.addEventListener('resize', handleResize);
|
|
61
|
+
return () => {
|
|
62
|
+
window.removeEventListener('resize', handleResize);
|
|
63
|
+
};
|
|
64
|
+
},
|
|
39
65
|
toggleSidebar: ({ commit }) => {
|
|
40
66
|
commit('toggleSidebar')
|
|
41
67
|
},
|
|
@@ -32,3 +32,135 @@
|
|
|
32
32
|
box-shadow: 0px 1px 8px 0px #00000019;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
[overflow-wrap] {
|
|
37
|
+
word-wrap: break-word;
|
|
38
|
+
overflow-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.yx-flex-wrap {
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
&[vertical] {
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
}
|
|
47
|
+
&[justify='space-between'] {
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
}
|
|
50
|
+
&[align='center'] {
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
&[wrap] {
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.el-descriptions {
|
|
59
|
+
&[layout='form'] {
|
|
60
|
+
.el-descriptions__cell {
|
|
61
|
+
display: flex;
|
|
62
|
+
gap: 10px;
|
|
63
|
+
.el-descriptions__label {
|
|
64
|
+
margin: 0;
|
|
65
|
+
max-width: 40%;
|
|
66
|
+
flex: 0 0 auto;
|
|
67
|
+
}
|
|
68
|
+
.el-descriptions__content {
|
|
69
|
+
flex: 1 1 auto;
|
|
70
|
+
word-wrap: break-word;
|
|
71
|
+
overflow-wrap: break-word;
|
|
72
|
+
|
|
73
|
+
.ellipsis {
|
|
74
|
+
word-wrap: break-word !important;
|
|
75
|
+
overflow-wrap: break-word !important;
|
|
76
|
+
width: auto !important;
|
|
77
|
+
white-space: inherit !important;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
@media (max-width: 450px) {
|
|
81
|
+
& {
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
}
|
|
84
|
+
.el-descriptions__label {
|
|
85
|
+
width: 100% !important;
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.yx-card-main {
|
|
94
|
+
&.is-checked {
|
|
95
|
+
border-color: #409eff;
|
|
96
|
+
}
|
|
97
|
+
&[header-padding] {
|
|
98
|
+
& > .el-card__header {
|
|
99
|
+
padding: 0 !important;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
&[body-padding] {
|
|
103
|
+
& > .el-card__body {
|
|
104
|
+
padding: 0 !important;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.el-card__header {
|
|
108
|
+
& > .yx-flex-wrap {
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[scrollable-main] {
|
|
115
|
+
position: relative;
|
|
116
|
+
&:has(.el-scrollbar__wrap:has(::-webkit-scrollbar-thumb:vertical)):not(:has(.el-scrollbar__wrap:has(:first-child:has(+ *))))::before {
|
|
117
|
+
content: " ";
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 0;
|
|
120
|
+
left: 0;
|
|
121
|
+
right: 0;
|
|
122
|
+
height: 10px;
|
|
123
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* 底部阴影 */
|
|
128
|
+
&:has(.el-scrollbar__wrap:has(::-webkit-scrollbar-thumb:vertical)):not(:has(.el-scrollbar__wrap:has(:last-child:has(+ *))))::after {
|
|
129
|
+
content: " ";
|
|
130
|
+
position: absolute;
|
|
131
|
+
bottom: 0;
|
|
132
|
+
left: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
height: 10px;
|
|
135
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[loading-rotate] {
|
|
141
|
+
animation: loading-rotate 2s linear infinite;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@keyframes loading-rotate {
|
|
145
|
+
to {
|
|
146
|
+
transform:rotate(360deg)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.isHideTable {
|
|
151
|
+
opacity: 0 !important;
|
|
152
|
+
z-index: -99 !important;
|
|
153
|
+
width: 0px !important;
|
|
154
|
+
height: 0px !important;
|
|
155
|
+
overflow: hidden !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.xs-hidden-opacity-only {
|
|
159
|
+
@media (max-width: 768px) {
|
|
160
|
+
opacity: 0 !important;
|
|
161
|
+
z-index: -99 !important;
|
|
162
|
+
width: 0px !important;
|
|
163
|
+
height: 0px !important;
|
|
164
|
+
overflow: hidden !important;
|
|
165
|
+
}
|
|
166
|
+
}
|
package/src/styles/index.scss
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取4位随机数
|
|
3
|
+
*/
|
|
4
|
+
export function getS4(a, b, c, d) {
|
|
5
|
+
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 生成GuId
|
|
10
|
+
*/
|
|
11
|
+
export function getGuId(data = `{s}{s}-{s}-{s}-{s}-{s}{s}{s}`) {
|
|
12
|
+
return data.replace(/{(y|m|d|h|i|s|a)+}/g, getS4)
|
|
13
|
+
}
|
package/vite.config.js
CHANGED
|
@@ -2,14 +2,17 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { terser } from 'rollup-plugin-terser'
|
|
5
|
+
import vueJsx from '@vitejs/plugin-vue-jsx';
|
|
6
|
+
|
|
5
7
|
// https://vitejs.dev/config/
|
|
6
|
-
export default defineConfig({
|
|
8
|
+
export default defineConfig(({ mode }) => ({
|
|
7
9
|
plugins: [
|
|
8
|
-
vue(),
|
|
10
|
+
vue(),
|
|
11
|
+
vueJsx(),
|
|
9
12
|
terser({
|
|
10
13
|
compress: {
|
|
11
|
-
drop_console:
|
|
12
|
-
drop_debugger:
|
|
14
|
+
drop_console: ['production'].includes(mode),
|
|
15
|
+
drop_debugger: ['production'].includes(mode),
|
|
13
16
|
},
|
|
14
17
|
output: {
|
|
15
18
|
// 对于console.error,不做任何处理
|
|
@@ -26,7 +29,7 @@ export default defineConfig({
|
|
|
26
29
|
}, //库编译模式配置
|
|
27
30
|
rollupOptions: {
|
|
28
31
|
// 确保外部化处理那些你不想打包进库的依赖
|
|
29
|
-
external: ["vue"],
|
|
32
|
+
external: ["vue", "jsx"],
|
|
30
33
|
output: {
|
|
31
34
|
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
32
35
|
globals: {
|
|
@@ -40,11 +43,12 @@ export default defineConfig({
|
|
|
40
43
|
},
|
|
41
44
|
},
|
|
42
45
|
}, // rollup打包配置
|
|
46
|
+
sourcemap: mode === 'development'
|
|
43
47
|
},
|
|
44
48
|
// ...其他配置项
|
|
45
49
|
resolve: {
|
|
46
50
|
// 忽略后缀名的配置选项, 添加 .vue 选项时要记得原本默认忽略的选项也要手动写入
|
|
47
51
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
|
48
52
|
}
|
|
49
|
-
});
|
|
53
|
+
}));
|
|
50
54
|
|