ll-plus 1.0.0 → 2.0.1
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/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
- package/es/component.mjs +8 -0
- package/es/component.mjs.map +1 -0
- package/es/components/icon/index.d.ts +55 -10
- package/es/components/icon/index.mjs +10 -0
- package/es/components/icon/index.mjs.map +1 -0
- package/es/components/icon/src/icon.d.ts +27 -3
- package/es/components/icon/src/icon.mjs +34 -0
- package/es/components/icon/src/icon.mjs.map +1 -0
- package/es/components/icon/src/icon.vue.d.ts +56 -10
- package/es/components/icon/src/icon.vue.mjs +8 -0
- package/es/components/icon/src/icon.vue.mjs.map +1 -0
- package/es/components/icon/src/icon.vue2.mjs +59 -0
- package/es/components/icon/src/icon.vue2.mjs.map +1 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +7 -0
- package/es/components/index.mjs.map +1 -0
- package/es/components/table/index.d.ts +592 -0
- package/es/components/table/index.mjs +10 -0
- package/es/components/table/index.mjs.map +1 -0
- package/es/components/table/src/components/header-search.vue.d.ts +110 -0
- package/es/components/table/src/components/header-search.vue.mjs +8 -0
- package/es/components/table/src/components/header-search.vue.mjs.map +1 -0
- package/es/components/table/src/components/header-search.vue2.mjs +125 -0
- package/es/components/table/src/components/header-search.vue2.mjs.map +1 -0
- package/es/components/table/src/components/main-table.vue.d.ts +254 -0
- package/es/components/table/src/components/main-table.vue.mjs +8 -0
- package/es/components/table/src/components/main-table.vue.mjs.map +1 -0
- package/es/components/table/src/components/main-table.vue2.mjs +549 -0
- package/es/components/table/src/components/main-table.vue2.mjs.map +1 -0
- package/es/components/table/src/components/pagination.vue.d.ts +65 -0
- package/es/components/table/src/components/pagination.vue.mjs +8 -0
- package/es/components/table/src/components/pagination.vue.mjs.map +1 -0
- package/es/components/table/src/components/pagination.vue2.mjs +37 -0
- package/es/components/table/src/components/pagination.vue2.mjs.map +1 -0
- package/es/components/table/src/table.d.ts +148 -0
- package/es/components/table/src/table.mjs +196 -0
- package/es/components/table/src/table.mjs.map +1 -0
- package/es/components/table/src/table.vue.d.ts +586 -0
- package/es/components/table/src/table.vue.mjs +8 -0
- package/es/components/table/src/table.vue.mjs.map +1 -0
- package/es/components/table/src/table.vue2.mjs +134 -0
- package/es/components/table/src/table.vue2.mjs.map +1 -0
- package/es/defaults.d.ts +4 -0
- package/es/defaults.mjs +8 -0
- package/es/defaults.mjs.map +1 -0
- package/es/index.d.ts +4 -6
- package/es/index.mjs +12 -0
- package/es/index.mjs.map +1 -0
- package/es/ll-plus/defaults.d.ts +4 -0
- package/es/ll-plus/index.d.ts +4 -0
- package/es/ll-plus/make-installer.d.ts +4 -0
- package/es/locale/index.d.ts +10 -0
- package/es/locale/index.mjs +6 -0
- package/es/locale/index.mjs.map +1 -0
- package/es/locale/lang/en_US.d.ts +144 -0
- package/es/locale/lang/en_US.mjs +147 -0
- package/es/locale/lang/en_US.mjs.map +1 -0
- package/es/locale/lang/zh_CN.d.ts +169 -0
- package/es/locale/lang/zh_CN.mjs +172 -0
- package/es/locale/lang/zh_CN.mjs.map +1 -0
- package/es/locale/lang/zh_TW.d.ts +125 -0
- package/es/locale/lang/zh_TW.mjs +128 -0
- package/es/locale/lang/zh_TW.mjs.map +1 -0
- package/es/make-installer.d.ts +4 -0
- package/es/make-installer.mjs +12 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/utils/add-unit.mjs +7 -0
- package/es/utils/add-unit.mjs.map +1 -0
- package/es/utils/create-namespace.mjs +40 -0
- package/es/utils/create-namespace.mjs.map +1 -0
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.mjs +8 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/props/index.d.ts +3 -0
- package/es/utils/props/index.mjs +6 -0
- package/es/utils/props/index.mjs.map +1 -0
- package/es/utils/props/runtime.d.ts +29 -0
- package/es/utils/props/runtime.mjs +53 -0
- package/es/utils/props/runtime.mjs.map +1 -0
- package/es/utils/props/types.d.ts +120 -0
- package/es/utils/props/types.mjs +2 -0
- package/es/utils/props/types.mjs.map +1 -0
- package/es/utils/props/util.d.ts +8 -0
- package/es/utils/props/util.mjs +2 -0
- package/es/utils/props/util.mjs.map +1 -0
- package/es/utils/types.d.ts +10 -0
- package/es/utils/types.mjs +30 -0
- package/es/utils/types.mjs.map +1 -0
- package/es/utils/with-install.mjs +10 -0
- package/es/utils/with-install.mjs.map +1 -0
- package/global.d.ts +11 -0
- package/index.full.js +8305 -0
- package/index.full.min.js +25 -0
- package/index.full.min.js.map +1 -0
- package/index.full.min.mjs +25 -0
- package/index.full.min.mjs.map +1 -0
- package/index.full.mjs +8288 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +14 -0
- package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/lib/component.js +12 -0
- package/lib/component.js.map +1 -0
- package/lib/components/icon/index.d.ts +55 -10
- package/lib/components/icon/index.js +8 -31
- package/lib/components/icon/index.js.map +1 -0
- package/lib/components/icon/src/icon.d.ts +27 -3
- package/lib/components/icon/src/icon.js +36 -0
- package/lib/components/icon/src/icon.js.map +1 -0
- package/lib/components/icon/src/icon.vue.d.ts +56 -10
- package/lib/components/icon/src/icon.vue.js +12 -0
- package/lib/components/icon/src/icon.vue.js.map +1 -0
- package/lib/components/icon/src/icon.vue2.js +63 -0
- package/lib/components/icon/src/icon.vue2.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +15 -8
- package/lib/components/index.js.map +1 -0
- package/lib/components/table/index.d.ts +592 -0
- package/lib/components/table/index.js +21 -0
- package/lib/components/table/index.js.map +1 -0
- package/lib/components/table/src/components/header-search.vue.d.ts +110 -0
- package/lib/components/table/src/components/header-search.vue.js +12 -0
- package/lib/components/table/src/components/header-search.vue.js.map +1 -0
- package/lib/components/table/src/components/header-search.vue2.js +129 -0
- package/lib/components/table/src/components/header-search.vue2.js.map +1 -0
- package/lib/components/table/src/components/main-table.vue.d.ts +254 -0
- package/lib/components/table/src/components/main-table.vue.js +12 -0
- package/lib/components/table/src/components/main-table.vue.js.map +1 -0
- package/lib/components/table/src/components/main-table.vue2.js +553 -0
- package/lib/components/table/src/components/main-table.vue2.js.map +1 -0
- package/lib/components/table/src/components/pagination.vue.d.ts +65 -0
- package/lib/components/table/src/components/pagination.vue.js +12 -0
- package/lib/components/table/src/components/pagination.vue.js.map +1 -0
- package/lib/components/table/src/components/pagination.vue2.js +41 -0
- package/lib/components/table/src/components/pagination.vue2.js.map +1 -0
- package/lib/components/table/src/table.d.ts +148 -0
- package/lib/components/table/src/table.js +203 -0
- package/lib/components/table/src/table.js.map +1 -0
- package/lib/components/table/src/table.vue.d.ts +586 -0
- package/lib/components/table/src/table.vue.js +12 -0
- package/lib/components/table/src/table.vue.js.map +1 -0
- package/lib/components/table/src/table.vue2.js +138 -0
- package/lib/components/table/src/table.vue2.js.map +1 -0
- package/lib/defaults.d.ts +4 -0
- package/lib/defaults.js +12 -0
- package/lib/defaults.js.map +1 -0
- package/lib/index.d.ts +4 -6
- package/lib/index.js +20 -15
- package/lib/index.js.map +1 -0
- package/lib/ll-plus/component.d.ts +3 -0
- package/lib/ll-plus/defaults.d.ts +4 -0
- package/lib/ll-plus/index.d.ts +4 -0
- package/lib/ll-plus/make-installer.d.ts +4 -0
- package/lib/locale/index.d.ts +10 -0
- package/lib/locale/index.js +12 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/lang/en_US.d.ts +144 -0
- package/lib/locale/lang/en_US.js +151 -0
- package/lib/locale/lang/en_US.js.map +1 -0
- package/lib/locale/lang/zh_CN.d.ts +169 -0
- package/lib/locale/lang/zh_CN.js +176 -0
- package/lib/locale/lang/zh_CN.js.map +1 -0
- package/lib/locale/lang/zh_TW.d.ts +125 -0
- package/lib/locale/lang/zh_TW.js +132 -0
- package/lib/locale/lang/zh_TW.js.map +1 -0
- package/lib/make-installer.d.ts +4 -0
- package/lib/make-installer.js +14 -0
- package/lib/make-installer.js.map +1 -0
- package/lib/utils/add-unit.js +9 -0
- package/lib/utils/add-unit.js.map +1 -0
- package/lib/utils/create-namespace.js +34 -34
- package/lib/utils/create-namespace.js.map +1 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +18 -18
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/props/index.d.ts +3 -0
- package/lib/utils/props/index.js +14 -0
- package/lib/utils/props/index.js.map +1 -0
- package/lib/utils/props/runtime.d.ts +29 -0
- package/lib/utils/props/runtime.js +59 -0
- package/lib/utils/props/runtime.js.map +1 -0
- package/lib/utils/props/types.d.ts +120 -0
- package/lib/utils/props/types.js +4 -0
- package/lib/utils/props/types.js.map +1 -0
- package/lib/utils/props/util.d.ts +8 -0
- package/lib/utils/props/util.js +4 -0
- package/lib/utils/props/util.js.map +1 -0
- package/lib/utils/types.d.ts +10 -0
- package/lib/utils/types.js +70 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/with-install.js +8 -6
- package/lib/utils/with-install.js.map +1 -0
- package/package.json +39 -3
- package/theme-chalk/css/icon.css +1 -1
- package/theme-chalk/css/index.css +5 -1
- package/theme-chalk/css/table.css +5 -0
- package/theme-chalk/fonts/iconfont.js +1 -0
- package/theme-chalk/fonts/iconfont.json +1262 -0
- package/types/packages/component.d.ts +3 -0
- package/types/packages/components/icon/index.d.ts +79 -0
- package/types/packages/components/icon/src/icon.d.ts +30 -0
- package/types/packages/components/icon/src/icon.vue.d.ts +73 -0
- package/types/packages/components/index.d.ts +2 -0
- package/types/packages/components/table/index.d.ts +592 -0
- package/types/packages/components/table/src/components/header-search.vue.d.ts +110 -0
- package/types/packages/components/table/src/components/main-table.vue.d.ts +254 -0
- package/types/packages/components/table/src/components/pagination.vue.d.ts +65 -0
- package/types/packages/components/table/src/table.d.ts +148 -0
- package/types/packages/components/table/src/table.vue.d.ts +586 -0
- package/types/packages/defaults.d.ts +4 -0
- package/types/packages/index.d.ts +4 -0
- package/types/packages/ll-plus/component.d.ts +3 -0
- package/types/packages/ll-plus/defaults.d.ts +4 -0
- package/types/packages/ll-plus/index.d.ts +4 -0
- package/types/packages/ll-plus/make-installer.d.ts +4 -0
- package/types/packages/locale/index.d.ts +10 -0
- package/types/packages/locale/lang/en_US.d.ts +144 -0
- package/types/packages/locale/lang/zh_CN.d.ts +169 -0
- package/types/packages/locale/lang/zh_TW.d.ts +125 -0
- package/types/packages/make-installer.d.ts +4 -0
- package/types/{utils → packages/utils}/index.d.ts +2 -1
- package/types/packages/utils/props/index.d.ts +3 -0
- package/types/packages/utils/props/runtime.d.ts +29 -0
- package/types/packages/utils/props/types.d.ts +120 -0
- package/types/packages/utils/props/util.d.ts +8 -0
- package/types/packages/utils/types.d.ts +10 -0
- package/types/tsconfig.web.tsbuildinfo +1 -0
- package/entry/types/index.d.ts +0 -6
- package/es/components/icon/index.js +0 -33
- package/es/components/index.js +0 -1
- package/es/components.js +0 -5
- package/es/index.js +0 -11
- package/es/utils/add-util.js +0 -3
- package/es/utils/create-namespace.js +0 -38
- package/es/utils/index.js +0 -3
- package/es/utils/with-install.js +0 -6
- package/index.esm.js +0 -91
- package/index.js +0 -101
- package/lib/components.js +0 -9
- package/lib/utils/add-util.js +0 -7
- package/theme-chalk/fonts/iconfont.ttf +0 -0
- package/theme-chalk/fonts/iconfont.woff +0 -0
- package/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/types/components/icon/index.d.ts +0 -34
- package/types/components/icon/src/icon.d.ts +0 -6
- package/types/components/icon/src/icon.vue.d.ts +0 -27
- package/types/components/index.d.ts +0 -1
- /package/{entry/types/components.d.ts → es/component.d.ts} +0 -0
- /package/es/{components.d.ts → ll-plus/component.d.ts} +0 -0
- /package/es/utils/{add-util.d.ts → add-unit.d.ts} +0 -0
- /package/lib/{components.d.ts → component.d.ts} +0 -0
- /package/lib/utils/{add-util.d.ts → add-unit.d.ts} +0 -0
- /package/types/{utils/add-util.d.ts → packages/utils/add-unit.d.ts} +0 -0
- /package/types/{utils → packages/utils}/create-namespace.d.ts +0 -0
- /package/types/{utils → packages/utils}/with-install.d.ts +0 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, ref, watch, computed, resolveComponent, openBlock, createBlock, mergeProps, unref, withCtx, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, createCommentVNode, createTextVNode, Fragment, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
|
+
import '../../../../utils/index.mjs';
|
|
3
|
+
import draggable from 'vuedraggable';
|
|
4
|
+
import { mainTableProps } from '../table.mjs';
|
|
5
|
+
import { createNamespace } from '../../../../utils/create-namespace.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "TableMain"
|
|
11
|
+
},
|
|
12
|
+
__name: "main-table",
|
|
13
|
+
props: mainTableProps,
|
|
14
|
+
emits: ["handleChangeDataSource"],
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emits = __emit;
|
|
18
|
+
const attrs = useAttrs();
|
|
19
|
+
const newColumns = ref([]);
|
|
20
|
+
const settingColumns = ref([]);
|
|
21
|
+
const newDataSource = ref([]);
|
|
22
|
+
const newExpandedRowKeys = ref([]);
|
|
23
|
+
let preIndex = -1;
|
|
24
|
+
let nextIndex = -1;
|
|
25
|
+
const bem = createNamespace("table");
|
|
26
|
+
const handleAddSerialNumberAndOperateToColumns = () => {
|
|
27
|
+
if (props.showIndexColumn) {
|
|
28
|
+
newColumns.value.unshift({
|
|
29
|
+
title: "#",
|
|
30
|
+
dataIndex: "#",
|
|
31
|
+
key: "#",
|
|
32
|
+
width: 50,
|
|
33
|
+
fixed: "left",
|
|
34
|
+
class: "table-serial-number-cell"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (props.showOperate) {
|
|
38
|
+
newColumns.value.push({
|
|
39
|
+
title: "\u64CD\u4F5C",
|
|
40
|
+
dataIndex: "",
|
|
41
|
+
key: "operate",
|
|
42
|
+
width: 120,
|
|
43
|
+
fixed: "right",
|
|
44
|
+
class: "table-serial-operate-cell"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const handleColumnsSortByFixed = (list, isDrag) => {
|
|
49
|
+
const newList = list;
|
|
50
|
+
const leftFixedColumns = [], normalFixedColumns = [], rightFixedColumns = [];
|
|
51
|
+
newList.forEach((item) => {
|
|
52
|
+
const fixed = item.fixed;
|
|
53
|
+
if (fixed === "left") {
|
|
54
|
+
leftFixedColumns.push(item);
|
|
55
|
+
} else if (fixed === "right") {
|
|
56
|
+
rightFixedColumns.push(item);
|
|
57
|
+
} else {
|
|
58
|
+
normalFixedColumns.push(item);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
leftFixedColumns.sort(
|
|
62
|
+
(a, b) => a.columnSortIndex - b.columnSortIndex
|
|
63
|
+
);
|
|
64
|
+
normalFixedColumns.sort(
|
|
65
|
+
(a, b) => a.columnSortIndex - b.columnSortIndex
|
|
66
|
+
);
|
|
67
|
+
rightFixedColumns.sort(
|
|
68
|
+
(a, b) => a.columnSortIndex - b.columnSortIndex
|
|
69
|
+
);
|
|
70
|
+
newColumns.value = [
|
|
71
|
+
...leftFixedColumns,
|
|
72
|
+
...normalFixedColumns,
|
|
73
|
+
...rightFixedColumns
|
|
74
|
+
];
|
|
75
|
+
if (isDrag) {
|
|
76
|
+
handleAddSerialNumberAndOperateToColumns();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
watch(
|
|
80
|
+
() => props.dataSource,
|
|
81
|
+
(newValue) => {
|
|
82
|
+
newDataSource.value = [...newValue];
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
deep: true,
|
|
86
|
+
immediate: true
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
watch(
|
|
90
|
+
() => [
|
|
91
|
+
props.columns,
|
|
92
|
+
props.settingKey,
|
|
93
|
+
props.showIndexColumn,
|
|
94
|
+
props.showOperate
|
|
95
|
+
],
|
|
96
|
+
(arr) => {
|
|
97
|
+
const [newValue, key] = arr;
|
|
98
|
+
let newcolumns = [];
|
|
99
|
+
if (key && localStorage.getItem(key)) {
|
|
100
|
+
const localStorageColumns = localStorage.getItem(key);
|
|
101
|
+
if (localStorageColumns) {
|
|
102
|
+
newcolumns = JSON.parse(localStorageColumns);
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
newcolumns = newValue.map((item, index) => ({
|
|
106
|
+
...item,
|
|
107
|
+
isCheck: true,
|
|
108
|
+
columnSortIndex: item.columnSortIndex === 0 || item.columnSortIndex ? item.columnSortIndex : index
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
newColumns.value = [...newcolumns].filter((item) => item.isCheck);
|
|
112
|
+
handleAddSerialNumberAndOperateToColumns();
|
|
113
|
+
handleColumnsSortByFixed(newColumns.value);
|
|
114
|
+
settingColumns.value = [...newcolumns];
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
deep: true,
|
|
118
|
+
immediate: true
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
watch(
|
|
122
|
+
() => props.expandedRowKeys,
|
|
123
|
+
(newValue) => {
|
|
124
|
+
newExpandedRowKeys.value = [...newValue];
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
deep: true,
|
|
128
|
+
immediate: true
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
const handleExpand = (expanded, record) => {
|
|
132
|
+
if (expanded) {
|
|
133
|
+
newExpandedRowKeys.value.push(record.id);
|
|
134
|
+
} else {
|
|
135
|
+
const index = newExpandedRowKeys.value.findIndex(
|
|
136
|
+
(e) => e === record.id
|
|
137
|
+
);
|
|
138
|
+
newExpandedRowKeys.value.splice(index, 1);
|
|
139
|
+
}
|
|
140
|
+
props.expand && props.expand(expanded, record);
|
|
141
|
+
};
|
|
142
|
+
const handleResizeColumn = (w, col) => {
|
|
143
|
+
col.width = w;
|
|
144
|
+
props.resizeColumn && props.resizeColumn(w, col);
|
|
145
|
+
};
|
|
146
|
+
const dragCustomRow = (_, index) => {
|
|
147
|
+
const normalConfig = {
|
|
148
|
+
props: {
|
|
149
|
+
// draggable: 'true'
|
|
150
|
+
},
|
|
151
|
+
draggable: true,
|
|
152
|
+
style: {
|
|
153
|
+
cursor: "pointer"
|
|
154
|
+
},
|
|
155
|
+
// 鼠标移入
|
|
156
|
+
onMouseenter: (event) => {
|
|
157
|
+
const target = event.target;
|
|
158
|
+
target.draggable = true;
|
|
159
|
+
},
|
|
160
|
+
// 开始拖拽
|
|
161
|
+
onDragstart: (event) => {
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
preIndex = index;
|
|
164
|
+
},
|
|
165
|
+
// 拖动元素经过的元素
|
|
166
|
+
onDragover: (event) => {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
},
|
|
169
|
+
// 鼠标松开
|
|
170
|
+
onDrop: (event) => {
|
|
171
|
+
let sortSource = [];
|
|
172
|
+
event.stopPropagation();
|
|
173
|
+
nextIndex = index;
|
|
174
|
+
const dataSource = newDataSource.value;
|
|
175
|
+
const preItem = { ...dataSource[preIndex] };
|
|
176
|
+
const nextItem = { ...dataSource[nextIndex] };
|
|
177
|
+
const preSort = preItem.sort;
|
|
178
|
+
const nextSort = nextItem.sort;
|
|
179
|
+
preItem.sort = nextSort;
|
|
180
|
+
nextItem.sort = preSort;
|
|
181
|
+
dataSource[preIndex] = nextItem;
|
|
182
|
+
dataSource[nextIndex] = preItem;
|
|
183
|
+
sortSource = [...dataSource];
|
|
184
|
+
emits("handleChangeDataSource", sortSource);
|
|
185
|
+
props.dragChange && props.dragChange(sortSource);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const extraConfig = props.customRowProps ? { ...props.customRowProps(_, index) } : {};
|
|
189
|
+
return { ...normalConfig, ...extraConfig };
|
|
190
|
+
};
|
|
191
|
+
const isAllCheck = computed(() => {
|
|
192
|
+
return settingColumns.value.every((item) => item.isCheck);
|
|
193
|
+
});
|
|
194
|
+
const isIndeterminate = computed(() => {
|
|
195
|
+
const getIsChecks = settingColumns.value.filter((item) => item.isCheck);
|
|
196
|
+
return getIsChecks.length === 0 ? false : settingColumns.value.length > getIsChecks.length;
|
|
197
|
+
});
|
|
198
|
+
const handleChangeColumns = () => {
|
|
199
|
+
const isCheckSettingColumns = settingColumns.value.filter(
|
|
200
|
+
(item, index) => {
|
|
201
|
+
item.columnSortIndex = index;
|
|
202
|
+
return item.isCheck;
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
handleColumnsSortByFixed(isCheckSettingColumns, true);
|
|
206
|
+
};
|
|
207
|
+
const handleColumnItemChange = (value, item) => {
|
|
208
|
+
const findSettingIndex = settingColumns.value.findIndex(
|
|
209
|
+
(citem) => item.key === citem.key
|
|
210
|
+
);
|
|
211
|
+
if (findSettingIndex > -1) {
|
|
212
|
+
settingColumns.value[findSettingIndex].isCheck = value;
|
|
213
|
+
handleChangeColumns();
|
|
214
|
+
handleClickSubmitBtn();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const handleAllColumnChange = (e) => {
|
|
218
|
+
const checked = e.target.checked;
|
|
219
|
+
settingColumns.value.forEach((item) => item.isCheck = checked);
|
|
220
|
+
if (checked) {
|
|
221
|
+
newColumns.value = [...props.columns];
|
|
222
|
+
} else {
|
|
223
|
+
newColumns.value = [];
|
|
224
|
+
}
|
|
225
|
+
handleAddSerialNumberAndOperateToColumns();
|
|
226
|
+
handleClickSubmitBtn();
|
|
227
|
+
};
|
|
228
|
+
const dragChange = () => {
|
|
229
|
+
handleChangeColumns();
|
|
230
|
+
handleClickSubmitBtn();
|
|
231
|
+
};
|
|
232
|
+
const handleClickResetBtn = () => {
|
|
233
|
+
const newcolumns = props.columns.map((item, index) => ({
|
|
234
|
+
...item,
|
|
235
|
+
isCheck: true,
|
|
236
|
+
columnSortIndex: index
|
|
237
|
+
}));
|
|
238
|
+
newColumns.value = [...newcolumns];
|
|
239
|
+
handleAddSerialNumberAndOperateToColumns();
|
|
240
|
+
settingColumns.value = [...newcolumns];
|
|
241
|
+
handleClickSubmitBtn();
|
|
242
|
+
};
|
|
243
|
+
const handleClickSubmitBtn = () => {
|
|
244
|
+
if (props.settingKey) {
|
|
245
|
+
localStorage.setItem(props.settingKey, JSON.stringify(settingColumns.value));
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const handleColumnMove = (element, way) => {
|
|
249
|
+
const fixed = element.fixed;
|
|
250
|
+
if (fixed === way) {
|
|
251
|
+
element.fixed = false;
|
|
252
|
+
} else {
|
|
253
|
+
element.fixed = way;
|
|
254
|
+
}
|
|
255
|
+
handleColumnsSortByFixed(newColumns.value);
|
|
256
|
+
handleClickSubmitBtn();
|
|
257
|
+
};
|
|
258
|
+
return (_ctx, _cache) => {
|
|
259
|
+
var _a, _b, _c, _d;
|
|
260
|
+
const _component_a_checkbox = resolveComponent("a-checkbox");
|
|
261
|
+
const _component_ll_icon = resolveComponent("ll-icon");
|
|
262
|
+
const _component_a_button = resolveComponent("a-button");
|
|
263
|
+
const _component_a_divider = resolveComponent("a-divider");
|
|
264
|
+
const _component_a_popover = resolveComponent("a-popover");
|
|
265
|
+
const _component_a_table = resolveComponent("a-table");
|
|
266
|
+
return openBlock(), createBlock(_component_a_table, mergeProps({
|
|
267
|
+
class: `${unref(bem).e("main-content")}`,
|
|
268
|
+
"row-key": "id"
|
|
269
|
+
}, unref(attrs), {
|
|
270
|
+
columns: newColumns.value,
|
|
271
|
+
"data-source": newDataSource.value,
|
|
272
|
+
"expanded-row-keys": newExpandedRowKeys.value,
|
|
273
|
+
"custom-row": props.showDrag ? dragCustomRow : _ctx.customRowProps,
|
|
274
|
+
pagination: false,
|
|
275
|
+
"show-header": "",
|
|
276
|
+
scroll: {
|
|
277
|
+
scrollToFirstRowOnChange: true,
|
|
278
|
+
x: ((_a = props == null ? void 0 : props.scroll) == null ? void 0 : _a.x) ? (_b = props == null ? void 0 : props.scroll) == null ? void 0 : _b.x : "max-content",
|
|
279
|
+
y: ((_c = props == null ? void 0 : props.scroll) == null ? void 0 : _c.y) ? (_d = props == null ? void 0 : props.scroll) == null ? void 0 : _d.y : "100%"
|
|
280
|
+
},
|
|
281
|
+
onExpand: handleExpand,
|
|
282
|
+
onResizeColumn: handleResizeColumn,
|
|
283
|
+
onChange: props.change,
|
|
284
|
+
onExpandedRowsChange: props.expandedRowsChange
|
|
285
|
+
}), {
|
|
286
|
+
headerCell: withCtx((slots) => [
|
|
287
|
+
slots.column.key === "operate" && _ctx.showSetting ? (openBlock(), createElementBlock(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
key: 0,
|
|
291
|
+
class: normalizeClass(`${unref(bem).e("operate")}`)
|
|
292
|
+
},
|
|
293
|
+
[
|
|
294
|
+
createElementVNode(
|
|
295
|
+
"span",
|
|
296
|
+
null,
|
|
297
|
+
toDisplayString(slots.column.title),
|
|
298
|
+
1
|
|
299
|
+
/* TEXT */
|
|
300
|
+
),
|
|
301
|
+
createVNode(_component_a_popover, {
|
|
302
|
+
trigger: "click",
|
|
303
|
+
placement: "bottomRight",
|
|
304
|
+
"overlay-inner-style": {
|
|
305
|
+
padding: "0"
|
|
306
|
+
}
|
|
307
|
+
}, {
|
|
308
|
+
content: withCtx(() => [
|
|
309
|
+
createElementVNode(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
class: normalizeClass(`${unref(bem).e("setting-popover")}`)
|
|
313
|
+
},
|
|
314
|
+
[
|
|
315
|
+
createCommentVNode(" \u5934\u90E8 "),
|
|
316
|
+
createElementVNode(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-header")}`)
|
|
320
|
+
},
|
|
321
|
+
[
|
|
322
|
+
createVNode(_component_a_checkbox, {
|
|
323
|
+
indeterminate: isIndeterminate.value,
|
|
324
|
+
checked: isAllCheck.value,
|
|
325
|
+
onChange: handleAllColumnChange
|
|
326
|
+
}, {
|
|
327
|
+
default: withCtx(() => [
|
|
328
|
+
createTextVNode(" \u5217\u5C55\u793A ")
|
|
329
|
+
]),
|
|
330
|
+
_: 1
|
|
331
|
+
/* STABLE */
|
|
332
|
+
}, 8, ["indeterminate", "checked"]),
|
|
333
|
+
createElementVNode(
|
|
334
|
+
"span",
|
|
335
|
+
{
|
|
336
|
+
class: normalizeClass(`${unref(bem).e("setting-reset-btn")}`),
|
|
337
|
+
onClick: handleClickResetBtn
|
|
338
|
+
},
|
|
339
|
+
" \u91CD\u7F6E ",
|
|
340
|
+
2
|
|
341
|
+
/* CLASS */
|
|
342
|
+
)
|
|
343
|
+
],
|
|
344
|
+
2
|
|
345
|
+
/* CLASS */
|
|
346
|
+
),
|
|
347
|
+
createCommentVNode(" \u5185\u5BB9 "),
|
|
348
|
+
createElementVNode(
|
|
349
|
+
"div",
|
|
350
|
+
{
|
|
351
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-content")}`)
|
|
352
|
+
},
|
|
353
|
+
[
|
|
354
|
+
createElementVNode("div", null, [
|
|
355
|
+
createVNode(unref(draggable), {
|
|
356
|
+
list: settingColumns.value,
|
|
357
|
+
"item-key": "key",
|
|
358
|
+
group: { name: "g1" },
|
|
359
|
+
onChange: dragChange
|
|
360
|
+
}, {
|
|
361
|
+
item: withCtx(({ element }) => [
|
|
362
|
+
createElementVNode(
|
|
363
|
+
"div",
|
|
364
|
+
{
|
|
365
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-menu")}`)
|
|
366
|
+
},
|
|
367
|
+
[
|
|
368
|
+
createCommentVNode(" \u62D6\u62FD "),
|
|
369
|
+
createElementVNode(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
class: normalizeClass(`flex items-center ${unref(bem).e(
|
|
373
|
+
"setting-popover-menu-left"
|
|
374
|
+
)}`)
|
|
375
|
+
},
|
|
376
|
+
[
|
|
377
|
+
createVNode(_component_a_button, {
|
|
378
|
+
type: "text",
|
|
379
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-menu-icon")}`),
|
|
380
|
+
style: {
|
|
381
|
+
marginright: "5px"
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
default: withCtx(() => [
|
|
385
|
+
createVNode(_component_ll_icon, {
|
|
386
|
+
"icon-name": "icon-move",
|
|
387
|
+
"class-name": "icon"
|
|
388
|
+
})
|
|
389
|
+
]),
|
|
390
|
+
_: 1
|
|
391
|
+
/* STABLE */
|
|
392
|
+
}, 8, ["class"]),
|
|
393
|
+
createVNode(_component_a_checkbox, {
|
|
394
|
+
checked: element.isCheck,
|
|
395
|
+
onChange: (e) => {
|
|
396
|
+
var _a2;
|
|
397
|
+
handleColumnItemChange((_a2 = e.target) == null ? void 0 : _a2.checked, element);
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
default: withCtx(() => [
|
|
401
|
+
createTextVNode(
|
|
402
|
+
toDisplayString(element.title),
|
|
403
|
+
1
|
|
404
|
+
/* TEXT */
|
|
405
|
+
)
|
|
406
|
+
]),
|
|
407
|
+
_: 2
|
|
408
|
+
/* DYNAMIC */
|
|
409
|
+
}, 1032, ["checked", "onChange"])
|
|
410
|
+
],
|
|
411
|
+
2
|
|
412
|
+
/* CLASS */
|
|
413
|
+
),
|
|
414
|
+
createElementVNode(
|
|
415
|
+
"div",
|
|
416
|
+
{
|
|
417
|
+
class: normalizeClass(`flex items-center ${unref(bem).e(
|
|
418
|
+
"setting-popover-menu-right"
|
|
419
|
+
)}`)
|
|
420
|
+
},
|
|
421
|
+
[
|
|
422
|
+
createCommentVNode(" \u5DE6\u79FB "),
|
|
423
|
+
createVNode(_component_a_button, {
|
|
424
|
+
type: "text",
|
|
425
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-menu-icon")}`),
|
|
426
|
+
onClick: ($event) => handleColumnMove(element, "left")
|
|
427
|
+
}, {
|
|
428
|
+
default: withCtx(() => [
|
|
429
|
+
createVNode(_component_ll_icon, {
|
|
430
|
+
"icon-name": "icon-zuoyi",
|
|
431
|
+
"class-name": `icon ${element.fixed === "left" ? unref(bem).e("setting-popover-menu-fixed-icon") : ""}`
|
|
432
|
+
}, null, 8, ["class-name"])
|
|
433
|
+
]),
|
|
434
|
+
_: 2
|
|
435
|
+
/* DYNAMIC */
|
|
436
|
+
}, 1032, ["class", "onClick"]),
|
|
437
|
+
createVNode(_component_a_divider, { type: "vertical" }),
|
|
438
|
+
createCommentVNode(" \u53F3\u79FB "),
|
|
439
|
+
createVNode(_component_a_button, {
|
|
440
|
+
type: "text",
|
|
441
|
+
class: normalizeClass(`${unref(bem).e("setting-popover-menu-icon")}`),
|
|
442
|
+
onClick: ($event) => handleColumnMove(element, "right")
|
|
443
|
+
}, {
|
|
444
|
+
default: withCtx(() => [
|
|
445
|
+
createVNode(_component_ll_icon, {
|
|
446
|
+
"icon-name": "icon-youyi",
|
|
447
|
+
"class-name": `icon ${element.fixed === "right" ? unref(bem).e("setting-popover-menu-fixed-icon") : ""}`
|
|
448
|
+
}, null, 8, ["class-name"])
|
|
449
|
+
]),
|
|
450
|
+
_: 2
|
|
451
|
+
/* DYNAMIC */
|
|
452
|
+
}, 1032, ["class", "onClick"])
|
|
453
|
+
],
|
|
454
|
+
2
|
|
455
|
+
/* CLASS */
|
|
456
|
+
)
|
|
457
|
+
],
|
|
458
|
+
2
|
|
459
|
+
/* CLASS */
|
|
460
|
+
)
|
|
461
|
+
]),
|
|
462
|
+
_: 1
|
|
463
|
+
/* STABLE */
|
|
464
|
+
}, 8, ["list"])
|
|
465
|
+
])
|
|
466
|
+
],
|
|
467
|
+
2
|
|
468
|
+
/* CLASS */
|
|
469
|
+
)
|
|
470
|
+
],
|
|
471
|
+
2
|
|
472
|
+
/* CLASS */
|
|
473
|
+
)
|
|
474
|
+
]),
|
|
475
|
+
default: withCtx(() => [
|
|
476
|
+
createVNode(_component_a_button, {
|
|
477
|
+
type: "text",
|
|
478
|
+
class: normalizeClass(`${unref(bem).e("setting-icon")}`)
|
|
479
|
+
}, {
|
|
480
|
+
default: withCtx(() => [
|
|
481
|
+
createVNode(_component_ll_icon, { "icon-name": "icon-set-line" })
|
|
482
|
+
]),
|
|
483
|
+
_: 1
|
|
484
|
+
/* STABLE */
|
|
485
|
+
}, 8, ["class"])
|
|
486
|
+
]),
|
|
487
|
+
_: 1
|
|
488
|
+
/* STABLE */
|
|
489
|
+
})
|
|
490
|
+
],
|
|
491
|
+
2
|
|
492
|
+
/* CLASS */
|
|
493
|
+
)) : (openBlock(), createElementBlock(
|
|
494
|
+
Fragment,
|
|
495
|
+
{ key: 1 },
|
|
496
|
+
[
|
|
497
|
+
createTextVNode(
|
|
498
|
+
toDisplayString(slots.column.title),
|
|
499
|
+
1
|
|
500
|
+
/* TEXT */
|
|
501
|
+
)
|
|
502
|
+
],
|
|
503
|
+
64
|
|
504
|
+
/* STABLE_FRAGMENT */
|
|
505
|
+
)),
|
|
506
|
+
createCommentVNode(" \u989D\u5916header\u5355\u5143\u683C\u7684\u63D2\u69FD\u5185\u5BB9 "),
|
|
507
|
+
renderSlot(_ctx.$slots, "tableHeaderCell", normalizeProps(guardReactiveProps(slots)))
|
|
508
|
+
]),
|
|
509
|
+
bodyCell: withCtx((slots) => [
|
|
510
|
+
createCommentVNode(" \u6DFB\u52A0\u5E8F\u5217\u5217 "),
|
|
511
|
+
slots.column.key === "#" && _ctx.showIndexColumn ? (openBlock(), createElementBlock(
|
|
512
|
+
Fragment,
|
|
513
|
+
{ key: 0 },
|
|
514
|
+
[
|
|
515
|
+
createTextVNode(
|
|
516
|
+
toDisplayString(slots.index + 1),
|
|
517
|
+
1
|
|
518
|
+
/* TEXT */
|
|
519
|
+
)
|
|
520
|
+
],
|
|
521
|
+
64
|
|
522
|
+
/* STABLE_FRAGMENT */
|
|
523
|
+
)) : slots.column.key === "operate" ? (openBlock(), createElementBlock(
|
|
524
|
+
Fragment,
|
|
525
|
+
{ key: 1 },
|
|
526
|
+
[
|
|
527
|
+
createCommentVNode(" \u6DFB\u52A0\u64CD\u4F5C\u5217 "),
|
|
528
|
+
renderSlot(_ctx.$slots, "tableOperate", normalizeProps(guardReactiveProps(slots)))
|
|
529
|
+
],
|
|
530
|
+
64
|
|
531
|
+
/* STABLE_FRAGMENT */
|
|
532
|
+
)) : createCommentVNode("v-if", true),
|
|
533
|
+
createCommentVNode(" \u989D\u5916Body\u5355\u5143\u683C\u7684\u63D2\u69FD\u5185\u5BB9 "),
|
|
534
|
+
renderSlot(_ctx.$slots, "tableBodyCell", normalizeProps(guardReactiveProps(slots)))
|
|
535
|
+
]),
|
|
536
|
+
emptyText: withCtx(() => [
|
|
537
|
+
renderSlot(_ctx.$slots, "emptyText", {}, () => [
|
|
538
|
+
createCommentVNode(" <ll-empty>\n <template #content>\u6682\u65E0\u6570\u636E</template>\n </ll-empty> ")
|
|
539
|
+
])
|
|
540
|
+
]),
|
|
541
|
+
_: 3
|
|
542
|
+
/* FORWARDED */
|
|
543
|
+
}, 16, ["class", "columns", "data-source", "expanded-row-keys", "custom-row", "scroll", "onChange", "onExpandedRowsChange"]);
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
export { _sfc_main as default };
|
|
549
|
+
//# sourceMappingURL=main-table.vue2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-table.vue2.mjs","sources":["../../../../../../packages/components/table/src/components/main-table.vue"],"sourcesContent":["<template>\n <a-table\n :class=\"`${bem.e('main-content')}`\"\n row-key=\"id\"\n v-bind=\"attrs\"\n :columns=\"newColumns\"\n :data-source=\"newDataSource\"\n :expanded-row-keys=\"newExpandedRowKeys\"\n :custom-row=\"props.showDrag ? dragCustomRow : (customRowProps as any)\"\n :pagination=\"false\"\n show-header\n :scroll=\"{\n scrollToFirstRowOnChange: true,\n x: props?.scroll?.x ? props?.scroll?.x : 'max-content',\n y: props?.scroll?.y ? props?.scroll?.y : '100%'\n }\"\n @expand=\"handleExpand\"\n @resize-column=\"handleResizeColumn\"\n @change=\"props.change\"\n @expanded-rows-change=\"props.expandedRowsChange\"\n >\n <!-- 1.表头插槽 -->\n <template #headerCell=\"slots\">\n <template v-if=\"slots.column.key === 'operate' && showSetting\">\n <div :class=\"`${bem.e('operate')}`\">\n <span>{{ slots.column.title }}</span>\n <a-popover\n trigger=\"click\"\n placement=\"bottomRight\"\n :overlay-inner-style=\"{\n padding: '0'\n }\"\n >\n <template #content>\n <div :class=\"`${bem.e('setting-popover')}`\">\n <!-- 头部 -->\n <div :class=\"`${bem.e('setting-popover-header')}`\">\n <a-checkbox\n :indeterminate=\"isIndeterminate\"\n :checked=\"isAllCheck\"\n @change=\"handleAllColumnChange\"\n >\n 列展示\n </a-checkbox>\n <span\n :class=\"`${bem.e('setting-reset-btn')}`\"\n @click=\"handleClickResetBtn\"\n >\n 重置\n </span>\n </div>\n <!-- 内容 -->\n <div :class=\"`${bem.e('setting-popover-content')}`\">\n <div>\n <draggable\n :list=\"settingColumns\"\n item-key=\"key\"\n :group=\"{ name: 'g1' }\"\n @change=\"dragChange\"\n >\n <template #item=\"{ element }\">\n <div :class=\"`${bem.e('setting-popover-menu')}`\">\n <!-- 拖拽 -->\n <div\n :class=\"`flex items-center ${bem.e(\n 'setting-popover-menu-left'\n )}`\"\n >\n <a-button\n type=\"text\"\n :class=\"`${bem.e('setting-popover-menu-icon')}`\"\n :style=\"{\n marginright: '5px'\n }\"\n >\n <ll-icon\n icon-name=\"icon-move\"\n class-name=\"icon\"\n />\n </a-button>\n <a-checkbox\n :checked=\"element.isCheck\"\n @change=\"\n (e: any) =>\n {\n handleColumnItemChange(e.target?.checked!, element)\n }\n \"\n >\n {{ element.title }}\n </a-checkbox>\n </div>\n <div\n :class=\"`flex items-center ${bem.e(\n 'setting-popover-menu-right'\n )}`\"\n >\n <!-- 左移 -->\n <a-button\n type=\"text\"\n :class=\"`${bem.e('setting-popover-menu-icon')}`\"\n @click=\"handleColumnMove(element, 'left')\"\n >\n <ll-icon\n icon-name=\"icon-zuoyi\"\n :class-name=\"`icon ${\n element.fixed === 'left'\n ? bem.e('setting-popover-menu-fixed-icon')\n : ''\n }`\"\n />\n </a-button>\n <a-divider type=\"vertical\" />\n <!-- 右移 -->\n <a-button\n type=\"text\"\n :class=\"`${bem.e('setting-popover-menu-icon')}`\"\n @click=\"handleColumnMove(element, 'right')\"\n >\n <ll-icon\n icon-name=\"icon-youyi\"\n :class-name=\"`icon ${\n element.fixed === 'right'\n ? bem.e('setting-popover-menu-fixed-icon')\n : ''\n }`\"\n />\n </a-button>\n </div>\n </div>\n </template>\n </draggable>\n </div>\n </div>\n </div>\n </template>\n <a-button type=\"text\" :class=\"`${bem.e('setting-icon')}`\">\n <ll-icon icon-name=\"icon-set-line\" />\n </a-button>\n </a-popover>\n </div>\n </template>\n <template v-else>{{ slots.column.title }}</template>\n <!-- 额外header单元格的插槽内容 -->\n <slot name=\"tableHeaderCell\" v-bind=\"slots\"></slot>\n </template>\n <!-- 2.表格内容插槽 -->\n <template #bodyCell=\"slots\">\n <!-- 添加序列列 -->\n <template v-if=\"slots.column.key === '#' && showIndexColumn\">\n {{ slots.index + 1 }}\n </template>\n <!-- 添加操作列 -->\n <template v-else-if=\"slots.column.key === 'operate'\">\n <slot name=\"tableOperate\" v-bind=\"slots\"></slot>\n </template>\n <!-- 额外Body单元格的插槽内容 -->\n <slot name=\"tableBodyCell\" v-bind=\"slots\"></slot>\n </template>\n <!-- 3.空状态自定义插槽 -->\n <template #emptyText>\n <slot name=\"emptyText\">\n <!-- <ll-empty>\n <template #content>暂无数据</template>\n </ll-empty> -->\n </slot>\n </template>\n </a-table>\n</template>\n<script lang=\"ts\" setup>\nimport { ref, watch, computed, useAttrs } from 'vue'\n\nimport { createNamespace } from '@ll-plus/utils'\n\nimport draggable from 'vuedraggable'\n\nimport { mainTableProps } from '../table'\n\n// 1.defineOptions\ndefineOptions({\n name: 'TableMain'\n})\n\n// 2.props/emits\nconst props = defineProps(mainTableProps)\nconst emits = defineEmits([\"handleChangeDataSource\"])\n\n// 3.hooks\nconst attrs = useAttrs()\n\n// 3.ref/let/const\nconst newColumns: any = ref([]) // 显示在表格的columns\nconst settingColumns: any = ref([])\nconst newDataSource: any = ref([])\nconst newExpandedRowKeys: any = ref([]) //展开的id数组\nlet preIndex = -1 // 源目标数据序号\nlet nextIndex = -1 // 目标数据序号\nconst bem = createNamespace('table')\n\n// 往表格列中添加序号和操作\nconst handleAddSerialNumberAndOperateToColumns = () => {\n if (props.showIndexColumn) {\n newColumns.value.unshift({\n title: '#',\n dataIndex: '#',\n key: '#',\n width: 50,\n fixed: 'left',\n class: 'table-serial-number-cell'\n })\n }\n if (props.showOperate) {\n newColumns.value.push({\n title: '操作',\n dataIndex: '',\n key: 'operate',\n width: 120,\n fixed: 'right',\n class: 'table-serial-operate-cell'\n })\n }\n}\n// 处理表格列的左、右固定排序(letf放最左边,没有定位放中间,右边放right定位)\nconst handleColumnsSortByFixed = (list: any, isDrag?: boolean) => {\n const newList = list\n const leftFixedColumns: any = [],\n normalFixedColumns: any = [],\n rightFixedColumns: any = []\n newList.forEach((item: any) => {\n const fixed = item.fixed\n if (fixed === 'left') {\n leftFixedColumns.push(item)\n } else if (fixed === 'right') {\n rightFixedColumns.push(item)\n } else {\n normalFixedColumns.push(item)\n }\n })\n leftFixedColumns.sort(\n (a: any, b: any) => a.columnSortIndex - b.columnSortIndex\n )\n normalFixedColumns.sort(\n (a: any, b: any) => a.columnSortIndex - b.columnSortIndex\n )\n rightFixedColumns.sort(\n (a: any, b: any) => a.columnSortIndex - b.columnSortIndex\n )\n newColumns.value = [\n ...leftFixedColumns,\n ...normalFixedColumns,\n ...rightFixedColumns\n ]\n if (isDrag) {\n handleAddSerialNumberAndOperateToColumns()\n }\n}\n\n// 4.watch\nwatch(\n () => props.dataSource,\n (newValue: any) => {\n newDataSource.value = [...newValue]\n },\n {\n deep: true,\n immediate: true\n }\n)\n// 从本地存储中获取columns/没有则用用户传的\nwatch(\n () => [\n props.columns,\n props.settingKey,\n props.showIndexColumn,\n props.showOperate\n ],\n (arr: any) => {\n const [newValue, key] = arr\n let newcolumns = []\n // 有key\n if (key && localStorage.getItem(key)) {\n const localStorageColumns = localStorage.getItem(key)\n if (localStorageColumns) {\n newcolumns = JSON.parse(localStorageColumns)\n }\n } else {\n // 没key\n newcolumns = newValue.map((item: any, index: number) => ({\n ...item,\n isCheck: true,\n columnSortIndex:\n item.columnSortIndex === 0 || item.columnSortIndex\n ? item.columnSortIndex\n : index\n }))\n }\n // 1.过滤掉没有选中的\n newColumns.value = [...newcolumns].filter((item: any) => item.isCheck)\n // 2.如果有设置序列和操作,则添加\n handleAddSerialNumberAndOperateToColumns()\n // 3.根据定位来排序\n handleColumnsSortByFixed(newColumns.value)\n settingColumns.value = [...newcolumns]\n },\n {\n deep: true,\n immediate: true\n }\n)\nwatch(\n () => props.expandedRowKeys,\n (newValue: any) => {\n newExpandedRowKeys.value = [...newValue]\n },\n {\n deep: true,\n immediate: true\n }\n)\n// 5.methods\n//重新定义树状展开关闭功能\nconst handleExpand = (expanded: boolean, record: any) => {\n if (expanded) {\n newExpandedRowKeys.value.push(record.id)\n } else {\n const index = newExpandedRowKeys.value.findIndex(\n (e: any) => e === record.id\n )\n newExpandedRowKeys.value.splice(index, 1)\n }\n props.expand && props.expand(expanded, record)\n}\n// 列拖拽\nconst handleResizeColumn = (w: any, col: any) => {\n col.width = w\n props.resizeColumn && props.resizeColumn(w, col)\n}\n// 拖动排序\nconst dragCustomRow = (_: any, index: number) => {\n const normalConfig = {\n props: {\n // draggable: 'true'\n },\n draggable: true,\n style: {\n cursor: 'pointer'\n },\n // 鼠标移入\n onMouseenter: (event: Event) => {\n const target = event.target as HTMLElement\n target.draggable = true // 让你要拖动的行可以拖动,默认不可以\n },\n // 开始拖拽\n onDragstart: (event: Event) => {\n event.stopPropagation()\n preIndex = index\n },\n // 拖动元素经过的元素\n onDragover: (event: Event) => {\n event.preventDefault()\n },\n // 鼠标松开\n onDrop: (event: Event) => {\n let sortSource: any[] = []\n event.stopPropagation()\n // 得到目标数据序号\n nextIndex = index\n const dataSource = newDataSource.value\n // 排序后两个sort互换\n const preItem = { ...dataSource[preIndex] }\n const nextItem = { ...dataSource[nextIndex] }\n const preSort = preItem.sort\n const nextSort = nextItem.sort\n preItem.sort = nextSort\n nextItem.sort = preSort\n\n dataSource[preIndex] = nextItem\n dataSource[nextIndex] = preItem\n sortSource = [...dataSource]\n emits('handleChangeDataSource', sortSource)\n props.dragChange && props.dragChange(sortSource)\n }\n }\n const extraConfig = props.customRowProps\n ? { ...props.customRowProps(_, index) }\n : {}\n return { ...normalConfig, ...extraConfig }\n}\n// 是否全选\nconst isAllCheck = computed(() => {\n return settingColumns.value.every((item: any) => item.isCheck)\n})\n// 是否全选\nconst isIndeterminate = computed(() => {\n const getIsChecks = settingColumns.value.filter((item: any) => item.isCheck)\n return getIsChecks.length === 0\n ? false\n : settingColumns.value.length > getIsChecks.length\n})\n// 单个checkbox的change\nconst handleChangeColumns = () => {\n const isCheckSettingColumns = settingColumns.value.filter(\n (item: any, index: number) => {\n item.columnSortIndex = index\n return item.isCheck\n }\n )\n handleColumnsSortByFixed(isCheckSettingColumns, true)\n}\n\nconst handleColumnItemChange = (value: boolean, item: any) => {\n const findSettingIndex = settingColumns.value.findIndex(\n (citem: any) => item.key === citem.key\n )\n\n if (findSettingIndex > -1) {\n settingColumns.value[findSettingIndex].isCheck = value\n handleChangeColumns()\n handleClickSubmitBtn()\n }\n}\n// 全选change\nconst handleAllColumnChange = (e: any) => {\n const checked = e.target.checked\n settingColumns.value.forEach((item: any) => (item.isCheck = checked))\n if (checked) {\n newColumns.value = [...props.columns]\n } else {\n newColumns.value = []\n }\n handleAddSerialNumberAndOperateToColumns()\n handleClickSubmitBtn()\n}\n// 拖拽change\nconst dragChange = () => {\n handleChangeColumns()\n handleClickSubmitBtn()\n}\n// 点击重置按钮\nconst handleClickResetBtn = () => {\n const newcolumns = props.columns.map((item: any, index: number) => ({\n ...item,\n isCheck: true,\n columnSortIndex: index\n }))\n newColumns.value = [...newcolumns]\n handleAddSerialNumberAndOperateToColumns()\n settingColumns.value = [...newcolumns]\n handleClickSubmitBtn()\n}\n// 点击保存按钮\nconst handleClickSubmitBtn = () => {\n if (props.settingKey) {\n localStorage.setItem(props.settingKey, JSON.stringify(settingColumns.value))\n }\n}\n// 处理column左固定和右固定\nconst handleColumnMove = (element: any, way: string) => {\n const fixed = element.fixed\n if (fixed === way) {\n element.fixed = false\n } else {\n element.fixed = way\n }\n handleColumnsSortByFixed(newColumns.value)\n handleClickSubmitBtn()\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwLA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAGd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAGvB,IAAM,MAAA,UAAA,GAAkB,GAAI,CAAA,EAAE,CAAA,CAAA;AAC9B,IAAM,MAAA,cAAA,GAAsB,GAAI,CAAA,EAAE,CAAA,CAAA;AAClC,IAAM,MAAA,aAAA,GAAqB,GAAI,CAAA,EAAE,CAAA,CAAA;AACjC,IAAM,MAAA,kBAAA,GAA0B,GAAI,CAAA,EAAE,CAAA,CAAA;AACtC,IAAA,IAAI,QAAW,GAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,SAAY,GAAA,CAAA,CAAA,CAAA;AAChB,IAAM,MAAA,GAAA,GAAM,gBAAgB,OAAO,CAAA,CAAA;AAGnC,IAAA,MAAM,2CAA2C,MAAM;AACrD,MAAA,IAAI,MAAM,eAAiB,EAAA;AACzB,QAAA,UAAA,CAAW,MAAM,OAAQ,CAAA;AAAA,UACvB,KAAO,EAAA,GAAA;AAAA,UACP,SAAW,EAAA,GAAA;AAAA,UACX,GAAK,EAAA,GAAA;AAAA,UACL,KAAO,EAAA,EAAA;AAAA,UACP,K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AA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
readonly current: {
|
|
3
|
+
readonly type: import("vue").PropType<number>;
|
|
4
|
+
readonly required: true;
|
|
5
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
6
|
+
__epPropKey: true;
|
|
7
|
+
};
|
|
8
|
+
readonly pageSize: {
|
|
9
|
+
readonly type: import("vue").PropType<number>;
|
|
10
|
+
readonly required: true;
|
|
11
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
12
|
+
__epPropKey: true;
|
|
13
|
+
};
|
|
14
|
+
readonly total: {
|
|
15
|
+
readonly type: import("vue").PropType<number>;
|
|
16
|
+
readonly required: true;
|
|
17
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
18
|
+
__epPropKey: true;
|
|
19
|
+
};
|
|
20
|
+
readonly onChange: import("ll-plus/es/utils").EpPropFinalized<FunctionConstructor, unknown, unknown, () => void, boolean>;
|
|
21
|
+
}, {
|
|
22
|
+
props: import("@vue/shared").LooseRequired<{
|
|
23
|
+
readonly onChange: Function;
|
|
24
|
+
readonly total: number;
|
|
25
|
+
readonly current: number;
|
|
26
|
+
readonly pageSize: number;
|
|
27
|
+
} & {}>;
|
|
28
|
+
attrs: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
bem: {
|
|
32
|
+
b: (blockSuffix?: string) => string;
|
|
33
|
+
e: (element?: string) => string;
|
|
34
|
+
m: (modifier?: string) => string;
|
|
35
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
36
|
+
em: (element: string, modifier: string) => string;
|
|
37
|
+
bm: (blockSuffix: string, modifier: string) => string;
|
|
38
|
+
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
39
|
+
is: (name?: string) => string;
|
|
40
|
+
};
|
|
41
|
+
handlePageChange: (page: number, pageSize: number) => any;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
readonly current: {
|
|
44
|
+
readonly type: import("vue").PropType<number>;
|
|
45
|
+
readonly required: true;
|
|
46
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
47
|
+
__epPropKey: true;
|
|
48
|
+
};
|
|
49
|
+
readonly pageSize: {
|
|
50
|
+
readonly type: import("vue").PropType<number>;
|
|
51
|
+
readonly required: true;
|
|
52
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
53
|
+
__epPropKey: true;
|
|
54
|
+
};
|
|
55
|
+
readonly total: {
|
|
56
|
+
readonly type: import("vue").PropType<number>;
|
|
57
|
+
readonly required: true;
|
|
58
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
59
|
+
__epPropKey: true;
|
|
60
|
+
};
|
|
61
|
+
readonly onChange: import("ll-plus/es/utils").EpPropFinalized<FunctionConstructor, unknown, unknown, () => void, boolean>;
|
|
62
|
+
}>>, {
|
|
63
|
+
readonly onChange: Function;
|
|
64
|
+
}, {}>;
|
|
65
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from './pagination.vue2.mjs';
|
|
2
|
+
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "pagination.vue"]]);
|
|
6
|
+
|
|
7
|
+
export { Pagination as default };
|
|
8
|
+
//# sourceMappingURL=pagination.vue.mjs.map
|