@vipl520/dk-ui 1.0.23 → 1.0.24
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/index.js +126 -55
- package/dist/index.min.js +5 -3
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +5 -3
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +126 -55
- package/dist/web-types.json +1 -1
- package/es/table/index.d.ts +15 -0
- package/es/table/src/components/header.vue2.mjs +58 -26
- package/es/table/src/components/header.vue2.mjs.map +1 -1
- package/es/table/src/props.d.ts +4 -0
- package/es/table/src/props.mjs +6 -0
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue.d.ts +9 -0
- package/es/table/src/table.vue2.mjs +16 -19
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/utils/dkTable.d.ts +1 -0
- package/es/table/utils/dkTable.mjs +36 -0
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/lib/table/index.d.ts +15 -0
- package/lib/table/src/components/header.vue2.js +58 -26
- package/lib/table/src/components/header.vue2.js.map +1 -1
- package/lib/table/src/props.d.ts +4 -0
- package/lib/table/src/props.js +6 -0
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue.d.ts +9 -0
- package/lib/table/src/table.vue2.js +16 -19
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/utils/dkTable.d.ts +1 -0
- package/lib/table/utils/dkTable.js +36 -0
- package/lib/table/utils/dkTable.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -11800,7 +11800,7 @@ const _hoisted_7$b = { class: "attachment-content flex" };
|
|
11800
11800
|
const _hoisted_8$9 = { class: "attachment-group" };
|
11801
11801
|
const _hoisted_9$7 = { class: "group_list" };
|
11802
11802
|
const _hoisted_10$6 = ["onClick"];
|
11803
|
-
const _hoisted_11$
|
11803
|
+
const _hoisted_11$6 = { class: "ml-10px" };
|
11804
11804
|
const _hoisted_12$5 = { class: "op" };
|
11805
11805
|
const _hoisted_13$4 = { class: "attachment-container" };
|
11806
11806
|
const _hoisted_14$4 = {
|
@@ -12177,7 +12177,7 @@ var _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
12177
12177
|
})),
|
12178
12178
|
createElementVNode(
|
12179
12179
|
"span",
|
12180
|
-
_hoisted_11$
|
12180
|
+
_hoisted_11$6,
|
12181
12181
|
toDisplayString(item.name),
|
12182
12182
|
1
|
12183
12183
|
/* TEXT */
|
@@ -14384,7 +14384,7 @@ const _hoisted_7$a = { class: "name-header-operations" };
|
|
14384
14384
|
const _hoisted_8$8 = ["title", "onDblclick"];
|
14385
14385
|
const _hoisted_9$6 = ["onUpdate:modelValue", "onBlur"];
|
14386
14386
|
const _hoisted_10$5 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
|
14387
|
-
const _hoisted_11$
|
14387
|
+
const _hoisted_11$5 = /* @__PURE__ */ createElementVNode(
|
14388
14388
|
"div",
|
14389
14389
|
{ style: { "position": "absolute", "display": "none", "width": "100%", "height": "100%" } },
|
14390
14390
|
null,
|
@@ -14807,7 +14807,7 @@ var _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
14807
14807
|
/* KEYED_FRAGMENT */
|
14808
14808
|
))
|
14809
14809
|
]),
|
14810
|
-
_hoisted_11$
|
14810
|
+
_hoisted_11$5,
|
14811
14811
|
createElementVNode("div", _hoisted_12$4, [
|
14812
14812
|
(openBlock(), createElementBlock(
|
14813
14813
|
Fragment,
|
@@ -17841,7 +17841,7 @@ const _hoisted_8$6 = /* @__PURE__ */ createElementVNode(
|
|
17841
17841
|
);
|
17842
17842
|
const _hoisted_9$5 = { class: "phone-title" };
|
17843
17843
|
const _hoisted_10$4 = { class: "phone-title-icon" };
|
17844
|
-
const _hoisted_11$
|
17844
|
+
const _hoisted_11$4 = /* @__PURE__ */ createElementVNode(
|
17845
17845
|
"div",
|
17846
17846
|
null,
|
17847
17847
|
"\u9875\u9762\u6807\u9898",
|
@@ -18010,7 +18010,7 @@ var _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
18010
18010
|
/* STABLE */
|
18011
18011
|
})
|
18012
18012
|
]),
|
18013
|
-
_hoisted_11$
|
18013
|
+
_hoisted_11$4,
|
18014
18014
|
createElementVNode("div", _hoisted_12$3, [
|
18015
18015
|
createVNode(_component_el_popover, {
|
18016
18016
|
placement: "bottom",
|
@@ -22920,7 +22920,7 @@ const _hoisted_10$3 = {
|
|
22920
22920
|
key: 0,
|
22921
22921
|
class: "tag"
|
22922
22922
|
};
|
22923
|
-
const _hoisted_11$
|
22923
|
+
const _hoisted_11$3 = {
|
22924
22924
|
key: 1,
|
22925
22925
|
class: "tag"
|
22926
22926
|
};
|
@@ -23124,7 +23124,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23124
23124
|
]))
|
23125
23125
|
: createCommentVNode("v-if", true),
|
23126
23126
|
(item.down_count > 100)
|
23127
|
-
? (openBlock(), createElementBlock("span", _hoisted_11$
|
23127
|
+
? (openBlock(), createElementBlock("span", _hoisted_11$3, [
|
23128
23128
|
createVNode(_component_van_icon, { name: "fire" }),
|
23129
23129
|
createTextVNode("热门")
|
23130
23130
|
]))
|
@@ -24748,6 +24748,12 @@ const tableProps = {
|
|
24748
24748
|
return {};
|
24749
24749
|
},
|
24750
24750
|
type: Object
|
24751
|
+
},
|
24752
|
+
buttons: {
|
24753
|
+
default: () => {
|
24754
|
+
return ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
|
24755
|
+
},
|
24756
|
+
type: Array
|
24751
24757
|
}
|
24752
24758
|
// ...ElTableNext.props,
|
24753
24759
|
};
|
@@ -28320,6 +28326,36 @@ class dkTable {
|
|
28320
28326
|
this.runAfter("onTableDblclick", { row, column });
|
28321
28327
|
}
|
28322
28328
|
};
|
28329
|
+
exportCsv = () => {
|
28330
|
+
const header = this.table.column;
|
28331
|
+
const headerMap = new Map(
|
28332
|
+
header.filter((item) => item !== void 0 && item.label !== void 0 && item.export).map((item) => [item.label, item.prop])
|
28333
|
+
);
|
28334
|
+
const headerLabels = Array.from(headerMap.keys());
|
28335
|
+
function jsonToCsv(data) {
|
28336
|
+
let csvContent = headerLabels.join(",") + "\n";
|
28337
|
+
data.forEach((row) => {
|
28338
|
+
const line = [];
|
28339
|
+
headerLabels.forEach((label) => {
|
28340
|
+
const prop = headerMap.get(label);
|
28341
|
+
const value = String(row[prop]);
|
28342
|
+
line.push(`"${value.replace(/"/g, '""').replace(/[\n\r]/g, " ")}"`);
|
28343
|
+
});
|
28344
|
+
csvContent += line.join(",") + "\n";
|
28345
|
+
});
|
28346
|
+
return csvContent;
|
28347
|
+
}
|
28348
|
+
function downloadCsv(csvContent, fileName) {
|
28349
|
+
const link = document.createElement("a");
|
28350
|
+
link.setAttribute("href", "data:text/csv;charset=utf-8," + encodeURIComponent(csvContent));
|
28351
|
+
link.setAttribute("download", fileName + ".csv");
|
28352
|
+
document.body.appendChild(link);
|
28353
|
+
link.click();
|
28354
|
+
document.body.removeChild(link);
|
28355
|
+
}
|
28356
|
+
const csvStr = jsonToCsv(this.table.selection);
|
28357
|
+
downloadCsv(csvStr, "export_data");
|
28358
|
+
};
|
28323
28359
|
/**
|
28324
28360
|
* 打开表单
|
28325
28361
|
* @param operate 操作:Add=添加,Edit=编辑
|
@@ -28411,6 +28447,12 @@ class dkTable {
|
|
28411
28447
|
this.toggleForm("Add");
|
28412
28448
|
}
|
28413
28449
|
],
|
28450
|
+
[
|
28451
|
+
"export_csv",
|
28452
|
+
() => {
|
28453
|
+
this.exportCsv();
|
28454
|
+
}
|
28455
|
+
],
|
28414
28456
|
[
|
28415
28457
|
"edit",
|
28416
28458
|
() => {
|
@@ -29408,7 +29450,7 @@ const _hoisted_8$4 = {
|
|
29408
29450
|
};
|
29409
29451
|
const _hoisted_9$3 = { class: "com-search-col-input-range" };
|
29410
29452
|
const _hoisted_10$2 = { class: "com-search-col" };
|
29411
|
-
const _hoisted_11$
|
29453
|
+
const _hoisted_11$2 = {
|
29412
29454
|
key: 0,
|
29413
29455
|
class: "com-search-col-label"
|
29414
29456
|
};
|
@@ -29671,7 +29713,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
29671
29713
|
createElementVNode("div", _hoisted_10$2, [
|
29672
29714
|
item.comSearchShowLabel !== false ? (openBlock(), createElementBlock(
|
29673
29715
|
"div",
|
29674
|
-
_hoisted_11$
|
29716
|
+
_hoisted_11$2,
|
29675
29717
|
toDisplayString(item.label),
|
29676
29718
|
1
|
29677
29719
|
/* TEXT */
|
@@ -29919,31 +29961,38 @@ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode(
|
|
29919
29961
|
/* HOISTED */
|
29920
29962
|
);
|
29921
29963
|
const _hoisted_3$6 = /* @__PURE__ */ createElementVNode(
|
29964
|
+
"span",
|
29965
|
+
{ class: "m-l-5px" },
|
29966
|
+
"\u5BFC\u51FA",
|
29967
|
+
-1
|
29968
|
+
/* HOISTED */
|
29969
|
+
);
|
29970
|
+
const _hoisted_4$6 = /* @__PURE__ */ createElementVNode(
|
29922
29971
|
"span",
|
29923
29972
|
{ class: "m-l-5px" },
|
29924
29973
|
"\u7F16\u8F91",
|
29925
29974
|
-1
|
29926
29975
|
/* HOISTED */
|
29927
29976
|
);
|
29928
|
-
const
|
29929
|
-
const
|
29977
|
+
const _hoisted_5$4 = { class: "m-l-5px" };
|
29978
|
+
const _hoisted_6$4 = /* @__PURE__ */ createElementVNode(
|
29930
29979
|
"span",
|
29931
29980
|
{ class: "m-l-5px" },
|
29932
29981
|
"\u5220\u9664",
|
29933
29982
|
-1
|
29934
29983
|
/* HOISTED */
|
29935
29984
|
);
|
29936
|
-
const
|
29937
|
-
const
|
29985
|
+
const _hoisted_7$4 = { class: "table-header-operate-text" };
|
29986
|
+
const _hoisted_8$3 = /* @__PURE__ */ createElementVNode(
|
29938
29987
|
"span",
|
29939
29988
|
{ class: "table-header-operate-text" },
|
29940
29989
|
" \u56DE\u6536\u7AD9 ",
|
29941
29990
|
-1
|
29942
29991
|
/* HOISTED */
|
29943
29992
|
);
|
29944
|
-
const
|
29945
|
-
const
|
29946
|
-
const
|
29993
|
+
const _hoisted_9$2 = { class: "table-search" };
|
29994
|
+
const _hoisted_10$1 = { class: "mr-1" };
|
29995
|
+
const _hoisted_11$1 = { class: "table-search-button-group" };
|
29947
29996
|
const __default__$d = defineComponent({
|
29948
29997
|
name: "DkTableHeader"
|
29949
29998
|
});
|
@@ -29956,7 +30005,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
29956
30005
|
},
|
29957
30006
|
buttons: {
|
29958
30007
|
default: () => {
|
29959
|
-
return ["refresh", "add", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
|
30008
|
+
return ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
|
29960
30009
|
},
|
29961
30010
|
type: Array
|
29962
30011
|
},
|
@@ -30090,8 +30139,33 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30090
30139
|
_: 1
|
30091
30140
|
/* STABLE */
|
30092
30141
|
})) : createCommentVNode("v-if", true),
|
30093
|
-
props.buttons.includes("
|
30142
|
+
props.buttons.includes("export_csv") && unref(DkTable).auth("export_csv") ? (openBlock(), createBlock(_component_el_tooltip, {
|
30094
30143
|
key: 2,
|
30144
|
+
content: "\u5BFC\u51FA\u9009\u4E2D\u884C",
|
30145
|
+
placement: "top"
|
30146
|
+
}, {
|
30147
|
+
default: withCtx(() => [
|
30148
|
+
withDirectives((openBlock(), createBlock(_component_el_button, {
|
30149
|
+
disabled: !enableBatchOpt.value,
|
30150
|
+
class: "table-header-operate",
|
30151
|
+
type: "primary",
|
30152
|
+
onClick: _cache[2] || (_cache[2] = ($event) => onAction("export_csv"))
|
30153
|
+
}, {
|
30154
|
+
default: withCtx(() => [
|
30155
|
+
createVNode(_component_dk_icon, { icon: "typcn:download" }),
|
30156
|
+
_hoisted_3$6
|
30157
|
+
]),
|
30158
|
+
_: 1
|
30159
|
+
/* STABLE */
|
30160
|
+
}, 8, ["disabled"])), [
|
30161
|
+
[_directive_blur]
|
30162
|
+
])
|
30163
|
+
]),
|
30164
|
+
_: 1
|
30165
|
+
/* STABLE */
|
30166
|
+
})) : createCommentVNode("v-if", true),
|
30167
|
+
props.buttons.includes("edit") && unref(DkTable).auth("edit") ? (openBlock(), createBlock(_component_el_tooltip, {
|
30168
|
+
key: 3,
|
30095
30169
|
content: "\u7F16\u8F91\u9009\u4E2D\u884C",
|
30096
30170
|
placement: "top"
|
30097
30171
|
}, {
|
@@ -30100,11 +30174,11 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30100
30174
|
disabled: !enableBatchOpt.value,
|
30101
30175
|
class: "table-header-operate",
|
30102
30176
|
type: "primary",
|
30103
|
-
onClick: _cache[
|
30177
|
+
onClick: _cache[3] || (_cache[3] = ($event) => onAction("edit"))
|
30104
30178
|
}, {
|
30105
30179
|
default: withCtx(() => [
|
30106
30180
|
createVNode(_component_dk_icon, { icon: "typcn:edit" }),
|
30107
|
-
|
30181
|
+
_hoisted_4$6
|
30108
30182
|
]),
|
30109
30183
|
_: 1
|
30110
30184
|
/* STABLE */
|
@@ -30116,16 +30190,16 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30116
30190
|
/* STABLE */
|
30117
30191
|
})) : createCommentVNode("v-if", true),
|
30118
30192
|
props.buttons.includes("delete") && unref(DkTable).auth("del") ? (openBlock(), createBlock(_component_el_popconfirm, {
|
30119
|
-
key:
|
30193
|
+
key: 4,
|
30120
30194
|
"confirm-button-text": "\u5220\u9664",
|
30121
30195
|
"cancel-button-text": "\u53D6\u6D88",
|
30122
30196
|
"confirm-button-type": "danger",
|
30123
30197
|
title: "\u60A8\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u8BB0\u5F55\u5417\uFF1F",
|
30124
30198
|
disabled: !enableBatchOpt.value,
|
30125
|
-
onConfirm: _cache[
|
30199
|
+
onConfirm: _cache[4] || (_cache[4] = ($event) => onAction("delete"))
|
30126
30200
|
}, {
|
30127
30201
|
reference: withCtx(() => [
|
30128
|
-
createElementVNode("div",
|
30202
|
+
createElementVNode("div", _hoisted_5$4, [
|
30129
30203
|
createVNode(_component_el_tooltip, {
|
30130
30204
|
content: "\u5220\u9664\u6240\u9009\u884C",
|
30131
30205
|
placement: "top"
|
@@ -30139,7 +30213,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30139
30213
|
default: withCtx(() => [
|
30140
30214
|
createCommentVNode(' <Icon name="fa fa-trash" />'),
|
30141
30215
|
createVNode(_component_dk_icon, { icon: "typcn:trash" }),
|
30142
|
-
|
30216
|
+
_hoisted_6$4
|
30143
30217
|
]),
|
30144
30218
|
_: 1
|
30145
30219
|
/* STABLE */
|
@@ -30156,7 +30230,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30156
30230
|
/* STABLE */
|
30157
30231
|
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
30158
30232
|
props.buttons.includes("unfold") ? (openBlock(), createBlock(_component_el_tooltip, {
|
30159
|
-
key:
|
30233
|
+
key: 5,
|
30160
30234
|
content: (unref(DkTable).table.expandAll ? "\u6536\u7F29" : "\u5C55\u5F00") + "\u6240\u6709\u5B50\u83DC\u5355",
|
30161
30235
|
placement: "top"
|
30162
30236
|
}, {
|
@@ -30164,14 +30238,14 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30164
30238
|
withDirectives((openBlock(), createBlock(_component_el_button, {
|
30165
30239
|
class: "table-header-operate",
|
30166
30240
|
type: unref(DkTable).table.expandAll ? "danger" : "warning",
|
30167
|
-
onClick: _cache[
|
30241
|
+
onClick: _cache[5] || (_cache[5] = ($event) => unref(DkTable).onTableHeaderAction("unfold", {
|
30168
30242
|
unfold: !unref(DkTable).table.expandAll
|
30169
30243
|
}))
|
30170
30244
|
}, {
|
30171
30245
|
default: withCtx(() => [
|
30172
30246
|
createElementVNode(
|
30173
30247
|
"span",
|
30174
|
-
|
30248
|
+
_hoisted_7$4,
|
30175
30249
|
toDisplayString(unref(DkTable).table.expandAll ? "\u6536\u7F29\u6240\u6709" : "\u5C55\u5F00\u6240\u6709"),
|
30176
30250
|
1
|
30177
30251
|
/* TEXT */
|
@@ -30195,10 +30269,10 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30195
30269
|
class: "table-header-operate m-l-5px",
|
30196
30270
|
type: "warning",
|
30197
30271
|
loading: unref(DkTable).recycleTable.showDialogLoading,
|
30198
|
-
onClick: _cache[
|
30272
|
+
onClick: _cache[6] || (_cache[6] = ($event) => onAction("recycle"))
|
30199
30273
|
}, {
|
30200
30274
|
default: withCtx(() => [
|
30201
|
-
|
30275
|
+
_hoisted_8$3
|
30202
30276
|
]),
|
30203
30277
|
_: 1
|
30204
30278
|
/* STABLE */
|
@@ -30209,18 +30283,18 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30209
30283
|
_: 1
|
30210
30284
|
/* STABLE */
|
30211
30285
|
}),
|
30212
|
-
createElementVNode("div",
|
30213
|
-
createElementVNode("div",
|
30286
|
+
createElementVNode("div", _hoisted_9$2, [
|
30287
|
+
createElementVNode("div", _hoisted_10$1, [
|
30214
30288
|
createVNode(_component_el_input, {
|
30215
30289
|
modelValue: unref(DkTable).table.filter.quickSearch,
|
30216
|
-
"onUpdate:modelValue": _cache[
|
30290
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(DkTable).table.filter.quickSearch = $event),
|
30217
30291
|
placeholder: "\u8BF7\u8F93\u5165",
|
30218
30292
|
"prefix-icon": "Search",
|
30219
30293
|
size: __props.size,
|
30220
|
-
onInput: _cache[
|
30294
|
+
onInput: _cache[8] || (_cache[8] = ($event) => unref(debounce)(onSearchInput, 500)())
|
30221
30295
|
}, null, 8, ["modelValue", "size"])
|
30222
30296
|
]),
|
30223
|
-
createElementVNode("div",
|
30297
|
+
createElementVNode("div", _hoisted_11$1, [
|
30224
30298
|
props.buttons.includes("columnDisplay") ? (openBlock(), createBlock(_component_el_dropdown, {
|
30225
30299
|
key: 0,
|
30226
30300
|
"max-height": 380,
|
@@ -30290,7 +30364,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
30290
30364
|
withDirectives((openBlock(), createBlock(_component_el_button, {
|
30291
30365
|
size: __props.size,
|
30292
30366
|
class: "table-search-button-item",
|
30293
|
-
onClick: _cache[
|
30367
|
+
onClick: _cache[9] || (_cache[9] = ($event) => unref(DkTable).table.showComSearch = !unref(DkTable).table.showComSearch)
|
30294
30368
|
}, {
|
30295
30369
|
default: withCtx(() => [
|
30296
30370
|
createVNode(_component_dk_icon, { icon: "Search" })
|
@@ -31172,25 +31246,22 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
31172
31246
|
[
|
31173
31247
|
createElementVNode("div", _hoisted_1$8, [
|
31174
31248
|
createCommentVNode("\u9876\u90E8\u83DC\u5355"),
|
31175
|
-
createVNode(
|
31176
|
-
|
31177
|
-
|
31178
|
-
|
31179
|
-
|
31180
|
-
|
31181
|
-
|
31182
|
-
|
31183
|
-
|
31184
|
-
|
31185
|
-
|
31186
|
-
|
31187
|
-
|
31188
|
-
|
31189
|
-
|
31190
|
-
|
31191
|
-
1024
|
31192
|
-
/* DYNAMIC_SLOTS */
|
31193
|
-
),
|
31249
|
+
createVNode(DkTableHeader, {
|
31250
|
+
size: "default",
|
31251
|
+
buttons: _ctx.buttons
|
31252
|
+
}, createSlots({
|
31253
|
+
_: 2
|
31254
|
+
/* DYNAMIC */
|
31255
|
+
}, [
|
31256
|
+
renderList(_ctx.$slots, (slot, idx) => {
|
31257
|
+
return {
|
31258
|
+
name: idx,
|
31259
|
+
fn: withCtx(() => [
|
31260
|
+
renderSlot(_ctx.$slots, idx)
|
31261
|
+
])
|
31262
|
+
};
|
31263
|
+
})
|
31264
|
+
]), 1032, ["buttons"]),
|
31194
31265
|
createCommentVNode("\u8868\u683C"),
|
31195
31266
|
withDirectives((openBlock(), createBlock(_component_el_table, mergeProps({
|
31196
31267
|
ref_key: "TableRef",
|
package/dist/web-types.json
CHANGED
package/es/table/index.d.ts
CHANGED
@@ -7,6 +7,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
7
7
|
cacheTable?: boolean | undefined;
|
8
8
|
tableBefore?: Record<string, any> | undefined;
|
9
9
|
tableAfter?: Record<string, any> | undefined;
|
10
|
+
buttons?: unknown[] | undefined;
|
10
11
|
style?: unknown;
|
11
12
|
key?: string | number | symbol | undefined;
|
12
13
|
ref?: import("vue").VNodeRef | undefined;
|
@@ -82,6 +83,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
82
83
|
default: () => {};
|
83
84
|
type: ObjectConstructor;
|
84
85
|
};
|
86
|
+
buttons: {
|
87
|
+
default: () => string[];
|
88
|
+
type: ArrayConstructor;
|
89
|
+
};
|
85
90
|
}>>, {
|
86
91
|
DkTable: import("./utils/dkTable").default;
|
87
92
|
TableRef: import("vue").Ref<any>;
|
@@ -91,6 +96,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
91
96
|
cacheTable: boolean;
|
92
97
|
tableBefore: Record<string, any>;
|
93
98
|
tableAfter: Record<string, any>;
|
99
|
+
buttons: unknown[];
|
94
100
|
}, {}, string, {}> & {
|
95
101
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
96
102
|
created?: ((() => void) | (() => void)[]) | undefined;
|
@@ -128,6 +134,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
128
134
|
default: () => {};
|
129
135
|
type: ObjectConstructor;
|
130
136
|
};
|
137
|
+
buttons: {
|
138
|
+
default: () => string[];
|
139
|
+
type: ArrayConstructor;
|
140
|
+
};
|
131
141
|
}>> & import("vue").ShallowUnwrapRef<{
|
132
142
|
DkTable: import("./utils/dkTable").default;
|
133
143
|
TableRef: import("vue").Ref<any>;
|
@@ -153,6 +163,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
153
163
|
default: () => {};
|
154
164
|
type: ObjectConstructor;
|
155
165
|
};
|
166
|
+
buttons: {
|
167
|
+
default: () => string[];
|
168
|
+
type: ArrayConstructor;
|
169
|
+
};
|
156
170
|
}>>, {
|
157
171
|
DkTable: import("./utils/dkTable").default;
|
158
172
|
TableRef: import("vue").Ref<any>;
|
@@ -162,6 +176,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
162
176
|
cacheTable: boolean;
|
163
177
|
tableBefore: Record<string, any>;
|
164
178
|
tableAfter: Record<string, any>;
|
179
|
+
buttons: unknown[];
|
165
180
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
166
181
|
$slots: Partial<Record<NonNullable<string | number>, (_: {}) => any>> & Partial<Record<string, (_: any) => any>> & {
|
167
182
|
columnPrepend?(_: {}): any;
|
@@ -11,31 +11,38 @@ const _hoisted_2 = /* @__PURE__ */ createElementVNode(
|
|
11
11
|
/* HOISTED */
|
12
12
|
);
|
13
13
|
const _hoisted_3 = /* @__PURE__ */ createElementVNode(
|
14
|
+
"span",
|
15
|
+
{ class: "m-l-5px" },
|
16
|
+
"\u5BFC\u51FA",
|
17
|
+
-1
|
18
|
+
/* HOISTED */
|
19
|
+
);
|
20
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode(
|
14
21
|
"span",
|
15
22
|
{ class: "m-l-5px" },
|
16
23
|
"\u7F16\u8F91",
|
17
24
|
-1
|
18
25
|
/* HOISTED */
|
19
26
|
);
|
20
|
-
const
|
21
|
-
const
|
27
|
+
const _hoisted_5 = { class: "m-l-5px" };
|
28
|
+
const _hoisted_6 = /* @__PURE__ */ createElementVNode(
|
22
29
|
"span",
|
23
30
|
{ class: "m-l-5px" },
|
24
31
|
"\u5220\u9664",
|
25
32
|
-1
|
26
33
|
/* HOISTED */
|
27
34
|
);
|
28
|
-
const
|
29
|
-
const
|
35
|
+
const _hoisted_7 = { class: "table-header-operate-text" };
|
36
|
+
const _hoisted_8 = /* @__PURE__ */ createElementVNode(
|
30
37
|
"span",
|
31
38
|
{ class: "table-header-operate-text" },
|
32
39
|
" \u56DE\u6536\u7AD9 ",
|
33
40
|
-1
|
34
41
|
/* HOISTED */
|
35
42
|
);
|
36
|
-
const
|
37
|
-
const
|
38
|
-
const
|
43
|
+
const _hoisted_9 = { class: "table-search" };
|
44
|
+
const _hoisted_10 = { class: "mr-1" };
|
45
|
+
const _hoisted_11 = { class: "table-search-button-group" };
|
39
46
|
const __default__ = defineComponent({
|
40
47
|
name: "DkTableHeader"
|
41
48
|
});
|
@@ -48,7 +55,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
48
55
|
},
|
49
56
|
buttons: {
|
50
57
|
default: () => {
|
51
|
-
return ["refresh", "add", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
|
58
|
+
return ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
|
52
59
|
},
|
53
60
|
type: Array
|
54
61
|
},
|
@@ -182,8 +189,33 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
182
189
|
_: 1
|
183
190
|
/* STABLE */
|
184
191
|
})) : createCommentVNode("v-if", true),
|
185
|
-
props.buttons.includes("
|
192
|
+
props.buttons.includes("export_csv") && unref(DkTable).auth("export_csv") ? (openBlock(), createBlock(_component_el_tooltip, {
|
186
193
|
key: 2,
|
194
|
+
content: "\u5BFC\u51FA\u9009\u4E2D\u884C",
|
195
|
+
placement: "top"
|
196
|
+
}, {
|
197
|
+
default: withCtx(() => [
|
198
|
+
withDirectives((openBlock(), createBlock(_component_el_button, {
|
199
|
+
disabled: !enableBatchOpt.value,
|
200
|
+
class: "table-header-operate",
|
201
|
+
type: "primary",
|
202
|
+
onClick: _cache[2] || (_cache[2] = ($event) => onAction("export_csv"))
|
203
|
+
}, {
|
204
|
+
default: withCtx(() => [
|
205
|
+
createVNode(_component_dk_icon, { icon: "typcn:download" }),
|
206
|
+
_hoisted_3
|
207
|
+
]),
|
208
|
+
_: 1
|
209
|
+
/* STABLE */
|
210
|
+
}, 8, ["disabled"])), [
|
211
|
+
[_directive_blur]
|
212
|
+
])
|
213
|
+
]),
|
214
|
+
_: 1
|
215
|
+
/* STABLE */
|
216
|
+
})) : createCommentVNode("v-if", true),
|
217
|
+
props.buttons.includes("edit") && unref(DkTable).auth("edit") ? (openBlock(), createBlock(_component_el_tooltip, {
|
218
|
+
key: 3,
|
187
219
|
content: "\u7F16\u8F91\u9009\u4E2D\u884C",
|
188
220
|
placement: "top"
|
189
221
|
}, {
|
@@ -192,11 +224,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
192
224
|
disabled: !enableBatchOpt.value,
|
193
225
|
class: "table-header-operate",
|
194
226
|
type: "primary",
|
195
|
-
onClick: _cache[
|
227
|
+
onClick: _cache[3] || (_cache[3] = ($event) => onAction("edit"))
|
196
228
|
}, {
|
197
229
|
default: withCtx(() => [
|
198
230
|
createVNode(_component_dk_icon, { icon: "typcn:edit" }),
|
199
|
-
|
231
|
+
_hoisted_4
|
200
232
|
]),
|
201
233
|
_: 1
|
202
234
|
/* STABLE */
|
@@ -208,16 +240,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
208
240
|
/* STABLE */
|
209
241
|
})) : createCommentVNode("v-if", true),
|
210
242
|
props.buttons.includes("delete") && unref(DkTable).auth("del") ? (openBlock(), createBlock(_component_el_popconfirm, {
|
211
|
-
key:
|
243
|
+
key: 4,
|
212
244
|
"confirm-button-text": "\u5220\u9664",
|
213
245
|
"cancel-button-text": "\u53D6\u6D88",
|
214
246
|
"confirm-button-type": "danger",
|
215
247
|
title: "\u60A8\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u8BB0\u5F55\u5417\uFF1F",
|
216
248
|
disabled: !enableBatchOpt.value,
|
217
|
-
onConfirm: _cache[
|
249
|
+
onConfirm: _cache[4] || (_cache[4] = ($event) => onAction("delete"))
|
218
250
|
}, {
|
219
251
|
reference: withCtx(() => [
|
220
|
-
createElementVNode("div",
|
252
|
+
createElementVNode("div", _hoisted_5, [
|
221
253
|
createVNode(_component_el_tooltip, {
|
222
254
|
content: "\u5220\u9664\u6240\u9009\u884C",
|
223
255
|
placement: "top"
|
@@ -231,7 +263,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
231
263
|
default: withCtx(() => [
|
232
264
|
createCommentVNode(' <Icon name="fa fa-trash" />'),
|
233
265
|
createVNode(_component_dk_icon, { icon: "typcn:trash" }),
|
234
|
-
|
266
|
+
_hoisted_6
|
235
267
|
]),
|
236
268
|
_: 1
|
237
269
|
/* STABLE */
|
@@ -248,7 +280,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
248
280
|
/* STABLE */
|
249
281
|
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
250
282
|
props.buttons.includes("unfold") ? (openBlock(), createBlock(_component_el_tooltip, {
|
251
|
-
key:
|
283
|
+
key: 5,
|
252
284
|
content: (unref(DkTable).table.expandAll ? "\u6536\u7F29" : "\u5C55\u5F00") + "\u6240\u6709\u5B50\u83DC\u5355",
|
253
285
|
placement: "top"
|
254
286
|
}, {
|
@@ -256,14 +288,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
256
288
|
withDirectives((openBlock(), createBlock(_component_el_button, {
|
257
289
|
class: "table-header-operate",
|
258
290
|
type: unref(DkTable).table.expandAll ? "danger" : "warning",
|
259
|
-
onClick: _cache[
|
291
|
+
onClick: _cache[5] || (_cache[5] = ($event) => unref(DkTable).onTableHeaderAction("unfold", {
|
260
292
|
unfold: !unref(DkTable).table.expandAll
|
261
293
|
}))
|
262
294
|
}, {
|
263
295
|
default: withCtx(() => [
|
264
296
|
createElementVNode(
|
265
297
|
"span",
|
266
|
-
|
298
|
+
_hoisted_7,
|
267
299
|
toDisplayString(unref(DkTable).table.expandAll ? "\u6536\u7F29\u6240\u6709" : "\u5C55\u5F00\u6240\u6709"),
|
268
300
|
1
|
269
301
|
/* TEXT */
|
@@ -287,10 +319,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
287
319
|
class: "table-header-operate m-l-5px",
|
288
320
|
type: "warning",
|
289
321
|
loading: unref(DkTable).recycleTable.showDialogLoading,
|
290
|
-
onClick: _cache[
|
322
|
+
onClick: _cache[6] || (_cache[6] = ($event) => onAction("recycle"))
|
291
323
|
}, {
|
292
324
|
default: withCtx(() => [
|
293
|
-
|
325
|
+
_hoisted_8
|
294
326
|
]),
|
295
327
|
_: 1
|
296
328
|
/* STABLE */
|
@@ -301,18 +333,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
301
333
|
_: 1
|
302
334
|
/* STABLE */
|
303
335
|
}),
|
304
|
-
createElementVNode("div",
|
305
|
-
createElementVNode("div",
|
336
|
+
createElementVNode("div", _hoisted_9, [
|
337
|
+
createElementVNode("div", _hoisted_10, [
|
306
338
|
createVNode(_component_el_input, {
|
307
339
|
modelValue: unref(DkTable).table.filter.quickSearch,
|
308
|
-
"onUpdate:modelValue": _cache[
|
340
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(DkTable).table.filter.quickSearch = $event),
|
309
341
|
placeholder: "\u8BF7\u8F93\u5165",
|
310
342
|
"prefix-icon": "Search",
|
311
343
|
size: __props.size,
|
312
|
-
onInput: _cache[
|
344
|
+
onInput: _cache[8] || (_cache[8] = ($event) => unref(debounce)(onSearchInput, 500)())
|
313
345
|
}, null, 8, ["modelValue", "size"])
|
314
346
|
]),
|
315
|
-
createElementVNode("div",
|
347
|
+
createElementVNode("div", _hoisted_11, [
|
316
348
|
props.buttons.includes("columnDisplay") ? (openBlock(), createBlock(_component_el_dropdown, {
|
317
349
|
key: 0,
|
318
350
|
"max-height": 380,
|
@@ -382,7 +414,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
382
414
|
withDirectives((openBlock(), createBlock(_component_el_button, {
|
383
415
|
size: __props.size,
|
384
416
|
class: "table-search-button-item",
|
385
|
-
onClick: _cache[
|
417
|
+
onClick: _cache[9] || (_cache[9] = ($event) => unref(DkTable).table.showComSearch = !unref(DkTable).table.showComSearch)
|
386
418
|
}, {
|
387
419
|
default: withCtx(() => [
|
388
420
|
createVNode(_component_dk_icon, { icon: "Search" })
|