workdesktop-ai 1.0.1 → 1.1.0
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/CHANGELOG.md +155 -61
- package/README.md +123 -25
- package/dist/api-button/index.mjs +7 -0
- package/dist/api-button/index.mjs.map +1 -0
- package/dist/assets/Select-CNzSyvlZ.css +1 -0
- package/dist/auto-complete/index.mjs +7 -0
- package/dist/auto-complete/index.mjs.map +1 -0
- package/dist/auto-complete/style.css +1 -0
- package/dist/base.css +1 -0
- package/dist/checkbox-list/index.mjs +7 -0
- package/dist/checkbox-list/index.mjs.map +1 -0
- package/dist/checkbox-list/style.css +1 -0
- package/dist/chunks/ApiButton.vue_vue_type_script_setup_true_lang-CweWFfDE.mjs +80 -0
- package/dist/chunks/ApiButton.vue_vue_type_script_setup_true_lang-CweWFfDE.mjs.map +1 -0
- package/dist/chunks/AutoComplete-B_L169hU.mjs +80 -0
- package/dist/chunks/AutoComplete-B_L169hU.mjs.map +1 -0
- package/dist/chunks/CheckboxList-bPqpbd8d.mjs +129 -0
- package/dist/chunks/CheckboxList-bPqpbd8d.mjs.map +1 -0
- package/dist/chunks/ConfirmButton.vue_vue_type_script_setup_true_lang-DpdMPkka.mjs +99 -0
- package/dist/chunks/ConfirmButton.vue_vue_type_script_setup_true_lang-DpdMPkka.mjs.map +1 -0
- package/dist/chunks/DataForm-C6UW92Ds.mjs +305 -0
- package/dist/chunks/DataForm-C6UW92Ds.mjs.map +1 -0
- package/dist/chunks/DataGrid-BhgND4G_.mjs +1124 -0
- package/dist/chunks/DataGrid-BhgND4G_.mjs.map +1 -0
- package/dist/chunks/DialogButton.vue_vue_type_script_setup_true_lang-CTXP79zc.mjs +117 -0
- package/dist/chunks/DialogButton.vue_vue_type_script_setup_true_lang-CTXP79zc.mjs.map +1 -0
- package/dist/chunks/Drawer-ucXKUecL.mjs +259 -0
- package/dist/chunks/Drawer-ucXKUecL.mjs.map +1 -0
- package/dist/chunks/DrawerButton.vue_vue_type_script_setup_true_lang-DUda4p7_.mjs +125 -0
- package/dist/chunks/DrawerButton.vue_vue_type_script_setup_true_lang-DUda4p7_.mjs.map +1 -0
- package/dist/chunks/EditableGrid-Cx7ScWkW.mjs +1783 -0
- package/dist/chunks/EditableGrid-Cx7ScWkW.mjs.map +1 -0
- package/dist/chunks/FormItem-C1q0opnk.mjs +79 -0
- package/dist/chunks/FormItem-C1q0opnk.mjs.map +1 -0
- package/dist/chunks/Iframe-CeSiMnvR.mjs +65 -0
- package/dist/chunks/Iframe-CeSiMnvR.mjs.map +1 -0
- package/dist/chunks/ImageUpload-D3JGJjVO.mjs +193 -0
- package/dist/chunks/ImageUpload-D3JGJjVO.mjs.map +1 -0
- package/dist/chunks/Panel-d4chdlTA.mjs +113 -0
- package/dist/chunks/Panel-d4chdlTA.mjs.map +1 -0
- package/dist/chunks/PromptButton.vue_vue_type_script_setup_true_lang-BqoNAUoo.mjs +118 -0
- package/dist/chunks/PromptButton.vue_vue_type_script_setup_true_lang-BqoNAUoo.mjs.map +1 -0
- package/dist/chunks/RadioList-DT-8WSN2.mjs +129 -0
- package/dist/chunks/RadioList-DT-8WSN2.mjs.map +1 -0
- package/dist/chunks/Requester.vue_vue_type_script_setup_true_lang-5B1V-53c.mjs +80 -0
- package/dist/chunks/Requester.vue_vue_type_script_setup_true_lang-5B1V-53c.mjs.map +1 -0
- package/dist/chunks/RouteButton.vue_vue_type_script_setup_true_lang-Da0D3tKA.mjs +73 -0
- package/dist/chunks/RouteButton.vue_vue_type_script_setup_true_lang-Da0D3tKA.mjs.map +1 -0
- package/dist/chunks/SearchItem-pFO57lEO.mjs +79 -0
- package/dist/chunks/SearchItem-pFO57lEO.mjs.map +1 -0
- package/dist/chunks/SearchPanel-xQ1hPaNq.mjs +158 -0
- package/dist/chunks/SearchPanel-xQ1hPaNq.mjs.map +1 -0
- package/dist/chunks/Select-CMw-tWYm.mjs +114 -0
- package/dist/chunks/Select-CMw-tWYm.mjs.map +1 -0
- package/dist/chunks/Station-BF_QlQ8c.mjs +796 -0
- package/dist/chunks/Station-BF_QlQ8c.mjs.map +1 -0
- package/dist/chunks/Switch.vue_vue_type_script_setup_true_lang-CCU_d3jW.mjs +71 -0
- package/dist/chunks/Switch.vue_vue_type_script_setup_true_lang-CCU_d3jW.mjs.map +1 -0
- package/dist/chunks/Tips-IWCZcR1K.mjs +63 -0
- package/dist/chunks/Tips-IWCZcR1K.mjs.map +1 -0
- package/dist/chunks/TipsButton.vue_vue_type_script_setup_true_lang-DvcpRSV1.mjs +51 -0
- package/dist/chunks/TipsButton.vue_vue_type_script_setup_true_lang-DvcpRSV1.mjs.map +1 -0
- package/dist/chunks/Upload.vue_vue_type_script_setup_true_lang-CkxGO85H.mjs +200 -0
- package/dist/chunks/Upload.vue_vue_type_script_setup_true_lang-CkxGO85H.mjs.map +1 -0
- package/dist/chunks/Viewer-COLbtcgF.mjs +381 -0
- package/dist/chunks/Viewer-COLbtcgF.mjs.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +10 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs.map +1 -0
- package/dist/chunks/containerContext-BgphFDeH.mjs +13 -0
- package/dist/chunks/containerContext-BgphFDeH.mjs.map +1 -0
- package/dist/chunks/http-DUPsbs2K.mjs +2951 -0
- package/dist/chunks/http-DUPsbs2K.mjs.map +1 -0
- package/dist/chunks/linkage-FbL1mcz3.mjs +66 -0
- package/dist/chunks/linkage-FbL1mcz3.mjs.map +1 -0
- package/dist/chunks/props-DAytpx7D.mjs +65 -0
- package/dist/chunks/props-DAytpx7D.mjs.map +1 -0
- package/dist/chunks/useApiAction-C1CdKGjt.mjs +30 -0
- package/dist/chunks/useApiAction-C1CdKGjt.mjs.map +1 -0
- package/dist/chunks/useColumnSettings-BDtF5-8R.mjs +216 -0
- package/dist/chunks/useColumnSettings-BDtF5-8R.mjs.map +1 -0
- package/dist/chunks/useOptionsLoader-D0RTB_ar.mjs +64 -0
- package/dist/chunks/useOptionsLoader-D0RTB_ar.mjs.map +1 -0
- package/dist/confirm-button/index.mjs +7 -0
- package/dist/confirm-button/index.mjs.map +1 -0
- package/dist/data-form/index.mjs +7 -0
- package/dist/data-form/index.mjs.map +1 -0
- package/dist/data-form/style.css +1 -0
- package/dist/data-grid/index.mjs +7 -0
- package/dist/data-grid/index.mjs.map +1 -0
- package/dist/data-grid/style.css +1 -0
- package/dist/dialog-button/index.mjs +7 -0
- package/dist/dialog-button/index.mjs.map +1 -0
- package/dist/drawer/index.mjs +7 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/drawer/style.css +1 -0
- package/dist/drawer-button/index.mjs +7 -0
- package/dist/drawer-button/index.mjs.map +1 -0
- package/dist/editable-grid/index.mjs +7 -0
- package/dist/editable-grid/index.mjs.map +1 -0
- package/dist/editable-grid/style.css +1 -0
- package/dist/form-item/index.mjs +7 -0
- package/dist/form-item/index.mjs.map +1 -0
- package/dist/form-item/style.css +1 -0
- package/dist/iframe/index.mjs +7 -0
- package/dist/iframe/index.mjs.map +1 -0
- package/dist/iframe/style.css +1 -0
- package/dist/image-upload/index.mjs +7 -0
- package/dist/image-upload/index.mjs.map +1 -0
- package/dist/image-upload/style.css +1 -0
- package/dist/index.esm.js +318 -6474
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +20 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/panel/index.mjs +7 -0
- package/dist/panel/index.mjs.map +1 -0
- package/dist/panel/style.css +1 -0
- package/dist/prompt-button/index.mjs +7 -0
- package/dist/prompt-button/index.mjs.map +1 -0
- package/dist/radio-list/index.mjs +7 -0
- package/dist/radio-list/index.mjs.map +1 -0
- package/dist/radio-list/style.css +1 -0
- package/dist/requester/index.mjs +7 -0
- package/dist/requester/index.mjs.map +1 -0
- package/dist/route-button/index.mjs +7 -0
- package/dist/route-button/index.mjs.map +1 -0
- package/dist/search-item/index.mjs +7 -0
- package/dist/search-item/index.mjs.map +1 -0
- package/dist/search-item/style.css +1 -0
- package/dist/search-panel/index.mjs +7 -0
- package/dist/search-panel/index.mjs.map +1 -0
- package/dist/search-panel/style.css +1 -0
- package/dist/select/index.mjs +7 -0
- package/dist/select/index.mjs.map +1 -0
- package/dist/station/index.mjs +7 -0
- package/dist/station/index.mjs.map +1 -0
- package/dist/station/style.css +1 -0
- package/dist/style.css +1 -1
- package/dist/switch/index.mjs +7 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/tips/index.mjs +7 -0
- package/dist/tips/index.mjs.map +1 -0
- package/dist/tips/style.css +1 -0
- package/dist/tips-button/index.mjs +7 -0
- package/dist/tips-button/index.mjs.map +1 -0
- package/dist/types/src/components/buttons/ApiButton.vue.d.ts +41 -3
- package/dist/types/src/components/buttons/ConfirmButton.vue.d.ts +43 -5
- package/dist/types/src/components/buttons/DialogButton.vue.d.ts +89 -29
- package/dist/types/src/components/buttons/DrawerButton.vue.d.ts +99 -31
- package/dist/types/src/components/buttons/PopconfirmButton.vue.d.ts +317 -0
- package/dist/types/src/components/buttons/PromptButton.vue.d.ts +51 -11
- package/dist/types/src/components/buttons/RouteButton.vue.d.ts +40 -2
- package/dist/types/src/components/buttons/TipsButton.vue.d.ts +14 -12
- package/dist/types/src/components/common/props.d.ts +37 -0
- package/dist/types/src/components/containers/Drawer.vue.d.ts +61 -8
- package/dist/types/src/components/containers/Iframe.vue.d.ts +39 -2
- package/dist/types/src/components/containers/containerContext.d.ts +1 -1
- package/dist/types/src/components/containers/useContainerController.d.ts +5 -0
- package/dist/types/src/components/containers/useIframeContainer.d.ts +20 -0
- package/dist/types/src/components/core/Requester.vue.d.ts +41 -0
- package/dist/types/src/components/data/datagrid/DataGrid.vue.d.ts +212 -5
- package/dist/types/src/components/data/datagrid/useColumnSettings.d.ts +14 -0
- package/dist/types/src/components/data/editable-grid/EditableGrid.vue.d.ts +586 -0
- package/dist/types/src/components/data/viewer/Viewer.vue.d.ts +187 -0
- package/dist/types/src/components/form/FormItem.vue.d.ts +62 -0
- package/dist/types/src/components/form/SearchItem.vue.d.ts +62 -0
- package/dist/types/src/components/{containers → form}/SearchPanel.vue.d.ts +17 -2
- package/dist/types/src/components/form/data-form/DataForm.vue.d.ts +6 -6
- package/dist/types/src/components/index.d.ts +10 -6
- package/dist/types/src/components/inputs/AutoComplete.vue.d.ts +12 -3
- package/dist/types/src/components/inputs/CheckboxList.vue.d.ts +28 -3
- package/dist/types/src/components/inputs/RadioList.vue.d.ts +28 -3
- package/dist/types/src/components/inputs/Select.vue.d.ts +11 -1
- package/dist/types/src/components/inputs/Switch.vue.d.ts +2 -2
- package/dist/types/src/components/inputs/useOptionsLoader.d.ts +3 -0
- package/dist/types/src/components/layout/Station.vue.d.ts +302 -0
- package/dist/types/src/components/layout/StationMenuNode.vue.d.ts +20 -0
- package/dist/types/src/components/layout/types.d.ts +54 -0
- package/dist/types/src/components/styles/Panel.vue.d.ts +47 -5
- package/dist/types/src/components/upload/ImageUpload.vue.d.ts +9 -9
- package/dist/types/src/components/upload/Upload.vue.d.ts +1 -1
- package/dist/types/src/entries/api-button.d.ts +9 -0
- package/dist/types/src/entries/auto-complete.d.ts +9 -0
- package/dist/types/src/entries/checkbox-list.d.ts +9 -0
- package/dist/types/src/entries/components-map.d.ts +8 -0
- package/dist/types/src/entries/confirm-button.d.ts +9 -0
- package/dist/types/src/entries/data-form.d.ts +9 -0
- package/dist/types/src/entries/data-grid.d.ts +9 -0
- package/dist/types/src/entries/dialog-button.d.ts +9 -0
- package/dist/types/src/entries/drawer-button.d.ts +9 -0
- package/dist/types/src/entries/drawer.d.ts +9 -0
- package/dist/types/src/entries/editable-grid.d.ts +9 -0
- package/dist/types/src/entries/form-item.d.ts +9 -0
- package/dist/types/src/entries/iframe.d.ts +9 -0
- package/dist/types/src/entries/image-upload.d.ts +9 -0
- package/dist/types/src/entries/panel.d.ts +9 -0
- package/dist/types/src/entries/prompt-button.d.ts +9 -0
- package/dist/types/src/entries/radio-list.d.ts +9 -0
- package/dist/types/src/entries/requester.d.ts +9 -0
- package/dist/types/src/entries/route-button.d.ts +9 -0
- package/dist/types/src/entries/search-item.d.ts +9 -0
- package/dist/types/src/entries/search-panel.d.ts +9 -0
- package/dist/types/src/entries/select.d.ts +9 -0
- package/dist/types/src/entries/station.d.ts +9 -0
- package/dist/types/src/entries/switch.d.ts +9 -0
- package/dist/types/src/entries/tips-button.d.ts +9 -0
- package/dist/types/src/entries/tips.d.ts +9 -0
- package/dist/types/src/entries/upload.d.ts +9 -0
- package/dist/types/src/entries/viewer.d.ts +9 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/lib/composables/useConfig.d.ts +1 -1
- package/dist/types/src/lib/composables/useDataGrid.d.ts +15 -0
- package/dist/types/src/lib/core/http.d.ts +21 -4
- package/dist/types/src/lib/core/station-linkage.d.ts +41 -0
- package/dist/types/src/types/config.d.ts +21 -4
- package/dist/types/vite.config.d.ts +6 -1
- package/dist/upload/index.mjs +7 -0
- package/dist/upload/index.mjs.map +1 -0
- package/dist/viewer/index.mjs +7 -0
- package/dist/viewer/index.mjs.map +1 -0
- package/dist/viewer/style.css +1 -0
- package/package.json +199 -68
- package/dist/types/src/components/containers/Dialog.vue.d.ts +0 -112
- package/dist/types/src/components/data/editable-table/EditableTable.vue.d.ts +0 -306
- package/dist/types/src/components/utils/Viewer.vue.d.ts +0 -131
|
@@ -0,0 +1,1124 @@
|
|
|
1
|
+
import { defineComponent as Fe, useSlots as Ft, ref as D, computed as m, watch as N, nextTick as we, onMounted as Ot, onBeforeUnmount as Lt, resolveComponent as P, resolveDirective as It, openBlock as o, createElementBlock as y, normalizeStyle as Gt, normalizeClass as A, renderSlot as Y, unref as u, createBlock as f, withCtx as a, createVNode as n, createTextVNode as C, createCommentVNode as g, toDisplayString as M, withDirectives as Oe, Fragment as J, renderList as Q, createElementVNode as E, isRef as Nt, withModifiers as Le, resolveDynamicComponent as jt, createSlots as Ut } from "vue";
|
|
2
|
+
import { Plus as Ie, Download as Ge, Refresh as Ne, ScaleToOriginal as je, Grid as Ue, Menu as We, Setting as qe, ShoppingCart as Ye, Rank as Wt } from "@element-plus/icons-vue";
|
|
3
|
+
import { u as qt, a as Yt, o as Jt } from "./useColumnSettings-BDtF5-8R.mjs";
|
|
4
|
+
import { a as Qt } from "./linkage-FbL1mcz3.mjs";
|
|
5
|
+
import { c as Xt, a as Zt } from "./http-DUPsbs2K.mjs";
|
|
6
|
+
import { _ as ea } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
7
|
+
const ta = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "wd-datagrid__toolbar"
|
|
10
|
+
}, aa = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "wd-datagrid__cart-text"
|
|
13
|
+
}, la = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "wd-datagrid__cards"
|
|
16
|
+
}, na = { class: "wd-datagrid__card-title" }, oa = { class: "wd-datagrid__card-body" }, ia = { class: "wd-datagrid__card-label" }, ra = { class: "wd-datagrid__card-value" }, ua = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "wd-datagrid__bottom-group wd-datagrid__bottom-actions"
|
|
19
|
+
}, da = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "wd-datagrid__cart-text"
|
|
22
|
+
}, sa = { class: "wd-datagrid__col-setting" }, ca = ["onDragover", "onDragleave", "onDrop"], fa = ["onDragstart"], ga = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "wd-datagrid__cart-list"
|
|
25
|
+
}, va = { class: "wd-datagrid__cart-name" }, pa = /* @__PURE__ */ Fe({
|
|
26
|
+
name: "WdDataGrid",
|
|
27
|
+
__name: "DataGrid",
|
|
28
|
+
props: {
|
|
29
|
+
// 数据源
|
|
30
|
+
api: { type: String, default: "" },
|
|
31
|
+
apiMethod: { type: String, default: "post" },
|
|
32
|
+
apiParam: { type: Object, default: () => ({}) },
|
|
33
|
+
active: { type: Boolean, default: !1 },
|
|
34
|
+
/** 静态数据(数组) */
|
|
35
|
+
dataSource: { type: [Array, Object], default: void 0 },
|
|
36
|
+
// 分页 / 搜索 / 模式
|
|
37
|
+
withPager: { type: Boolean, default: !0 },
|
|
38
|
+
withSearch: { type: Boolean, default: !1 },
|
|
39
|
+
modeSwitch: { type: Boolean, default: !1 },
|
|
40
|
+
dynamicColumn: { type: Boolean, default: !1 },
|
|
41
|
+
columnStorageKey: { type: String, default: "" },
|
|
42
|
+
// 表格展示
|
|
43
|
+
fix: { type: Boolean, default: !0 },
|
|
44
|
+
border: { type: Boolean, default: !1 },
|
|
45
|
+
stripe: { type: Boolean, default: !1 },
|
|
46
|
+
/**
|
|
47
|
+
* 高度模式:缺省内容自适应(数据多少就多高);
|
|
48
|
+
* 'fix' —— 贴合最近一个有确定高度 / 可滚动的祖先容器(顶部取自身位置、底部贴其内容区底),
|
|
49
|
+
* 数据超出在行区内滚动、表头固定;祖先无定高 / 滚动约束时退化为内容自适应;
|
|
50
|
+
* 数字 / CSS 长度(如 '520px')—— 表格固定高度,行区内滚动。
|
|
51
|
+
*/
|
|
52
|
+
height: { type: [String, Number], default: void 0 },
|
|
53
|
+
autoHeight: { type: Boolean, default: !1 },
|
|
54
|
+
rowKey: { type: String, default: "" },
|
|
55
|
+
tableSize: { type: String, default: "default" },
|
|
56
|
+
pagerStyle: { type: String, default: "normal" },
|
|
57
|
+
/** 分页在底栏的水平位置:left/center/right;缺省走全局配置 page.pager.position(默认 right) */
|
|
58
|
+
pagerPosition: { type: String, default: "" },
|
|
59
|
+
withIndex: { type: Boolean, default: !0 },
|
|
60
|
+
withSelection: { type: Boolean, default: !1 },
|
|
61
|
+
// 行合并
|
|
62
|
+
rowspanKey: { type: String, default: "" },
|
|
63
|
+
rowspanColumn: { type: Array, default: () => [] },
|
|
64
|
+
// 树形
|
|
65
|
+
treeProps: { type: Object, default: () => ({ children: "children", hasChildren: "hasChildren" }) },
|
|
66
|
+
defaultExpandAll: { type: Boolean, default: !1 },
|
|
67
|
+
// selection v-model
|
|
68
|
+
modelValue: { type: Array, default: () => [] },
|
|
69
|
+
/**
|
|
70
|
+
* 选中项返回:默认返回完整行对象数组;如果设置 selectionKey,则返回对应字段值数组
|
|
71
|
+
*/
|
|
72
|
+
selectionKey: { type: String, default: "" },
|
|
73
|
+
// tools
|
|
74
|
+
tools: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: () => ({})
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* 内置工具按钮组(刷新 / 大小 / 模式切换 / 列设置 / 购物车)位置:
|
|
80
|
+
* left 右上左区 / right 右上右区(默认)/ bottom 底栏(与分页同一行)
|
|
81
|
+
*/
|
|
82
|
+
toolsPosition: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "right"
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* 自定义工具栏(toolbar 插槽 + 新增/导出按钮)位置:
|
|
88
|
+
* left 左上左区(默认)/ right 左上右区 / bottom 底栏(与分页同一行)
|
|
89
|
+
*/
|
|
90
|
+
toolbarPosition: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: "left"
|
|
93
|
+
},
|
|
94
|
+
/** 内置操作列配置(渲染行操作按钮,点击 emit row-action) */
|
|
95
|
+
rowActions: {
|
|
96
|
+
type: Array,
|
|
97
|
+
default: () => []
|
|
98
|
+
},
|
|
99
|
+
// 跨页选择「购物车」
|
|
100
|
+
withSelectionCart: { type: Boolean, default: !1 },
|
|
101
|
+
/** 购物车去重/自动回勾的唯一键字段,缺省复用 rowKey,均未配置时退化为按行对象引用比较 */
|
|
102
|
+
cartRowKey: { type: String, default: "" },
|
|
103
|
+
/** 购物车按钮与查看面板配置 */
|
|
104
|
+
cartConfig: {
|
|
105
|
+
type: Object,
|
|
106
|
+
default: () => ({
|
|
107
|
+
type: "dialog",
|
|
108
|
+
title: "已选数据",
|
|
109
|
+
buttonText: "",
|
|
110
|
+
size: 560,
|
|
111
|
+
showClear: !0,
|
|
112
|
+
showRemove: !0
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
// 联动
|
|
116
|
+
filter: { type: String, default: "" }
|
|
117
|
+
},
|
|
118
|
+
emits: [
|
|
119
|
+
"add",
|
|
120
|
+
"export",
|
|
121
|
+
"row-action",
|
|
122
|
+
"page-change",
|
|
123
|
+
"selection-change",
|
|
124
|
+
"mode-change",
|
|
125
|
+
"loaded",
|
|
126
|
+
"apiBefore",
|
|
127
|
+
"apiAfter",
|
|
128
|
+
"update:modelValue",
|
|
129
|
+
"cart-change"
|
|
130
|
+
],
|
|
131
|
+
setup(d, { expose: Je, emit: Qe }) {
|
|
132
|
+
const Xe = Fe({
|
|
133
|
+
name: "WdColumnRenderer",
|
|
134
|
+
props: {
|
|
135
|
+
vnodes: { type: Array, default: () => [] }
|
|
136
|
+
},
|
|
137
|
+
render() {
|
|
138
|
+
return this.vnodes;
|
|
139
|
+
}
|
|
140
|
+
}), l = d, b = Qe, re = Ft(), H = D(null), $ = D("table"), w = m(() => ({
|
|
141
|
+
refresh: l.tools.refresh !== !1,
|
|
142
|
+
// 默认 true
|
|
143
|
+
columnSetting: l.tools.columnSetting === !0,
|
|
144
|
+
// 默认 false
|
|
145
|
+
modeSwitch: l.tools.modeSwitch !== !1,
|
|
146
|
+
// 默认 true(需配合 card-item 插槽才渲染)
|
|
147
|
+
size: l.tools.size !== !1,
|
|
148
|
+
// 默认 true
|
|
149
|
+
add: l.tools.add === !0,
|
|
150
|
+
// 默认 false
|
|
151
|
+
export: l.tools.export === !0
|
|
152
|
+
// 默认 false
|
|
153
|
+
})), B = m(() => l.tools.mode || "round"), k = m(() => l.tools.buttonSize || void 0), Ze = m(() => !!re.toolbar), ue = m(() => Ze.value || w.value.add || w.value.export), de = m(
|
|
154
|
+
() => w.value.refresh || w.value.size || (w.value.modeSwitch || l.modeSwitch) && !!re["card-item"] || w.value.columnSetting || l.dynamicColumn || l.withSelectionCart
|
|
155
|
+
), be = m(() => ue.value && l.toolbarPosition !== "bottom"), Se = m(() => de.value && l.toolsPosition !== "bottom"), Ce = m(() => ue.value && l.toolbarPosition === "bottom"), ke = m(() => de.value && l.toolsPosition === "bottom"), et = m(() => be.value || Se.value), tt = m(
|
|
156
|
+
() => Ce.value || ke.value || l.withPager && $.value === "table"
|
|
157
|
+
);
|
|
158
|
+
m(() => ue.value || de.value);
|
|
159
|
+
let O = !1;
|
|
160
|
+
const p = D([]), se = D(!1);
|
|
161
|
+
function V(e) {
|
|
162
|
+
const t = l.cartRowKey || l.rowKey;
|
|
163
|
+
return t ? e == null ? void 0 : e[t] : e;
|
|
164
|
+
}
|
|
165
|
+
function at(e) {
|
|
166
|
+
const t = l.cartRowKey || l.rowKey;
|
|
167
|
+
if (!t) return "已选项";
|
|
168
|
+
const r = e == null ? void 0 : e[t];
|
|
169
|
+
return r == null ? "" : String(r);
|
|
170
|
+
}
|
|
171
|
+
function lt(e) {
|
|
172
|
+
const t = new Set(_.value.map((s) => V(s))), i = [...p.value.filter((s) => !t.has(V(s)))];
|
|
173
|
+
e.forEach((s) => {
|
|
174
|
+
const S = V(s), x = i.findIndex((T) => V(T) === S);
|
|
175
|
+
x >= 0 ? i[x] = s : i.push(s);
|
|
176
|
+
}), (i.length !== p.value.length || i.some((s, S) => V(s) !== V(p.value[S]) || s !== p.value[S])) && (p.value = i, b("cart-change", p.value));
|
|
177
|
+
}
|
|
178
|
+
function _e() {
|
|
179
|
+
se.value = !0;
|
|
180
|
+
}
|
|
181
|
+
function ze(e) {
|
|
182
|
+
const t = V(e);
|
|
183
|
+
p.value = p.value.filter((i) => V(i) !== t), b("cart-change", p.value);
|
|
184
|
+
const r = H.value;
|
|
185
|
+
r && _.value.includes(e) && r.toggleRowSelection(e, !1);
|
|
186
|
+
}
|
|
187
|
+
function ce() {
|
|
188
|
+
var e, t;
|
|
189
|
+
p.value = [], b("cart-change", p.value), (t = (e = H.value) == null ? void 0 : e.clearSelection) == null || t.call(e);
|
|
190
|
+
}
|
|
191
|
+
function nt() {
|
|
192
|
+
return p.value;
|
|
193
|
+
}
|
|
194
|
+
function ot() {
|
|
195
|
+
if (!l.withSelectionCart || !l.withSelection || !_.value.length || !p.value.length) return;
|
|
196
|
+
const e = H.value;
|
|
197
|
+
e && (O = !0, _.value.forEach((t) => {
|
|
198
|
+
p.value.some((r) => V(r) === V(t)) && e.toggleRowSelection(t, !0);
|
|
199
|
+
}), we(() => {
|
|
200
|
+
O = !1;
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
const X = l.columnStorageKey ? `wd:tablesize:${l.columnStorageKey}` : "", xe = X ? Xt(localStorage.getItem(X), null) : null, R = D(xe || l.tableSize);
|
|
204
|
+
N(
|
|
205
|
+
() => l.tableSize,
|
|
206
|
+
(e) => {
|
|
207
|
+
xe || (R.value = e);
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
function Pe(e) {
|
|
211
|
+
R.value = e, X && localStorage.setItem(X, JSON.stringify(e));
|
|
212
|
+
}
|
|
213
|
+
const Be = D(null), j = D(0), U = D(0), Z = m(() => l.height === "fix"), it = m(() => {
|
|
214
|
+
if (l.autoHeight) return !1;
|
|
215
|
+
const e = l.height;
|
|
216
|
+
return e != null && e !== "" && e !== "fix";
|
|
217
|
+
}), rt = m(
|
|
218
|
+
() => Z.value && j.value > 0 ? { height: `${j.value}px` } : void 0
|
|
219
|
+
), ut = m(() => {
|
|
220
|
+
if (Z.value) return U.value > 0 ? U.value : void 0;
|
|
221
|
+
if (l.autoHeight) return "100%";
|
|
222
|
+
const e = l.height;
|
|
223
|
+
if (!(e == null || e === ""))
|
|
224
|
+
return e;
|
|
225
|
+
});
|
|
226
|
+
function dt(e) {
|
|
227
|
+
let t = e.parentElement;
|
|
228
|
+
for (; t && t !== document.body && t !== document.documentElement; ) {
|
|
229
|
+
const r = getComputedStyle(t), i = parseFloat(r.height), v = r.maxHeight === "none" ? 0 : parseFloat(r.maxHeight), s = r.overflowY, S = s === "auto" || s === "scroll" || s === "overlay", x = Number.isFinite(i) && i > 0 || Number.isFinite(v) && v > 0;
|
|
230
|
+
if (S || x) return t;
|
|
231
|
+
t = t.parentElement;
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
let ee = null, z = null;
|
|
236
|
+
function te() {
|
|
237
|
+
const e = Be.value;
|
|
238
|
+
if (!e || !Z.value) return;
|
|
239
|
+
const t = dt(e);
|
|
240
|
+
if (ee !== t && (z == null || z.disconnect(), ee = t, t && typeof ResizeObserver < "u" && (z = new ResizeObserver(() => te()), z.observe(t))), !t) {
|
|
241
|
+
j.value = 0, U.value = 0;
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const r = getComputedStyle(t), i = parseFloat(r.paddingBottom) || 0, v = t.getBoundingClientRect(), s = e.getBoundingClientRect().top, S = Math.floor(t.clientHeight - i + v.top + t.clientTop - s - t.scrollTop);
|
|
245
|
+
if (S <= 0) {
|
|
246
|
+
j.value = 0, U.value = 0;
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
j.value = S;
|
|
250
|
+
const x = e.querySelector(".wd-datagrid__toolbar"), T = e.querySelector(".wd-datagrid__pager");
|
|
251
|
+
U.value = Math.max(40, S - ((x == null ? void 0 : x.offsetHeight) ?? 0) - ((T == null ? void 0 : T.offsetHeight) ?? 0));
|
|
252
|
+
}
|
|
253
|
+
function ae() {
|
|
254
|
+
te();
|
|
255
|
+
}
|
|
256
|
+
N(
|
|
257
|
+
() => l.height,
|
|
258
|
+
(e) => {
|
|
259
|
+
e === "fix" ? (window.addEventListener("resize", ae), we(te)) : (window.removeEventListener("resize", ae), z == null || z.disconnect(), z = null, ee = null);
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
const W = Zt(), st = W.page.pager.pageSizes, ct = W.page.pager.hideOnSinglePage, ft = m(() => l.pagerStyle === "simple" ? "prev, pager, next" : l.pagerStyle === "full" ? "total, sizes, prev, pager, next, jumper" : W.page.pager.layout), gt = m(() => l.pagerPosition || W.page.pager.position || "right"), F = m(() => Array.isArray(l.dataSource)), K = qt({
|
|
263
|
+
api: F.value ? "" : l.api,
|
|
264
|
+
apiMethod: l.apiMethod,
|
|
265
|
+
apiParam: l.apiParam,
|
|
266
|
+
pageSize: W.page.pager.pageSize,
|
|
267
|
+
immediate: !1
|
|
268
|
+
}), { list: _, total: Ke, loading: fe, currentPage: le, pageSize: ge, selection: Te } = K;
|
|
269
|
+
N(
|
|
270
|
+
() => l.dataSource,
|
|
271
|
+
(e) => {
|
|
272
|
+
F.value && (_.value = e, Ke.value = e.length);
|
|
273
|
+
},
|
|
274
|
+
{ immediate: !0 }
|
|
275
|
+
);
|
|
276
|
+
const {
|
|
277
|
+
columns: vt,
|
|
278
|
+
controllableColumns: pt,
|
|
279
|
+
hiddenKeys: mt,
|
|
280
|
+
columnOrderMap: yt,
|
|
281
|
+
settingVisible: L,
|
|
282
|
+
init: ht,
|
|
283
|
+
setVisible: wt,
|
|
284
|
+
reorder: bt,
|
|
285
|
+
reset: St
|
|
286
|
+
} = Yt(l.columnStorageKey || void 0), I = D(""), G = D(""), ne = D("before");
|
|
287
|
+
function Ct(e, t) {
|
|
288
|
+
I.value = t, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t));
|
|
289
|
+
}
|
|
290
|
+
function kt(e, t) {
|
|
291
|
+
if (!I.value || I.value === t) return;
|
|
292
|
+
const i = e.currentTarget.getBoundingClientRect();
|
|
293
|
+
G.value = t, ne.value = e.clientY - i.top < i.height / 2 ? "before" : "after", e.dataTransfer && (e.dataTransfer.dropEffect = "move");
|
|
294
|
+
}
|
|
295
|
+
function _t(e) {
|
|
296
|
+
G.value === e && (G.value = "");
|
|
297
|
+
}
|
|
298
|
+
function zt(e) {
|
|
299
|
+
bt(I.value, e, ne.value), De();
|
|
300
|
+
}
|
|
301
|
+
function De() {
|
|
302
|
+
I.value = "", G.value = "";
|
|
303
|
+
}
|
|
304
|
+
const xt = m(() => {
|
|
305
|
+
const e = re.default;
|
|
306
|
+
if (!e) return [];
|
|
307
|
+
const t = e();
|
|
308
|
+
return vt.value.length || ht(t), Jt(Pt(t, mt.value), yt.value);
|
|
309
|
+
});
|
|
310
|
+
function Pt(e, t) {
|
|
311
|
+
const r = [];
|
|
312
|
+
return e.forEach((i) => {
|
|
313
|
+
if (!i || typeof i != "object") {
|
|
314
|
+
i && r.push(i);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const v = i.props || {}, s = String(v.prop || v.columnKey || "");
|
|
318
|
+
v.type === "selection" || v.type === "index" || s && t.has(s) || r.push(i);
|
|
319
|
+
}), r;
|
|
320
|
+
}
|
|
321
|
+
function Bt(e) {
|
|
322
|
+
return (le.value - 1) * ge.value + e + 1;
|
|
323
|
+
}
|
|
324
|
+
function Kt({ row: e, column: t, rowIndex: r, columnIndex: i }) {
|
|
325
|
+
if (!l.rowspanKey || !l.rowspanColumn.length) return { rowspan: 1, colspan: 1 };
|
|
326
|
+
const v = t.property;
|
|
327
|
+
if (!l.rowspanColumn.includes(v)) return { rowspan: 1, colspan: 1 };
|
|
328
|
+
const s = _.value, S = e[l.rowspanKey], x = s.findIndex((T) => T[l.rowspanKey] === S);
|
|
329
|
+
return r === x ? { rowspan: s.filter((q) => q[l.rowspanKey] === S).length, colspan: 1 } : { rowspan: 0, colspan: 0 };
|
|
330
|
+
}
|
|
331
|
+
function ve(e) {
|
|
332
|
+
return l.selectionKey ? e.map((t) => t == null ? void 0 : t[l.selectionKey]) : e;
|
|
333
|
+
}
|
|
334
|
+
function pe(e, t) {
|
|
335
|
+
if (e === void 0 && (e = l.modelValue), (!e || e.length === 0) && (!t || t.length === 0)) return;
|
|
336
|
+
const r = H.value;
|
|
337
|
+
if (!r) return;
|
|
338
|
+
const i = ve(K.getSelection());
|
|
339
|
+
i.length === e.length && e.every((v) => i.includes(v)) || (O = !0, r.clearSelection(), e && e.length && (l.selectionKey ? _.value.filter((s) => e.includes(s == null ? void 0 : s[l.selectionKey])) : _.value.filter((s) => e.includes(s))).forEach((s) => r.toggleRowSelection(s, !0)), we(() => {
|
|
340
|
+
O = !1;
|
|
341
|
+
}));
|
|
342
|
+
}
|
|
343
|
+
N(
|
|
344
|
+
() => l.modelValue,
|
|
345
|
+
(e, t) => {
|
|
346
|
+
pe(e, t);
|
|
347
|
+
},
|
|
348
|
+
{ deep: !0 }
|
|
349
|
+
), N(
|
|
350
|
+
() => _.value,
|
|
351
|
+
() => {
|
|
352
|
+
O || pe(), l.withSelectionCart && ot();
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
function Tt(e) {
|
|
356
|
+
if (K.setSelection(e), O) return;
|
|
357
|
+
l.withSelectionCart && lt(e);
|
|
358
|
+
const t = ve(e);
|
|
359
|
+
b("selection-change", t), b("update:modelValue", t);
|
|
360
|
+
}
|
|
361
|
+
function Ve(e) {
|
|
362
|
+
K.onChangeCurrentpage(e), b("page-change", { currentPage: e, pageSize: ge.value });
|
|
363
|
+
}
|
|
364
|
+
function Re(e) {
|
|
365
|
+
K.onChangePagesize(e), b("page-change", { currentPage: le.value, pageSize: e });
|
|
366
|
+
}
|
|
367
|
+
function $e() {
|
|
368
|
+
$.value = $.value === "table" ? "card" : "table", b("mode-change", $.value);
|
|
369
|
+
}
|
|
370
|
+
const Dt = m(() => {
|
|
371
|
+
const e = l.rowActions.reduce((t, r) => t + r.text.length * 14 + 16, 20);
|
|
372
|
+
return Math.max(e, 90);
|
|
373
|
+
});
|
|
374
|
+
function Vt(e, t) {
|
|
375
|
+
b("row-action", { row: e, command: t.command ?? t.text, text: t.text });
|
|
376
|
+
}
|
|
377
|
+
function me(e) {
|
|
378
|
+
return F.value ? Promise.resolve() : K.fetchData(e == null ? void 0 : e.apiParam).then((t) => {
|
|
379
|
+
b("loaded", t);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function oe() {
|
|
383
|
+
return F.value ? Promise.resolve() : K.fetchData().then((e) => b("loaded", e));
|
|
384
|
+
}
|
|
385
|
+
function Rt() {
|
|
386
|
+
return ve(K.getSelection());
|
|
387
|
+
}
|
|
388
|
+
function $t() {
|
|
389
|
+
var e, t;
|
|
390
|
+
(t = (e = H.value) == null ? void 0 : e.clearSelection) == null || t.call(e), K.clearSelection();
|
|
391
|
+
}
|
|
392
|
+
function Ae(e) {
|
|
393
|
+
return F.value ? Promise.resolve() : (le.value = 1, K.fetchData(e).then((t) => b("loaded", t)));
|
|
394
|
+
}
|
|
395
|
+
function Me() {
|
|
396
|
+
return K.reset();
|
|
397
|
+
}
|
|
398
|
+
Je({
|
|
399
|
+
requestApi: me,
|
|
400
|
+
refresh: oe,
|
|
401
|
+
onChangePagesize: Re,
|
|
402
|
+
onChangeCurrentpage: Ve,
|
|
403
|
+
getSelection: Rt,
|
|
404
|
+
clearSelection: $t,
|
|
405
|
+
search: Ae,
|
|
406
|
+
resetSearch: Me,
|
|
407
|
+
getCartList: nt,
|
|
408
|
+
clearCart: ce,
|
|
409
|
+
tableRef: H
|
|
410
|
+
});
|
|
411
|
+
let ie = null;
|
|
412
|
+
return Ot(() => {
|
|
413
|
+
ie = Qt({
|
|
414
|
+
filter: l.filter,
|
|
415
|
+
refresh: () => oe(),
|
|
416
|
+
search: (e) => Ae(e),
|
|
417
|
+
resetSearch: () => Me()
|
|
418
|
+
}), l.active && !F.value && me(), Z.value && (window.addEventListener("resize", ae), te()), pe();
|
|
419
|
+
}), Lt(() => {
|
|
420
|
+
window.removeEventListener("resize", ae), z == null || z.disconnect(), z = null, ee = null, ie == null || ie();
|
|
421
|
+
}), N(
|
|
422
|
+
() => [l.api, l.apiMethod],
|
|
423
|
+
() => {
|
|
424
|
+
l.active && !F.value && me();
|
|
425
|
+
}
|
|
426
|
+
), (e, t) => {
|
|
427
|
+
const r = P("el-icon"), i = P("el-button"), v = P("el-tooltip"), s = P("el-dropdown-item"), S = P("el-dropdown-menu"), x = P("el-dropdown"), T = P("el-badge"), q = P("el-table-column"), ye = P("el-empty"), At = P("el-table"), Mt = P("el-pagination"), Et = P("el-checkbox"), Ht = P("el-dialog"), Ee = It("loading");
|
|
428
|
+
return o(), y("div", {
|
|
429
|
+
ref_key: "rootRef",
|
|
430
|
+
ref: Be,
|
|
431
|
+
class: A(["wd-datagrid", {
|
|
432
|
+
"wd-datagrid--auto-height": d.autoHeight,
|
|
433
|
+
"wd-datagrid--fixed-height": it.value
|
|
434
|
+
}]),
|
|
435
|
+
style: Gt(rt.value)
|
|
436
|
+
}, [
|
|
437
|
+
et.value ? (o(), y("div", ta, [
|
|
438
|
+
be.value ? (o(), y("div", {
|
|
439
|
+
key: 0,
|
|
440
|
+
class: A(["wd-datagrid__toolbar-left wd-datagrid__toolbar-group", d.toolbarPosition === "right" ? "at-right" : "at-left"])
|
|
441
|
+
}, [
|
|
442
|
+
Y(e.$slots, "toolbar", {
|
|
443
|
+
selection: u(Te),
|
|
444
|
+
list: u(_)
|
|
445
|
+
}, void 0, !0),
|
|
446
|
+
w.value.add ? (o(), f(i, {
|
|
447
|
+
key: 0,
|
|
448
|
+
type: "primary",
|
|
449
|
+
size: k.value,
|
|
450
|
+
onClick: t[0] || (t[0] = (c) => b("add"))
|
|
451
|
+
}, {
|
|
452
|
+
default: a(() => [
|
|
453
|
+
n(r, null, {
|
|
454
|
+
default: a(() => [
|
|
455
|
+
n(u(Ie))
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
}),
|
|
459
|
+
t[10] || (t[10] = C("新增 ", -1))
|
|
460
|
+
]),
|
|
461
|
+
_: 1
|
|
462
|
+
}, 8, ["size"])) : g("", !0),
|
|
463
|
+
w.value.export ? (o(), f(i, {
|
|
464
|
+
key: 1,
|
|
465
|
+
size: k.value,
|
|
466
|
+
onClick: t[1] || (t[1] = (c) => b("export"))
|
|
467
|
+
}, {
|
|
468
|
+
default: a(() => [
|
|
469
|
+
n(r, null, {
|
|
470
|
+
default: a(() => [
|
|
471
|
+
n(u(Ge))
|
|
472
|
+
]),
|
|
473
|
+
_: 1
|
|
474
|
+
}),
|
|
475
|
+
t[11] || (t[11] = C("导出 ", -1))
|
|
476
|
+
]),
|
|
477
|
+
_: 1
|
|
478
|
+
}, 8, ["size"])) : g("", !0)
|
|
479
|
+
], 2)) : g("", !0),
|
|
480
|
+
Se.value ? (o(), y("div", {
|
|
481
|
+
key: 1,
|
|
482
|
+
class: A(["wd-datagrid__toolbar-right wd-datagrid__toolbar-group", [`is-${B.value}`, d.toolsPosition === "left" ? "at-left" : "at-right"]])
|
|
483
|
+
}, [
|
|
484
|
+
w.value.refresh ? (o(), f(v, {
|
|
485
|
+
key: 0,
|
|
486
|
+
content: "刷新",
|
|
487
|
+
placement: "top"
|
|
488
|
+
}, {
|
|
489
|
+
default: a(() => [
|
|
490
|
+
n(i, {
|
|
491
|
+
circle: B.value === "round",
|
|
492
|
+
size: k.value,
|
|
493
|
+
onClick: oe
|
|
494
|
+
}, {
|
|
495
|
+
default: a(() => [
|
|
496
|
+
n(r, null, {
|
|
497
|
+
default: a(() => [
|
|
498
|
+
n(u(Ne))
|
|
499
|
+
]),
|
|
500
|
+
_: 1
|
|
501
|
+
})
|
|
502
|
+
]),
|
|
503
|
+
_: 1
|
|
504
|
+
}, 8, ["circle", "size"])
|
|
505
|
+
]),
|
|
506
|
+
_: 1
|
|
507
|
+
})) : g("", !0),
|
|
508
|
+
w.value.size ? (o(), f(v, {
|
|
509
|
+
key: 1,
|
|
510
|
+
content: "调整大小",
|
|
511
|
+
placement: "top"
|
|
512
|
+
}, {
|
|
513
|
+
default: a(() => [
|
|
514
|
+
n(x, {
|
|
515
|
+
trigger: "click",
|
|
516
|
+
onCommand: Pe
|
|
517
|
+
}, {
|
|
518
|
+
dropdown: a(() => [
|
|
519
|
+
n(S, null, {
|
|
520
|
+
default: a(() => [
|
|
521
|
+
n(s, {
|
|
522
|
+
command: "large",
|
|
523
|
+
disabled: R.value === "large"
|
|
524
|
+
}, {
|
|
525
|
+
default: a(() => [...t[12] || (t[12] = [
|
|
526
|
+
C("大", -1)
|
|
527
|
+
])]),
|
|
528
|
+
_: 1
|
|
529
|
+
}, 8, ["disabled"]),
|
|
530
|
+
n(s, {
|
|
531
|
+
command: "default",
|
|
532
|
+
disabled: R.value === "default"
|
|
533
|
+
}, {
|
|
534
|
+
default: a(() => [...t[13] || (t[13] = [
|
|
535
|
+
C("默认", -1)
|
|
536
|
+
])]),
|
|
537
|
+
_: 1
|
|
538
|
+
}, 8, ["disabled"]),
|
|
539
|
+
n(s, {
|
|
540
|
+
command: "small",
|
|
541
|
+
disabled: R.value === "small"
|
|
542
|
+
}, {
|
|
543
|
+
default: a(() => [...t[14] || (t[14] = [
|
|
544
|
+
C("小", -1)
|
|
545
|
+
])]),
|
|
546
|
+
_: 1
|
|
547
|
+
}, 8, ["disabled"])
|
|
548
|
+
]),
|
|
549
|
+
_: 1
|
|
550
|
+
})
|
|
551
|
+
]),
|
|
552
|
+
default: a(() => [
|
|
553
|
+
n(i, {
|
|
554
|
+
circle: B.value === "round",
|
|
555
|
+
size: k.value
|
|
556
|
+
}, {
|
|
557
|
+
default: a(() => [
|
|
558
|
+
n(r, null, {
|
|
559
|
+
default: a(() => [
|
|
560
|
+
n(u(je))
|
|
561
|
+
]),
|
|
562
|
+
_: 1
|
|
563
|
+
})
|
|
564
|
+
]),
|
|
565
|
+
_: 1
|
|
566
|
+
}, 8, ["circle", "size"])
|
|
567
|
+
]),
|
|
568
|
+
_: 1
|
|
569
|
+
})
|
|
570
|
+
]),
|
|
571
|
+
_: 1
|
|
572
|
+
})) : g("", !0),
|
|
573
|
+
(w.value.modeSwitch || d.modeSwitch) && e.$slots["card-item"] ? (o(), f(v, {
|
|
574
|
+
key: 2,
|
|
575
|
+
content: "表格/列表切换",
|
|
576
|
+
placement: "top"
|
|
577
|
+
}, {
|
|
578
|
+
default: a(() => [
|
|
579
|
+
n(i, {
|
|
580
|
+
circle: B.value === "round",
|
|
581
|
+
size: k.value,
|
|
582
|
+
onClick: $e
|
|
583
|
+
}, {
|
|
584
|
+
default: a(() => [
|
|
585
|
+
n(r, null, {
|
|
586
|
+
default: a(() => [
|
|
587
|
+
$.value === "card" ? (o(), f(u(Ue), { key: 0 })) : (o(), f(u(We), { key: 1 }))
|
|
588
|
+
]),
|
|
589
|
+
_: 1
|
|
590
|
+
})
|
|
591
|
+
]),
|
|
592
|
+
_: 1
|
|
593
|
+
}, 8, ["circle", "size"])
|
|
594
|
+
]),
|
|
595
|
+
_: 1
|
|
596
|
+
})) : g("", !0),
|
|
597
|
+
w.value.columnSetting || d.dynamicColumn ? (o(), f(v, {
|
|
598
|
+
key: 3,
|
|
599
|
+
content: "列设置",
|
|
600
|
+
placement: "top"
|
|
601
|
+
}, {
|
|
602
|
+
default: a(() => [
|
|
603
|
+
n(i, {
|
|
604
|
+
circle: B.value === "round",
|
|
605
|
+
size: k.value,
|
|
606
|
+
onClick: t[2] || (t[2] = (c) => L.value = !0)
|
|
607
|
+
}, {
|
|
608
|
+
default: a(() => [
|
|
609
|
+
n(r, null, {
|
|
610
|
+
default: a(() => [
|
|
611
|
+
n(u(qe))
|
|
612
|
+
]),
|
|
613
|
+
_: 1
|
|
614
|
+
})
|
|
615
|
+
]),
|
|
616
|
+
_: 1
|
|
617
|
+
}, 8, ["circle", "size"])
|
|
618
|
+
]),
|
|
619
|
+
_: 1
|
|
620
|
+
})) : g("", !0),
|
|
621
|
+
d.withSelectionCart ? (o(), f(v, {
|
|
622
|
+
key: 4,
|
|
623
|
+
content: d.cartConfig.buttonText || "已选数据",
|
|
624
|
+
placement: "top"
|
|
625
|
+
}, {
|
|
626
|
+
default: a(() => [
|
|
627
|
+
n(T, {
|
|
628
|
+
value: p.value.length,
|
|
629
|
+
hidden: p.value.length === 0,
|
|
630
|
+
max: 999
|
|
631
|
+
}, {
|
|
632
|
+
default: a(() => [
|
|
633
|
+
n(i, {
|
|
634
|
+
circle: B.value === "round" && !d.cartConfig.buttonText,
|
|
635
|
+
size: k.value,
|
|
636
|
+
class: A(["wd-datagrid__cart-btn", { "wd-datagrid__cart-btn--text": !!d.cartConfig.buttonText }]),
|
|
637
|
+
onClick: _e
|
|
638
|
+
}, {
|
|
639
|
+
default: a(() => [
|
|
640
|
+
n(r, null, {
|
|
641
|
+
default: a(() => [
|
|
642
|
+
n(u(Ye))
|
|
643
|
+
]),
|
|
644
|
+
_: 1
|
|
645
|
+
}),
|
|
646
|
+
d.cartConfig.buttonText ? (o(), y("span", aa, M(d.cartConfig.buttonText), 1)) : g("", !0)
|
|
647
|
+
]),
|
|
648
|
+
_: 1
|
|
649
|
+
}, 8, ["circle", "size", "class"])
|
|
650
|
+
]),
|
|
651
|
+
_: 1
|
|
652
|
+
}, 8, ["value", "hidden"])
|
|
653
|
+
]),
|
|
654
|
+
_: 1
|
|
655
|
+
}, 8, ["content"])) : g("", !0)
|
|
656
|
+
], 2)) : g("", !0)
|
|
657
|
+
])) : g("", !0),
|
|
658
|
+
$.value === "table" ? Oe((o(), f(At, {
|
|
659
|
+
key: 1,
|
|
660
|
+
ref_key: "tableRef",
|
|
661
|
+
ref: H,
|
|
662
|
+
data: u(_),
|
|
663
|
+
size: R.value,
|
|
664
|
+
border: d.border,
|
|
665
|
+
stripe: d.stripe,
|
|
666
|
+
height: ut.value,
|
|
667
|
+
"row-key": d.rowKey || void 0,
|
|
668
|
+
"tree-props": d.treeProps,
|
|
669
|
+
"default-expand-all": d.defaultExpandAll,
|
|
670
|
+
"span-method": Kt,
|
|
671
|
+
class: "wd-datagrid__table",
|
|
672
|
+
onSelectionChange: Tt,
|
|
673
|
+
onSortChange: u(K).changeSort
|
|
674
|
+
}, {
|
|
675
|
+
empty: a(() => [
|
|
676
|
+
Y(e.$slots, "empty", {}, () => [
|
|
677
|
+
n(ye, {
|
|
678
|
+
description: u(fe) ? "加载中..." : "暂无数据",
|
|
679
|
+
"image-size": 80
|
|
680
|
+
}, null, 8, ["description"])
|
|
681
|
+
], !0)
|
|
682
|
+
]),
|
|
683
|
+
default: a(() => [
|
|
684
|
+
d.withSelection ? (o(), f(q, {
|
|
685
|
+
key: 0,
|
|
686
|
+
type: "selection",
|
|
687
|
+
width: "60",
|
|
688
|
+
align: "center",
|
|
689
|
+
"reserve-selection": ""
|
|
690
|
+
})) : g("", !0),
|
|
691
|
+
d.withIndex ? (o(), f(q, {
|
|
692
|
+
key: 1,
|
|
693
|
+
type: "index",
|
|
694
|
+
label: "序号",
|
|
695
|
+
width: "60",
|
|
696
|
+
align: "center",
|
|
697
|
+
index: Bt
|
|
698
|
+
})) : g("", !0),
|
|
699
|
+
n(u(Xe), { vnodes: xt.value }, null, 8, ["vnodes"]),
|
|
700
|
+
d.rowActions.length ? (o(), f(q, {
|
|
701
|
+
key: 2,
|
|
702
|
+
label: "操作",
|
|
703
|
+
width: Dt.value,
|
|
704
|
+
align: "center",
|
|
705
|
+
fixed: "right"
|
|
706
|
+
}, {
|
|
707
|
+
default: a(({ row: c }) => [
|
|
708
|
+
(o(!0), y(J, null, Q(d.rowActions, (h) => (o(), f(i, {
|
|
709
|
+
key: h.command || h.text,
|
|
710
|
+
link: "",
|
|
711
|
+
size: "small",
|
|
712
|
+
type: h.type || "primary",
|
|
713
|
+
onClick: (he) => Vt(c, h)
|
|
714
|
+
}, {
|
|
715
|
+
default: a(() => [
|
|
716
|
+
C(M(h.text), 1)
|
|
717
|
+
]),
|
|
718
|
+
_: 2
|
|
719
|
+
}, 1032, ["type", "onClick"]))), 128))
|
|
720
|
+
]),
|
|
721
|
+
_: 1
|
|
722
|
+
}, 8, ["width"])) : g("", !0)
|
|
723
|
+
]),
|
|
724
|
+
_: 3
|
|
725
|
+
}, 8, ["data", "size", "border", "stripe", "height", "row-key", "tree-props", "default-expand-all", "onSortChange"])), [
|
|
726
|
+
[Ee, u(fe)]
|
|
727
|
+
]) : Oe((o(), y("div", la, [
|
|
728
|
+
u(_).length ? g("", !0) : (o(), f(ye, {
|
|
729
|
+
key: 0,
|
|
730
|
+
description: "暂无数据",
|
|
731
|
+
"image-size": 80
|
|
732
|
+
})),
|
|
733
|
+
(o(!0), y(J, null, Q(u(_), (c, h) => (o(), y("div", {
|
|
734
|
+
key: c[d.rowKey || "id"] ?? h,
|
|
735
|
+
class: "wd-datagrid__card"
|
|
736
|
+
}, [
|
|
737
|
+
Y(e.$slots, "card-item", {
|
|
738
|
+
row: c,
|
|
739
|
+
index: h
|
|
740
|
+
}, () => [
|
|
741
|
+
E("div", na, M(c.name || c.title || `第 ${h + 1} 项`), 1),
|
|
742
|
+
E("div", oa, [
|
|
743
|
+
(o(!0), y(J, null, Q(c, (he, He) => (o(), y("div", {
|
|
744
|
+
key: He,
|
|
745
|
+
class: "wd-datagrid__card-line"
|
|
746
|
+
}, [
|
|
747
|
+
E("span", ia, M(He), 1),
|
|
748
|
+
E("span", ra, M(he), 1)
|
|
749
|
+
]))), 128))
|
|
750
|
+
])
|
|
751
|
+
], !0)
|
|
752
|
+
]))), 128))
|
|
753
|
+
])), [
|
|
754
|
+
[Ee, u(fe)]
|
|
755
|
+
]),
|
|
756
|
+
tt.value ? (o(), y("div", {
|
|
757
|
+
key: 3,
|
|
758
|
+
class: A(["wd-datagrid__pager wd-datagrid__bottom-bar", `pager-at-${gt.value}`])
|
|
759
|
+
}, [
|
|
760
|
+
Ce.value ? (o(), y("div", ua, [
|
|
761
|
+
Y(e.$slots, "toolbar", {
|
|
762
|
+
selection: u(Te),
|
|
763
|
+
list: u(_)
|
|
764
|
+
}, void 0, !0),
|
|
765
|
+
w.value.add ? (o(), f(i, {
|
|
766
|
+
key: 0,
|
|
767
|
+
type: "primary",
|
|
768
|
+
size: k.value,
|
|
769
|
+
onClick: t[3] || (t[3] = (c) => b("add"))
|
|
770
|
+
}, {
|
|
771
|
+
default: a(() => [
|
|
772
|
+
n(r, null, {
|
|
773
|
+
default: a(() => [
|
|
774
|
+
n(u(Ie))
|
|
775
|
+
]),
|
|
776
|
+
_: 1
|
|
777
|
+
}),
|
|
778
|
+
t[15] || (t[15] = C("新增 ", -1))
|
|
779
|
+
]),
|
|
780
|
+
_: 1
|
|
781
|
+
}, 8, ["size"])) : g("", !0),
|
|
782
|
+
w.value.export ? (o(), f(i, {
|
|
783
|
+
key: 1,
|
|
784
|
+
size: k.value,
|
|
785
|
+
onClick: t[4] || (t[4] = (c) => b("export"))
|
|
786
|
+
}, {
|
|
787
|
+
default: a(() => [
|
|
788
|
+
n(r, null, {
|
|
789
|
+
default: a(() => [
|
|
790
|
+
n(u(Ge))
|
|
791
|
+
]),
|
|
792
|
+
_: 1
|
|
793
|
+
}),
|
|
794
|
+
t[16] || (t[16] = C("导出 ", -1))
|
|
795
|
+
]),
|
|
796
|
+
_: 1
|
|
797
|
+
}, 8, ["size"])) : g("", !0)
|
|
798
|
+
])) : g("", !0),
|
|
799
|
+
ke.value ? (o(), y("div", {
|
|
800
|
+
key: 1,
|
|
801
|
+
class: A(["wd-datagrid__bottom-group wd-datagrid__bottom-tools wd-datagrid__toolbar-group", `is-${B.value}`])
|
|
802
|
+
}, [
|
|
803
|
+
w.value.refresh ? (o(), f(v, {
|
|
804
|
+
key: 0,
|
|
805
|
+
content: "刷新",
|
|
806
|
+
placement: "top"
|
|
807
|
+
}, {
|
|
808
|
+
default: a(() => [
|
|
809
|
+
n(i, {
|
|
810
|
+
circle: B.value === "round",
|
|
811
|
+
size: k.value,
|
|
812
|
+
onClick: oe
|
|
813
|
+
}, {
|
|
814
|
+
default: a(() => [
|
|
815
|
+
n(r, null, {
|
|
816
|
+
default: a(() => [
|
|
817
|
+
n(u(Ne))
|
|
818
|
+
]),
|
|
819
|
+
_: 1
|
|
820
|
+
})
|
|
821
|
+
]),
|
|
822
|
+
_: 1
|
|
823
|
+
}, 8, ["circle", "size"])
|
|
824
|
+
]),
|
|
825
|
+
_: 1
|
|
826
|
+
})) : g("", !0),
|
|
827
|
+
w.value.size ? (o(), f(v, {
|
|
828
|
+
key: 1,
|
|
829
|
+
content: "调整大小",
|
|
830
|
+
placement: "top"
|
|
831
|
+
}, {
|
|
832
|
+
default: a(() => [
|
|
833
|
+
n(x, {
|
|
834
|
+
trigger: "click",
|
|
835
|
+
onCommand: Pe
|
|
836
|
+
}, {
|
|
837
|
+
dropdown: a(() => [
|
|
838
|
+
n(S, null, {
|
|
839
|
+
default: a(() => [
|
|
840
|
+
n(s, {
|
|
841
|
+
command: "large",
|
|
842
|
+
disabled: R.value === "large"
|
|
843
|
+
}, {
|
|
844
|
+
default: a(() => [...t[17] || (t[17] = [
|
|
845
|
+
C("大", -1)
|
|
846
|
+
])]),
|
|
847
|
+
_: 1
|
|
848
|
+
}, 8, ["disabled"]),
|
|
849
|
+
n(s, {
|
|
850
|
+
command: "default",
|
|
851
|
+
disabled: R.value === "default"
|
|
852
|
+
}, {
|
|
853
|
+
default: a(() => [...t[18] || (t[18] = [
|
|
854
|
+
C("默认", -1)
|
|
855
|
+
])]),
|
|
856
|
+
_: 1
|
|
857
|
+
}, 8, ["disabled"]),
|
|
858
|
+
n(s, {
|
|
859
|
+
command: "small",
|
|
860
|
+
disabled: R.value === "small"
|
|
861
|
+
}, {
|
|
862
|
+
default: a(() => [...t[19] || (t[19] = [
|
|
863
|
+
C("小", -1)
|
|
864
|
+
])]),
|
|
865
|
+
_: 1
|
|
866
|
+
}, 8, ["disabled"])
|
|
867
|
+
]),
|
|
868
|
+
_: 1
|
|
869
|
+
})
|
|
870
|
+
]),
|
|
871
|
+
default: a(() => [
|
|
872
|
+
n(i, {
|
|
873
|
+
circle: B.value === "round",
|
|
874
|
+
size: k.value
|
|
875
|
+
}, {
|
|
876
|
+
default: a(() => [
|
|
877
|
+
n(r, null, {
|
|
878
|
+
default: a(() => [
|
|
879
|
+
n(u(je))
|
|
880
|
+
]),
|
|
881
|
+
_: 1
|
|
882
|
+
})
|
|
883
|
+
]),
|
|
884
|
+
_: 1
|
|
885
|
+
}, 8, ["circle", "size"])
|
|
886
|
+
]),
|
|
887
|
+
_: 1
|
|
888
|
+
})
|
|
889
|
+
]),
|
|
890
|
+
_: 1
|
|
891
|
+
})) : g("", !0),
|
|
892
|
+
(w.value.modeSwitch || d.modeSwitch) && e.$slots.list ? (o(), f(v, {
|
|
893
|
+
key: 2,
|
|
894
|
+
content: "表格/列表切换",
|
|
895
|
+
placement: "top"
|
|
896
|
+
}, {
|
|
897
|
+
default: a(() => [
|
|
898
|
+
n(i, {
|
|
899
|
+
circle: B.value === "round",
|
|
900
|
+
size: k.value,
|
|
901
|
+
onClick: $e
|
|
902
|
+
}, {
|
|
903
|
+
default: a(() => [
|
|
904
|
+
n(r, null, {
|
|
905
|
+
default: a(() => [
|
|
906
|
+
$.value === "card" ? (o(), f(u(Ue), { key: 0 })) : (o(), f(u(We), { key: 1 }))
|
|
907
|
+
]),
|
|
908
|
+
_: 1
|
|
909
|
+
})
|
|
910
|
+
]),
|
|
911
|
+
_: 1
|
|
912
|
+
}, 8, ["circle", "size"])
|
|
913
|
+
]),
|
|
914
|
+
_: 1
|
|
915
|
+
})) : g("", !0),
|
|
916
|
+
w.value.columnSetting || d.dynamicColumn ? (o(), f(v, {
|
|
917
|
+
key: 3,
|
|
918
|
+
content: "列设置",
|
|
919
|
+
placement: "top"
|
|
920
|
+
}, {
|
|
921
|
+
default: a(() => [
|
|
922
|
+
n(i, {
|
|
923
|
+
circle: B.value === "round",
|
|
924
|
+
size: k.value,
|
|
925
|
+
onClick: t[5] || (t[5] = (c) => L.value = !0)
|
|
926
|
+
}, {
|
|
927
|
+
default: a(() => [
|
|
928
|
+
n(r, null, {
|
|
929
|
+
default: a(() => [
|
|
930
|
+
n(u(qe))
|
|
931
|
+
]),
|
|
932
|
+
_: 1
|
|
933
|
+
})
|
|
934
|
+
]),
|
|
935
|
+
_: 1
|
|
936
|
+
}, 8, ["circle", "size"])
|
|
937
|
+
]),
|
|
938
|
+
_: 1
|
|
939
|
+
})) : g("", !0),
|
|
940
|
+
d.withSelectionCart ? (o(), f(v, {
|
|
941
|
+
key: 4,
|
|
942
|
+
content: d.cartConfig.buttonText || "已选数据",
|
|
943
|
+
placement: "top"
|
|
944
|
+
}, {
|
|
945
|
+
default: a(() => [
|
|
946
|
+
n(T, {
|
|
947
|
+
value: p.value.length,
|
|
948
|
+
hidden: p.value.length === 0,
|
|
949
|
+
max: 999
|
|
950
|
+
}, {
|
|
951
|
+
default: a(() => [
|
|
952
|
+
n(i, {
|
|
953
|
+
circle: B.value === "round" && !d.cartConfig.buttonText,
|
|
954
|
+
size: k.value,
|
|
955
|
+
class: A(["wd-datagrid__cart-btn", { "wd-datagrid__cart-btn--text": !!d.cartConfig.buttonText }]),
|
|
956
|
+
onClick: _e
|
|
957
|
+
}, {
|
|
958
|
+
default: a(() => [
|
|
959
|
+
n(r, null, {
|
|
960
|
+
default: a(() => [
|
|
961
|
+
n(u(Ye))
|
|
962
|
+
]),
|
|
963
|
+
_: 1
|
|
964
|
+
}),
|
|
965
|
+
d.cartConfig.buttonText ? (o(), y("span", da, M(d.cartConfig.buttonText), 1)) : g("", !0)
|
|
966
|
+
]),
|
|
967
|
+
_: 1
|
|
968
|
+
}, 8, ["circle", "size", "class"])
|
|
969
|
+
]),
|
|
970
|
+
_: 1
|
|
971
|
+
}, 8, ["value", "hidden"])
|
|
972
|
+
]),
|
|
973
|
+
_: 1
|
|
974
|
+
}, 8, ["content"])) : g("", !0)
|
|
975
|
+
], 2)) : g("", !0),
|
|
976
|
+
d.withPager && $.value === "table" ? (o(), f(Mt, {
|
|
977
|
+
key: 2,
|
|
978
|
+
class: "wd-datagrid__pager-main",
|
|
979
|
+
"current-page": u(le),
|
|
980
|
+
"page-size": u(ge),
|
|
981
|
+
total: u(Ke),
|
|
982
|
+
"page-sizes": u(st),
|
|
983
|
+
layout: ft.value,
|
|
984
|
+
small: d.pagerStyle === "simple",
|
|
985
|
+
"hide-on-single-page": u(ct),
|
|
986
|
+
background: !0,
|
|
987
|
+
onCurrentChange: Ve,
|
|
988
|
+
onSizeChange: Re
|
|
989
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout", "small", "hide-on-single-page"])) : g("", !0)
|
|
990
|
+
], 2)) : g("", !0),
|
|
991
|
+
n(Ht, {
|
|
992
|
+
modelValue: u(L),
|
|
993
|
+
"onUpdate:modelValue": t[8] || (t[8] = (c) => Nt(L) ? L.value = c : null),
|
|
994
|
+
title: "列设置",
|
|
995
|
+
width: "360px",
|
|
996
|
+
"append-to-body": ""
|
|
997
|
+
}, {
|
|
998
|
+
footer: a(() => [
|
|
999
|
+
n(i, {
|
|
1000
|
+
onClick: t[6] || (t[6] = (c) => u(St)())
|
|
1001
|
+
}, {
|
|
1002
|
+
default: a(() => [...t[20] || (t[20] = [
|
|
1003
|
+
C("恢复默认", -1)
|
|
1004
|
+
])]),
|
|
1005
|
+
_: 1
|
|
1006
|
+
}),
|
|
1007
|
+
n(i, {
|
|
1008
|
+
type: "primary",
|
|
1009
|
+
onClick: t[7] || (t[7] = (c) => L.value = !1)
|
|
1010
|
+
}, {
|
|
1011
|
+
default: a(() => [...t[21] || (t[21] = [
|
|
1012
|
+
C("完成", -1)
|
|
1013
|
+
])]),
|
|
1014
|
+
_: 1
|
|
1015
|
+
})
|
|
1016
|
+
]),
|
|
1017
|
+
default: a(() => [
|
|
1018
|
+
t[22] || (t[22] = E("div", { class: "wd-datagrid__col-tip" }, "勾选控制列的显示 / 隐藏,拖拽手柄可调整列顺序", -1)),
|
|
1019
|
+
E("div", sa, [
|
|
1020
|
+
(o(!0), y(J, null, Q(u(pt), (c) => (o(), y("div", {
|
|
1021
|
+
key: c.key,
|
|
1022
|
+
class: A(["wd-datagrid__col-item", {
|
|
1023
|
+
"is-dragging": I.value === c.key,
|
|
1024
|
+
"drag-over--before": G.value === c.key && ne.value === "before",
|
|
1025
|
+
"drag-over--after": G.value === c.key && ne.value === "after"
|
|
1026
|
+
}]),
|
|
1027
|
+
onDragover: Le((h) => kt(h, c.key), ["prevent"]),
|
|
1028
|
+
onDragleave: (h) => _t(c.key),
|
|
1029
|
+
onDrop: Le((h) => zt(c.key), ["prevent"])
|
|
1030
|
+
}, [
|
|
1031
|
+
n(Et, {
|
|
1032
|
+
class: "wd-datagrid__col-checkbox",
|
|
1033
|
+
"model-value": c.visible,
|
|
1034
|
+
"onUpdate:modelValue": (h) => u(wt)(c.key, h)
|
|
1035
|
+
}, {
|
|
1036
|
+
default: a(() => [
|
|
1037
|
+
C(M(c.label), 1)
|
|
1038
|
+
]),
|
|
1039
|
+
_: 2
|
|
1040
|
+
}, 1032, ["model-value", "onUpdate:modelValue"]),
|
|
1041
|
+
E("span", {
|
|
1042
|
+
class: "wd-datagrid__col-handle",
|
|
1043
|
+
draggable: "true",
|
|
1044
|
+
title: "拖拽调整顺序",
|
|
1045
|
+
onDragstart: (h) => Ct(h, c.key),
|
|
1046
|
+
onDragend: De
|
|
1047
|
+
}, [
|
|
1048
|
+
n(r, null, {
|
|
1049
|
+
default: a(() => [
|
|
1050
|
+
n(u(Wt))
|
|
1051
|
+
]),
|
|
1052
|
+
_: 1
|
|
1053
|
+
})
|
|
1054
|
+
], 40, fa)
|
|
1055
|
+
], 42, ca))), 128))
|
|
1056
|
+
])
|
|
1057
|
+
]),
|
|
1058
|
+
_: 1
|
|
1059
|
+
}, 8, ["modelValue"]),
|
|
1060
|
+
(o(), f(jt(d.cartConfig.type === "drawer" ? "el-drawer" : "el-dialog"), {
|
|
1061
|
+
modelValue: se.value,
|
|
1062
|
+
"onUpdate:modelValue": t[9] || (t[9] = (c) => se.value = c),
|
|
1063
|
+
title: String(d.cartConfig.title || "已选数据").replace("{count}", String(p.value.length)),
|
|
1064
|
+
width: d.cartConfig.size,
|
|
1065
|
+
"append-to-body": ""
|
|
1066
|
+
}, Ut({
|
|
1067
|
+
default: a(() => [
|
|
1068
|
+
Y(e.$slots, "cart-content", {
|
|
1069
|
+
list: p.value,
|
|
1070
|
+
remove: ze,
|
|
1071
|
+
clear: ce
|
|
1072
|
+
}, () => [
|
|
1073
|
+
p.value.length ? (o(), y("div", ga, [
|
|
1074
|
+
(o(!0), y(J, null, Q(p.value, (c, h) => (o(), y("div", {
|
|
1075
|
+
key: h,
|
|
1076
|
+
class: "wd-datagrid__cart-item"
|
|
1077
|
+
}, [
|
|
1078
|
+
E("span", va, M(c.name || c.title || at(c)), 1),
|
|
1079
|
+
d.cartConfig.showRemove !== !1 ? (o(), f(i, {
|
|
1080
|
+
key: 0,
|
|
1081
|
+
link: "",
|
|
1082
|
+
type: "danger",
|
|
1083
|
+
size: "small",
|
|
1084
|
+
onClick: (he) => ze(c)
|
|
1085
|
+
}, {
|
|
1086
|
+
default: a(() => [...t[23] || (t[23] = [
|
|
1087
|
+
C(" 移除 ", -1)
|
|
1088
|
+
])]),
|
|
1089
|
+
_: 1
|
|
1090
|
+
}, 8, ["onClick"])) : g("", !0)
|
|
1091
|
+
]))), 128))
|
|
1092
|
+
])) : (o(), f(ye, {
|
|
1093
|
+
key: 0,
|
|
1094
|
+
description: "暂无已选数据",
|
|
1095
|
+
"image-size": 80
|
|
1096
|
+
}))
|
|
1097
|
+
], !0)
|
|
1098
|
+
]),
|
|
1099
|
+
_: 2
|
|
1100
|
+
}, [
|
|
1101
|
+
d.cartConfig.showClear !== !1 ? {
|
|
1102
|
+
name: "footer",
|
|
1103
|
+
fn: a(() => [
|
|
1104
|
+
n(i, {
|
|
1105
|
+
type: "danger",
|
|
1106
|
+
onClick: ce
|
|
1107
|
+
}, {
|
|
1108
|
+
default: a(() => [...t[24] || (t[24] = [
|
|
1109
|
+
C("清空", -1)
|
|
1110
|
+
])]),
|
|
1111
|
+
_: 1
|
|
1112
|
+
})
|
|
1113
|
+
]),
|
|
1114
|
+
key: "0"
|
|
1115
|
+
} : void 0
|
|
1116
|
+
]), 1032, ["modelValue", "title", "width"]))
|
|
1117
|
+
], 6);
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
}), Ca = /* @__PURE__ */ ea(pa, [["__scopeId", "data-v-41e543b4"]]);
|
|
1121
|
+
export {
|
|
1122
|
+
Ca as W
|
|
1123
|
+
};
|
|
1124
|
+
//# sourceMappingURL=DataGrid-BhgND4G_.mjs.map
|