resolver-egretimp-plus 0.1.119 → 0.1.121
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/dist/h5/index.js +18 -18
- package/dist/web/index.js +11 -11
- package/package.json +1 -1
- package/src/components/options/OptionsDefault.vue +0 -1
- package/src/components/packages-web/CustomComponentCycle.vue +38 -33
- package/src/components/packages-web/CustomComponentCycleTabPane.vue +40 -33
- package/src/components/packages-web/CustomComponentPlain.vue +6 -5
- package/src/components/packages-web/CustomComponentTable.jsx +48 -40
- package/src/components/packages-web/ElInput copy.jsx +0 -1
- package/src/components/packages-web/ElInput.jsx +0 -1
- package/src/config.js +2 -0
- package/src/hooks/pageConfig.js +10 -4
- package/src/index.jsx +15 -10
- package/src/renderer.jsx +4 -1
- package/src/resolver-common.vue +22 -2
- package/src/rules/rulesDriver.js +4 -0
- package/src/utils/common.js +13 -0
- package/src/utils/render.jsx +196 -96
- package/src-bak/analysisComponent.jsx +0 -343
- package/src-bak/api/builtIn.js +0 -10
- package/src-bak/bpm/bpmInstance.js +0 -388
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +0 -8
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +0 -97
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +0 -88
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +0 -3
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +0 -76
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +0 -201
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +0 -69
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +0 -56
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +0 -76
- package/src-bak/bpm/udc-sdk-esm/cjs/index.js +0 -46
- package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +0 -21
- package/src-bak/components/childDialog/index.js +0 -39
- package/src-bak/components/childDialog/src/index.vue +0 -185
- package/src-bak/components/cmiFormItem/index.js +0 -1
- package/src-bak/components/cmiFormItem/src/index.vue +0 -112
- package/src-bak/components/confirmInstance-H5/index.js +0 -53
- package/src-bak/components/confirmInstance-H5/src/index.vue +0 -54
- package/src-bak/components/helper/FormPolyfill.jsx +0 -25
- package/src-bak/components/helper/calcTooltip.jsx +0 -134
- package/src-bak/components/helper/dock.js +0 -141
- package/src-bak/components/helper/eventOrchestration.js +0 -763
- package/src-bak/components/helper/resolver.js +0 -163
- package/src-bak/components/helper/table.jsx +0 -103
- package/src-bak/components/icons/date.vue +0 -33
- package/src-bak/components/icons/info.vue +0 -62
- package/src-bak/components/icons/loading.vue +0 -19
- package/src-bak/components/icons/question-filled.vue +0 -8
- package/src-bak/components/loading/index.js +0 -6
- package/src-bak/components/loading/loading.js +0 -98
- package/src-bak/components/loading/loading.scss +0 -74
- package/src-bak/components/loading/loading.vue +0 -89
- package/src-bak/components/loadingComponent/LoadingComponent.vue +0 -33
- package/src-bak/components/modal/index.js +0 -9
- package/src-bak/components/modal/modal.scss +0 -195
- package/src-bak/components/modal/modal.vue +0 -201
- package/src-bak/components/options/OptionsDefault.vue +0 -47
- package/src-bak/components/packages-H5/CmiButton.vue +0 -120
- package/src-bak/components/packages-H5/CmiCalendar.vue +0 -152
- package/src-bak/components/packages-H5/CmiCell.vue +0 -87
- package/src-bak/components/packages-H5/CmiCheckbox.vue +0 -82
- package/src-bak/components/packages-H5/CmiDatetimePicker.vue +0 -98
- package/src-bak/components/packages-H5/CmiDivider.vue +0 -30
- package/src-bak/components/packages-H5/CmiDropdownMenu.vue +0 -58
- package/src-bak/components/packages-H5/CmiInput.vue +0 -69
- package/src-bak/components/packages-H5/CmiLink.vue +0 -28
- package/src-bak/components/packages-H5/CmiPicker.vue +0 -229
- package/src-bak/components/packages-H5/CmiRadio.vue +0 -29
- package/src-bak/components/packages-H5/CmiSearch.vue +0 -39
- package/src-bak/components/packages-H5/CmiSelect.vue +0 -84
- package/src-bak/components/packages-H5/CustomComponentCardH5.vue +0 -129
- package/src-bak/components/packages-H5/CustomComponentColH5.vue +0 -8
- package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +0 -141
- package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +0 -54
- package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +0 -38
- package/src-bak/components/packages-H5/CustomComponentTableH5.vue +0 -352
- package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +0 -170
- package/src-bak/components/packages-web/CustomComponentCard.vue +0 -40
- package/src-bak/components/packages-web/CustomComponentCol.vue +0 -66
- package/src-bak/components/packages-web/CustomComponentCollapse.vue +0 -164
- package/src-bak/components/packages-web/CustomComponentCycle.vue +0 -95
- package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +0 -155
- package/src-bak/components/packages-web/CustomComponentDialog.vue +0 -192
- package/src-bak/components/packages-web/CustomComponentEditor.vue +0 -50
- package/src-bak/components/packages-web/CustomComponentFileExport.vue +0 -60
- package/src-bak/components/packages-web/CustomComponentFileImport.vue +0 -60
- package/src-bak/components/packages-web/CustomComponentFormLayout.vue +0 -65
- package/src-bak/components/packages-web/CustomComponentGrid.vue +0 -29
- package/src-bak/components/packages-web/CustomComponentGridCol.vue +0 -29
- package/src-bak/components/packages-web/CustomComponentInputDialog.vue +0 -144
- package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +0 -84
- package/src-bak/components/packages-web/CustomComponentPlain.vue +0 -247
- package/src-bak/components/packages-web/CustomComponentRow.vue +0 -83
- package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +0 -203
- package/src-bak/components/packages-web/CustomComponentSendMail.vue +0 -62
- package/src-bak/components/packages-web/CustomComponentSteps.vue +0 -41
- package/src-bak/components/packages-web/CustomComponentTabPane.vue +0 -20
- package/src-bak/components/packages-web/CustomComponentTable.jsx +0 -814
- package/src-bak/components/packages-web/CustomComponentTabs.vue +0 -126
- package/src-bak/components/packages-web/CustomComponentTree.vue +0 -28
- package/src-bak/components/packages-web/ElButton.vue +0 -146
- package/src-bak/components/packages-web/ElCheckbox.vue +0 -97
- package/src-bak/components/packages-web/ElDatePicker.vue +0 -93
- package/src-bak/components/packages-web/ElInput copy.jsx +0 -393
- package/src-bak/components/packages-web/ElInput.jsx +0 -312
- package/src-bak/components/packages-web/ElInputNumber.vue +0 -81
- package/src-bak/components/packages-web/ElPagination.vue +0 -61
- package/src-bak/components/packages-web/ElRadio.vue +0 -47
- package/src-bak/components/packages-web/ElSelect.jsx +0 -249
- package/src-bak/components/packages-web/ElSelect_bak.vue +0 -155
- package/src-bak/components/packages-web/ElText.jsx +0 -187
- package/src-bak/components/packages-web/ElTextaa.vue +0 -169
- package/src-bak/components/packages-web/ElTimePicker.vue +0 -39
- package/src-bak/components/patchComponents-H5.js +0 -46
- package/src-bak/components/patchComponents-web.js +0 -46
- package/src-bak/components/simpleFormItemPc/index.js +0 -1
- package/src-bak/components/simpleFormItemPc/src/index.vue +0 -94
- package/src-bak/components/table/index.ts +0 -29
- package/src-bak/components/table/src/composables/use-scrollbar.ts +0 -30
- package/src-bak/components/table/src/config.ts +0 -256
- package/src-bak/components/table/src/filter-panel.vue +0 -260
- package/src-bak/components/table/src/h-helper.ts +0 -34
- package/src-bak/components/table/src/layout-observer.ts +0 -78
- package/src-bak/components/table/src/store/current.ts +0 -85
- package/src-bak/components/table/src/store/expand.ts +0 -76
- package/src-bak/components/table/src/store/helper.ts +0 -74
- package/src-bak/components/table/src/store/index.ts +0 -246
- package/src-bak/components/table/src/store/tree.ts +0 -230
- package/src-bak/components/table/src/store/watcher.ts +0 -543
- package/src-bak/components/table/src/table/defaults.ts +0 -402
- package/src-bak/components/table/src/table/key-render-helper.ts +0 -27
- package/src-bak/components/table/src/table/style-helper.ts +0 -378
- package/src-bak/components/table/src/table/utils-helper.ts +0 -47
- package/src-bak/components/table/src/table-body/defaults.ts +0 -52
- package/src-bak/components/table/src/table-body/events-helper.ts +0 -203
- package/src-bak/components/table/src/table-body/index.ts +0 -119
- package/src-bak/components/table/src/table-body/render-helper.ts +0 -283
- package/src-bak/components/table/src/table-body/styles-helper.ts +0 -164
- package/src-bak/components/table/src/table-column/defaults.ts +0 -237
- package/src-bak/components/table/src/table-column/index.ts +0 -202
- package/src-bak/components/table/src/table-column/render-helper.ts +0 -214
- package/src-bak/components/table/src/table-column/watcher-helper.ts +0 -88
- package/src-bak/components/table/src/table-footer/index.ts +0 -128
- package/src-bak/components/table/src/table-footer/mapState-helper.ts +0 -33
- package/src-bak/components/table/src/table-footer/style-helper.ts +0 -51
- package/src-bak/components/table/src/table-header/event-helper.ts +0 -213
- package/src-bak/components/table/src/table-header/index.ts +0 -244
- package/src-bak/components/table/src/table-header/style.helper.ts +0 -119
- package/src-bak/components/table/src/table-header/utils-helper.ts +0 -94
- package/src-bak/components/table/src/table-layout.ts +0 -259
- package/src-bak/components/table/src/table.vue +0 -389
- package/src-bak/components/table/src/tableColumn.ts +0 -3
- package/src-bak/components/table/src/tokens.ts +0 -5
- package/src-bak/components/table/src/util.ts +0 -521
- package/src-bak/components/table/style/css.ts +0 -5
- package/src-bak/components/table/style/index.ts +0 -5
- package/src-bak/components/tabs/index.js +0 -8
- package/src-bak/components/tabs/src/constants.js +0 -23
- package/src-bak/components/tabs/src/tab-bar.js +0 -8
- package/src-bak/components/tabs/src/tab-bar.vue +0 -92
- package/src-bak/components/tabs/src/tab-nav.jsx +0 -424
- package/src-bak/components/tabs/src/tab-pane.js +0 -16
- package/src-bak/components/tabs/src/tab-pane.vue +0 -80
- package/src-bak/components/tabs/src/tabs.jsx +0 -223
- package/src-bak/components/tabs/style/css.js +0 -2
- package/src-bak/components/tabs/style/index.js +0 -2
- package/src-bak/components/thirdPartyFrame/index.js +0 -32
- package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +0 -125
- package/src-bak/enums/index.js +0 -16
- package/src-bak/hooks/configLoad.js +0 -45
- package/src-bak/hooks/index.js +0 -189
- package/src-bak/hooks/mock.js +0 -6960
- package/src-bak/hooks/pageConfig.js +0 -127
- package/src-bak/index.jsx +0 -443
- package/src-bak/renderer.jsx +0 -77
- package/src-bak/resolver-H5.vue +0 -88
- package/src-bak/resolver-common.vue +0 -129
- package/src-bak/resolver-web.vue +0 -91
- package/src-bak/rules/eventsSupplement.js +0 -573
- package/src-bak/rules/parseCondition.js +0 -378
- package/src-bak/rules/ruleUtils.js +0 -273
- package/src-bak/rules/rulesDriver.js +0 -139
- package/src-bak/rulesImp/events.js +0 -588
- package/src-bak/rulesImp/index.js +0 -33
- package/src-bak/rulesImp/ruleInstance.js +0 -231
- package/src-bak/rulesImp/ruleUtils.js +0 -124
- package/src-bak/theme/element/components/button.scss +0 -122
- package/src-bak/theme/element/components/card.scss +0 -8
- package/src-bak/theme/element/components/checkbox.scss +0 -19
- package/src-bak/theme/element/components/collapse.scss +0 -174
- package/src-bak/theme/element/components/common.scss +0 -30
- package/src-bak/theme/element/components/cycle.scss +0 -0
- package/src-bak/theme/element/components/date.scss +0 -13
- package/src-bak/theme/element/components/dialog.scss +0 -44
- package/src-bak/theme/element/components/form.scss +0 -104
- package/src-bak/theme/element/components/index.scss +0 -55
- package/src-bak/theme/element/components/input.scss +0 -36
- package/src-bak/theme/element/components/message.scss +0 -48
- package/src-bak/theme/element/components/pagination.scss +0 -47
- package/src-bak/theme/element/components/popper.scss +0 -3
- package/src-bak/theme/element/components/radio.scss +0 -40
- package/src-bak/theme/element/components/scrollbar.scss +0 -14
- package/src-bak/theme/element/components/select.scss +0 -82
- package/src-bak/theme/element/components/steps.scss +0 -6
- package/src-bak/theme/element/components/table.scss +0 -218
- package/src-bak/theme/element/components/tabs.scss +0 -128
- package/src-bak/theme/element/components/tag.scss +0 -6
- package/src-bak/theme/element/components/text.scss +0 -20
- package/src-bak/theme/element/components/textarea.scss +0 -3
- package/src-bak/theme/element/components/tree.scss +0 -0
- package/src-bak/theme/element/index.scss +0 -55
- package/src-bak/utils/cipher.js +0 -141
- package/src-bak/utils/common.js +0 -664
- package/src-bak/utils/const.js +0 -259
- package/src-bak/utils/defaultVal.js +0 -92
- package/src-bak/utils/dom.js +0 -36
- package/src-bak/utils/format.js +0 -19
- package/src-bak/utils/index.js +0 -4
- package/src-bak/utils/is.js +0 -74
- package/src-bak/utils/loadModule.js +0 -75
- package/src-bak/utils/preserveFunc.js +0 -33
- package/src-bak/utils/render.jsx +0 -1138
- package/src-bak/utils/request.js +0 -136
- package/src-bak/utils/respone.js +0 -70
- package/src-bak/utils/valid.js +0 -89
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { h } from 'vue'
|
|
3
|
-
import ElCheckbox from 'element-plus/es/components/checkbox/index.mjs'
|
|
4
|
-
import { ElIcon } from 'element-plus/es/components/icon/index.mjs'
|
|
5
|
-
import { ArrowRight, Loading } from '@element-plus/icons-vue'
|
|
6
|
-
import { getProp } from 'element-plus/es/utils/index.mjs'
|
|
7
|
-
|
|
8
|
-
import type { VNode } from 'vue'
|
|
9
|
-
import type { TableColumnCtx } from './table-column/defaults'
|
|
10
|
-
import type { Store } from './store'
|
|
11
|
-
import type { TreeNode } from './table/defaults'
|
|
12
|
-
|
|
13
|
-
const defaultClassNames = {
|
|
14
|
-
selection: 'table-column--selection',
|
|
15
|
-
expand: 'table__expand-column',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const cellStarts = {
|
|
19
|
-
default: {
|
|
20
|
-
order: '',
|
|
21
|
-
},
|
|
22
|
-
selection: {
|
|
23
|
-
width: 48,
|
|
24
|
-
minWidth: 48,
|
|
25
|
-
realWidth: 48,
|
|
26
|
-
order: '',
|
|
27
|
-
},
|
|
28
|
-
expand: {
|
|
29
|
-
width: 48,
|
|
30
|
-
minWidth: 48,
|
|
31
|
-
realWidth: 48,
|
|
32
|
-
order: '',
|
|
33
|
-
},
|
|
34
|
-
index: {
|
|
35
|
-
width: 48,
|
|
36
|
-
minWidth: 48,
|
|
37
|
-
realWidth: 48,
|
|
38
|
-
order: '',
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const getDefaultClassName = (type) => {
|
|
43
|
-
return defaultClassNames[type] || ''
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 这些选项不应该被覆盖
|
|
47
|
-
export const cellForced = {
|
|
48
|
-
selection: {
|
|
49
|
-
renderHeader<T>({ store, column }: { store: Store<T> }) {
|
|
50
|
-
function isDisabled() {
|
|
51
|
-
return store.states.data.value && store.states.data.value.length === 0
|
|
52
|
-
}
|
|
53
|
-
return h(ElCheckbox, {
|
|
54
|
-
disabled: isDisabled(),
|
|
55
|
-
size: store.states.tableSize.value,
|
|
56
|
-
indeterminate:
|
|
57
|
-
store.states.selection.value.length > 0 &&
|
|
58
|
-
!store.states.isAllSelected.value,
|
|
59
|
-
'onUpdate:modelValue': store.toggleAllSelection,
|
|
60
|
-
modelValue: store.states.isAllSelected.value,
|
|
61
|
-
ariaLabel: column.label,
|
|
62
|
-
})
|
|
63
|
-
},
|
|
64
|
-
renderCell<T>({
|
|
65
|
-
row,
|
|
66
|
-
column,
|
|
67
|
-
store,
|
|
68
|
-
$index,
|
|
69
|
-
}: {
|
|
70
|
-
row: T
|
|
71
|
-
column: TableColumnCtx<T>
|
|
72
|
-
store: Store<T>
|
|
73
|
-
$index: string
|
|
74
|
-
}) {
|
|
75
|
-
return h(ElCheckbox, {
|
|
76
|
-
disabled: column.selectable
|
|
77
|
-
? !column.selectable.call(null, row, $index)
|
|
78
|
-
: false,
|
|
79
|
-
size: store.states.tableSize.value,
|
|
80
|
-
onChange: () => {
|
|
81
|
-
store.commit('rowSelectedChanged', row)
|
|
82
|
-
},
|
|
83
|
-
onClick: (event: Event) => event.stopPropagation(),
|
|
84
|
-
modelValue: store.isSelected(row),
|
|
85
|
-
ariaLabel: column.label,
|
|
86
|
-
})
|
|
87
|
-
},
|
|
88
|
-
sortable: false,
|
|
89
|
-
resizable: false,
|
|
90
|
-
},
|
|
91
|
-
index: {
|
|
92
|
-
renderHeader<T>({ column }: { column: TableColumnCtx<T> }) {
|
|
93
|
-
return column.label || '#'
|
|
94
|
-
},
|
|
95
|
-
renderCell<T>({
|
|
96
|
-
column,
|
|
97
|
-
$index,
|
|
98
|
-
}: {
|
|
99
|
-
column: TableColumnCtx<T>
|
|
100
|
-
$index: number
|
|
101
|
-
}) {
|
|
102
|
-
let i = $index + 1
|
|
103
|
-
const index = column.index
|
|
104
|
-
|
|
105
|
-
if (typeof index === 'number') {
|
|
106
|
-
i = $index + index
|
|
107
|
-
} else if (typeof index === 'function') {
|
|
108
|
-
i = index($index)
|
|
109
|
-
}
|
|
110
|
-
return h('div', {}, [i])
|
|
111
|
-
},
|
|
112
|
-
sortable: false,
|
|
113
|
-
},
|
|
114
|
-
expand: {
|
|
115
|
-
renderHeader<T>({ column }: { column: TableColumnCtx<T> }) {
|
|
116
|
-
return column.label || ''
|
|
117
|
-
},
|
|
118
|
-
renderCell<T>({
|
|
119
|
-
row,
|
|
120
|
-
store,
|
|
121
|
-
expanded,
|
|
122
|
-
}: {
|
|
123
|
-
row: T
|
|
124
|
-
store: Store<T>
|
|
125
|
-
expanded: boolean
|
|
126
|
-
}) {
|
|
127
|
-
const { ns } = store
|
|
128
|
-
const classes = [ns.e('expand-icon')]
|
|
129
|
-
if (expanded) {
|
|
130
|
-
classes.push(ns.em('expand-icon', 'expanded'))
|
|
131
|
-
}
|
|
132
|
-
const callback = function (e: Event) {
|
|
133
|
-
e.stopPropagation()
|
|
134
|
-
store.toggleRowExpansion(row)
|
|
135
|
-
}
|
|
136
|
-
return h(
|
|
137
|
-
'div',
|
|
138
|
-
{
|
|
139
|
-
class: classes,
|
|
140
|
-
onClick: callback,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
default: () => {
|
|
144
|
-
return [
|
|
145
|
-
h(ElIcon, null, {
|
|
146
|
-
default: () => {
|
|
147
|
-
return [h(ArrowRight)]
|
|
148
|
-
},
|
|
149
|
-
}),
|
|
150
|
-
]
|
|
151
|
-
},
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
},
|
|
155
|
-
sortable: false,
|
|
156
|
-
resizable: false,
|
|
157
|
-
},
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function defaultRenderCell<T>({
|
|
161
|
-
row,
|
|
162
|
-
column,
|
|
163
|
-
$index,
|
|
164
|
-
}: {
|
|
165
|
-
row: T
|
|
166
|
-
column: TableColumnCtx<T>
|
|
167
|
-
$index: number
|
|
168
|
-
}) {
|
|
169
|
-
const property = column.property
|
|
170
|
-
const value = property && getProp(row, property).value
|
|
171
|
-
if (column && column.formatter) {
|
|
172
|
-
return column.formatter(row, column, value, $index)
|
|
173
|
-
}
|
|
174
|
-
return value?.toString?.() || ''
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function treeCellPrefix<T>(
|
|
178
|
-
{
|
|
179
|
-
row,
|
|
180
|
-
treeNode,
|
|
181
|
-
store,
|
|
182
|
-
}: {
|
|
183
|
-
row: T
|
|
184
|
-
treeNode: TreeNode
|
|
185
|
-
store: Store<T>
|
|
186
|
-
},
|
|
187
|
-
createPlaceholder = false
|
|
188
|
-
) {
|
|
189
|
-
const { ns } = store
|
|
190
|
-
if (!treeNode) {
|
|
191
|
-
if (createPlaceholder) {
|
|
192
|
-
return [
|
|
193
|
-
h('span', {
|
|
194
|
-
class: ns.e('placeholder'),
|
|
195
|
-
}),
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
return null
|
|
199
|
-
}
|
|
200
|
-
const ele: VNode[] = []
|
|
201
|
-
const callback = function (e) {
|
|
202
|
-
e.stopPropagation()
|
|
203
|
-
if (treeNode.loading) {
|
|
204
|
-
return
|
|
205
|
-
}
|
|
206
|
-
store.loadOrToggle(row)
|
|
207
|
-
}
|
|
208
|
-
if (treeNode.indent) {
|
|
209
|
-
ele.push(
|
|
210
|
-
h('span', {
|
|
211
|
-
class: ns.e('indent'),
|
|
212
|
-
style: { 'padding-left': `${treeNode.indent}px` },
|
|
213
|
-
})
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
if (typeof treeNode.expanded === 'boolean' && !treeNode.noLazyChildren) {
|
|
217
|
-
const expandClasses = [
|
|
218
|
-
ns.e('expand-icon'),
|
|
219
|
-
treeNode.expanded ? ns.em('expand-icon', 'expanded') : '',
|
|
220
|
-
]
|
|
221
|
-
let icon = ArrowRight
|
|
222
|
-
if (treeNode.loading) {
|
|
223
|
-
icon = Loading
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
ele.push(
|
|
227
|
-
h(
|
|
228
|
-
'div',
|
|
229
|
-
{
|
|
230
|
-
class: expandClasses,
|
|
231
|
-
onClick: callback,
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
default: () => {
|
|
235
|
-
return [
|
|
236
|
-
h(
|
|
237
|
-
ElIcon,
|
|
238
|
-
{ class: { [ns.is('loading')]: treeNode.loading } },
|
|
239
|
-
{
|
|
240
|
-
default: () => [h(icon)],
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
]
|
|
244
|
-
},
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
)
|
|
248
|
-
} else {
|
|
249
|
-
ele.push(
|
|
250
|
-
h('span', {
|
|
251
|
-
class: ns.e('placeholder'),
|
|
252
|
-
})
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
return ele
|
|
256
|
-
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-tooltip
|
|
3
|
-
ref="tooltip"
|
|
4
|
-
:visible="tooltipVisible"
|
|
5
|
-
:offset="0"
|
|
6
|
-
:placement="placement"
|
|
7
|
-
:show-arrow="false"
|
|
8
|
-
:stop-popper-mouse-event="false"
|
|
9
|
-
teleported
|
|
10
|
-
effect="light"
|
|
11
|
-
pure
|
|
12
|
-
:popper-class="filterClassName"
|
|
13
|
-
persistent
|
|
14
|
-
>
|
|
15
|
-
<template #content>
|
|
16
|
-
<div v-if="multiple">
|
|
17
|
-
<div :class="ns.e('content')">
|
|
18
|
-
<el-scrollbar :wrap-class="ns.e('wrap')">
|
|
19
|
-
<el-checkbox-group
|
|
20
|
-
v-model="filteredValue"
|
|
21
|
-
:class="ns.e('checkbox-group')"
|
|
22
|
-
>
|
|
23
|
-
<el-checkbox
|
|
24
|
-
v-for="filter in filters"
|
|
25
|
-
:key="filter.value"
|
|
26
|
-
:value="filter.value"
|
|
27
|
-
>
|
|
28
|
-
{{ filter.text }}
|
|
29
|
-
</el-checkbox>
|
|
30
|
-
</el-checkbox-group>
|
|
31
|
-
</el-scrollbar>
|
|
32
|
-
</div>
|
|
33
|
-
<div :class="ns.e('bottom')">
|
|
34
|
-
<button
|
|
35
|
-
:class="{ [ns.is('disabled')]: filteredValue.length === 0 }"
|
|
36
|
-
:disabled="filteredValue.length === 0"
|
|
37
|
-
type="button"
|
|
38
|
-
@click="handleConfirm"
|
|
39
|
-
>
|
|
40
|
-
{{ t('el.table.confirmFilter') }}
|
|
41
|
-
</button>
|
|
42
|
-
<button type="button" @click="handleReset">
|
|
43
|
-
{{ t('el.table.resetFilter') }}
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<ul v-else :class="ns.e('list')">
|
|
48
|
-
<li
|
|
49
|
-
:class="[
|
|
50
|
-
ns.e('list-item'),
|
|
51
|
-
{
|
|
52
|
-
[ns.is('active')]:
|
|
53
|
-
filterValue === undefined || filterValue === null,
|
|
54
|
-
},
|
|
55
|
-
]"
|
|
56
|
-
@click="handleSelect(null)"
|
|
57
|
-
>
|
|
58
|
-
{{ t('el.table.clearFilter') }}
|
|
59
|
-
</li>
|
|
60
|
-
<li
|
|
61
|
-
v-for="filter in filters"
|
|
62
|
-
:key="filter.value"
|
|
63
|
-
:class="[ns.e('list-item'), ns.is('active', isActive(filter))]"
|
|
64
|
-
:label="filter.value"
|
|
65
|
-
@click="handleSelect(filter.value)"
|
|
66
|
-
>
|
|
67
|
-
{{ filter.text }}
|
|
68
|
-
</li>
|
|
69
|
-
</ul>
|
|
70
|
-
</template>
|
|
71
|
-
<template #default>
|
|
72
|
-
<span
|
|
73
|
-
v-click-outside:[popperPaneRef]="hideFilterPanel"
|
|
74
|
-
:class="[
|
|
75
|
-
`${ns.namespace.value}-table__column-filter-trigger`,
|
|
76
|
-
`${ns.namespace.value}-none-outline`,
|
|
77
|
-
]"
|
|
78
|
-
@click="showFilterPanel"
|
|
79
|
-
>
|
|
80
|
-
<el-icon>
|
|
81
|
-
<arrow-up v-if="column.filterOpened" />
|
|
82
|
-
<arrow-down v-else />
|
|
83
|
-
</el-icon>
|
|
84
|
-
</span>
|
|
85
|
-
</template>
|
|
86
|
-
</el-tooltip>
|
|
87
|
-
</template>
|
|
88
|
-
|
|
89
|
-
<script lang="ts">
|
|
90
|
-
// @ts-nocheck
|
|
91
|
-
import { computed, defineComponent, getCurrentInstance, ref, watch } from 'vue'
|
|
92
|
-
import ElCheckbox from 'element-plus/es/components/checkbox/index.mjs'
|
|
93
|
-
import { ElIcon } from 'element-plus/es/components/icon/index.mjs'
|
|
94
|
-
import { ArrowDown, ArrowUp } from '@element-plus/icons-vue'
|
|
95
|
-
import { ClickOutside } from 'element-plus/es/directives/index.mjs'
|
|
96
|
-
import { useLocale, useNamespace } from 'element-plus/es/hooks/index.mjs'
|
|
97
|
-
import ElTooltip from 'element-plus/es/components/tooltip/index.mjs'
|
|
98
|
-
import ElScrollbar from 'element-plus/es/components/scrollbar/index.mjs'
|
|
99
|
-
import type { Placement } from 'element-plus/es/components/popper/index.mjs.mjs'
|
|
100
|
-
|
|
101
|
-
import type { PropType, WritableComputedRef } from 'vue'
|
|
102
|
-
import type { TableColumnCtx } from './table-column/defaults'
|
|
103
|
-
import type { TableHeader } from './table-header'
|
|
104
|
-
import type { Store } from './store'
|
|
105
|
-
|
|
106
|
-
const { CheckboxGroup: ElCheckboxGroup } = ElCheckbox
|
|
107
|
-
|
|
108
|
-
export default defineComponent({
|
|
109
|
-
name: 'ElTableFilterPanel',
|
|
110
|
-
components: {
|
|
111
|
-
ElCheckbox,
|
|
112
|
-
ElCheckboxGroup,
|
|
113
|
-
ElScrollbar,
|
|
114
|
-
ElTooltip,
|
|
115
|
-
ElIcon,
|
|
116
|
-
ArrowDown,
|
|
117
|
-
ArrowUp,
|
|
118
|
-
},
|
|
119
|
-
directives: { ClickOutside },
|
|
120
|
-
props: {
|
|
121
|
-
placement: {
|
|
122
|
-
type: String as PropType<Placement>,
|
|
123
|
-
default: 'bottom-start',
|
|
124
|
-
},
|
|
125
|
-
store: {
|
|
126
|
-
type: Object as PropType<Store<unknown>>,
|
|
127
|
-
},
|
|
128
|
-
column: {
|
|
129
|
-
type: Object as PropType<TableColumnCtx<unknown>>,
|
|
130
|
-
},
|
|
131
|
-
upDataColumn: {
|
|
132
|
-
type: Function,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
setup(props) {
|
|
136
|
-
const instance = getCurrentInstance()
|
|
137
|
-
const { t } = useLocale()
|
|
138
|
-
const ns = useNamespace('table-filter')
|
|
139
|
-
const parent = instance?.parent as TableHeader
|
|
140
|
-
if (!parent.filterPanels.value[props.column.id]) {
|
|
141
|
-
parent.filterPanels.value[props.column.id] = instance
|
|
142
|
-
}
|
|
143
|
-
const tooltipVisible = ref(false)
|
|
144
|
-
const tooltip = ref<InstanceType<typeof ElTooltip> | null>(null)
|
|
145
|
-
const filters = computed(() => {
|
|
146
|
-
return props.column && props.column.filters
|
|
147
|
-
})
|
|
148
|
-
const filterClassName = computed(() => {
|
|
149
|
-
if (props.column.filterClassName) {
|
|
150
|
-
return `${ns.b()} ${props.column.filterClassName}`
|
|
151
|
-
}
|
|
152
|
-
return ns.b()
|
|
153
|
-
})
|
|
154
|
-
const filterValue = computed({
|
|
155
|
-
get: () => (props.column?.filteredValue || [])[0],
|
|
156
|
-
set: (value: string) => {
|
|
157
|
-
if (filteredValue.value) {
|
|
158
|
-
if (typeof value !== 'undefined' && value !== null) {
|
|
159
|
-
filteredValue.value.splice(0, 1, value)
|
|
160
|
-
} else {
|
|
161
|
-
filteredValue.value.splice(0, 1)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
})
|
|
166
|
-
const filteredValue: WritableComputedRef<unknown[]> = computed({
|
|
167
|
-
get() {
|
|
168
|
-
if (props.column) {
|
|
169
|
-
return props.column.filteredValue || []
|
|
170
|
-
}
|
|
171
|
-
return []
|
|
172
|
-
},
|
|
173
|
-
set(value: unknown[]) {
|
|
174
|
-
if (props.column) {
|
|
175
|
-
props.upDataColumn('filteredValue', value)
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
})
|
|
179
|
-
const multiple = computed(() => {
|
|
180
|
-
if (props.column) {
|
|
181
|
-
return props.column.filterMultiple
|
|
182
|
-
}
|
|
183
|
-
return true
|
|
184
|
-
})
|
|
185
|
-
const isActive = (filter) => {
|
|
186
|
-
return filter.value === filterValue.value
|
|
187
|
-
}
|
|
188
|
-
const hidden = () => {
|
|
189
|
-
tooltipVisible.value = false
|
|
190
|
-
}
|
|
191
|
-
const showFilterPanel = (e: MouseEvent) => {
|
|
192
|
-
e.stopPropagation()
|
|
193
|
-
tooltipVisible.value = !tooltipVisible.value
|
|
194
|
-
}
|
|
195
|
-
const hideFilterPanel = () => {
|
|
196
|
-
tooltipVisible.value = false
|
|
197
|
-
}
|
|
198
|
-
const handleConfirm = () => {
|
|
199
|
-
confirmFilter(filteredValue.value)
|
|
200
|
-
hidden()
|
|
201
|
-
}
|
|
202
|
-
const handleReset = () => {
|
|
203
|
-
filteredValue.value = []
|
|
204
|
-
confirmFilter(filteredValue.value)
|
|
205
|
-
hidden()
|
|
206
|
-
}
|
|
207
|
-
const handleSelect = (_filterValue?: string) => {
|
|
208
|
-
filterValue.value = _filterValue
|
|
209
|
-
if (typeof _filterValue !== 'undefined' && _filterValue !== null) {
|
|
210
|
-
confirmFilter(filteredValue.value)
|
|
211
|
-
} else {
|
|
212
|
-
confirmFilter([])
|
|
213
|
-
}
|
|
214
|
-
hidden()
|
|
215
|
-
}
|
|
216
|
-
const confirmFilter = (filteredValue: unknown[]) => {
|
|
217
|
-
props.store.commit('filterChange', {
|
|
218
|
-
column: props.column,
|
|
219
|
-
values: filteredValue,
|
|
220
|
-
})
|
|
221
|
-
props.store.updateAllSelected()
|
|
222
|
-
}
|
|
223
|
-
watch(
|
|
224
|
-
tooltipVisible,
|
|
225
|
-
(value) => {
|
|
226
|
-
// todo
|
|
227
|
-
if (props.column) {
|
|
228
|
-
props.upDataColumn('filterOpened', value)
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
immediate: true,
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
|
|
236
|
-
const popperPaneRef = computed(() => {
|
|
237
|
-
return tooltip.value?.popperRef?.contentRef
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
return {
|
|
241
|
-
tooltipVisible,
|
|
242
|
-
multiple,
|
|
243
|
-
filterClassName,
|
|
244
|
-
filteredValue,
|
|
245
|
-
filterValue,
|
|
246
|
-
filters,
|
|
247
|
-
handleConfirm,
|
|
248
|
-
handleReset,
|
|
249
|
-
handleSelect,
|
|
250
|
-
isActive,
|
|
251
|
-
t,
|
|
252
|
-
ns,
|
|
253
|
-
showFilterPanel,
|
|
254
|
-
hideFilterPanel,
|
|
255
|
-
popperPaneRef,
|
|
256
|
-
tooltip,
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
})
|
|
260
|
-
</script>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { h } from 'vue'
|
|
3
|
-
export function hColgroup(props) {
|
|
4
|
-
const isAuto = props.tableLayout === 'auto'
|
|
5
|
-
let columns = props.columns || []
|
|
6
|
-
if (isAuto) {
|
|
7
|
-
if (columns.every((column) => column.width === undefined)) {
|
|
8
|
-
columns = []
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const getPropsData = (column) => {
|
|
12
|
-
const propsData = {
|
|
13
|
-
key: `${props.tableLayout}_${column.id}`,
|
|
14
|
-
style: {},
|
|
15
|
-
name: undefined,
|
|
16
|
-
}
|
|
17
|
-
if (isAuto) {
|
|
18
|
-
propsData.style = {
|
|
19
|
-
width: `${column.width}px`,
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
propsData.name = column.id
|
|
23
|
-
}
|
|
24
|
-
return propsData
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return h(
|
|
28
|
-
'colgroup',
|
|
29
|
-
{},
|
|
30
|
-
columns.map((column) => h('col', getPropsData(column)))
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
hColgroup.props = ['columns', 'tableLayout']
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import {
|
|
3
|
-
computed,
|
|
4
|
-
getCurrentInstance,
|
|
5
|
-
onBeforeMount,
|
|
6
|
-
onMounted,
|
|
7
|
-
onUnmounted,
|
|
8
|
-
onUpdated,
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
import type { TableHeader } from './table-header'
|
|
12
|
-
import type TableLayout from './table-layout'
|
|
13
|
-
import type { Table } from './table/defaults'
|
|
14
|
-
|
|
15
|
-
function useLayoutObserver<T>(root: Table<T>) {
|
|
16
|
-
const instance = getCurrentInstance() as TableHeader
|
|
17
|
-
onBeforeMount(() => {
|
|
18
|
-
tableLayout.value.addObserver(instance)
|
|
19
|
-
})
|
|
20
|
-
onMounted(() => {
|
|
21
|
-
onColumnsChange(tableLayout.value)
|
|
22
|
-
onScrollableChange(tableLayout.value)
|
|
23
|
-
})
|
|
24
|
-
onUpdated(() => {
|
|
25
|
-
onColumnsChange(tableLayout.value)
|
|
26
|
-
onScrollableChange(tableLayout.value)
|
|
27
|
-
})
|
|
28
|
-
onUnmounted(() => {
|
|
29
|
-
tableLayout.value.removeObserver(instance)
|
|
30
|
-
})
|
|
31
|
-
const tableLayout = computed(() => {
|
|
32
|
-
const layout = root.layout as TableLayout<T>
|
|
33
|
-
if (!layout) {
|
|
34
|
-
throw new Error('Can not find table layout.')
|
|
35
|
-
}
|
|
36
|
-
return layout
|
|
37
|
-
})
|
|
38
|
-
const onColumnsChange = (layout: TableLayout<T>) => {
|
|
39
|
-
const cols = root.vnode.el?.querySelectorAll('colgroup > col') || []
|
|
40
|
-
if (!cols.length) return
|
|
41
|
-
const flattenColumns = layout.getFlattenColumns()
|
|
42
|
-
const columnsMap = {}
|
|
43
|
-
flattenColumns.forEach((column) => {
|
|
44
|
-
columnsMap[column.id] = column
|
|
45
|
-
})
|
|
46
|
-
for (let i = 0, j = cols.length; i < j; i++) {
|
|
47
|
-
const col = cols[i]
|
|
48
|
-
const name = col.getAttribute('name')
|
|
49
|
-
const column = columnsMap[name]
|
|
50
|
-
if (column) {
|
|
51
|
-
col.setAttribute('width', column.realWidth || column.width)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const onScrollableChange = (layout: TableLayout<T>) => {
|
|
57
|
-
const cols =
|
|
58
|
-
root.vnode.el?.querySelectorAll('colgroup > col[name=gutter]') || []
|
|
59
|
-
for (let i = 0, j = cols.length; i < j; i++) {
|
|
60
|
-
const col = cols[i]
|
|
61
|
-
col.setAttribute('width', layout.scrollY.value ? layout.gutterWidth : '0')
|
|
62
|
-
}
|
|
63
|
-
const ths = root.vnode.el?.querySelectorAll('th.gutter') || []
|
|
64
|
-
for (let i = 0, j = ths.length; i < j; i++) {
|
|
65
|
-
const th = ths[i]
|
|
66
|
-
th.style.width = layout.scrollY.value ? `${layout.gutterWidth}px` : '0'
|
|
67
|
-
th.style.display = layout.scrollY.value ? '' : 'none'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
tableLayout: tableLayout.value,
|
|
73
|
-
onColumnsChange,
|
|
74
|
-
onScrollableChange,
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default useLayoutObserver
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { getCurrentInstance, ref, unref } from 'vue'
|
|
3
|
-
import { getRowIdentity } from '../util'
|
|
4
|
-
|
|
5
|
-
import type { Ref } from 'vue'
|
|
6
|
-
import type { Table } from '../table/defaults'
|
|
7
|
-
import type { WatcherPropsData } from '.'
|
|
8
|
-
|
|
9
|
-
function useCurrent<T>(watcherData: WatcherPropsData<T>) {
|
|
10
|
-
const instance = getCurrentInstance() as Table<T>
|
|
11
|
-
const _currentRowKey = ref<string>(null)
|
|
12
|
-
const currentRow: Ref<T> = ref(null)
|
|
13
|
-
|
|
14
|
-
const setCurrentRowKey = (key: string) => {
|
|
15
|
-
instance.store.assertRowKey()
|
|
16
|
-
_currentRowKey.value = key
|
|
17
|
-
setCurrentRowByKey(key)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const restoreCurrentRowKey = () => {
|
|
21
|
-
_currentRowKey.value = null
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const setCurrentRowByKey = (key: string) => {
|
|
25
|
-
const { data, rowKey } = watcherData
|
|
26
|
-
let _currentRow = null
|
|
27
|
-
if (rowKey.value) {
|
|
28
|
-
_currentRow = (unref(data) || []).find(
|
|
29
|
-
(item) => getRowIdentity(item, rowKey.value) === key
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
currentRow.value = _currentRow
|
|
33
|
-
instance.emit('current-change', currentRow.value, null)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const updateCurrentRow = (_currentRow: T) => {
|
|
37
|
-
const oldCurrentRow = currentRow.value
|
|
38
|
-
if (_currentRow && _currentRow !== oldCurrentRow) {
|
|
39
|
-
currentRow.value = _currentRow
|
|
40
|
-
instance.emit('current-change', currentRow.value, oldCurrentRow)
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
if (!_currentRow && oldCurrentRow) {
|
|
44
|
-
currentRow.value = null
|
|
45
|
-
instance.emit('current-change', null, oldCurrentRow)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const updateCurrentRowData = () => {
|
|
50
|
-
const rowKey = watcherData.rowKey.value
|
|
51
|
-
// data 为 null 时,解构时的默认值会被忽略
|
|
52
|
-
const data = watcherData.data.value || []
|
|
53
|
-
const oldCurrentRow = currentRow.value
|
|
54
|
-
// 当 currentRow 不在 data 中时尝试更新数据
|
|
55
|
-
if (!data.includes(oldCurrentRow) && oldCurrentRow) {
|
|
56
|
-
if (rowKey) {
|
|
57
|
-
const currentRowKey = getRowIdentity(oldCurrentRow, rowKey)
|
|
58
|
-
setCurrentRowByKey(currentRowKey)
|
|
59
|
-
} else {
|
|
60
|
-
currentRow.value = null
|
|
61
|
-
}
|
|
62
|
-
if (currentRow.value === null) {
|
|
63
|
-
instance.emit('current-change', null, oldCurrentRow)
|
|
64
|
-
}
|
|
65
|
-
} else if (_currentRowKey.value) {
|
|
66
|
-
// 把初始时下设置的 rowKey 转化成 rowData
|
|
67
|
-
setCurrentRowByKey(_currentRowKey.value)
|
|
68
|
-
restoreCurrentRowKey()
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
setCurrentRowKey,
|
|
74
|
-
restoreCurrentRowKey,
|
|
75
|
-
setCurrentRowByKey,
|
|
76
|
-
updateCurrentRow,
|
|
77
|
-
updateCurrentRowData,
|
|
78
|
-
states: {
|
|
79
|
-
_currentRowKey,
|
|
80
|
-
currentRow,
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default useCurrent
|