@fecp/designer 5.5.65 → 5.5.67
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/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/index.vue.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/aside/index.mjs +1 -0
- package/es/designer/src/packages/form/property/widgets.vue.mjs +70 -43
- package/es/designer.css +508 -49
- package/es/packages/mobile/index.mjs +6 -0
- package/es/packages/mobile/src/api/index.mjs +8 -0
- package/es/packages/mobile/src/components/all.mjs +4 -0
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.mjs +14 -0
- package/es/packages/mobile/src/components/dataDisplay/dataStat/index.mjs +10 -0
- package/es/packages/mobile/src/components/dataDisplay/menuGrid/MenuGrid.vue.mjs +123 -0
- package/es/packages/mobile/src/components/dataDisplay/menuGrid/index.mjs +7 -0
- package/es/packages/mobile/src/components/dataDisplay/noticeBar/NoticeBar.vue.mjs +98 -16
- package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +2 -4
- package/es/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.mjs +14 -15
- package/es/packages/mobile/src/components/form/search/Search.vue.mjs +4 -4
- package/es/packages/mobile/src/components/navigation/actionBar/ActionBar.vue.mjs +1 -1
- package/es/packages/mobile/src/components/navigation/navBar/NavBar.vue.mjs +13 -3
- package/es/packages/mobile/src/components/navigation/navBar/index.mjs +2 -2
- package/es/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.mjs +8 -4
- package/es/packages/mobile/src/components/navigation/tabbar/index.mjs +2 -2
- package/es/packages/mobile/src/index.vue.mjs +138 -0
- package/es/packages/mobile/src/page.vue.mjs +117 -0
- package/es/packages/mobile/src/utils/eventBus.mjs +5 -0
- package/es/packages/mobile/src/utils/pageHistory.mjs +111 -0
- package/es/packages/vue/src/components/forms/date/Date.vue.mjs +20 -0
- package/es/packages/vue/src/components/forms/form/validation.mjs +1 -1
- package/es/packages/vue/src/utils/parseFilterConfig.mjs +25 -0
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/index.vue.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/aside/index.js +1 -0
- package/lib/designer/src/packages/form/property/widgets.vue.js +70 -43
- package/lib/designer.css +508 -49
- package/lib/packages/mobile/index.js +94 -88
- package/lib/packages/mobile/src/api/index.js +8 -0
- package/lib/packages/mobile/src/components/all.js +92 -88
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.js +14 -0
- package/lib/packages/mobile/src/components/dataDisplay/dataStat/index.js +10 -0
- package/lib/packages/mobile/src/components/dataDisplay/menuGrid/MenuGrid.vue.js +123 -0
- package/lib/packages/mobile/src/components/dataDisplay/menuGrid/index.js +7 -0
- package/lib/packages/mobile/src/components/dataDisplay/noticeBar/NoticeBar.vue.js +97 -15
- package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +2 -4
- package/lib/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.js +13 -14
- package/lib/packages/mobile/src/components/form/search/Search.vue.js +4 -4
- package/lib/packages/mobile/src/components/navigation/actionBar/ActionBar.vue.js +1 -1
- package/lib/packages/mobile/src/components/navigation/navBar/NavBar.vue.js +13 -3
- package/lib/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.js +8 -4
- package/lib/packages/mobile/src/index.vue.js +138 -0
- package/lib/packages/mobile/src/page.vue.js +117 -0
- package/lib/packages/mobile/src/utils/eventBus.js +5 -0
- package/lib/packages/mobile/src/utils/pageHistory.js +111 -0
- package/lib/packages/vue/src/components/forms/date/Date.vue.js +20 -0
- package/lib/packages/vue/src/components/forms/form/validation.js +1 -1
- package/lib/packages/vue/src/utils/parseFilterConfig.js +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import "../../../node_modules/element-plus/es/index.mjs";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { getCurrentInstance, ref, onMounted, createBlock, createCommentVNode, unref, openBlock, withCtx } from "vue";
|
|
11
|
+
import MobilePage from "./page.vue.mjs";
|
|
12
|
+
import api from "./api/index.mjs";
|
|
13
|
+
import emitter from "./utils/eventBus.mjs";
|
|
14
|
+
import { pageHistory } from "./utils/pageHistory.mjs";
|
|
15
|
+
/* empty css */
|
|
16
|
+
/* empty css */
|
|
17
|
+
/* empty css */
|
|
18
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
19
|
+
import { ElContainer } from "../../../node_modules/element-plus/es/components/container/index.mjs";
|
|
20
|
+
import { ElMessage } from "../../../node_modules/element-plus/es/components/message/index.mjs";
|
|
21
|
+
import { Empty } from "../node_modules/vant/es/empty/index.mjs";
|
|
22
|
+
const _sfc_main = {
|
|
23
|
+
__name: "index",
|
|
24
|
+
props: {
|
|
25
|
+
appId: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(__props) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const currentInstance = getCurrentInstance();
|
|
33
|
+
const ctx = currentInstance.proxy;
|
|
34
|
+
const pageList = ref({});
|
|
35
|
+
const layoutData = ref([]);
|
|
36
|
+
const configLoading = ref(true);
|
|
37
|
+
const loadConfig = async () => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if (!props.appId) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
configLoading.value = true;
|
|
43
|
+
try {
|
|
44
|
+
let option = await api.getAppById(ctx.$http, props.appId);
|
|
45
|
+
pageList.value = ((_a = JSON.parse(option.pageConfig)) == null ? void 0 : _a.pageConfig) || [];
|
|
46
|
+
let homePage = pageList.value.find((page) => page.isHome);
|
|
47
|
+
if (!homePage) {
|
|
48
|
+
homePage = (_b = pageList.value) == null ? void 0 : _b[0];
|
|
49
|
+
}
|
|
50
|
+
console.log("🚀 ~ pageList ~ pageList.value:", pageList.value);
|
|
51
|
+
loadPage(homePage);
|
|
52
|
+
pageHistory.init(homePage);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error("加载配置失败:", error);
|
|
55
|
+
ElMessage.error("加载配置失败");
|
|
56
|
+
} finally {
|
|
57
|
+
configLoading.value = false;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const currentPage = ref({});
|
|
61
|
+
function loadPage(page) {
|
|
62
|
+
currentPage.value = { ...page };
|
|
63
|
+
layoutData.value = [...page.layoutData].sort((a, b) => {
|
|
64
|
+
if (a.y !== b.y) {
|
|
65
|
+
return a.y - b.y;
|
|
66
|
+
}
|
|
67
|
+
return a.x - b.x;
|
|
68
|
+
});
|
|
69
|
+
layoutData.value.forEach((item) => item.isResizable = false);
|
|
70
|
+
}
|
|
71
|
+
function findPageById(pageList2, pageId) {
|
|
72
|
+
for (const item of pageList2) {
|
|
73
|
+
if (item.id == pageId) {
|
|
74
|
+
return item;
|
|
75
|
+
}
|
|
76
|
+
if (item.children && item.children.length > 0) {
|
|
77
|
+
const found = findPageById(item.children, pageId);
|
|
78
|
+
if (found) {
|
|
79
|
+
found.parentPage = item;
|
|
80
|
+
return found;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const routePage = ref(null);
|
|
87
|
+
emitter.on("loadPage", (pageId) => {
|
|
88
|
+
var _a;
|
|
89
|
+
if (((_a = currentPage.value) == null ? void 0 : _a.id) == pageId) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const targetPage = findPageById(pageList.value, pageId);
|
|
93
|
+
if (targetPage) {
|
|
94
|
+
if (targetPage.parentPage) {
|
|
95
|
+
currentPage.value = targetPage.parentPage;
|
|
96
|
+
routePage.value = targetPage;
|
|
97
|
+
} else {
|
|
98
|
+
currentPage.value = targetPage;
|
|
99
|
+
routePage.value = null;
|
|
100
|
+
}
|
|
101
|
+
pageHistory.push(targetPage);
|
|
102
|
+
} else {
|
|
103
|
+
currentPage.value = null;
|
|
104
|
+
routePage.value = null;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
onMounted(() => {
|
|
108
|
+
loadConfig();
|
|
109
|
+
});
|
|
110
|
+
return (_ctx, _cache) => {
|
|
111
|
+
const _component_van_empty = Empty;
|
|
112
|
+
const _component_el_container = ElContainer;
|
|
113
|
+
return !unref(configLoading) ? (openBlock(), createBlock(_component_el_container, {
|
|
114
|
+
key: 0,
|
|
115
|
+
direction: "vertical",
|
|
116
|
+
class: "fec-mobile-app",
|
|
117
|
+
ref: "fecMobileAppRef"
|
|
118
|
+
}, {
|
|
119
|
+
default: withCtx(() => [
|
|
120
|
+
unref(currentPage) ? (openBlock(), createBlock(unref(MobilePage), {
|
|
121
|
+
key: 0,
|
|
122
|
+
currentPage: unref(currentPage),
|
|
123
|
+
routePage: unref(routePage)
|
|
124
|
+
}, null, 8, ["currentPage", "routePage"])) : (openBlock(), createBlock(_component_van_empty, {
|
|
125
|
+
key: 1,
|
|
126
|
+
image: "search",
|
|
127
|
+
description: "页面找不到了"
|
|
128
|
+
}))
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 512)) : createCommentVNode("", true);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const MobileApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-78e0cbef"]]);
|
|
136
|
+
export {
|
|
137
|
+
MobileApp as default
|
|
138
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ref, computed, onMounted, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeProps, mergeProps, unref, createVNode, guardReactiveProps, isRef, withCtx, resolveDynamicComponent } from "vue";
|
|
2
|
+
import "../../../node_modules/grid-layout-plus/es/index.mjs";
|
|
3
|
+
import * as all from "./components/all.mjs";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
6
|
+
import De from "../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
|
|
7
|
+
const _hoisted_1 = { class: "grid-wrapper no-scrollbar" };
|
|
8
|
+
const _hoisted_2 = { class: "component-content" };
|
|
9
|
+
const colNum = 24;
|
|
10
|
+
const rowHeight = 10;
|
|
11
|
+
const _sfc_main = {
|
|
12
|
+
__name: "page",
|
|
13
|
+
props: {
|
|
14
|
+
currentPage: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
routePage: {
|
|
19
|
+
type: Object
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const formData = ref({});
|
|
25
|
+
function getComp(type) {
|
|
26
|
+
return all[type];
|
|
27
|
+
}
|
|
28
|
+
const layoutData = computed(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
if (Array.isArray(props.currentPage.layoutData)) {
|
|
31
|
+
return ((_a = props.currentPage.layoutData) == null ? void 0 : _a.map((item) => {
|
|
32
|
+
item.isResizable = false;
|
|
33
|
+
return item;
|
|
34
|
+
})) || [];
|
|
35
|
+
}
|
|
36
|
+
return props.currentPage.layoutData;
|
|
37
|
+
});
|
|
38
|
+
const tabbarActive = ref(0);
|
|
39
|
+
const childPage = ref(null);
|
|
40
|
+
function onTabbarChange(pageId) {
|
|
41
|
+
if (!pageId) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const page = props.currentPage.children.find((item) => item.id == pageId);
|
|
45
|
+
if (!page) ;
|
|
46
|
+
else {
|
|
47
|
+
childPage.value = page;
|
|
48
|
+
}
|
|
49
|
+
console.log("🚀 ~ onTabbarChange ~ page:", page);
|
|
50
|
+
}
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
if (props.currentPage.footerType == "tabbar") {
|
|
53
|
+
tabbarActive.value = props.currentPage.tabbarConfig.tabbarOptions[0].pageId;
|
|
54
|
+
onTabbarChange(tabbarActive.value);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
const _component_FecMobileNavBar = resolveComponent("FecMobileNavBar");
|
|
59
|
+
const _component_page = resolveComponent("page", true);
|
|
60
|
+
const _component_FecMobileMenuGrid = resolveComponent("FecMobileMenuGrid");
|
|
61
|
+
const _component_FecMobileNoticeBar = resolveComponent("FecMobileNoticeBar");
|
|
62
|
+
const _component_FecMobileDataStat = resolveComponent("FecMobileDataStat");
|
|
63
|
+
const _component_FecMobileTabbar = resolveComponent("FecMobileTabbar");
|
|
64
|
+
const _component_FecMobileActionBar = resolveComponent("FecMobileActionBar");
|
|
65
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
66
|
+
__props.currentPage.isNavBar ? (openBlock(), createBlock(_component_FecMobileNavBar, normalizeProps(mergeProps({ key: 0 }, __props.currentPage.navBarConfig)), null, 16)) : createCommentVNode("", true),
|
|
67
|
+
createElementVNode("div", _hoisted_1, [
|
|
68
|
+
__props.currentPage.footerType == "tabbar" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
69
|
+
__props.routePage || unref(childPage) ? (openBlock(), createBlock(_component_page, {
|
|
70
|
+
key: 0,
|
|
71
|
+
currentPage: __props.routePage || unref(childPage)
|
|
72
|
+
}, null, 8, ["currentPage"])) : createCommentVNode("", true)
|
|
73
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
74
|
+
__props.currentPage.type == "home" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
75
|
+
createVNode(_component_FecMobileMenuGrid, normalizeProps(guardReactiveProps(__props.currentPage.layoutData.menuGridProps)), null, 16),
|
|
76
|
+
createVNode(_component_FecMobileNoticeBar),
|
|
77
|
+
createVNode(_component_FecMobileDataStat)
|
|
78
|
+
], 64)) : __props.currentPage.type == "approval" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [], 64)) : (openBlock(), createBlock(unref(De), {
|
|
79
|
+
key: 2,
|
|
80
|
+
ref: "gridLayout",
|
|
81
|
+
layout: unref(layoutData),
|
|
82
|
+
"onUpdate:layout": _cache[0] || (_cache[0] = ($event) => isRef(layoutData) ? layoutData.value = $event : null),
|
|
83
|
+
"row-height": rowHeight,
|
|
84
|
+
margin: [0, 0],
|
|
85
|
+
"col-num": colNum,
|
|
86
|
+
"use-css-transforms": false,
|
|
87
|
+
"is-draggable": false,
|
|
88
|
+
"is-resizable": false,
|
|
89
|
+
style: { "height": "100%" }
|
|
90
|
+
}, {
|
|
91
|
+
item: withCtx(({ item: { component } }) => [
|
|
92
|
+
createElementVNode("div", _hoisted_2, [
|
|
93
|
+
(openBlock(), createBlock(resolveDynamicComponent(getComp(component.fieldType)), mergeProps(component.props, {
|
|
94
|
+
modelValue: unref(formData)[component.props.fieldName],
|
|
95
|
+
"onUpdate:modelValue": ($event) => unref(formData)[component.props.fieldName] = $event,
|
|
96
|
+
dataSources: _ctx.dataSources
|
|
97
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources"]))
|
|
98
|
+
])
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["layout"]))
|
|
102
|
+
], 64))
|
|
103
|
+
]),
|
|
104
|
+
__props.currentPage.footerType == "tabbar" ? (openBlock(), createBlock(_component_FecMobileTabbar, mergeProps({
|
|
105
|
+
key: 1,
|
|
106
|
+
modelValue: unref(tabbarActive),
|
|
107
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(tabbarActive) ? tabbarActive.value = $event : null)
|
|
108
|
+
}, __props.currentPage.tabbarConfig, { onChange: onTabbarChange }), null, 16, ["modelValue"])) : createCommentVNode("", true),
|
|
109
|
+
__props.currentPage.footerType == "actionBar" ? (openBlock(), createBlock(_component_FecMobileActionBar, normalizeProps(mergeProps({ key: 2 }, __props.currentPage.actionBarConfig)), null, 16)) : createCommentVNode("", true)
|
|
110
|
+
], 64);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const MobilePage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-08632dac"]]);
|
|
115
|
+
export {
|
|
116
|
+
MobilePage as default
|
|
117
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const HISTORY_KEY = "mobile_page_history";
|
|
2
|
+
const MAX_HISTORY_SIZE = 20;
|
|
3
|
+
class PageHistory {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.history = this.loadHistory();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 从 sessionStorage 加载历史记录
|
|
9
|
+
*/
|
|
10
|
+
loadHistory() {
|
|
11
|
+
try {
|
|
12
|
+
const data = sessionStorage.getItem(HISTORY_KEY);
|
|
13
|
+
return data ? JSON.parse(data) : [];
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.error("加载页面历史失败:", e);
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 保存历史记录到 sessionStorage
|
|
21
|
+
*/
|
|
22
|
+
saveHistory() {
|
|
23
|
+
try {
|
|
24
|
+
sessionStorage.setItem(HISTORY_KEY, JSON.stringify(this.history));
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error("保存页面历史失败:", e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 添加页面到历史
|
|
31
|
+
* @param {Object} page - 页面配置对象,需包含 id
|
|
32
|
+
*/
|
|
33
|
+
push(page) {
|
|
34
|
+
if (!page || !page.id) {
|
|
35
|
+
console.warn("页面配置无效,无法添加到历史");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (this.history.length > 0 && this.history[this.history.length - 1].id == page.id) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.history.push({
|
|
42
|
+
id: page.id,
|
|
43
|
+
name: page.name || "",
|
|
44
|
+
timestamp: Date.now(),
|
|
45
|
+
data: page
|
|
46
|
+
});
|
|
47
|
+
if (this.history.length > MAX_HISTORY_SIZE) {
|
|
48
|
+
this.history.shift();
|
|
49
|
+
}
|
|
50
|
+
this.saveHistory();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 后退到上一个页面
|
|
54
|
+
* @returns {Object|null} 返回上一个页面的配置,如果无法后退则返回 null
|
|
55
|
+
*/
|
|
56
|
+
back() {
|
|
57
|
+
if (this.history.length <= 1) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
this.history.pop();
|
|
61
|
+
this.saveHistory();
|
|
62
|
+
const prevPage = this.history[this.history.length - 1];
|
|
63
|
+
return prevPage ? prevPage.data : null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 获取当前页面
|
|
67
|
+
* @returns {Object|null}
|
|
68
|
+
*/
|
|
69
|
+
getCurrentPage() {
|
|
70
|
+
if (this.history.length == 0) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return this.history[this.history.length - 1].data;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 判断是否可以后退
|
|
77
|
+
* @returns {Boolean}
|
|
78
|
+
*/
|
|
79
|
+
canBack() {
|
|
80
|
+
return this.history.length > 1;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 获取历史记录数量
|
|
84
|
+
* @returns {Number}
|
|
85
|
+
*/
|
|
86
|
+
getLength() {
|
|
87
|
+
return this.history.length;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 清空历史记录
|
|
91
|
+
*/
|
|
92
|
+
clear() {
|
|
93
|
+
this.history = [];
|
|
94
|
+
this.saveHistory();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 初始化或重置历史记录(仅包含首页)
|
|
98
|
+
* @param {Object} homePage - 首页配置
|
|
99
|
+
*/
|
|
100
|
+
init(homePage) {
|
|
101
|
+
this.clear();
|
|
102
|
+
if (homePage) {
|
|
103
|
+
this.push(homePage);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const pageHistory = new PageHistory();
|
|
108
|
+
export {
|
|
109
|
+
pageHistory as default,
|
|
110
|
+
pageHistory
|
|
111
|
+
};
|
|
@@ -54,6 +54,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
54
54
|
endDate: {
|
|
55
55
|
type: String,
|
|
56
56
|
default: ""
|
|
57
|
+
},
|
|
58
|
+
dateRange: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: ""
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
emits: ["update:modelValue", "change"],
|
|
@@ -87,6 +91,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
87
91
|
emit("change", val);
|
|
88
92
|
}
|
|
89
93
|
});
|
|
94
|
+
const disabledDate = (date) => {
|
|
95
|
+
if (!props.dateRange) return false;
|
|
96
|
+
debugger;
|
|
97
|
+
const today = /* @__PURE__ */ new Date();
|
|
98
|
+
today.setHours(0, 0, 0, 0);
|
|
99
|
+
const targetDate = new Date(date);
|
|
100
|
+
targetDate.setHours(0, 0, 0, 0);
|
|
101
|
+
if (props.dateRange === "beforeToday") {
|
|
102
|
+
return targetDate > today;
|
|
103
|
+
}
|
|
104
|
+
if (props.dateRange === "afterToday") {
|
|
105
|
+
return targetDate < today;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
90
109
|
return (_ctx, _cache) => {
|
|
91
110
|
const _component_el_date_picker = ElDatePicker;
|
|
92
111
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -100,6 +119,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
100
119
|
readonly: __props.readonly,
|
|
101
120
|
format: computedFormat.value,
|
|
102
121
|
"value-format": computedValueFormat.value,
|
|
122
|
+
"disabled-date": disabledDate,
|
|
103
123
|
clearable: "",
|
|
104
124
|
style: { "width": "100%" }
|
|
105
125
|
}), null, 16, ["modelValue", "type", "placeholder", "disabled", "readonly", "format", "value-format"])
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { parseSingleParamValue } from "./parseRouteParams.mjs";
|
|
2
|
+
function isDateString(value) {
|
|
3
|
+
if (typeof value !== "string") return false;
|
|
4
|
+
return /^\d{4}\/\d{2}\/\d{2}$/.test(value);
|
|
5
|
+
}
|
|
6
|
+
function compareDate(a, b) {
|
|
7
|
+
return a.localeCompare(b);
|
|
8
|
+
}
|
|
2
9
|
function checkFilterMatch(filterConfig, data, fields = []) {
|
|
3
10
|
if (!filterConfig || !data) {
|
|
4
11
|
return false;
|
|
@@ -30,21 +37,39 @@ function checkConditionMatch(condition, data, fields) {
|
|
|
30
37
|
const fieldName = (fieldInfo == null ? void 0 : fieldInfo.fieldName) || field;
|
|
31
38
|
const dataValue = data[fieldName];
|
|
32
39
|
const parsedValue = parseSingleParamValue(value, data, fields);
|
|
40
|
+
if ("null" == (dataValue ?? "null") || "null" == (parsedValue ?? "null")) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
33
43
|
switch (operator) {
|
|
34
44
|
case "eq":
|
|
35
45
|
return dataValue == parsedValue;
|
|
36
46
|
case "ne":
|
|
37
47
|
return dataValue != parsedValue;
|
|
38
48
|
case "gt":
|
|
49
|
+
if (isDateString(dataValue) && isDateString(parsedValue)) {
|
|
50
|
+
return compareDate(dataValue, parsedValue) > 0;
|
|
51
|
+
}
|
|
39
52
|
return Number(dataValue) > Number(parsedValue);
|
|
40
53
|
case "gte":
|
|
54
|
+
if (isDateString(dataValue) && isDateString(parsedValue)) {
|
|
55
|
+
return compareDate(dataValue, parsedValue) >= 0;
|
|
56
|
+
}
|
|
41
57
|
return Number(dataValue) >= Number(parsedValue);
|
|
42
58
|
case "lt":
|
|
59
|
+
if (isDateString(dataValue) && isDateString(parsedValue)) {
|
|
60
|
+
return compareDate(dataValue, parsedValue) < 0;
|
|
61
|
+
}
|
|
43
62
|
return Number(dataValue) < Number(parsedValue);
|
|
44
63
|
case "lte":
|
|
64
|
+
if (isDateString(dataValue) && isDateString(parsedValue)) {
|
|
65
|
+
return compareDate(dataValue, parsedValue) <= 0;
|
|
66
|
+
}
|
|
45
67
|
return Number(dataValue) <= Number(parsedValue);
|
|
46
68
|
case "range":
|
|
47
69
|
if (!parsedValue || parsedValue.min == null || parsedValue.max == null) return false;
|
|
70
|
+
if (isDateString(dataValue) && isDateString(parsedValue.min) && isDateString(parsedValue.max)) {
|
|
71
|
+
return compareDate(dataValue, parsedValue.min) >= 0 && compareDate(dataValue, parsedValue.max) <= 0;
|
|
72
|
+
}
|
|
48
73
|
const numValue = Number(dataValue);
|
|
49
74
|
return numValue >= Number(parsedValue.min) && numValue <= Number(parsedValue.max);
|
|
50
75
|
case "contains":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index.
|
|
3
|
+
const index = require("./index.vue.js");
|
|
4
4
|
const Vue = require("vue");
|
|
5
5
|
function useDialogDialog() {
|
|
6
6
|
const dialogDialogVisible = Vue.ref(false);
|
|
@@ -86,7 +86,7 @@ const widgets = require("../table/property/widgets.vue.js");
|
|
|
86
86
|
require("../../../../node_modules/element-plus/theme-chalk/el-tab-pane.css.js");
|
|
87
87
|
;/* empty css */
|
|
88
88
|
;/* empty css */
|
|
89
|
-
;/* empty css
|
|
89
|
+
;/* empty css */
|
|
90
90
|
;/* empty css */
|
|
91
91
|
;/* empty css */
|
|
92
92
|
;/* empty css */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index.
|
|
3
|
+
const index = require("./index.vue.js");
|
|
4
4
|
const Vue = require("vue");
|
|
5
5
|
function useDialogGlobalDialog() {
|
|
6
6
|
const dialogGlobalDialogVisible = Vue.ref(false);
|