@ditari/bsui 5.0.7 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/date/RangePicker.vue2.cjs +7 -20
- package/dist/cjs/components/date/RangePicker.vue2.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +6 -0
- package/dist/cjs/components/index.cjs.map +1 -1
- package/dist/cjs/components/layout/Layout.vue2.cjs +39 -54
- package/dist/cjs/components/layout/Layout.vue2.cjs.map +1 -1
- package/dist/cjs/components/layout/List.cjs +27 -19
- package/dist/cjs/components/layout/List.cjs.map +1 -1
- package/dist/cjs/components/layout/Show.cjs +39 -33
- package/dist/cjs/components/layout/Show.cjs.map +1 -1
- package/dist/cjs/components/layout/components/index.cjs +26 -0
- package/dist/cjs/components/layout/components/index.cjs.map +1 -0
- package/dist/cjs/components/layout/components/layout/HeaderLayout.vue2.cjs +1 -0
- package/dist/cjs/components/layout/components/layout/HeaderLayout.vue2.cjs.map +1 -1
- package/dist/cjs/components/layout/components/layout/ThemeApp.vue2.cjs +1 -1
- package/dist/cjs/components/layout/components/layout/ThemeApp.vue2.cjs.map +1 -1
- package/dist/cjs/components/layout/components/menu/Menu.cjs +4 -4
- package/dist/cjs/components/layout/components/menu/Menu.cjs.map +1 -1
- package/dist/cjs/components/layout/index.cjs +11 -4
- package/dist/cjs/components/layout/index.cjs.map +1 -1
- package/dist/cjs/components/tab/Tab.vue2.cjs +1 -0
- package/dist/cjs/components/tab/Tab.vue2.cjs.map +1 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/css/components/layout/components/settings/style/index.css +1 -1
- package/dist/css/index.css +1 -1
- package/dist/esm/components/date/RangePicker.vue2.mjs +8 -21
- package/dist/esm/components/date/RangePicker.vue2.mjs.map +1 -1
- package/dist/esm/components/index.mjs +3 -0
- package/dist/esm/components/index.mjs.map +1 -1
- package/dist/esm/components/layout/Layout.vue2.mjs +43 -58
- package/dist/esm/components/layout/Layout.vue2.mjs.map +1 -1
- package/dist/esm/components/layout/List.mjs +29 -21
- package/dist/esm/components/layout/List.mjs.map +1 -1
- package/dist/esm/components/layout/Show.mjs +41 -35
- package/dist/esm/components/layout/Show.mjs.map +1 -1
- package/dist/esm/components/layout/components/index.mjs +22 -0
- package/dist/esm/components/layout/components/index.mjs.map +1 -0
- package/dist/esm/components/layout/components/layout/HeaderLayout.vue2.mjs +1 -0
- package/dist/esm/components/layout/components/layout/HeaderLayout.vue2.mjs.map +1 -1
- package/dist/esm/components/layout/components/layout/ThemeApp.vue2.mjs +1 -1
- package/dist/esm/components/layout/components/layout/ThemeApp.vue2.mjs.map +1 -1
- package/dist/esm/components/layout/components/menu/Menu.mjs +4 -4
- package/dist/esm/components/layout/components/menu/Menu.mjs.map +1 -1
- package/dist/esm/components/layout/index.mjs +8 -4
- package/dist/esm/components/layout/index.mjs.map +1 -1
- package/dist/esm/components/tab/Tab.vue2.mjs +1 -0
- package/dist/esm/components/tab/Tab.vue2.mjs.map +1 -1
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/style/index.scss +18 -0
- package/dist/style/layout/components/settings/style/index.scss +1 -1
- package/dist/types/components/layout/Layout.vue.d.ts +1 -10
- package/dist/types/components/layout/Layout.vue.d.ts.map +1 -1
- package/dist/types/components/layout/List.d.ts.map +1 -1
- package/dist/types/components/layout/Show.d.ts.map +1 -1
- package/dist/types/components/layout/components/index.d.ts +5 -0
- package/dist/types/components/layout/components/index.d.ts.map +1 -0
- package/dist/types/components/layout/components/layout/HeaderLayout.vue.d.ts.map +1 -1
- package/dist/types/components/layout/components/menu/Menu.d.ts.map +1 -1
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/layout/index.d.ts.map +1 -1
- package/dist/types/components/tab/Tab.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderLayout.vue2.cjs","sources":["../../../../../../src/components/layout/components/layout/HeaderLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed, type ComputedRef } from \"vue\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { MenuFoldOutlined, MenuUnfoldOutlined } from \"@ant-design/icons-vue\";\r\nimport { useAppStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\nimport type { GlobalToken } from \"ant-design-vue/es/theme/interface\";\r\n\r\nimport Tab from \"../../../tab/Tab.vue\";\r\n\r\nconst { layout, modeConfig, headerTokenStyle } = storeToRefs(useAppStore());\r\nconst { headerStyle, headerTabStyle, collapsedStyle, rightStyle } = useStyle();\r\n\r\nfunction useStyle(): {\r\n headerStyle: ComputedRef<string>;\r\n headerTabStyle: ComputedRef<string>;\r\n collapsedStyle: ComputedRef<string>;\r\n rightStyle: ComputedRef<string>;\r\n} {\r\n const { useToken } = theme;\r\n const { token }: { token: ComputedRef<GlobalToken> } = useToken();\r\n\r\n const left = computed(\r\n () =>\r\n `${layout.value.collapsed ? layout.value.collapsedWidth : layout.value.sideWidth}px`\r\n );\r\n\r\n const headerStyle = computed(\r\n () => css`\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n background-color: ${modeConfig.value.mode !== \"light\"\r\n ? token.value.colorBgContainer\r\n : headerTokenStyle.value.bgColor};\r\n left: ${left.value};\r\n height: ${layout.value.headerHeight}px;\r\n transition: left 0.4s cubic-bezier(0.22, 1.2, 0.36, 1);\r\n display: flex;\r\n align-items: flex-end;\r\n `\r\n );\r\n\r\n const headerTabStyle = computed(\r\n () => css`\r\n flex: 1;\r\n overflow: hidden;\r\n padding-right: 10px;\r\n `\r\n );\r\n\r\n const collapsedStyle = computed(\r\n () => css`\r\n padding: 0 10px;\r\n height: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n color: ${modeConfig.value.mode === \"light\"\r\n ? headerTokenStyle.value.txtColor\r\n : \"inherit\"};\r\n `\r\n );\r\n\r\n const rightStyle = computed(\r\n () => css`\r\n height: 100%;\r\n `\r\n );\r\n\r\n return {\r\n headerStyle,\r\n headerTabStyle,\r\n collapsedStyle,\r\n rightStyle\r\n };\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"headerStyle\">\r\n <div :class=\"collapsedStyle\" @click=\"layout.collapsed = !layout.collapsed\">\r\n <menu-unfold-outlined v-if=\"layout.collapsed\" class=\"trigger\" />\r\n <menu-fold-outlined v-else />\r\n </div>\r\n <div :class=\"headerTabStyle\">\r\n <Tab />\r\n </div>\r\n <div :class=\"rightStyle\">\r\n <slot></slot>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<style scoped></style>\r\n"],"names":["storeToRefs","useAppStore","theme","computed","headerStyle","css","headerTabStyle","collapsedStyle","rightStyle"],"mappings":";;;;;;;;;;;;;;;;;AAYA,IAAA,MAAM,EAAE,MAAQ,EAAA,UAAA,EAAY,kBAAqB,GAAAA,iBAAA,CAAYC,mBAAa,CAAA;AAC1E,IAAA,MAAM,EAAE,WAAa,EAAA,cAAA,EAAgB,cAAgB,EAAA,UAAA,KAAe,QAAS,EAAA;AAE7E,IAAA,SAAS,QAKP,GAAA;AACA,MAAM,MAAA,EAAE,UAAa,GAAAC,kBAAA;AACrB,MAAM,MAAA,EAAE,KAAM,EAAA,GAAyC,QAAS,EAAA;AAEhE,MAAA,MAAM,IAAO,GAAAC,YAAA;AAAA,QACX,MACE,CAAG,EAAA,MAAA,CAAO,KAAM,CAAA,SAAA,GAAY,OAAO,KAAM,CAAA,cAAA,GAAiB,MAAO,CAAA,KAAA,CAAM,SAAS,CAAA,EAAA;AAAA,OACpF;AAEA,MAAA,MAAMC,YAAc,GAAAD,YAAA;AAAA,QAClB,MAAME,OAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"HeaderLayout.vue2.cjs","sources":["../../../../../../src/components/layout/components/layout/HeaderLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed, type ComputedRef } from \"vue\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { MenuFoldOutlined, MenuUnfoldOutlined } from \"@ant-design/icons-vue\";\r\nimport { useAppStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\nimport type { GlobalToken } from \"ant-design-vue/es/theme/interface\";\r\n\r\nimport Tab from \"../../../tab/Tab.vue\";\r\n\r\nconst { layout, modeConfig, headerTokenStyle } = storeToRefs(useAppStore());\r\nconst { headerStyle, headerTabStyle, collapsedStyle, rightStyle } = useStyle();\r\n\r\nfunction useStyle(): {\r\n headerStyle: ComputedRef<string>;\r\n headerTabStyle: ComputedRef<string>;\r\n collapsedStyle: ComputedRef<string>;\r\n rightStyle: ComputedRef<string>;\r\n} {\r\n const { useToken } = theme;\r\n const { token }: { token: ComputedRef<GlobalToken> } = useToken();\r\n\r\n const left = computed(\r\n () =>\r\n `${layout.value.collapsed ? layout.value.collapsedWidth : layout.value.sideWidth}px`\r\n );\r\n\r\n const headerStyle = computed(\r\n () => css`\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n background-color: ${modeConfig.value.mode !== \"light\"\r\n ? token.value.colorBgContainer\r\n : headerTokenStyle.value.bgColor};\r\n left: ${left.value};\r\n height: ${layout.value.headerHeight}px;\r\n transition: left 0.4s cubic-bezier(0.22, 1.2, 0.36, 1);\r\n display: flex;\r\n align-items: flex-end;\r\n `\r\n );\r\n\r\n const headerTabStyle = computed(\r\n () => css`\r\n flex: 1;\r\n overflow: hidden;\r\n padding-right: 10px;\r\n `\r\n );\r\n\r\n const collapsedStyle = computed(\r\n () => css`\r\n padding: 0 10px;\r\n height: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n color: ${modeConfig.value.mode === \"light\"\r\n ? headerTokenStyle.value.txtColor\r\n : \"inherit\"};\r\n `\r\n );\r\n\r\n const rightStyle = computed(\r\n () => css`\r\n height: 100%;\r\n `\r\n );\r\n\r\n return {\r\n headerStyle,\r\n headerTabStyle,\r\n collapsedStyle,\r\n rightStyle\r\n };\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"headerStyle\">\r\n <div :class=\"collapsedStyle\" @click=\"layout.collapsed = !layout.collapsed\">\r\n <menu-unfold-outlined v-if=\"layout.collapsed\" class=\"trigger\" />\r\n <menu-fold-outlined v-else />\r\n </div>\r\n <div :class=\"headerTabStyle\">\r\n <Tab />\r\n </div>\r\n <div :class=\"rightStyle\">\r\n <slot></slot>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<style scoped></style>\r\n"],"names":["storeToRefs","useAppStore","theme","computed","headerStyle","css","headerTabStyle","collapsedStyle","rightStyle"],"mappings":";;;;;;;;;;;;;;;;;AAYA,IAAA,MAAM,EAAE,MAAQ,EAAA,UAAA,EAAY,kBAAqB,GAAAA,iBAAA,CAAYC,mBAAa,CAAA;AAC1E,IAAA,MAAM,EAAE,WAAa,EAAA,cAAA,EAAgB,cAAgB,EAAA,UAAA,KAAe,QAAS,EAAA;AAE7E,IAAA,SAAS,QAKP,GAAA;AACA,MAAM,MAAA,EAAE,UAAa,GAAAC,kBAAA;AACrB,MAAM,MAAA,EAAE,KAAM,EAAA,GAAyC,QAAS,EAAA;AAEhE,MAAA,MAAM,IAAO,GAAAC,YAAA;AAAA,QACX,MACE,CAAG,EAAA,MAAA,CAAO,KAAM,CAAA,SAAA,GAAY,OAAO,KAAM,CAAA,cAAA,GAAiB,MAAO,CAAA,KAAA,CAAM,SAAS,CAAA,EAAA;AAAA,OACpF;AAEA,MAAA,MAAMC,YAAc,GAAAD,YAAA;AAAA,QAClB,MAAME,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAKgB,EAAA,UAAA,CAAW,MAAM,IAAS,KAAA,OAAA,GAC1C,MAAM,KAAM,CAAA,gBAAA,GACZ,gBAAiB,CAAA,KAAA,CAAM,OAAO,CAAA;AAAA,YAAA,EAC1B,KAAK,KAAK,CAAA;AAAA,cACR,EAAA,MAAA,CAAO,MAAM,YAAY,CAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,OAKvC;AAEA,MAAA,MAAMC,eAAiB,GAAAH,YAAA;AAAA,QACrB,MAAME,OAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,OAKR;AAEA,MAAA,MAAME,eAAiB,GAAAJ,YAAA;AAAA,QACrB,MAAME,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAA,EAOK,WAAW,KAAM,CAAA,IAAA,KAAS,UAC/B,gBAAiB,CAAA,KAAA,CAAM,WACvB,SAAS,CAAA;AAAA,IAAA;AAAA,OAEjB;AAEA,MAAA,MAAMG,WAAa,GAAAL,YAAA;AAAA,QACjB,MAAME,OAAA;AAAA;AAAA,IAAA;AAAA,OAGR;AAEA,MAAO,OAAA;AAAA,QACL,WAAAD,EAAAA,YAAAA;AAAA,QACA,cAAAE,EAAAA,eAAAA;AAAA,QACA,cAAAC,EAAAA,eAAAA;AAAA,QACA,UAAAC,EAAAA;AAAA,OACF;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,7 +14,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
14
14
|
const { appTheme } = useTheme();
|
|
15
15
|
function useTheme() {
|
|
16
16
|
const { modeConfig } = pinia.storeToRefs(store.useAppStore());
|
|
17
|
-
const appTheme2 = vue.ref({
|
|
17
|
+
const appTheme2 = vue.ref({});
|
|
18
18
|
vue.watch(
|
|
19
19
|
() => modeConfig.value.mode,
|
|
20
20
|
(val) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeApp.vue2.cjs","sources":["../../../../../../src/components/layout/components/layout/ThemeApp.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { Ref, ref, watch } from \"vue\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { useAppStore } from \"@ditari/store\";\r\n\r\nconst { appTheme } = useTheme();\r\n\r\nfunction useTheme(): { appTheme: Ref<unknown> } {\r\n const { modeConfig } = storeToRefs(useAppStore());\r\n const appTheme = ref<Record<string, unknown>>({
|
|
1
|
+
{"version":3,"file":"ThemeApp.vue2.cjs","sources":["../../../../../../src/components/layout/components/layout/ThemeApp.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { Ref, ref, watch } from \"vue\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { useAppStore } from \"@ditari/store\";\r\n\r\nconst { appTheme } = useTheme();\r\n\r\nfunction useTheme(): { appTheme: Ref<unknown> } {\r\n const { modeConfig } = storeToRefs(useAppStore());\r\n const appTheme = ref<Record<string, unknown>>({});\r\n\r\n watch(\r\n () => modeConfig.value.mode,\r\n (val: string) => {\r\n if (val === \"os\") {\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\r\n if (isDarkMode) {\r\n appTheme.value.algorithm = theme.darkAlgorithm;\r\n } else {\r\n appTheme.value.algorithm = theme.defaultAlgorithm;\r\n }\r\n } else if (val === \"light\") {\r\n appTheme.value.algorithm = theme.defaultAlgorithm;\r\n } else if (val === \"dark\") {\r\n appTheme.value.algorithm = theme.darkAlgorithm;\r\n } else {\r\n appTheme.value.algorithm = theme.defaultAlgorithm;\r\n }\r\n },\r\n { immediate: true }\r\n );\r\n\r\n return {\r\n appTheme\r\n };\r\n}\r\n</script>\r\n\r\n<template>\r\n <a-config-provider :theme=\"appTheme\">\r\n <slot></slot>\r\n </a-config-provider>\r\n</template>\r\n\r\n<style scoped></style>\r\n"],"names":["storeToRefs","useAppStore","appTheme","ref","watch","theme"],"mappings":";;;;;;;;;;;;;AAOA,IAAM,MAAA,EAAE,QAAS,EAAA,GAAI,QAAS,EAAA;AAE9B,IAAA,SAAS,QAAuC,GAAA;AAC9C,MAAA,MAAM,EAAE,UAAA,EAAe,GAAAA,iBAAA,CAAYC,mBAAa,CAAA;AAChD,MAAMC,MAAAA,SAAAA,GAAWC,OAA6B,CAAA,EAAE,CAAA;AAEhD,MAAAC,SAAA;AAAA,QACE,MAAM,WAAW,KAAM,CAAA,IAAA;AAAA,QACvB,CAAC,GAAgB,KAAA;AACf,UAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,YAAA,MAAM,aACJ,MAAO,CAAA,UAAA,IACP,MAAO,CAAA,UAAA,CAAW,8BAA8B,CAAE,CAAA,OAAA;AACpD,YAAA,IAAI,UAAY,EAAA;AACd,cAAAF,SAAAA,CAAS,KAAM,CAAA,SAAA,GAAYG,kBAAM,CAAA,aAAA;AAAA,aAC5B,MAAA;AACL,cAAAH,SAAAA,CAAS,KAAM,CAAA,SAAA,GAAYG,kBAAM,CAAA,gBAAA;AAAA;AACnC,WACF,MAAA,IAAW,QAAQ,OAAS,EAAA;AAC1B,YAAAH,SAAAA,CAAS,KAAM,CAAA,SAAA,GAAYG,kBAAM,CAAA,gBAAA;AAAA,WACnC,MAAA,IAAW,QAAQ,MAAQ,EAAA;AACzB,YAAAH,SAAAA,CAAS,KAAM,CAAA,SAAA,GAAYG,kBAAM,CAAA,aAAA;AAAA,WAC5B,MAAA;AACL,YAAAH,SAAAA,CAAS,KAAM,CAAA,SAAA,GAAYG,kBAAM,CAAA,gBAAA;AAAA;AACnC,SACF;AAAA,QACA,EAAE,WAAW,IAAK;AAAA,OACpB;AAEA,MAAO,OAAA;AAAA,QACL,QAAAH,EAAAA;AAAA,OACF;AAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -29,7 +29,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
29
29
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var Menu = /* @__PURE__ */ vue.defineComponent({
|
|
33
33
|
name: "DMenu",
|
|
34
34
|
setup() {
|
|
35
35
|
const {
|
|
@@ -78,7 +78,6 @@ var DMenu = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
78
|
const route = vueRouter.useRoute();
|
|
79
79
|
const router = vueRouter.useRouter();
|
|
80
80
|
vue.watch(() => route.fullPath, (path) => __async(this, null, function* () {
|
|
81
|
-
console.log(path);
|
|
82
81
|
const flag = selectedKeys2.value.some((item) => item === path);
|
|
83
82
|
if (!flag) {
|
|
84
83
|
const rs = _findMatchedMenuKey(path, data.value);
|
|
@@ -108,6 +107,7 @@ var DMenu = /* @__PURE__ */ vue.defineComponent({
|
|
|
108
107
|
}
|
|
109
108
|
});
|
|
110
109
|
const _findMatchedMenuKey = (path, menuItems, parentKey = "") => {
|
|
110
|
+
var _a;
|
|
111
111
|
for (const item of menuItems) {
|
|
112
112
|
if (item.key === path) {
|
|
113
113
|
return {
|
|
@@ -123,7 +123,7 @@ var DMenu = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
123
|
}
|
|
124
124
|
const match = path.match(/^\/[^/]+/);
|
|
125
125
|
const basePath = match ? match[0] : "";
|
|
126
|
-
if (item.key.startsWith(basePath)) {
|
|
126
|
+
if ((_a = item.key) == null ? void 0 : _a.startsWith(basePath)) {
|
|
127
127
|
return {
|
|
128
128
|
matchedKey: item.key,
|
|
129
129
|
parentKey
|
|
@@ -168,5 +168,5 @@ var DMenu = /* @__PURE__ */ vue.defineComponent({
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
exports.default =
|
|
171
|
+
exports.default = Menu;
|
|
172
172
|
//# sourceMappingURL=Menu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.cjs","sources":["../../../../../../src/components/layout/components/menu/Menu.tsx"],"sourcesContent":["import { computed, defineComponent, watch } from \"vue\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { useAppStore, useMenuStore, useNoStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\n\r\nexport default defineComponent({\r\n name: \"DMenu\",\r\n setup() {\r\n const { layout, modeConfig } = storeToRefs(useAppStore());\r\n const { menuList } = storeToRefs(useNoStore());\r\n const { menuWrapperStyle } = useStyle();\r\n const { openKeys, selectedKeys, onClick } = useMenu();\r\n\r\n function useStyle() {\r\n const menuWrapperStyle = computed(\r\n () => css`\r\n flex: 1;\r\n overflow: hidden;\r\n\r\n .ant-menu {\r\n height: 100%;\r\n overflow: scroll;\r\n -ms-overflow-style: none; /* 对 IE 和 Edge 生效 */\r\n scrollbar-width: none; /* 对 Firefox 生效 */\r\n\r\n ${modeConfig.value.mode === \"light\"\r\n ? \"background:transparent;\"\r\n : \"\"}\r\n /* Webkit 浏览器 */\r\n ::-webkit-scrollbar {\r\n display: none;\r\n }\r\n }\r\n `\r\n );\r\n return {\r\n menuWrapperStyle\r\n };\r\n }\r\n\r\n function useMenu() {\r\n const { openKeys, selectedKeys, data } = storeToRefs(useMenuStore());\r\n const route = useRoute();\r\n const router = useRouter();\r\n\r\n /**\r\n * 在标签切换的时候,路由会变化,需要动态关联左侧菜单的选中状态\r\n */\r\n watch(\r\n () => route.fullPath,\r\n async path => {\r\n
|
|
1
|
+
{"version":3,"file":"Menu.cjs","sources":["../../../../../../src/components/layout/components/menu/Menu.tsx"],"sourcesContent":["import { computed, defineComponent, watch } from \"vue\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport { useAppStore, useMenuStore, useNoStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\n\r\nexport default defineComponent({\r\n name: \"DMenu\",\r\n setup() {\r\n const { layout, modeConfig } = storeToRefs(useAppStore());\r\n const { menuList } = storeToRefs(useNoStore());\r\n const { menuWrapperStyle } = useStyle();\r\n const { openKeys, selectedKeys, onClick } = useMenu();\r\n\r\n function useStyle() {\r\n const menuWrapperStyle = computed(\r\n () => css`\r\n flex: 1;\r\n overflow: hidden;\r\n\r\n .ant-menu {\r\n height: 100%;\r\n overflow: scroll;\r\n -ms-overflow-style: none; /* 对 IE 和 Edge 生效 */\r\n scrollbar-width: none; /* 对 Firefox 生效 */\r\n\r\n ${modeConfig.value.mode === \"light\"\r\n ? \"background:transparent;\"\r\n : \"\"}\r\n /* Webkit 浏览器 */\r\n ::-webkit-scrollbar {\r\n display: none;\r\n }\r\n }\r\n `\r\n );\r\n return {\r\n menuWrapperStyle\r\n };\r\n }\r\n\r\n function useMenu() {\r\n const { openKeys, selectedKeys, data } = storeToRefs(useMenuStore());\r\n const route = useRoute();\r\n const router = useRouter();\r\n\r\n /**\r\n * 在标签切换的时候,路由会变化,需要动态关联左侧菜单的选中状态\r\n */\r\n watch(\r\n () => route.fullPath,\r\n async path => {\r\n const flag = selectedKeys.value.some((item: string) => item === path);\r\n if (!flag) {\r\n const rs = _findMatchedMenuKey(path, data.value as never);\r\n if (rs) {\r\n if (!layout.value.collapsed) {\r\n if (rs?.parentKey) {\r\n openKeys.value = [rs.parentKey];\r\n } else {\r\n openKeys.value = [rs!.matchedKey];\r\n }\r\n }\r\n selectedKeys.value = [rs!.matchedKey];\r\n }\r\n }\r\n }\r\n );\r\n\r\n watch(\r\n () => layout.value.collapsed,\r\n val => {\r\n const path = selectedKeys.value[0];\r\n const rs = _findMatchedMenuKey(path, data.value as never);\r\n if (val) {\r\n openKeys.value = [];\r\n } else {\r\n if (rs?.parentKey) {\r\n openKeys.value = [rs.parentKey];\r\n } else {\r\n openKeys.value = [rs!.matchedKey];\r\n }\r\n }\r\n }\r\n );\r\n\r\n // 匹配菜单项的函数(支持嵌套 children)\r\n const _findMatchedMenuKey = (\r\n path: string,\r\n menuItems: { key: string; children: [] }[],\r\n parentKey: string = \"\"\r\n ): { matchedKey: string; parentKey: string } | null => {\r\n // 遍历菜单项\r\n for (const item of menuItems) {\r\n // 完全匹配\r\n if (item.key === path) {\r\n return { matchedKey: item.key, parentKey };\r\n }\r\n\r\n // 如果当前菜单项有 children,递归查找\r\n if (item.children && item.children.length > 0) {\r\n const result = _findMatchedMenuKey(path, item.children, item.key);\r\n if (result) {\r\n return result;\r\n }\r\n }\r\n\r\n // 匹配以 basePath 开头的菜单项\r\n const match = path.match(/^\\/[^/]+/); // 匹配以 / 开头,后面不包含 / 的部分\r\n const basePath = match ? match[0] : \"\"; // 提取基础路径,如 /user\r\n if (item.key?.startsWith(basePath)) {\r\n return { matchedKey: item.key, parentKey };\r\n }\r\n }\r\n\r\n // 如果没有找到匹配的菜单项,返回 null\r\n return null;\r\n };\r\n\r\n const onClick = ({\r\n key,\r\n keyPath\r\n }: {\r\n item: string;\r\n key: string;\r\n keyPath: string[];\r\n }) => {\r\n openKeys.value = keyPath;\r\n selectedKeys.value = [key];\r\n\r\n // 判断目标路由和当前路由是否相等;\r\n // 不相等的时候再跳转\r\n if (route.path !== key) {\r\n router.push(key).then(r => {\r\n if (r) {\r\n console.warn(r);\r\n }\r\n });\r\n }\r\n };\r\n\r\n return {\r\n openKeys,\r\n selectedKeys,\r\n data,\r\n onClick\r\n };\r\n }\r\n\r\n return () => (\r\n <div class={menuWrapperStyle.value}>\r\n <a-menu\r\n v-model:open-keys={openKeys.value}\r\n v-model:selected-keys={selectedKeys.value}\r\n items={menuList.value}\r\n mode=\"inline\"\r\n triggerSubMenuAction={\"hover\"}\r\n onClick={onClick}\r\n ></a-menu>\r\n </div>\r\n );\r\n }\r\n});\r\n"],"names":["defineComponent","name","setup","layout","modeConfig","storeToRefs","useAppStore","menuList","useNoStore","menuWrapperStyle","useStyle","openKeys","selectedKeys","onClick","useMenu","computed","css","value","mode","data","useMenuStore","route","useRoute","router","useRouter","watch","fullPath","path","flag","some","item","rs","_findMatchedMenuKey","collapsed","parentKey","matchedKey","val","menuItems","key","children","length","result","match","basePath","startsWith","keyPath","push","then","r","console","warn","_createVNode","_resolveComponent","$event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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,QAAIjB,IAAAA,KAAAA,CAAMM,SAASW,GAAK,EAAA;AACtBf,UAAAA,MAAAA,CAAOuB,IAAKR,CAAAA,GAAG,CAAES,CAAAA,IAAAA,CAAKC,CAAK,CAAA,KAAA;AACzB,YAAA,IAAIA,CAAG,EAAA;AACLC,cAAAA,OAAAA,CAAQC,KAAKF,CAAC,CAAA;AAAA;AAChB,WACD,CAAA;AAAA;AACH,OACF;AAEA,MAAO,OAAA;AAAA,QACLrC,QAAAA,EAAAA,SAAAA;AAAAA,QACAC,YAAAA,EAAAA,aAAAA;AAAAA,QACAO,IAAAA;AAAAA,QACAN,OAAAA,EAAAA;AAAAA,OACF;AAAA;AAGF,IAAO,OAAA,MAAAsC,gBAAA,KAAA,EAAA;AAAA,MAAA,SACO1C,gBAAiBQ,CAAAA;AAAAA,KAAKkC,EAAAA,CAAAA,eAAAC,CAAAA,oBAAAA,CAAA,QAAA,CAAA,EAAA;AAAA,MAAA,aAEXzC,QAASM,CAAAA,KAAAA;AAAAA,MAAK,oBAAA,EAAAoC,CAAd1C,MAAAA,KAAAA,QAAAA,CAASM,KAAKoC,GAAAA,MAAAA;AAAAA,MAAA,iBACVzC,YAAaK,CAAAA,KAAAA;AAAAA,MAAK,wBAAA,EAAAoC,CAAlBzC,MAAAA,KAAAA,YAAAA,CAAaK,KAAKoC,GAAAA,MAAAA;AAAAA,MAAA,SAClC9C,QAASU,CAAAA,KAAAA;AAAAA,MAAK,MAAA,EAAA,QAAA;AAAA,MAAA,sBAEC,EAAA,OAAA;AAAA,MAAO,SACpBJ,EAAAA;AAAAA,KAAO,EAGrB,IAAA,CAAA,CAAA,CAAA;AAAA;AAEL,CAAC,CAAA;;;;"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var List = require('./List.cjs');
|
|
4
4
|
var Show = require('./Show.cjs');
|
|
5
5
|
require('./Layout.vue.cjs');
|
|
6
|
+
require('./components/index.cjs');
|
|
6
7
|
var Layout_vue_vue_type_script_setup_true_lang = require('./Layout.vue2.cjs');
|
|
8
|
+
var ThemeApp_vue_vue_type_script_setup_true_lang = require('./components/layout/ThemeApp.vue2.cjs');
|
|
9
|
+
var HeaderLayout_vue_vue_type_script_setup_true_lang = require('./components/layout/HeaderLayout.vue2.cjs');
|
|
10
|
+
var Menu = require('./components/menu/Menu.cjs');
|
|
7
11
|
|
|
8
12
|
"use strict";
|
|
9
|
-
Layout_vue_vue_type_script_setup_true_lang.default.install = function(app) {
|
|
10
|
-
app.component("DLayout", Layout_vue_vue_type_script_setup_true_lang.default);
|
|
11
|
-
return app;
|
|
12
|
-
};
|
|
13
13
|
List.default.install = function(app) {
|
|
14
14
|
app.component(List.default.name, List.default);
|
|
15
15
|
return app;
|
|
@@ -18,8 +18,15 @@ Show.default.install = function(app) {
|
|
|
18
18
|
app.component(Show.default.name, Show.default);
|
|
19
19
|
return app;
|
|
20
20
|
};
|
|
21
|
+
Layout_vue_vue_type_script_setup_true_lang.default.install = function(app) {
|
|
22
|
+
app.component("DLayout", Layout_vue_vue_type_script_setup_true_lang.default);
|
|
23
|
+
return app;
|
|
24
|
+
};
|
|
21
25
|
|
|
22
26
|
exports.List = List.default;
|
|
23
27
|
exports.Show = Show.default;
|
|
24
28
|
exports.Layout = Layout_vue_vue_type_script_setup_true_lang.default;
|
|
29
|
+
exports.AppTheme = ThemeApp_vue_vue_type_script_setup_true_lang.default;
|
|
30
|
+
exports.HeaderLayout = HeaderLayout_vue_vue_type_script_setup_true_lang.default;
|
|
31
|
+
exports.Menu = Menu.default;
|
|
25
32
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/layout/index.ts"],"sourcesContent":["import List from \"./List\";\r\nimport Show from \"./Show\";\r\nimport type { App } from \"vue\";\r\n\r\nimport Layout from \"./Layout.vue\";\r\n\r\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/layout/index.ts"],"sourcesContent":["import List from \"./List\";\r\nimport Show from \"./Show\";\r\nimport type { App } from \"vue\";\r\n\r\nimport Layout from \"./Layout.vue\";\r\n\r\nexport * from \"./components\";\r\n\r\nList.install = function (app: App) {\r\n app.component(List.name!, List);\r\n return app;\r\n};\r\n\r\nShow.install = function (app: App) {\r\n app.component(Show.name!, Show);\r\n return app;\r\n};\r\nLayout.install = function (app: App) {\r\n app.component(\"DLayout\", Layout);\r\n return app;\r\n};\r\n\r\nexport { Layout, List, Show };\r\n"],"names":["List","Show","Layout"],"mappings":";;;;;;;;;;;;AAQAA,YAAK,CAAA,OAAA,GAAU,SAAU,GAAU,EAAA;AACjC,EAAI,GAAA,CAAA,SAAA,CAAUA,YAAK,CAAA,IAAA,EAAOA,YAAI,CAAA;AAC9B,EAAO,OAAA,GAAA;AACT,CAAA;AAEAC,YAAK,CAAA,OAAA,GAAU,SAAU,GAAU,EAAA;AACjC,EAAI,GAAA,CAAA,SAAA,CAAUA,YAAK,CAAA,IAAA,EAAOA,YAAI,CAAA;AAC9B,EAAO,OAAA,GAAA;AACT,CAAA;AACAC,kDAAO,CAAA,OAAA,GAAU,SAAU,GAAU,EAAA;AACnC,EAAI,GAAA,CAAA,SAAA,CAAU,WAAWA,kDAAM,CAAA;AAC/B,EAAO,OAAA,GAAA;AACT,CAAA;;;;;;;;;"}
|
|
@@ -24,6 +24,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
24
24
|
function useStyle() {
|
|
25
25
|
const { useToken } = antDesignVue.theme;
|
|
26
26
|
const { token } = useToken();
|
|
27
|
+
console.log(JSON.stringify(token.value));
|
|
27
28
|
const activeTabColor = vue.computed(() => token.value.colorBgLayout);
|
|
28
29
|
const splitColor = vue.computed(() => token.value.colorBorderSecondary);
|
|
29
30
|
const tabsNavStyle2 = vue.computed(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.vue2.cjs","sources":["../../../../src/components/tab/Tab.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed, type ComputedRef, watch } from \"vue\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport Search from \"./Search\";\r\nimport { CloseOutlined } from \"@ant-design/icons-vue\";\r\nimport { useAppStore, useNavTabStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\nimport type { GlobalToken } from \"ant-design-vue/es/theme/interface\";\r\n\r\nconst { tabsNavStyle, tabHoverBgStyle, closeBtnStyle } = useStyle();\r\n\r\nconst { activeKey, list, onChange, onClose } = useTab();\r\n\r\nfunction useStyle(): {\r\n tabsNavStyle: ComputedRef<string>;\r\n tabHoverBgStyle: ComputedRef<string>;\r\n closeBtnStyle: ComputedRef<string>;\r\n} {\r\n const { useToken } = theme;\r\n const { token }: { token: ComputedRef<GlobalToken> } = useToken();\r\n\r\n const activeTabColor = computed(() => token.value.colorBgLayout);\r\n const splitColor = computed(() => token.value.colorBorderSecondary);\r\n\r\n const tabsNavStyle = computed(() => {\r\n return css`\r\n --active-tab-color: ${activeTabColor.value};\r\n --splitColor: ${splitColor.value};\r\n padding-top: 10px;\r\n display: flex;\r\n `;\r\n });\r\n\r\n const tabHoverBgStyle = computed(() => {\r\n return css`\r\n &:before {\r\n background: ${token.value.colorPrimaryBgHover};\r\n }\r\n `;\r\n });\r\n\r\n const closeBtnStyle = computed(() => {\r\n return css`\r\n &:hover {\r\n background: ${token.value.colorPrimaryBorderHover};\r\n border-radius: 50%;\r\n }\r\n `;\r\n });\r\n\r\n return {\r\n tabsNavStyle,\r\n tabHoverBgStyle,\r\n closeBtnStyle\r\n };\r\n}\r\n\r\nfunction useTab() {\r\n const route = useRoute();\r\n const router = useRouter();\r\n\r\n const store = useNavTabStore();\r\n const { list, activeKey } = storeToRefs(store);\r\n const { save, deleteTabs } = store;\r\n\r\n watch(\r\n () => route.fullPath,\r\n () => {\r\n save(route);\r\n },\r\n {\r\n immediate: true\r\n }\r\n );\r\n\r\n watch(\r\n () => route.fullPath,\r\n val => {\r\n activeKey.value = val;\r\n },\r\n {\r\n immediate: true\r\n }\r\n );\r\n\r\n const onChange = (key: string) => {\r\n if (key !== route.path) {\r\n // 匹配打开的标签路由数据\r\n const rs = list.value.filter(item => item.fullPath === key)[0];\r\n router.push(rs);\r\n }\r\n };\r\n\r\n const onClose = ($event: Event, key: string | undefined) => {\r\n if (!key) return;\r\n //阻止冒泡\r\n $event.stopPropagation();\r\n // 删除标签\r\n deleteTabs(key);\r\n // 重新push已打开的路由\r\n const backRoute = list.value[list.value.length - 1];\r\n if (backRoute.fullPath) {\r\n router.push(backRoute.fullPath);\r\n }\r\n };\r\n\r\n return {\r\n activeKey,\r\n list,\r\n onChange,\r\n onClose\r\n };\r\n}\r\n</script>\r\n<template>\r\n <div class=\"tabs-nav-wrapper\" :class=\"tabsNavStyle\">\r\n <Search />\r\n <div class=\"d-tabs-nav\">\r\n <a-tabs\r\n size=\"small\"\r\n v-model:activeKey=\"activeKey\"\r\n type=\"card\"\r\n hide-add\r\n @change=\"onChange\"\r\n >\r\n <a-tab-pane\r\n :key=\"item.fullPath\"\r\n :closable=\"false\"\r\n v-for=\"item in list\"\r\n :class=\"{ active: activeKey === item.fullPath }\"\r\n >\r\n <template #tab>\r\n <div class=\"tab-hover-bg\" :class=\"tabHoverBgStyle\"></div>\r\n <div class=\"tab-dividers\"></div>\r\n <div class=\"tab-item\">{{ item.meta?.title || \"无标题\" }}</div>\r\n <div class=\"tab-close\">\r\n <div\r\n class=\"close-btn\"\r\n :class=\"closeBtnStyle\"\r\n @click=\"onClose($event, item.fullPath)\"\r\n >\r\n <CloseOutlined />\r\n </div>\r\n </div>\r\n </template>\r\n </a-tab-pane>\r\n </a-tabs>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<style lang=\"scss\"></style>\r\n"],"names":["theme","computed","tabsNavStyle","css","tabHoverBgStyle","closeBtnStyle","useRoute","useRouter","store","useNavTabStore","list","activeKey","storeToRefs","watch","onChange","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,IAAA,MAAM,EAAE,YAAA,EAAc,eAAiB,EAAA,aAAA,KAAkB,QAAS,EAAA;AAElE,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,QAAU,EAAA,OAAA,KAAY,MAAO,EAAA;AAEtD,IAAA,SAAS,QAIP,GAAA;AACA,MAAM,MAAA,EAAE,UAAa,GAAAA,kBAAA;AACrB,MAAM,MAAA,EAAE,KAAM,EAAA,GAAyC,QAAS,EAAA;
|
|
1
|
+
{"version":3,"file":"Tab.vue2.cjs","sources":["../../../../src/components/tab/Tab.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed, type ComputedRef, watch } from \"vue\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { theme } from \"ant-design-vue\";\r\nimport { storeToRefs } from \"pinia\";\r\n\r\nimport Search from \"./Search\";\r\nimport { CloseOutlined } from \"@ant-design/icons-vue\";\r\nimport { useAppStore, useNavTabStore } from \"@ditari/store\";\r\nimport { css } from \"@emotion/css\";\r\nimport type { GlobalToken } from \"ant-design-vue/es/theme/interface\";\r\n\r\nconst { tabsNavStyle, tabHoverBgStyle, closeBtnStyle } = useStyle();\r\n\r\nconst { activeKey, list, onChange, onClose } = useTab();\r\n\r\nfunction useStyle(): {\r\n tabsNavStyle: ComputedRef<string>;\r\n tabHoverBgStyle: ComputedRef<string>;\r\n closeBtnStyle: ComputedRef<string>;\r\n} {\r\n const { useToken } = theme;\r\n const { token }: { token: ComputedRef<GlobalToken> } = useToken();\r\n console.log(JSON.stringify(token.value));\r\n\r\n const activeTabColor = computed(() => token.value.colorBgLayout);\r\n const splitColor = computed(() => token.value.colorBorderSecondary);\r\n\r\n const tabsNavStyle = computed(() => {\r\n return css`\r\n --active-tab-color: ${activeTabColor.value};\r\n --splitColor: ${splitColor.value};\r\n padding-top: 10px;\r\n display: flex;\r\n `;\r\n });\r\n\r\n const tabHoverBgStyle = computed(() => {\r\n return css`\r\n &:before {\r\n background: ${token.value.colorPrimaryBgHover};\r\n }\r\n `;\r\n });\r\n\r\n const closeBtnStyle = computed(() => {\r\n return css`\r\n &:hover {\r\n background: ${token.value.colorPrimaryBorderHover};\r\n border-radius: 50%;\r\n }\r\n `;\r\n });\r\n\r\n return {\r\n tabsNavStyle,\r\n tabHoverBgStyle,\r\n closeBtnStyle\r\n };\r\n}\r\n\r\nfunction useTab() {\r\n const route = useRoute();\r\n const router = useRouter();\r\n\r\n const store = useNavTabStore();\r\n const { list, activeKey } = storeToRefs(store);\r\n const { save, deleteTabs } = store;\r\n\r\n watch(\r\n () => route.fullPath,\r\n () => {\r\n save(route);\r\n },\r\n {\r\n immediate: true\r\n }\r\n );\r\n\r\n watch(\r\n () => route.fullPath,\r\n val => {\r\n activeKey.value = val;\r\n },\r\n {\r\n immediate: true\r\n }\r\n );\r\n\r\n const onChange = (key: string) => {\r\n if (key !== route.path) {\r\n // 匹配打开的标签路由数据\r\n const rs = list.value.filter(item => item.fullPath === key)[0];\r\n router.push(rs);\r\n }\r\n };\r\n\r\n const onClose = ($event: Event, key: string | undefined) => {\r\n if (!key) return;\r\n //阻止冒泡\r\n $event.stopPropagation();\r\n // 删除标签\r\n deleteTabs(key);\r\n // 重新push已打开的路由\r\n const backRoute = list.value[list.value.length - 1];\r\n if (backRoute.fullPath) {\r\n router.push(backRoute.fullPath);\r\n }\r\n };\r\n\r\n return {\r\n activeKey,\r\n list,\r\n onChange,\r\n onClose\r\n };\r\n}\r\n</script>\r\n<template>\r\n <div class=\"tabs-nav-wrapper\" :class=\"tabsNavStyle\">\r\n <Search />\r\n <div class=\"d-tabs-nav\">\r\n <a-tabs\r\n size=\"small\"\r\n v-model:activeKey=\"activeKey\"\r\n type=\"card\"\r\n hide-add\r\n @change=\"onChange\"\r\n >\r\n <a-tab-pane\r\n :key=\"item.fullPath\"\r\n :closable=\"false\"\r\n v-for=\"item in list\"\r\n :class=\"{ active: activeKey === item.fullPath }\"\r\n >\r\n <template #tab>\r\n <div class=\"tab-hover-bg\" :class=\"tabHoverBgStyle\"></div>\r\n <div class=\"tab-dividers\"></div>\r\n <div class=\"tab-item\">{{ item.meta?.title || \"无标题\" }}</div>\r\n <div class=\"tab-close\">\r\n <div\r\n class=\"close-btn\"\r\n :class=\"closeBtnStyle\"\r\n @click=\"onClose($event, item.fullPath)\"\r\n >\r\n <CloseOutlined />\r\n </div>\r\n </div>\r\n </template>\r\n </a-tab-pane>\r\n </a-tabs>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<style lang=\"scss\"></style>\r\n"],"names":["theme","computed","tabsNavStyle","css","tabHoverBgStyle","closeBtnStyle","useRoute","useRouter","store","useNavTabStore","list","activeKey","storeToRefs","watch","onChange","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,IAAA,MAAM,EAAE,YAAA,EAAc,eAAiB,EAAA,aAAA,KAAkB,QAAS,EAAA;AAElE,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,QAAU,EAAA,OAAA,KAAY,MAAO,EAAA;AAEtD,IAAA,SAAS,QAIP,GAAA;AACA,MAAM,MAAA,EAAE,UAAa,GAAAA,kBAAA;AACrB,MAAM,MAAA,EAAE,KAAM,EAAA,GAAyC,QAAS,EAAA;AAChE,MAAA,OAAA,CAAQ,GAAI,CAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAEvC,MAAA,MAAM,cAAiB,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,MAAM,aAAa,CAAA;AAC/D,MAAA,MAAM,UAAa,GAAAA,YAAA,CAAS,MAAM,KAAA,CAAM,MAAM,oBAAoB,CAAA;AAElE,MAAMC,MAAAA,aAAAA,GAAeD,aAAS,MAAM;AAClC,QAAO,OAAAE,OAAA;AAAA,0BAAA,EACiB,eAAe,KAAK,CAAA;AAAA,oBAAA,EAC1B,WAAW,KAAK,CAAA;AAAA;AAAA;AAAA,IAAA,CAAA;AAAA,OAInC,CAA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M,IAAM,EAAA;AAEtB,UAAM,MAAA,EAAA,GAAKJ,MAAK,KAAM,CAAA,MAAA,CAAO,UAAQ,IAAK,CAAA,QAAA,KAAa,GAAG,CAAA,CAAE,CAAC,CAAA;AAC7D,UAAA,MAAA,CAAO,KAAK,EAAE,CAAA;AAAA;AAChB,OACF;AAEA,MAAMK,MAAAA,QAAAA,GAAU,CAAC,MAAA,EAAe,GAA4B,KAAA;AAC1D,QAAA,IAAI,CAAC,GAAK,EAAA;AAEV,QAAA,MAAA,CAAO,eAAgB,EAAA;AAEvB,QAAA,UAAA,CAAW,GAAG,CAAA;AAEd,QAAA,MAAM,YAAYL,KAAK,CAAA,KAAA,CAAMA,KAAK,CAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAClD,QAAA,IAAI,UAAU,QAAU,EAAA;AACtB,UAAO,MAAA,CAAA,IAAA,CAAK,UAAU,QAAQ,CAAA;AAAA;AAChC,OACF;AAEA,MAAO,OAAA;AAAA,QACL,SAAAC,EAAAA,UAAAA;AAAA,QACA,IAAAD,EAAAA,KAAAA;AAAA,QACA,QAAAI,EAAAA,SAAAA;AAAA,QACA,OAAAC,EAAAA;AAAA,OACF;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -10,6 +10,9 @@ var RangePicker_vue_vue_type_script_setup_true_lang = require('./components/date
|
|
|
10
10
|
var FormLayout = require('./components/form/FormLayout.cjs');
|
|
11
11
|
var Moon = require('./components/icon/Moon.vue.cjs');
|
|
12
12
|
var Sun = require('./components/icon/Sun.vue.cjs');
|
|
13
|
+
var ThemeApp_vue_vue_type_script_setup_true_lang = require('./components/layout/components/layout/ThemeApp.vue2.cjs');
|
|
14
|
+
var HeaderLayout_vue_vue_type_script_setup_true_lang = require('./components/layout/components/layout/HeaderLayout.vue2.cjs');
|
|
15
|
+
var Menu = require('./components/layout/components/menu/Menu.cjs');
|
|
13
16
|
var Layout_vue_vue_type_script_setup_true_lang = require('./components/layout/Layout.vue2.cjs');
|
|
14
17
|
var List = require('./components/layout/List.cjs');
|
|
15
18
|
var Show = require('./components/layout/Show.cjs');
|
|
@@ -37,6 +40,9 @@ exports.RangePicker = RangePicker_vue_vue_type_script_setup_true_lang.default;
|
|
|
37
40
|
exports.FormLayout = FormLayout.default;
|
|
38
41
|
exports.Moon = Moon.default;
|
|
39
42
|
exports.Sun = Sun.default;
|
|
43
|
+
exports.AppTheme = ThemeApp_vue_vue_type_script_setup_true_lang.default;
|
|
44
|
+
exports.HeaderLayout = HeaderLayout_vue_vue_type_script_setup_true_lang.default;
|
|
45
|
+
exports.Menu = Menu.default;
|
|
40
46
|
exports.Layout = Layout_vue_vue_type_script_setup_true_lang.default;
|
|
41
47
|
exports.List = List.default;
|
|
42
48
|
exports.Show = Show.default;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import * as components from \"./components\";\r\nimport type { App, DefineComponent, Plugin } from \"vue\";\r\n\r\n// import { version } from \"../package.json\";\r\n\r\nexport * from \"./components\";\r\n\r\nconsole.log(components);\r\n// 定义组件类型,确保每个组件都可能具有 `install` 方法\r\ntype ComponentWithInstall = DefineComponent<never, never, never> & {\r\n install?: (app: App) => void;\r\n};\r\n\r\nexport const install = (app: App) => {\r\n Object.keys(components).forEach(key => {\r\n const component = components[\r\n key as keyof typeof components\r\n ] as ComponentWithInstall;\r\n // 类型断言,告诉 TypeScript component 可能是一个插件\r\n const plugin = component as Plugin;\r\n // 如果组件有 install 方法,则按插件安装\r\n if (plugin.install) {\r\n app.use(plugin);\r\n }\r\n });\r\n};\r\n\r\nexport default {\r\n // version,\r\n install\r\n};\r\n"],"names":["components"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import * as components from \"./components\";\r\nimport type { App, DefineComponent, Plugin } from \"vue\";\r\n\r\n// import { version } from \"../package.json\";\r\n\r\nexport * from \"./components\";\r\n\r\nconsole.log(components);\r\n// 定义组件类型,确保每个组件都可能具有 `install` 方法\r\ntype ComponentWithInstall = DefineComponent<never, never, never> & {\r\n install?: (app: App) => void;\r\n};\r\n\r\nexport const install = (app: App) => {\r\n Object.keys(components).forEach(key => {\r\n const component = components[\r\n key as keyof typeof components\r\n ] as ComponentWithInstall;\r\n // 类型断言,告诉 TypeScript component 可能是一个插件\r\n const plugin = component as Plugin;\r\n // 如果组件有 install 方法,则按插件安装\r\n if (plugin.install) {\r\n app.use(plugin);\r\n }\r\n });\r\n};\r\n\r\nexport default {\r\n // version,\r\n install\r\n};\r\n"],"names":["components"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,OAAA,CAAQ,IAAIA,OAAU,CAAA;AAMT,MAAA,OAAA,GAAU,CAAC,GAAa,KAAA;AACnC,EAAA,MAAA,CAAO,IAAK,CAAAA,OAAU,CAAE,CAAA,OAAA,CAAQ,CAAO,GAAA,KAAA;AACrC,IAAM,MAAA,SAAA,GAAYA,QAChB,GACF,CAAA;AAEA,IAAA,MAAM,MAAS,GAAA,SAAA;AAEf,IAAA,IAAI,OAAO,OAAS,EAAA;AAClB,MAAA,GAAA,CAAI,IAAI,MAAM,CAAA;AAAA;AAChB,GACD,CAAA;AACH;AAEA,YAAe;AAAA;AAAA,EAEb;AACF,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ant-pro-drawer-setting-handle{position:fixed;inset-block-start:240px;inset-inline-end:0;z-index:
|
|
1
|
+
.ant-pro-drawer-setting-handle{position:fixed;inset-block-start:240px;inset-inline-end:0;z-index:1;display:flex;align-items:center;justify-content:center;width:48px;height:48px;font-size:16px;text-align:center;backdrop-filter:saturate(180%) blur(20px);cursor:pointer;pointer-events:auto}.ant-pro-drawer-setting-handle .icon{color:#fff}.ant-pro-drawer-setting-handle-icon-dark{color:#e5e0d8}.ant-pro-drawer-setting-theme-color{margin-top:16px;overflow:hidden}.ant-pro-drawer-setting-theme-color-block{float:left;width:20px;height:20px;margin-top:8px;margin-right:8px;font-weight:700;display:flex;color:#fff;align-items:center;justify-content:center;border-radius:2px;cursor:pointer}.ant-pro-drawer-setting-block-checkbox{display:flex;min-height:42px}.ant-pro-drawer-setting-block-checkbox-selectIcon{position:absolute;right:6px;bottom:4px;font-weight:700;font-size:14px;pointer-events:none}.ant-pro-drawer-setting-block-checkbox-item{position:relative;width:44px;height:36px;margin-right:16px;overflow:hidden;background-color:#f0f2f5;border-radius:4px;box-shadow:0 1px 2.5px 0 rgba(0,0,0,.18);cursor:pointer}.ant-pro-drawer-setting-block-checkbox-item::before{position:absolute;top:0;left:0;width:33%;height:100%;background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item::after{position:absolute;top:0;left:0;width:100%;height:25%;background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-dark{background-color:rgba(0,21,41,.85)}.ant-pro-drawer-setting-block-checkbox-item-dark::before{background-color:rgba(0,21,41,.65);content:""}.ant-pro-drawer-setting-block-checkbox-item-dark::after{background-color:rgba(0,21,41,.85)}.ant-pro-drawer-setting-block-checkbox-item-light::before{background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-light::after{background-color:#fff}.ant-pro-drawer-setting-block-checkbox-item-inverted::before,.ant-pro-drawer-setting-block-checkbox-item-side::before{z-index:1;background-color:#001529;content:""}.ant-pro-drawer-setting-block-checkbox-item-inverted::after,.ant-pro-drawer-setting-block-checkbox-item-side::after{background-color:#fff}.ant-pro-drawer-setting-block-checkbox-item-top::before{background-color:rgba(0,0,0,0);content:""}.ant-pro-drawer-setting-block-checkbox-item-top::after{background-color:#001529}.ant-pro-drawer-setting-block-checkbox-item-mix::before{background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-mix::after{background-color:#001529}.ant-pro-drawer-setting-block-checkbox-theme-item{background:#2a2c2c;box-shadow:rgba(13,13,13,.18) 0px 1px 2.5px 0px}.ant-pro-drawer-setting-block-checkbox-theme-item-light::before,.ant-pro-drawer-setting-block-checkbox-theme-item-light::after{background-color:#242525}.ant-pro-drawer-setting-block-checkbox-theme-item-dark::before,.ant-pro-drawer-setting-block-checkbox-theme-item-dark::after{background-color:rgba(15,28,41,.65)}.ant-pro-drawer-setting-block-checkbox-theme-item-side::before,.ant-pro-drawer-setting-block-checkbox-theme-item-inverted::before{background-color:#0f1c29}.ant-pro-drawer-setting-block-checkbox-theme-item-side::after,.ant-pro-drawer-setting-block-checkbox-theme-item-inverted::after{background-color:#242525}.ant-pro-drawer-setting-block-checkbox-theme-item-mix::before{background-color:#242525}
|
package/dist/css/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-tabs-nav{flex:1;overflow:hidden}.d-tabs-nav .ant-tabs-nav{margin-bottom:0 !important}.d-tabs-nav .ant-tabs-nav:before{border-bottom-width:0}.d-tabs-nav .ant-tabs-nav-operations{display:none !important}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab{position:relative;transition:none !important;border:0;background:rgba(0,0,0,0)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:first-child{margin-left:20px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:first-child .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:nth-last-child(2){margin-right:20px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:before,.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:after{position:absolute;bottom:-1px;content:"";width:30px;height:30px;border-radius:100%;box-shadow:0 0 0 40px rgba(0,0,0,0)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:before{left:-30px;clip-path:inset(50% -10px 0 50%)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:after{right:-30px;clip-path:inset(50% 50% 0 -10px)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active{border-radius:10px 10px 0 0 !important;background:var(--active-tab-color)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active:before,.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active:after{z-index:10;box-shadow:0 0 0 30px var(--active-tab-color)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-hover-bg{position:absolute;display:flex;flex-direction:column;justify-content:center;top:0;right:0;bottom:0;left:0;z-index:-1}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-hover-bg:before{content:"";width:100%;height:25px;border-radius:6px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active)+.ant-tabs-tab .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:not(.ant-tabs-tab-active) .close-btn{color:#fff}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:not(.ant-tabs-tab-active) .tab-item{color:#fff}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab-active+.ant-tabs-tab .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab-btn{display:flex;align-items:center}.d-tabs-nav .tab-close{position:absolute;top:0;right:0;bottom:0;padding:4px;display:flex;align-items:center;justify-content:center}.d-tabs-nav .tab-close .close-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;z-index:20}.d-tabs-nav .tab-close .anticon{margin:0}.d-tabs-nav .tab-item{padding-right:30px}.d-tabs-nav .tab-dividers{position:absolute;z-index:0;height:14px;left:-2px}.d-tabs-nav .tab-dividers::before{content:"";display:block;position:absolute;top:0;left:1px;bottom:0;width:1px;opacity:1;background-color:var(--splitColor);border-radius:10px;transition:opacity .2s ease,background-color .3s}.search-popover-wrapper .ant-popover-inner{padding:0}.ant-pro-drawer-setting-handle{position:fixed;inset-block-start:240px;inset-inline-end:0;z-index:
|
|
1
|
+
.d-tabs-nav{flex:1;overflow:hidden}.d-tabs-nav .ant-tabs-nav{margin-bottom:0 !important}.d-tabs-nav .ant-tabs-nav:before{border-bottom-width:0}.d-tabs-nav .ant-tabs-nav-operations{display:none !important}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab{position:relative;transition:none !important;border:0;background:rgba(0,0,0,0)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:first-child{margin-left:20px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:first-child .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:nth-last-child(2){margin-right:20px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:before,.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:after{position:absolute;bottom:-1px;content:"";width:30px;height:30px;border-radius:100%;box-shadow:0 0 0 40px rgba(0,0,0,0)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:before{left:-30px;clip-path:inset(50% -10px 0 50%)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:after{right:-30px;clip-path:inset(50% 50% 0 -10px)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active{border-radius:10px 10px 0 0 !important;background:var(--active-tab-color)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active:before,.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active:after{z-index:10;box-shadow:0 0 0 30px var(--active-tab-color)}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-hover-bg{position:absolute;display:flex;flex-direction:column;justify-content:center;top:0;right:0;bottom:0;left:0;z-index:-1}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-hover-bg:before{content:"";width:100%;height:25px;border-radius:6px}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active) .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:hover:not(.ant-tabs-tab-active)+.ant-tabs-tab .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:not(.ant-tabs-tab-active) .close-btn{color:#fff}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab:not(.ant-tabs-tab-active) .tab-item{color:#fff}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab-active+.ant-tabs-tab .tab-dividers::before{opacity:0}.d-tabs-nav .ant-tabs-nav-list .ant-tabs-tab-btn{display:flex;align-items:center}.d-tabs-nav .tab-close{position:absolute;top:0;right:0;bottom:0;padding:4px;display:flex;align-items:center;justify-content:center}.d-tabs-nav .tab-close .close-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;z-index:20}.d-tabs-nav .tab-close .anticon{margin:0}.d-tabs-nav .tab-item{padding-right:30px}.d-tabs-nav .tab-dividers{position:absolute;z-index:0;height:14px;left:-2px}.d-tabs-nav .tab-dividers::before{content:"";display:block;position:absolute;top:0;left:1px;bottom:0;width:1px;opacity:1;background-color:var(--splitColor);border-radius:10px;transition:opacity .2s ease,background-color .3s}.search-popover-wrapper .ant-popover-inner{padding:0}.ant-pro-drawer-setting-handle{position:fixed;inset-block-start:240px;inset-inline-end:0;z-index:1;display:flex;align-items:center;justify-content:center;width:48px;height:48px;font-size:16px;text-align:center;backdrop-filter:saturate(180%) blur(20px);cursor:pointer;pointer-events:auto}.ant-pro-drawer-setting-handle .icon{color:#fff}.ant-pro-drawer-setting-handle-icon-dark{color:#e5e0d8}.ant-pro-drawer-setting-theme-color{margin-top:16px;overflow:hidden}.ant-pro-drawer-setting-theme-color-block{float:left;width:20px;height:20px;margin-top:8px;margin-right:8px;font-weight:700;display:flex;color:#fff;align-items:center;justify-content:center;border-radius:2px;cursor:pointer}.ant-pro-drawer-setting-block-checkbox{display:flex;min-height:42px}.ant-pro-drawer-setting-block-checkbox-selectIcon{position:absolute;right:6px;bottom:4px;font-weight:700;font-size:14px;pointer-events:none}.ant-pro-drawer-setting-block-checkbox-item{position:relative;width:44px;height:36px;margin-right:16px;overflow:hidden;background-color:#f0f2f5;border-radius:4px;box-shadow:0 1px 2.5px 0 rgba(0,0,0,.18);cursor:pointer}.ant-pro-drawer-setting-block-checkbox-item::before{position:absolute;top:0;left:0;width:33%;height:100%;background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item::after{position:absolute;top:0;left:0;width:100%;height:25%;background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-dark{background-color:rgba(0,21,41,.85)}.ant-pro-drawer-setting-block-checkbox-item-dark::before{background-color:rgba(0,21,41,.65);content:""}.ant-pro-drawer-setting-block-checkbox-item-dark::after{background-color:rgba(0,21,41,.85)}.ant-pro-drawer-setting-block-checkbox-item-light::before{background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-light::after{background-color:#fff}.ant-pro-drawer-setting-block-checkbox-item-inverted::before,.ant-pro-drawer-setting-block-checkbox-item-side::before{z-index:1;background-color:#001529;content:""}.ant-pro-drawer-setting-block-checkbox-item-inverted::after,.ant-pro-drawer-setting-block-checkbox-item-side::after{background-color:#fff}.ant-pro-drawer-setting-block-checkbox-item-top::before{background-color:rgba(0,0,0,0);content:""}.ant-pro-drawer-setting-block-checkbox-item-top::after{background-color:#001529}.ant-pro-drawer-setting-block-checkbox-item-mix::before{background-color:#fff;content:""}.ant-pro-drawer-setting-block-checkbox-item-mix::after{background-color:#001529}.ant-pro-drawer-setting-block-checkbox-theme-item{background:#2a2c2c;box-shadow:rgba(13,13,13,.18) 0px 1px 2.5px 0px}.ant-pro-drawer-setting-block-checkbox-theme-item-light::before,.ant-pro-drawer-setting-block-checkbox-theme-item-light::after{background-color:#242525}.ant-pro-drawer-setting-block-checkbox-theme-item-dark::before,.ant-pro-drawer-setting-block-checkbox-theme-item-dark::after{background-color:rgba(15,28,41,.65)}.ant-pro-drawer-setting-block-checkbox-theme-item-side::before,.ant-pro-drawer-setting-block-checkbox-theme-item-inverted::before{background-color:#0f1c29}.ant-pro-drawer-setting-block-checkbox-theme-item-side::after,.ant-pro-drawer-setting-block-checkbox-theme-item-inverted::after{background-color:#242525}.ant-pro-drawer-setting-block-checkbox-theme-item-mix::before{background-color:#242525}html::-webkit-scrollbar,body::-webkit-scrollbar{width:0 !important;display:none}.main-enter-active{transition:.2s}.main-leave-active{transition:.15s}.main-enter-from{opacity:0;margin-left:-20px}.main-leave-to{opacity:0;margin-left:20px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, resolveComponent,
|
|
1
|
+
import { defineComponent, ref, watch, resolveComponent, createBlock, openBlock } from 'vue';
|
|
2
2
|
import dayjs from '../../_virtual/dayjs.min.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
@@ -70,26 +70,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70
70
|
};
|
|
71
71
|
return (_ctx, _cache) => {
|
|
72
72
|
const _component_a_range_picker = resolveComponent("a-range-picker");
|
|
73
|
-
return openBlock(),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/* TEXT */
|
|
81
|
-
),
|
|
82
|
-
createVNode(_component_a_range_picker, {
|
|
83
|
-
style: { "width": "100%" },
|
|
84
|
-
value: innerValue.value,
|
|
85
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
|
|
86
|
-
placeholder: ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"],
|
|
87
|
-
onChange: handleChange
|
|
88
|
-
}, null, 8, ["value"])
|
|
89
|
-
],
|
|
90
|
-
64
|
|
91
|
-
/* STABLE_FRAGMENT */
|
|
92
|
-
);
|
|
73
|
+
return openBlock(), createBlock(_component_a_range_picker, {
|
|
74
|
+
style: { "width": "100%" },
|
|
75
|
+
value: innerValue.value,
|
|
76
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
|
|
77
|
+
placeholder: ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"],
|
|
78
|
+
onChange: handleChange
|
|
79
|
+
}, null, 8, ["value"]);
|
|
93
80
|
};
|
|
94
81
|
}
|
|
95
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangePicker.vue2.mjs","sources":["../../../../src/components/date/RangePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { ref, watch } from \"vue\";\r\n\r\nimport type { RangeValue } from \"ant-design-vue/es/vc-picker/interface\";\r\nimport type { Dayjs } from \"dayjs\";\r\nimport dayjs from \"dayjs\";\r\n\r\n// 定义 props 类型\r\ninterface Props {\r\n value: Record<string, unknown>; // 使用 any 以兼容任意字段\r\n startField?: string;\r\n endField?: string;\r\n format?: string;\r\n}\r\n\r\nconst props = defineProps({\n value: { type: Object, required: true, default: () => ({}) },\n startField: { type: String, required: false, default: \"startTime\" },\n endField: { type: String, required: false, default: \"endTime\" },\n format: { type: String, required: false, default: \"YYYY-MM-DD\" }\n});\r\n\r\n// 定义 emits 类型\r\nconst emits = defineEmits([\"update:value\", \"change\"]);\r\n\r\n// 定义 innerValue 的类型为 RangeValue<Dayjs>\r\nconst innerValue = ref<RangeValue<Dayjs>>(null);\r\n\r\n// 监听外部 value 变化,更新内部值\r\nwatch(\r\n () => props.value,\r\n newVal => {\r\n if (newVal[props.startField] && newVal[props.endField]) {\r\n innerValue.value = [\r\n dayjs(newVal[props.startField] as string),\r\n dayjs(newVal[props.endField] as string)\r\n ];\r\n } else {\r\n innerValue.value = null;\r\n }\r\n },\r\n { immediate: true, deep: true }\r\n);\r\n\r\n// 处理日期变化\r\nconst handleChange = (dates: RangeValue<Dayjs>) => {\r\n if (dates && dates.length === 2) {\r\n const [startTime, endTime] = dates;\r\n\r\n // 创建一个新对象,保留原 params 的其他属性\r\n const formattedValue = {\r\n ...props.value, // 保留原对象的所有属性\r\n [props.startField]: startTime ? startTime.format(props.format) : null,\r\n [props.endField]: endTime ? endTime.format(props.format) : null\r\n };\r\n\r\n emits(\"update:value\", formattedValue);\r\n emits(\"change\", formattedValue);\r\n } else {\r\n // 如果日期为空,则清空 startField 和 endField\r\n const formattedValue = {\r\n ...props.value, // 保留原对象的所有属性\r\n [props.startField]: null,\r\n [props.endField]: null\r\n };\r\n\r\n emits(\"update:value\", formattedValue);\r\n emits(\"change\", formattedValue);\r\n }\r\n};\r\n</script>\r\n\r\n<template>\r\n
|
|
1
|
+
{"version":3,"file":"RangePicker.vue2.mjs","sources":["../../../../src/components/date/RangePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { ref, watch } from \"vue\";\r\n\r\nimport type { RangeValue } from \"ant-design-vue/es/vc-picker/interface\";\r\nimport type { Dayjs } from \"dayjs\";\r\nimport dayjs from \"dayjs\";\r\n\r\n// 定义 props 类型\r\ninterface Props {\r\n value: Record<string, unknown>; // 使用 any 以兼容任意字段\r\n startField?: string;\r\n endField?: string;\r\n format?: string;\r\n}\r\n\r\nconst props = defineProps({\n value: { type: Object, required: true, default: () => ({}) },\n startField: { type: String, required: false, default: \"startTime\" },\n endField: { type: String, required: false, default: \"endTime\" },\n format: { type: String, required: false, default: \"YYYY-MM-DD\" }\n});\r\n\r\n// 定义 emits 类型\r\nconst emits = defineEmits([\"update:value\", \"change\"]);\r\n\r\n// 定义 innerValue 的类型为 RangeValue<Dayjs>\r\nconst innerValue = ref<RangeValue<Dayjs>>(null);\r\n\r\n// 监听外部 value 变化,更新内部值\r\nwatch(\r\n () => props.value,\r\n newVal => {\r\n if (newVal[props.startField] && newVal[props.endField]) {\r\n innerValue.value = [\r\n dayjs(newVal[props.startField] as string),\r\n dayjs(newVal[props.endField] as string)\r\n ];\r\n } else {\r\n innerValue.value = null;\r\n }\r\n },\r\n { immediate: true, deep: true }\r\n);\r\n\r\n// 处理日期变化\r\nconst handleChange = (dates: RangeValue<Dayjs>) => {\r\n if (dates && dates.length === 2) {\r\n const [startTime, endTime] = dates;\r\n\r\n // 创建一个新对象,保留原 params 的其他属性\r\n const formattedValue = {\r\n ...props.value, // 保留原对象的所有属性\r\n [props.startField]: startTime ? startTime.format(props.format) : null,\r\n [props.endField]: endTime ? endTime.format(props.format) : null\r\n };\r\n\r\n emits(\"update:value\", formattedValue);\r\n emits(\"change\", formattedValue);\r\n } else {\r\n // 如果日期为空,则清空 startField 和 endField\r\n const formattedValue = {\r\n ...props.value, // 保留原对象的所有属性\r\n [props.startField]: null,\r\n [props.endField]: null\r\n };\r\n\r\n emits(\"update:value\", formattedValue);\r\n emits(\"change\", formattedValue);\r\n }\r\n};\r\n</script>\r\n\r\n<template>\r\n <a-range-picker\r\n style=\"width: 100%\"\r\n v-model:value=\"innerValue\"\r\n :placeholder=\"['开始时间', '结束时间']\"\r\n @change=\"handleChange\"\r\n />\r\n</template>\r\n\r\n<style scoped></style>\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAQd,IAAA,MAAM,KAAQ,GAAA,MAAA;AAGd,IAAM,MAAA,UAAA,GAAa,IAAuB,IAAI,CAAA;AAG9C,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAU,MAAA,KAAA;AACR,QAAA,IAAI,OAAO,KAAM,CAAA,UAAU,KAAK,MAAO,CAAA,KAAA,CAAM,QAAQ,CAAG,EAAA;AACtD,UAAA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;;;;;;;;;;;;;;;;"}
|
|
@@ -12,6 +12,9 @@ export { default as RangePicker } from './date/RangePicker.vue2.mjs';
|
|
|
12
12
|
export { default as FormLayout } from './form/FormLayout.mjs';
|
|
13
13
|
export { default as Moon } from './icon/Moon.vue.mjs';
|
|
14
14
|
export { default as Sun } from './icon/Sun.vue.mjs';
|
|
15
|
+
export { default as AppTheme } from './layout/components/layout/ThemeApp.vue2.mjs';
|
|
16
|
+
export { default as HeaderLayout } from './layout/components/layout/HeaderLayout.vue2.mjs';
|
|
17
|
+
export { default as Menu } from './layout/components/menu/Menu.mjs';
|
|
15
18
|
export { default as Layout } from './layout/Layout.vue2.mjs';
|
|
16
19
|
export { default as List } from './layout/List.mjs';
|
|
17
20
|
export { default as Show } from './layout/Show.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { defineComponent, watch, ref, computed, resolveComponent, createElementBlock, openBlock, Fragment, createVNode,
|
|
1
|
+
import { defineComponent, watch, ref, provide, computed, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, normalizeClass, unref, withCtx, createElementVNode, renderSlot } from 'vue';
|
|
2
2
|
import { useRoute } from 'vue-router';
|
|
3
3
|
import { storeToRefs } from 'pinia';
|
|
4
|
-
import
|
|
4
|
+
import Menu from './components/menu/Menu.mjs';
|
|
5
5
|
import SettingDrawer from './components/settings/SettingDrawer.mjs';
|
|
6
6
|
import { useAppStore, useKeepAliveStore } from '@ditari/store';
|
|
7
7
|
import { css } from '@emotion/css';
|
|
8
8
|
import './components/layout/HeaderLayout.vue.mjs';
|
|
9
9
|
import './components/layout/RouterContent.vue.mjs';
|
|
10
|
-
import './components/layout/
|
|
11
|
-
import _sfc_main$
|
|
12
|
-
import _sfc_main$2 from './components/layout/HeaderLayout.vue2.mjs';
|
|
13
|
-
import _sfc_main$3 from './components/layout/RouterContent.vue2.mjs';
|
|
10
|
+
import _sfc_main$1 from './components/layout/HeaderLayout.vue2.mjs';
|
|
11
|
+
import _sfc_main$2 from './components/layout/RouterContent.vue2.mjs';
|
|
14
12
|
|
|
15
13
|
"use strict";
|
|
14
|
+
const _hoisted_1 = { class: "app-side" };
|
|
16
15
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
16
|
__name: "Layout",
|
|
18
17
|
props: {
|
|
@@ -26,7 +25,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
25
|
const route = useRoute();
|
|
27
26
|
const { layoutStyle, siderStyle, rightStyle, rightContentStyle } = useStyle();
|
|
28
27
|
useKeepAlive();
|
|
29
|
-
|
|
28
|
+
useWatermark();
|
|
30
29
|
function useKeepAlive() {
|
|
31
30
|
const { save } = useKeepAliveStore();
|
|
32
31
|
watch(
|
|
@@ -40,17 +39,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
39
|
);
|
|
41
40
|
}
|
|
42
41
|
function useWatermark() {
|
|
43
|
-
const
|
|
42
|
+
const watermarkContent = ref("");
|
|
43
|
+
provide("watermarkContent", watermarkContent);
|
|
44
44
|
watch(
|
|
45
45
|
() => props.watermark,
|
|
46
46
|
(val) => {
|
|
47
|
-
|
|
47
|
+
watermarkContent.value = val.content || "";
|
|
48
48
|
},
|
|
49
49
|
{ deep: true, immediate: true }
|
|
50
50
|
);
|
|
51
|
-
return {
|
|
52
|
-
watermarkContent: watermarkContent2
|
|
53
|
-
};
|
|
54
51
|
}
|
|
55
52
|
function useStyle() {
|
|
56
53
|
const layoutStyle2 = css`
|
|
@@ -68,12 +65,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
65
|
top: 0;
|
|
69
66
|
bottom: 0;
|
|
70
67
|
left: 0;
|
|
68
|
+
z-index: 1;
|
|
71
69
|
width: ${layout.value.sideWidth}px;
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
.app-side {
|
|
72
|
+
height: 100%;
|
|
75
73
|
display: flex;
|
|
76
74
|
flex-direction: column;
|
|
75
|
+
${modeConfig.value.mode === "light" ? `background:${sideTokenStyle.value.bgColor};` : ""}
|
|
77
76
|
}
|
|
78
77
|
`
|
|
79
78
|
);
|
|
@@ -98,66 +97,52 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
98
97
|
return (_ctx, _cache) => {
|
|
99
98
|
const _component_a_layout_sider = resolveComponent("a-layout-sider");
|
|
100
99
|
const _component_a_layout_content = resolveComponent("a-layout-content");
|
|
101
|
-
const _component_a_watermark = resolveComponent("a-watermark");
|
|
102
100
|
const _component_a_layout = resolveComponent("a-layout");
|
|
103
101
|
const _component_a_back_top = resolveComponent("a-back-top");
|
|
104
102
|
return openBlock(), createElementBlock(
|
|
105
103
|
Fragment,
|
|
106
104
|
null,
|
|
107
105
|
[
|
|
108
|
-
createVNode(
|
|
106
|
+
createVNode(_component_a_layout, {
|
|
107
|
+
class: normalizeClass(unref(layoutStyle))
|
|
108
|
+
}, {
|
|
109
109
|
default: withCtx(() => [
|
|
110
|
+
createVNode(_component_a_layout_sider, {
|
|
111
|
+
collapsed: unref(layout).collapsed,
|
|
112
|
+
"onUpdate:collapsed": _cache[0] || (_cache[0] = ($event) => unref(layout).collapsed = $event),
|
|
113
|
+
theme: "light",
|
|
114
|
+
collapsible: "",
|
|
115
|
+
trigger: null,
|
|
116
|
+
class: normalizeClass(unref(siderStyle))
|
|
117
|
+
}, {
|
|
118
|
+
default: withCtx(() => [
|
|
119
|
+
createElementVNode("div", _hoisted_1, [
|
|
120
|
+
renderSlot(_ctx.$slots, "logo"),
|
|
121
|
+
createVNode(unref(Menu))
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
_: 3
|
|
125
|
+
/* FORWARDED */
|
|
126
|
+
}, 8, ["collapsed", "class"]),
|
|
110
127
|
createVNode(_component_a_layout, {
|
|
111
|
-
class: normalizeClass(unref(
|
|
128
|
+
class: normalizeClass(unref(rightStyle))
|
|
112
129
|
}, {
|
|
113
130
|
default: withCtx(() => [
|
|
114
|
-
createVNode(
|
|
115
|
-
collapsed: unref(layout).collapsed,
|
|
116
|
-
"onUpdate:collapsed": _cache[0] || (_cache[0] = ($event) => unref(layout).collapsed = $event),
|
|
117
|
-
theme: "light",
|
|
118
|
-
collapsible: "",
|
|
119
|
-
trigger: null,
|
|
120
|
-
class: normalizeClass(unref(siderStyle))
|
|
121
|
-
}, {
|
|
131
|
+
createVNode(_sfc_main$1, null, {
|
|
122
132
|
default: withCtx(() => [
|
|
123
|
-
renderSlot(_ctx.$slots, "
|
|
124
|
-
createVNode(unref(DMenu))
|
|
133
|
+
renderSlot(_ctx.$slots, "headerRight")
|
|
125
134
|
]),
|
|
126
135
|
_: 3
|
|
127
136
|
/* FORWARDED */
|
|
128
|
-
}
|
|
129
|
-
createVNode(
|
|
130
|
-
class: normalizeClass(unref(
|
|
137
|
+
}),
|
|
138
|
+
createVNode(_component_a_layout_content, {
|
|
139
|
+
class: normalizeClass(unref(rightContentStyle))
|
|
131
140
|
}, {
|
|
132
141
|
default: withCtx(() => [
|
|
133
|
-
createVNode(
|
|
134
|
-
content: unref(watermarkContent),
|
|
135
|
-
style: { "display": "flex", "height": "100%" }
|
|
136
|
-
}, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(_sfc_main$2, null, {
|
|
139
|
-
default: withCtx(() => [
|
|
140
|
-
renderSlot(_ctx.$slots, "headerRight")
|
|
141
|
-
]),
|
|
142
|
-
_: 3
|
|
143
|
-
/* FORWARDED */
|
|
144
|
-
}),
|
|
145
|
-
createVNode(_component_a_layout_content, {
|
|
146
|
-
class: normalizeClass(unref(rightContentStyle))
|
|
147
|
-
}, {
|
|
148
|
-
default: withCtx(() => [
|
|
149
|
-
createVNode(_sfc_main$3)
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
/* STABLE */
|
|
153
|
-
}, 8, ["class"])
|
|
154
|
-
]),
|
|
155
|
-
_: 3
|
|
156
|
-
/* FORWARDED */
|
|
157
|
-
}, 8, ["content"])
|
|
142
|
+
createVNode(_sfc_main$2)
|
|
158
143
|
]),
|
|
159
|
-
_:
|
|
160
|
-
/*
|
|
144
|
+
_: 1
|
|
145
|
+
/* STABLE */
|
|
161
146
|
}, 8, ["class"])
|
|
162
147
|
]),
|
|
163
148
|
_: 3
|
|
@@ -166,7 +151,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
166
151
|
]),
|
|
167
152
|
_: 3
|
|
168
153
|
/* FORWARDED */
|
|
169
|
-
}),
|
|
154
|
+
}, 8, ["class"]),
|
|
170
155
|
createVNode(unref(SettingDrawer)),
|
|
171
156
|
createVNode(_component_a_back_top)
|
|
172
157
|
],
|