@ctzy-web-client/plugin-component-vue 1.0.0 → 1.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 +9 -0
- package/es/advance-select/advance-operation.mjs +43 -0
- package/es/advance-select/advance-option.mjs +125 -0
- package/es/advance-select/advance-select.mjs +359 -0
- package/es/advance-select/events-helpers.mjs +29 -0
- package/es/advance-select/index.mjs +13 -0
- package/es/advance-select/use-advance-option.mjs +43 -0
- package/es/advance-select/use-advance-select.mjs +117 -0
- package/es/application-slot/application-slot.mjs +51 -0
- package/es/application-slot/breadcrumb-item.mjs +23 -0
- package/es/application-slot/header-tools-item.mjs +23 -0
- package/es/application-slot/index.mjs +16 -0
- package/es/breadcrumb-select/breadcrumb-select.mjs +155 -0
- package/es/breadcrumb-select/index.mjs +6 -0
- package/es/components.mjs +22 -0
- package/es/contextmenu/contextmenu-item.mjs +21 -0
- package/es/contextmenu/contextmenu.mjs +64 -0
- package/es/contextmenu/index.mjs +10 -0
- package/es/contextmenu/use-contextmenu.mjs +85 -0
- package/es/data-form/data-form-item.mjs +53 -0
- package/es/data-form/data-form.mjs +175 -0
- package/es/data-form/dynamic-component.mjs +23 -0
- package/es/data-form/form-components/Blots/AtBlot.mjs +25 -0
- package/es/data-form/form-components/bwa-date-picker.mjs +45 -0
- package/es/data-form/form-components/bwa-date-time-picker.mjs +50 -0
- package/es/data-form/form-components/bwa-input-float.mjs +43 -0
- package/es/data-form/form-components/bwa-input-integer.mjs +56 -0
- package/es/data-form/form-components/bwa-input.mjs +38 -0
- package/es/data-form/form-components/bwa-multi-select.mjs +35 -0
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +234 -0
- package/es/data-form/form-components/bwa-rich-text.mjs +325 -0
- package/es/data-form/form-components/bwa-select.mjs +76 -0
- package/es/data-form/form-components/bwa-textarea.mjs +33 -0
- package/es/data-form/form-components/bwa-upload.mjs +159 -0
- package/es/data-form/form-components/bwa-user-multi-select.mjs +30 -0
- package/es/data-form/form-components/bwa-user-select.mjs +69 -0
- package/es/data-form/index.mjs +34 -0
- package/es/data-table/data-column-view.mjs +131 -0
- package/es/data-table/data-table-card.mjs +118 -0
- package/es/data-table/data-table-column.mjs +56 -0
- package/es/data-table/data-table.mjs +369 -0
- package/es/data-table/dynamic-component.mjs +48 -0
- package/es/data-table/index.mjs +13 -0
- package/es/data-table/use-datatable-drag.mjs +110 -0
- package/es/datatable-settings/datatable-settings.mjs +309 -0
- package/es/datatable-settings/index.mjs +6 -0
- package/es/date-range/date-picker.mjs +128 -0
- package/es/date-range/date-range.mjs +181 -0
- package/es/date-range/index.mjs +6 -0
- package/es/drag-list/constants.mjs +3 -0
- package/es/drag-list/drag-item.mjs +49 -0
- package/es/drag-list/drag-list.mjs +56 -0
- package/es/drag-list/index.mjs +6 -0
- package/es/drag-list/use-drag-list.mjs +154 -0
- package/es/dragable/constants.mjs +4 -0
- package/es/dragable/dragable-item.mjs +25 -0
- package/es/dragable/dragable-operation.mjs +32 -0
- package/es/dragable/dragable.mjs +31 -0
- package/es/dragable/index.mjs +15 -0
- package/es/dragable/use-dragable.mjs +134 -0
- package/es/filter-panel/conditions/condition.mjs +30 -0
- package/es/filter-panel/conditions/date-range-condition.mjs +46 -0
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +81 -0
- package/es/filter-panel/conditions/department-condition/department-node.mjs +74 -0
- package/es/filter-panel/conditions/index.mjs +21 -0
- package/es/filter-panel/conditions/input-condition.mjs +83 -0
- package/es/filter-panel/conditions/multi-user-condition.mjs +64 -0
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +41 -0
- package/es/filter-panel/conditions/single-menu-condition.mjs +68 -0
- package/es/filter-panel/conditions/single-user-condition.mjs +64 -0
- package/es/filter-panel/filter-panel-item.mjs +47 -0
- package/es/filter-panel/filter-panel.mjs +180 -0
- package/es/filter-panel/index.mjs +15 -0
- package/es/filter-panel/use-filter-panel-item.mjs +52 -0
- package/es/filter-panel/use-filter-panel.mjs +135 -0
- package/es/hooks/use-data/index.mjs +152 -0
- package/es/index.mjs +27 -0
- package/es/layout/index.mjs +6 -0
- package/es/layout/layout.mjs +86 -0
- package/es/make-installer.mjs +34 -0
- package/es/math/Rectangle.mjs +25 -0
- package/es/menu/index.mjs +6 -0
- package/es/menu/menu-item.mjs +75 -0
- package/es/menu/menu.mjs +60 -0
- package/es/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.mjs +6372 -0
- package/es/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.mjs +1517 -0
- package/es/panel/index.mjs +6 -0
- package/es/panel/panel.mjs +55 -0
- package/es/panel-tabs/index.mjs +6 -0
- package/es/panel-tabs/panel-tabs.mjs +66 -0
- package/es/pct-filter-panel/index.mjs +10 -0
- package/es/pct-filter-panel/pct-compents/index.mjs +10 -0
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +71 -0
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +74 -0
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +186 -0
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +147 -0
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +48 -0
- package/es/pct-filter-panel/pct-filter-panel.mjs +251 -0
- package/es/pct-filter-panel/use-filter-panel-item.mjs +56 -0
- package/es/pct-filter-panel/use-filter-panel.mjs +127 -0
- package/es/plugins.mjs +5 -0
- package/es/progress/index.mjs +10 -0
- package/es/progress/progress-item.mjs +68 -0
- package/es/progress/progress.mjs +74 -0
- package/es/progress/use-progress.mjs +46 -0
- package/es/utils/db.mjs +9 -0
- package/es/utils.mjs +99 -0
- package/es/where-filter-panel/index.mjs +1 -0
- package/es/where-filter-panel/use-where-filter-panel.mjs +18 -0
- package/es/where-filter-panel/where-filter-panel.mjs +17 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
- package/lib/advance-select/advance-operation.js +47 -0
- package/lib/advance-select/advance-option.js +129 -0
- package/lib/advance-select/advance-select.js +363 -0
- package/lib/advance-select/events-helpers.js +33 -0
- package/lib/advance-select/index.js +20 -0
- package/lib/advance-select/use-advance-option.js +47 -0
- package/lib/advance-select/use-advance-select.js +122 -0
- package/lib/application-slot/application-slot.js +55 -0
- package/lib/application-slot/breadcrumb-item.js +27 -0
- package/lib/application-slot/header-tools-item.js +27 -0
- package/lib/application-slot/index.js +23 -0
- package/lib/breadcrumb-select/breadcrumb-select.js +159 -0
- package/lib/breadcrumb-select/index.js +11 -0
- package/lib/components.js +26 -0
- package/lib/contextmenu/contextmenu-item.js +25 -0
- package/lib/contextmenu/contextmenu.js +68 -0
- package/lib/contextmenu/index.js +16 -0
- package/lib/contextmenu/use-contextmenu.js +89 -0
- package/lib/data-form/data-form-item.js +57 -0
- package/lib/data-form/data-form.js +179 -0
- package/lib/data-form/dynamic-component.js +27 -0
- package/lib/data-form/form-components/Blots/AtBlot.js +31 -0
- package/lib/data-form/form-components/bwa-date-picker.js +49 -0
- package/lib/data-form/form-components/bwa-date-time-picker.js +54 -0
- package/lib/data-form/form-components/bwa-input-float.js +47 -0
- package/lib/data-form/form-components/bwa-input-integer.js +60 -0
- package/lib/data-form/form-components/bwa-input.js +42 -0
- package/lib/data-form/form-components/bwa-multi-select.js +39 -0
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +242 -0
- package/lib/data-form/form-components/bwa-rich-text.js +333 -0
- package/lib/data-form/form-components/bwa-select.js +80 -0
- package/lib/data-form/form-components/bwa-textarea.js +37 -0
- package/lib/data-form/form-components/bwa-upload.js +163 -0
- package/lib/data-form/form-components/bwa-user-multi-select.js +34 -0
- package/lib/data-form/form-components/bwa-user-select.js +73 -0
- package/lib/data-form/index.js +40 -0
- package/lib/data-table/data-column-view.js +135 -0
- package/lib/data-table/data-table-card.js +122 -0
- package/lib/data-table/data-table-column.js +60 -0
- package/lib/data-table/data-table.js +373 -0
- package/lib/data-table/dynamic-component.js +56 -0
- package/lib/data-table/index.js +20 -0
- package/lib/data-table/use-datatable-drag.js +114 -0
- package/lib/datatable-settings/datatable-settings.js +313 -0
- package/lib/datatable-settings/index.js +11 -0
- package/lib/date-range/date-picker.js +136 -0
- package/lib/date-range/date-range.js +189 -0
- package/lib/date-range/index.js +11 -0
- package/lib/drag-list/constants.js +7 -0
- package/lib/drag-list/drag-item.js +53 -0
- package/lib/drag-list/drag-list.js +60 -0
- package/lib/drag-list/index.js +11 -0
- package/lib/drag-list/use-drag-list.js +158 -0
- package/lib/dragable/constants.js +9 -0
- package/lib/dragable/dragable-item.js +29 -0
- package/lib/dragable/dragable-operation.js +36 -0
- package/lib/dragable/dragable.js +35 -0
- package/lib/dragable/index.js +22 -0
- package/lib/dragable/use-dragable.js +138 -0
- package/lib/filter-panel/conditions/condition.js +34 -0
- package/lib/filter-panel/conditions/date-range-condition.js +50 -0
- package/lib/filter-panel/conditions/department-condition/department-condition.js +85 -0
- package/lib/filter-panel/conditions/department-condition/department-node.js +78 -0
- package/lib/filter-panel/conditions/index.js +26 -0
- package/lib/filter-panel/conditions/input-condition.js +87 -0
- package/lib/filter-panel/conditions/multi-user-condition.js +68 -0
- package/lib/filter-panel/conditions/multiple-menu-condition.js +45 -0
- package/lib/filter-panel/conditions/single-menu-condition.js +72 -0
- package/lib/filter-panel/conditions/single-user-condition.js +68 -0
- package/lib/filter-panel/filter-panel-item.js +51 -0
- package/lib/filter-panel/filter-panel.js +184 -0
- package/lib/filter-panel/index.js +20 -0
- package/lib/filter-panel/use-filter-panel-item.js +56 -0
- package/lib/filter-panel/use-filter-panel.js +139 -0
- package/lib/hooks/use-data/index.js +157 -0
- package/lib/index.js +60 -0
- package/lib/layout/index.js +11 -0
- package/lib/layout/layout.js +90 -0
- package/lib/make-installer.js +62 -0
- package/lib/math/Rectangle.js +29 -0
- package/lib/menu/index.js +11 -0
- package/lib/menu/menu-item.js +79 -0
- package/lib/menu/menu.js +64 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.js +6635 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.js +1628 -0
- package/lib/panel/index.js +11 -0
- package/lib/panel/panel.js +59 -0
- package/lib/panel-tabs/index.js +11 -0
- package/lib/panel-tabs/panel-tabs.js +70 -0
- package/lib/pct-filter-panel/index.js +14 -0
- package/lib/pct-filter-panel/pct-compents/index.js +16 -0
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +75 -0
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +78 -0
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +190 -0
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +151 -0
- package/lib/pct-filter-panel/pct-filter-panel-item.js +52 -0
- package/lib/pct-filter-panel/pct-filter-panel.js +255 -0
- package/lib/pct-filter-panel/use-filter-panel-item.js +60 -0
- package/lib/pct-filter-panel/use-filter-panel.js +131 -0
- package/lib/plugins.js +9 -0
- package/lib/progress/index.js +16 -0
- package/lib/progress/progress-item.js +72 -0
- package/lib/progress/progress.js +78 -0
- package/lib/progress/use-progress.js +51 -0
- package/lib/utils/db.js +17 -0
- package/lib/utils.js +110 -0
- package/lib/where-filter-panel/index.js +2 -0
- package/lib/where-filter-panel/use-where-filter-panel.js +22 -0
- package/lib/where-filter-panel/where-filter-panel.js +21 -0
- package/package.json +1 -1
- package/style/advance-select.css +1 -0
- package/style/breadcrumb-select.css +1 -0
- package/style/common.css +1 -0
- package/style/contextmenu.css +1 -0
- package/style/data-form.css +1 -0
- package/style/data-table.css +1 -0
- package/style/datatable-settings.css +1 -0
- package/style/date-range.css +1 -0
- package/style/department-condition.css +1 -0
- package/style/drag-list.css +1 -0
- package/style/dragable.css +1 -0
- package/style/filter-panel.css +1 -0
- package/style/index.css +1 -0
- package/style/input-condition.css +1 -0
- package/style/layout.css +1 -0
- package/style/menu.css +1 -0
- package/style/panel-tabs.css +1 -0
- package/style/panel.css +1 -0
- package/style/pct-filter-panel.css +1 -0
- package/style/progress.css +1 -0
- package/style/rich-text.css +1 -0
- package/style/var.css +1 -0
- /package/style/{advance-select.scss → src/advance-select.scss} +0 -0
- /package/style/{breadcrumb-select.scss → src/breadcrumb-select.scss} +0 -0
- /package/style/{common → src/common}/var.scss +0 -0
- /package/style/{common.scss → src/common.scss} +0 -0
- /package/style/{contextmenu.scss → src/contextmenu.scss} +0 -0
- /package/style/{data-form.scss → src/data-form.scss} +0 -0
- /package/style/{data-table.scss → src/data-table.scss} +0 -0
- /package/style/{datatable-settings.scss → src/datatable-settings.scss} +0 -0
- /package/style/{date-range.scss → src/date-range.scss} +0 -0
- /package/style/{department-condition.scss → src/department-condition.scss} +0 -0
- /package/style/{drag-list.scss → src/drag-list.scss} +0 -0
- /package/style/{dragable.scss → src/dragable.scss} +0 -0
- /package/style/{filter-panel.scss → src/filter-panel.scss} +0 -0
- /package/style/{index.scss → src/index.scss} +0 -0
- /package/style/{input-condition.scss → src/input-condition.scss} +0 -0
- /package/style/{layout.scss → src/layout.scss} +0 -0
- /package/style/{menu.scss → src/menu.scss} +0 -0
- /package/style/{mixins → src/mixins}/_var.scss +0 -0
- /package/style/{mixins → src/mixins}/config.scss +0 -0
- /package/style/{mixins → src/mixins}/function.scss +0 -0
- /package/style/{mixins → src/mixins}/mixins.scss +0 -0
- /package/style/{panel-tabs.scss → src/panel-tabs.scss} +0 -0
- /package/style/{panel.scss → src/panel.scss} +0 -0
- /package/style/{pct-filter-panel.scss → src/pct-filter-panel.scss} +0 -0
- /package/style/{progress.scss → src/progress.scss} +0 -0
- /package/style/{rich-text.scss → src/rich-text.scss} +0 -0
- /package/style/{theme → src/theme}/theme.scss +0 -0
- /package/style/{theme → src/theme}/var.scss +0 -0
- /package/style/{var.scss → src/var.scss} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, ref, computed, unref, getCurrentScope, onScopeDispose, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeClass, createTextVNode, createElementBlock, createVNode, createCommentVNode, toDisplayString, withModifiers, Fragment, renderList, renderSlot } from 'vue';
|
|
2
|
+
import { ElTooltip, ElIcon, ElScrollbar, ElSwitch } from 'element-plus';
|
|
3
|
+
import { useNamespace, useValue, useService, useEventDispatcher } from 'web-base-client-vue';
|
|
4
|
+
import { BwaDraglist } from '../drag-list/index.mjs';
|
|
5
|
+
import { map } from 'rxjs';
|
|
6
|
+
import { dataModelDB } from '../utils/db.mjs';
|
|
7
|
+
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
8
|
+
|
|
9
|
+
const __default__ = defineComponent({ name: "BwaDataTableSetting" });
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
dataTable: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const attrs = useAttrs();
|
|
20
|
+
const ns = useNamespace("datatable-settings");
|
|
21
|
+
const value = ref(false);
|
|
22
|
+
const appName = useValue("AppName");
|
|
23
|
+
const userService = useService("UserService");
|
|
24
|
+
const userID = computed(() => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return ((_b = (_a = unref(userService)) == null ? void 0 : _a.userInfo) == null ? void 0 : _b.id) || "";
|
|
27
|
+
});
|
|
28
|
+
const isShowResetColumn = computed(
|
|
29
|
+
() => !props.dataTable.isDefaultColumnSort()
|
|
30
|
+
);
|
|
31
|
+
const key = computed(
|
|
32
|
+
() => `${unref(appName)}_${props.dataTable.name}_settings`
|
|
33
|
+
);
|
|
34
|
+
const search = ref("");
|
|
35
|
+
const columns = computed(
|
|
36
|
+
() => props.dataTable.getColumns().filter((column) => column.settings.visible).filter((column) => column.settings.visible)
|
|
37
|
+
);
|
|
38
|
+
const initColumns = async () => {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
let persistentColumnInfos = [];
|
|
41
|
+
const result = await dataModelDB.tableHeaderSettings.where("[app+tableName+userID]").equals([unref(appName), props.dataTable.name, unref(userID)]).toArray();
|
|
42
|
+
if (result.length) {
|
|
43
|
+
persistentColumnInfos = (_b = (_a = result[0]) == null ? void 0 : _a.columnInfo) != null ? _b : [];
|
|
44
|
+
}
|
|
45
|
+
if (persistentColumnInfos.some((item) => typeof item === "string")) {
|
|
46
|
+
persistentColumnInfos = persistentColumnInfos.map((columnInfo) => {
|
|
47
|
+
return typeof columnInfo === "object" ? columnInfo : { name: columnInfo, visible: true };
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const _dataTable = props.dataTable;
|
|
51
|
+
let dataTableColumns = _dataTable.getColumns().slice().filter((item) => item.settings.visible);
|
|
52
|
+
persistentColumnInfos = persistentColumnInfos.filter(
|
|
53
|
+
(item) => dataTableColumns.findIndex((column) => column.name === item.name) !== -1
|
|
54
|
+
);
|
|
55
|
+
if (!persistentColumnInfos) {
|
|
56
|
+
return dataTableColumns;
|
|
57
|
+
}
|
|
58
|
+
let sortedColumns = persistentColumnInfos.map(
|
|
59
|
+
(columnInfo) => dataTableColumns.find((column) => column.name === columnInfo.name)
|
|
60
|
+
).filter(Boolean);
|
|
61
|
+
dataTableColumns = sortedColumns.concat(
|
|
62
|
+
dataTableColumns.filter(
|
|
63
|
+
(column) => !sortedColumns.find((col) => column.name === col.name)
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
for (const column of dataTableColumns) {
|
|
67
|
+
const persistentItem = persistentColumnInfos.find(
|
|
68
|
+
(item) => item.name === column.name
|
|
69
|
+
);
|
|
70
|
+
column.visible = (_c = persistentItem == null ? void 0 : persistentItem.visible) != null ? _c : column.visible;
|
|
71
|
+
}
|
|
72
|
+
props.dataTable.setDisplayColumns(
|
|
73
|
+
dataTableColumns.filter((column) => column.visible)
|
|
74
|
+
);
|
|
75
|
+
return dataTableColumns;
|
|
76
|
+
};
|
|
77
|
+
const resetColumns = () => {
|
|
78
|
+
const _dataTable = props.dataTable;
|
|
79
|
+
_dataTable.resetColumnSort();
|
|
80
|
+
};
|
|
81
|
+
const allSearchedColumns = computed(() => {
|
|
82
|
+
const _search = unref(search);
|
|
83
|
+
return unref(columns).filter((column) => column.title.indexOf(_search) > -1);
|
|
84
|
+
});
|
|
85
|
+
const hiddenSearchedColumns = computed(
|
|
86
|
+
() => unref(allSearchedColumns).filter((item) => !item.visible)
|
|
87
|
+
);
|
|
88
|
+
const displaySearchedColumns = computed(() => {
|
|
89
|
+
const _search = unref(search);
|
|
90
|
+
return props.dataTable.getDisplayColumns().filter((column) => column.settings.visible).filter((column) => column.title.indexOf(_search) > -1);
|
|
91
|
+
});
|
|
92
|
+
const handleSortChange = (sort) => {
|
|
93
|
+
const _columns = unref(columns);
|
|
94
|
+
const displayColumns = sort.map(
|
|
95
|
+
(attrName) => {
|
|
96
|
+
var _a;
|
|
97
|
+
return (_a = _columns.find((column) => column.attrName === attrName)) != null ? _a : null;
|
|
98
|
+
}
|
|
99
|
+
).filter(Boolean);
|
|
100
|
+
props.dataTable.setDisplayColumns(displayColumns);
|
|
101
|
+
};
|
|
102
|
+
const scope = getCurrentScope();
|
|
103
|
+
const handleInitCompleted = async () => {
|
|
104
|
+
const dataTableColumns = await initColumns();
|
|
105
|
+
const subscription = props.dataTable.getDisplayColumnsSubject().pipe(
|
|
106
|
+
map((displayColumns) => {
|
|
107
|
+
const hiddenColumns = dataTableColumns.filter(
|
|
108
|
+
(column) => !displayColumns.find(
|
|
109
|
+
(displayColumn) => displayColumn.attrName === column.attrName
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
return [...displayColumns, ...hiddenColumns].map((column) => ({
|
|
113
|
+
name: column.name,
|
|
114
|
+
visible: column.visible
|
|
115
|
+
}));
|
|
116
|
+
})
|
|
117
|
+
).subscribe({
|
|
118
|
+
next: (columnInfo) => {
|
|
119
|
+
dataModelDB.tableHeaderSettings.put({
|
|
120
|
+
app: unref(appName),
|
|
121
|
+
tableName: props.dataTable.name,
|
|
122
|
+
userID: unref(userID),
|
|
123
|
+
columnInfo
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
scope.run(() => {
|
|
128
|
+
onScopeDispose(() => {
|
|
129
|
+
subscription.unsubscribe();
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
if (!props.dataTable.inited) {
|
|
134
|
+
useEventDispatcher(props.dataTable, "init-completed", handleInitCompleted);
|
|
135
|
+
} else {
|
|
136
|
+
handleInitCompleted();
|
|
137
|
+
}
|
|
138
|
+
return (_ctx, _cache) => {
|
|
139
|
+
const _component_RefreshRight = resolveComponent("RefreshRight");
|
|
140
|
+
const _component_Close = resolveComponent("Close");
|
|
141
|
+
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
142
|
+
visible: value.value,
|
|
143
|
+
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => value.value = $event)
|
|
144
|
+
}, unref(attrs), {
|
|
145
|
+
effect: "light",
|
|
146
|
+
"show-arrow": false,
|
|
147
|
+
trigger: "click",
|
|
148
|
+
"popper-class": unref(ns).b(),
|
|
149
|
+
"gpu-acceleration": false,
|
|
150
|
+
placement: "bottom",
|
|
151
|
+
"append-to": ".bwa-application"
|
|
152
|
+
}), {
|
|
153
|
+
content: withCtx(() => [
|
|
154
|
+
createElementVNode("div", {
|
|
155
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
156
|
+
}, [
|
|
157
|
+
createElementVNode("div", {
|
|
158
|
+
class: normalizeClass(unref(ns).e("header"))
|
|
159
|
+
}, [
|
|
160
|
+
createTextVNode(" \u8868\u5934\u8BBE\u7F6E "),
|
|
161
|
+
createElementVNode("span", {
|
|
162
|
+
class: normalizeClass(unref(ns).e("tools"))
|
|
163
|
+
}, [
|
|
164
|
+
unref(isShowResetColumn) ? (openBlock(), createElementBlock("span", {
|
|
165
|
+
key: 0,
|
|
166
|
+
class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("refresh")]),
|
|
167
|
+
onClick: resetColumns
|
|
168
|
+
}, [
|
|
169
|
+
createVNode(unref(ElTooltip), {
|
|
170
|
+
content: "\u6062\u590D\u9ED8\u8BA4",
|
|
171
|
+
"append-to": ".bwa-application"
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [
|
|
174
|
+
createVNode(unref(ElIcon), null, {
|
|
175
|
+
default: withCtx(() => [
|
|
176
|
+
createVNode(_component_RefreshRight)
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
})
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
})
|
|
183
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
184
|
+
createElementVNode("span", {
|
|
185
|
+
class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("close")]),
|
|
186
|
+
onClick: _cache[0] || (_cache[0] = ($event) => value.value = false)
|
|
187
|
+
}, [
|
|
188
|
+
createVNode(unref(ElTooltip), {
|
|
189
|
+
content: "\u5173\u95ED",
|
|
190
|
+
"append-to": ".bwa-application"
|
|
191
|
+
}, {
|
|
192
|
+
default: withCtx(() => [
|
|
193
|
+
createVNode(unref(ElIcon), null, {
|
|
194
|
+
default: withCtx(() => [
|
|
195
|
+
createVNode(_component_Close)
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})
|
|
199
|
+
]),
|
|
200
|
+
_: 1
|
|
201
|
+
})
|
|
202
|
+
], 2)
|
|
203
|
+
], 2)
|
|
204
|
+
], 2),
|
|
205
|
+
createCommentVNode(` <div :class="ns.e('search')">\r
|
|
206
|
+
<ElInput\r
|
|
207
|
+
v-model="search"\r
|
|
208
|
+
:clearable="true"\r
|
|
209
|
+
prefix-icon="Search"\r
|
|
210
|
+
placeholder="\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"\r
|
|
211
|
+
/>\r
|
|
212
|
+
</div> `),
|
|
213
|
+
createVNode(unref(ElScrollbar), { "max-height": "500px" }, {
|
|
214
|
+
default: withCtx(() => [
|
|
215
|
+
createElementVNode("div", {
|
|
216
|
+
class: normalizeClass(unref(ns).e("main"))
|
|
217
|
+
}, [
|
|
218
|
+
unref(displaySearchedColumns).length ? (openBlock(), createElementBlock("div", {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: normalizeClass(unref(ns).b("section"))
|
|
221
|
+
}, [
|
|
222
|
+
createElementVNode("div", {
|
|
223
|
+
class: normalizeClass(unref(ns).be("section", "header"))
|
|
224
|
+
}, "\u663E\u793A\u5B57\u6BB5", 2),
|
|
225
|
+
createVNode(unref(BwaDraglist), {
|
|
226
|
+
data: unref(displaySearchedColumns),
|
|
227
|
+
labelAttr: "title",
|
|
228
|
+
idAttr: "attrName",
|
|
229
|
+
onSortChange: handleSortChange
|
|
230
|
+
}, {
|
|
231
|
+
default: withCtx(({ item }) => [
|
|
232
|
+
createElementVNode("div", {
|
|
233
|
+
class: normalizeClass(unref(ns).be("section", "content"))
|
|
234
|
+
}, [
|
|
235
|
+
createElementVNode("div", {
|
|
236
|
+
class: normalizeClass(unref(ns).e("field-item"))
|
|
237
|
+
}, [
|
|
238
|
+
createElementVNode("span", null, toDisplayString(item.title), 1),
|
|
239
|
+
createVNode(unref(ElSwitch), {
|
|
240
|
+
modelValue: item.visible,
|
|
241
|
+
"onUpdate:modelValue": ($event) => item.visible = $event,
|
|
242
|
+
size: "small",
|
|
243
|
+
disabled: item.settings.disabled,
|
|
244
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
245
|
+
}, ["stop"]))
|
|
246
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
247
|
+
], 2)
|
|
248
|
+
], 2)
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["data"]),
|
|
252
|
+
createCommentVNode(` <div\r
|
|
253
|
+
v-show="!displaySearchedColumns.length"\r
|
|
254
|
+
:class="ns.be('section', 'empty')"\r
|
|
255
|
+
>\r
|
|
256
|
+
\u6682\u65E0\u5B57\u6BB5\r
|
|
257
|
+
</div> `)
|
|
258
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
259
|
+
unref(hiddenSearchedColumns).length ? (openBlock(), createElementBlock("div", {
|
|
260
|
+
key: 1,
|
|
261
|
+
class: normalizeClass(unref(ns).b("section"))
|
|
262
|
+
}, [
|
|
263
|
+
createElementVNode("div", {
|
|
264
|
+
class: normalizeClass(unref(ns).be("section", "header"))
|
|
265
|
+
}, "\u672A\u663E\u793A\u5B57\u6BB5", 2),
|
|
266
|
+
createElementVNode("div", {
|
|
267
|
+
class: normalizeClass(unref(ns).be("section", "content"))
|
|
268
|
+
}, [
|
|
269
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(hiddenSearchedColumns), (column) => {
|
|
270
|
+
return openBlock(), createElementBlock("div", {
|
|
271
|
+
key: column.attrName,
|
|
272
|
+
class: normalizeClass(unref(ns).e("field-item"))
|
|
273
|
+
}, [
|
|
274
|
+
createElementVNode("span", null, toDisplayString(column.title), 1),
|
|
275
|
+
createVNode(unref(ElSwitch), {
|
|
276
|
+
modelValue: column.visible,
|
|
277
|
+
"onUpdate:modelValue": ($event) => column.visible = $event,
|
|
278
|
+
size: "small",
|
|
279
|
+
disabled: column.settings.disabled
|
|
280
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
281
|
+
], 2);
|
|
282
|
+
}), 128))
|
|
283
|
+
], 2),
|
|
284
|
+
createCommentVNode(` <div\r
|
|
285
|
+
v-show="!hiddenSearchedColumns.length"\r
|
|
286
|
+
:class="ns.be('section', 'empty')"\r
|
|
287
|
+
>\r
|
|
288
|
+
\u6682\u65E0\u5B57\u6BB5\r
|
|
289
|
+
</div> `)
|
|
290
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
291
|
+
], 2)
|
|
292
|
+
]),
|
|
293
|
+
_: 1
|
|
294
|
+
})
|
|
295
|
+
], 2)
|
|
296
|
+
]),
|
|
297
|
+
default: withCtx(() => [
|
|
298
|
+
createElementVNode("span", null, [
|
|
299
|
+
renderSlot(_ctx.$slots, "default")
|
|
300
|
+
])
|
|
301
|
+
]),
|
|
302
|
+
_: 3
|
|
303
|
+
}, 16, ["visible", "popper-class"]);
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
var DataTableSettings = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "datatable-settings.vue"]]);
|
|
308
|
+
|
|
309
|
+
export { DataTableSettings as default };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, provide, computed, resolveComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, createElementVNode, normalizeClass, createTextVNode } from 'vue';
|
|
2
|
+
import { ROOT_PICKER_INJECTION_KEY } from 'element-plus/es/components/date-picker/src/constants';
|
|
3
|
+
import ElPanelDatePicker from 'element-plus/es/components/date-picker/src/date-picker-com/panel-date-pick';
|
|
4
|
+
import { parseDate, valueEquals, formatter } from 'element-plus/es/components/time-picker/src/utils';
|
|
5
|
+
import { useLocale } from 'element-plus/es/hooks/index';
|
|
6
|
+
import { useNamespace } from 'web-base-client-vue';
|
|
7
|
+
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
8
|
+
|
|
9
|
+
const __default__ = defineComponent({ name: "BwaDatePicker" });
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: [String, Date, Array]
|
|
14
|
+
},
|
|
15
|
+
visible: {
|
|
16
|
+
type: Boolean
|
|
17
|
+
},
|
|
18
|
+
format: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "YYYY-MM-DD"
|
|
21
|
+
},
|
|
22
|
+
shortcuts: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:modelValue", "update:visible"],
|
|
28
|
+
setup(__props, { emit }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const ns = useNamespace("datepicker");
|
|
31
|
+
const { lang } = useLocale();
|
|
32
|
+
const visible = ref(false);
|
|
33
|
+
watch(visible, () => {
|
|
34
|
+
emit("update:visible", visible.value);
|
|
35
|
+
});
|
|
36
|
+
provide("EP_PICKER_BASE", {
|
|
37
|
+
props
|
|
38
|
+
});
|
|
39
|
+
provide(ROOT_PICKER_INJECTION_KEY, {
|
|
40
|
+
slots: {},
|
|
41
|
+
pickerNs: null
|
|
42
|
+
});
|
|
43
|
+
const parsedValue = computed(() => {
|
|
44
|
+
return parseDate(props.modelValue, props.format, lang);
|
|
45
|
+
});
|
|
46
|
+
const emitInput = (input) => {
|
|
47
|
+
if (valueEquals(props.modelValue, input)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let formatted;
|
|
51
|
+
if (Array.isArray(input)) {
|
|
52
|
+
formatted = input.map((item) => formatter(item, props.format, lang.value));
|
|
53
|
+
} else {
|
|
54
|
+
formatted = formatter(input, props.format, lang.value);
|
|
55
|
+
}
|
|
56
|
+
emit("update:modelValue", formatted);
|
|
57
|
+
};
|
|
58
|
+
const onPick = (date) => {
|
|
59
|
+
let result;
|
|
60
|
+
if (Array.isArray(date)) {
|
|
61
|
+
result = date.map((_) => _.toDate());
|
|
62
|
+
} else {
|
|
63
|
+
result = date ? date.toDate() : date;
|
|
64
|
+
}
|
|
65
|
+
emitInput(result);
|
|
66
|
+
visible.value = false;
|
|
67
|
+
};
|
|
68
|
+
const onClear = () => {
|
|
69
|
+
emit("update:modelValue", "");
|
|
70
|
+
visible.value = false;
|
|
71
|
+
};
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
const _component_ElButton = resolveComponent("ElButton");
|
|
74
|
+
const _component_ElTooltip = resolveComponent("ElTooltip");
|
|
75
|
+
return openBlock(), createBlock(_component_ElTooltip, {
|
|
76
|
+
trigger: "click",
|
|
77
|
+
pure: "",
|
|
78
|
+
teleported: "",
|
|
79
|
+
effect: "light",
|
|
80
|
+
role: "dialog",
|
|
81
|
+
transition: `el-zoom-in-top`,
|
|
82
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
83
|
+
"gpu-acceleration": false,
|
|
84
|
+
"show-arrow": false,
|
|
85
|
+
"stop-popper-mouse-event": false,
|
|
86
|
+
visible: visible.value,
|
|
87
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
88
|
+
"hide-after": 0,
|
|
89
|
+
"popper-class": unref(ns).b(),
|
|
90
|
+
persistent: "",
|
|
91
|
+
"append-to": ".bwa-application"
|
|
92
|
+
}, {
|
|
93
|
+
default: withCtx(() => [
|
|
94
|
+
renderSlot(_ctx.$slots, "default", { visible: visible.value })
|
|
95
|
+
]),
|
|
96
|
+
content: withCtx(() => [
|
|
97
|
+
createVNode(unref(ElPanelDatePicker), {
|
|
98
|
+
type: "date",
|
|
99
|
+
"parsed-value": unref(parsedValue),
|
|
100
|
+
onPick,
|
|
101
|
+
teleported: false
|
|
102
|
+
}, {
|
|
103
|
+
sidebar: withCtx(() => [
|
|
104
|
+
createElementVNode("div", {
|
|
105
|
+
class: normalizeClass(unref(ns).e("sidebar"))
|
|
106
|
+
}, [
|
|
107
|
+
createVNode(_component_ElButton, {
|
|
108
|
+
size: "small",
|
|
109
|
+
onClick: onClear
|
|
110
|
+
}, {
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
createTextVNode("\u6E05\u7A7A")
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
})
|
|
116
|
+
], 2)
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 8, ["parsed-value"])
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["visible", "popper-class"]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
var datePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-picker.vue"]]);
|
|
127
|
+
|
|
128
|
+
export { datePicker as default };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { defineComponent, ref, inject, computed, useSlots, unref, provide, watch, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createElementVNode, normalizeClass, createElementBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { useNamespace, filterPanelItemKey, useGlobalConfig } from 'web-base-client-vue';
|
|
3
|
+
import { dayjs } from 'element-plus';
|
|
4
|
+
import PanelDateRange from 'element-plus/es/components/date-picker/src/date-picker-com/panel-date-range';
|
|
5
|
+
import { timePickerDefaultProps } from 'element-plus/es/components/time-picker/src/common/props';
|
|
6
|
+
import { ROOT_PICKER_INJECTION_KEY } from 'element-plus/es/components/date-picker/src/constants';
|
|
7
|
+
import { useNamespace as useNamespace$1 } from 'element-plus/es/hooks/index';
|
|
8
|
+
import { parseDate, valueEquals, formatter } from 'element-plus/es/components/time-picker/src/utils';
|
|
9
|
+
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
10
|
+
|
|
11
|
+
const __default__ = defineComponent({ name: "BwaDateRange" });
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
13
|
+
props: {
|
|
14
|
+
...timePickerDefaultProps,
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue"],
|
|
21
|
+
setup(__props, { emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const ns = useNamespace("daterange");
|
|
24
|
+
const pickerVisivle = ref(false);
|
|
25
|
+
const filterPanelItem = inject(filterPanelItemKey);
|
|
26
|
+
const column = computed(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a : null;
|
|
29
|
+
});
|
|
30
|
+
const slots = useSlots();
|
|
31
|
+
const locale = useGlobalConfig("locale", "ZH");
|
|
32
|
+
const lang = computed(() => unref(locale).name);
|
|
33
|
+
provide(ROOT_PICKER_INJECTION_KEY, {
|
|
34
|
+
slots,
|
|
35
|
+
pickerNs: useNamespace$1("picker-panel")
|
|
36
|
+
});
|
|
37
|
+
provide("EP_PICKER_BASE", {
|
|
38
|
+
props
|
|
39
|
+
});
|
|
40
|
+
watch(
|
|
41
|
+
computed(() => props.modelValue),
|
|
42
|
+
() => {
|
|
43
|
+
if (!props.modelValue || Array.isArray(props.modelValue) || typeof props.modelValue !== "object") {
|
|
44
|
+
emit("update:modelValue", { start: "", end: "" });
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{ immediate: true }
|
|
48
|
+
);
|
|
49
|
+
const formatShowTime = (date) => {
|
|
50
|
+
return date ? dayjs(date).format("YYYY-MM-DD") : "";
|
|
51
|
+
};
|
|
52
|
+
const startTime = computed(() => {
|
|
53
|
+
var _a;
|
|
54
|
+
if (!((_a = props.modelValue) == null ? void 0 : _a.start)) {
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
return dayjs(props.modelValue.start).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss");
|
|
58
|
+
});
|
|
59
|
+
const endTime = computed(() => {
|
|
60
|
+
var _a;
|
|
61
|
+
if (!((_a = props.modelValue) == null ? void 0 : _a.end)) {
|
|
62
|
+
return "";
|
|
63
|
+
}
|
|
64
|
+
return dayjs(props.modelValue.end).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss");
|
|
65
|
+
});
|
|
66
|
+
const formatStartTime = computed(() => formatShowTime(unref(startTime)));
|
|
67
|
+
const formatEndTime = computed(() => formatShowTime(unref(endTime)));
|
|
68
|
+
const dateRangeValue = computed(() => [unref(startTime), unref(endTime)]);
|
|
69
|
+
const valueIsEmpty = computed(() => {
|
|
70
|
+
const value = unref(dateRangeValue);
|
|
71
|
+
return !value || Array.isArray(value) && !value.filter(Boolean).length;
|
|
72
|
+
});
|
|
73
|
+
const parsedValue = computed(() => {
|
|
74
|
+
const { valueFormat } = props;
|
|
75
|
+
const value = unref(dateRangeValue);
|
|
76
|
+
if (!unref(valueIsEmpty)) {
|
|
77
|
+
return value.map((d) => parseDate(d, valueFormat, unref(lang)));
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
});
|
|
81
|
+
const emitInput = (input) => {
|
|
82
|
+
if (!valueEquals(unref(dateRangeValue), input)) {
|
|
83
|
+
const formatted = input.map(
|
|
84
|
+
(item) => formatter(item, props.valueFormat, unref(lang))
|
|
85
|
+
);
|
|
86
|
+
emit("update:modelValue", {
|
|
87
|
+
start: formatted[0] ? dayjs(formatted[0]).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss") : "",
|
|
88
|
+
end: formatted[1] ? dayjs(formatted[1]).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss") : ""
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const onPick = (date, visible = false) => {
|
|
93
|
+
pickerVisivle.value = visible;
|
|
94
|
+
emitInput(date.map((item) => item.toDate()));
|
|
95
|
+
};
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
98
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
99
|
+
const _component_ElTooltip = resolveComponent("ElTooltip");
|
|
100
|
+
return openBlock(), createBlock(_component_ElTooltip, {
|
|
101
|
+
visible: pickerVisivle.value,
|
|
102
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => pickerVisivle.value = $event),
|
|
103
|
+
pure: "",
|
|
104
|
+
teleported: "",
|
|
105
|
+
effect: "light",
|
|
106
|
+
role: "dialog",
|
|
107
|
+
transition: `el-zoom-in-top`,
|
|
108
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
109
|
+
"gpu-acceleration": false,
|
|
110
|
+
"show-arrow": false,
|
|
111
|
+
"stop-popper-mouse-event": false,
|
|
112
|
+
"hide-after": 0,
|
|
113
|
+
persistent: "",
|
|
114
|
+
trigger: "click",
|
|
115
|
+
"append-to": ".bwa-application"
|
|
116
|
+
}, {
|
|
117
|
+
default: withCtx(() => [
|
|
118
|
+
renderSlot(_ctx.$slots, "pct-default", {
|
|
119
|
+
formatStartTime: unref(formatStartTime),
|
|
120
|
+
formatEndTime: unref(formatEndTime)
|
|
121
|
+
}, () => [
|
|
122
|
+
createElementVNode("div", {
|
|
123
|
+
class: normalizeClass([unref(ns).b(), unref(ns).is("active", pickerVisivle.value)])
|
|
124
|
+
}, [
|
|
125
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
126
|
+
unref(column) ? (openBlock(), createElementBlock("span", {
|
|
127
|
+
key: 0,
|
|
128
|
+
class: normalizeClass(unref(ns).e("label"))
|
|
129
|
+
}, toDisplayString(unref(column).title), 3)) : createCommentVNode("v-if", true)
|
|
130
|
+
]),
|
|
131
|
+
createElementVNode("span", {
|
|
132
|
+
class: normalizeClass([unref(ns).e("time"), unref(ns).is("empty", !unref(formatStartTime))])
|
|
133
|
+
}, [
|
|
134
|
+
createElementVNode("span", {
|
|
135
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
136
|
+
}, toDisplayString(unref(formatStartTime) ? unref(formatStartTime) : "\u5F00\u59CB\u65E5\u671F"), 3),
|
|
137
|
+
createVNode(_component_ElIcon, {
|
|
138
|
+
class: normalizeClass(unref(ns).e("caret"))
|
|
139
|
+
}, {
|
|
140
|
+
default: withCtx(() => [
|
|
141
|
+
createVNode(_component_CaretBottom)
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["class"])
|
|
145
|
+
], 2),
|
|
146
|
+
createTextVNode(" \u81F3 "),
|
|
147
|
+
createElementVNode("span", {
|
|
148
|
+
class: normalizeClass([unref(ns).e("time"), unref(ns).is("empty", !unref(formatEndTime))])
|
|
149
|
+
}, [
|
|
150
|
+
createElementVNode("span", {
|
|
151
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
152
|
+
}, toDisplayString(unref(formatEndTime) ? unref(formatEndTime) : "\u7ED3\u675F\u65E5\u671F"), 3),
|
|
153
|
+
createVNode(_component_ElIcon, {
|
|
154
|
+
class: normalizeClass(unref(ns).e("caret"))
|
|
155
|
+
}, {
|
|
156
|
+
default: withCtx(() => [
|
|
157
|
+
createVNode(_component_CaretBottom)
|
|
158
|
+
]),
|
|
159
|
+
_: 1
|
|
160
|
+
}, 8, ["class"])
|
|
161
|
+
], 2)
|
|
162
|
+
], 2)
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
content: withCtx(() => [
|
|
166
|
+
createVNode(unref(PanelDateRange), {
|
|
167
|
+
"parsed-value": unref(parsedValue),
|
|
168
|
+
type: "daterange",
|
|
169
|
+
visible: pickerVisivle.value,
|
|
170
|
+
onPick,
|
|
171
|
+
teleported: false
|
|
172
|
+
}, null, 8, ["parsed-value", "visible"])
|
|
173
|
+
]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 8, ["visible"]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
var DateRange = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-range.vue"]]);
|
|
180
|
+
|
|
181
|
+
export { DateRange as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent, inject, getCurrentInstance, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot } from 'vue';
|
|
2
|
+
import { useNamespace } from 'web-base-client-vue';
|
|
3
|
+
import { dragListContextKey } from './constants.mjs';
|
|
4
|
+
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
5
|
+
|
|
6
|
+
const __default__ = defineComponent({ name: "BwaDragItem" });
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
8
|
+
setup(__props, { expose }) {
|
|
9
|
+
const ns = useNamespace("dragitem");
|
|
10
|
+
;
|
|
11
|
+
const dragListContext = inject(dragListContextKey);
|
|
12
|
+
const id = dragListContext.nextID();
|
|
13
|
+
const instance = getCurrentInstance();
|
|
14
|
+
const handleMousedown = (event) => {
|
|
15
|
+
if (event.button !== 0) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
dragListContext.startDrag(instance.proxy);
|
|
19
|
+
};
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
dragListContext.handleItemCreate(id, instance.proxy);
|
|
22
|
+
});
|
|
23
|
+
onBeforeUnmount(() => {
|
|
24
|
+
dragListContext.handleItemDestroy(id, instance.proxy);
|
|
25
|
+
});
|
|
26
|
+
expose({
|
|
27
|
+
id
|
|
28
|
+
});
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock("div", {
|
|
31
|
+
class: normalizeClass(unref(ns).b()),
|
|
32
|
+
"draggable-context-id": "",
|
|
33
|
+
onMousedown: handleMousedown
|
|
34
|
+
}, [
|
|
35
|
+
createElementVNode("i", {
|
|
36
|
+
class: normalizeClass([unref(ns).e("drag-icon"), "ptp-icon", "ptp-buzhou-yidong"])
|
|
37
|
+
}, null, 2),
|
|
38
|
+
createElementVNode("span", {
|
|
39
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
40
|
+
}, [
|
|
41
|
+
renderSlot(_ctx.$slots, "default")
|
|
42
|
+
], 2)
|
|
43
|
+
], 34);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var DragItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "drag-item.vue"]]);
|
|
48
|
+
|
|
49
|
+
export { DragItem as default };
|