@ditari/bsui 1.1.48 → 1.1.50

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.
Files changed (132) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/dist/cjs/layout/Show.vue2.cjs.map +1 -1
  3. package/dist/cjs/menu/Menu.cjs +7 -1
  4. package/dist/cjs/menu/Menu.cjs.map +1 -1
  5. package/dist/css/index.css +1 -1
  6. package/dist/css/layout/style/index.css +1 -1
  7. package/dist/css/layout/style/main.css +1 -1
  8. package/dist/esm/layout/Show.vue2.mjs.map +1 -1
  9. package/dist/esm/menu/Menu.mjs +7 -1
  10. package/dist/esm/menu/Menu.mjs.map +1 -1
  11. package/dist/style/layout/style/main.scss +0 -1
  12. package/package.json +5 -1
  13. package/example/index.html +0 -13
  14. package/example/node_modules/.vite/deps/@ant-design_icons-vue.js +0 -29406
  15. package/example/node_modules/.vite/deps/@ant-design_icons-vue.js.map +0 -7
  16. package/example/node_modules/.vite/deps/@vueuse_core.js +0 -8255
  17. package/example/node_modules/.vite/deps/@vueuse_core.js.map +0 -7
  18. package/example/node_modules/.vite/deps/_metadata.json +0 -80
  19. package/example/node_modules/.vite/deps/ant-design-vue.js +0 -62756
  20. package/example/node_modules/.vite/deps/ant-design-vue.js.map +0 -7
  21. package/example/node_modules/.vite/deps/axios.js +0 -2126
  22. package/example/node_modules/.vite/deps/axios.js.map +0 -7
  23. package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js +0 -36
  24. package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js.map +0 -7
  25. package/example/node_modules/.vite/deps/chunk-D36HXFYL.js +0 -25
  26. package/example/node_modules/.vite/deps/chunk-D36HXFYL.js.map +0 -7
  27. package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js +0 -161
  28. package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js.map +0 -7
  29. package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js +0 -3600
  30. package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js.map +0 -7
  31. package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js +0 -10796
  32. package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js.map +0 -7
  33. package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js +0 -19
  34. package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js.map +0 -7
  35. package/example/node_modules/.vite/deps/package.json +0 -3
  36. package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js +0 -125
  37. package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js.map +0 -7
  38. package/example/node_modules/.vite/deps/pinia.js +0 -1519
  39. package/example/node_modules/.vite/deps/pinia.js.map +0 -7
  40. package/example/node_modules/.vite/deps/vue-request.js +0 -1191
  41. package/example/node_modules/.vite/deps/vue-request.js.map +0 -7
  42. package/example/node_modules/.vite/deps/vue-router.js +0 -2667
  43. package/example/node_modules/.vite/deps/vue-router.js.map +0 -7
  44. package/example/node_modules/.vite/deps/vue.js +0 -314
  45. package/example/node_modules/.vite/deps/vue.js.map +0 -7
  46. package/example/package.json +0 -17
  47. package/example/src/App.vue +0 -7
  48. package/example/src/api/list.ts +0 -22
  49. package/example/src/api/user.ts +0 -13
  50. package/example/src/components/AppMain.vue +0 -113
  51. package/example/src/hooks.ts +0 -103
  52. package/example/src/main.ts +0 -22
  53. package/example/src/router/form/index.route.ts +0 -23
  54. package/example/src/router/index.ts +0 -61
  55. package/example/src/router/table/index.route.ts +0 -39
  56. package/example/src/views/Demo.vue +0 -49
  57. package/example/src/views/DemoBk.vue +0 -34
  58. package/example/src/views/Login.vue +0 -79
  59. package/example/src/views/form/List.vue +0 -16
  60. package/example/src/views/form/List2.vue +0 -74
  61. package/example/src/views/form/QueryFormDemo.vue +0 -49
  62. package/example/src/views/form/dyn/List.vue +0 -121
  63. package/example/src/views/table/Add.vue +0 -379
  64. package/example/src/views/table/Demo.vue +0 -15
  65. package/example/src/views/table/Demo2.vue +0 -12
  66. package/example/src/views/table/Edit.vue +0 -10
  67. package/example/src/views/table/List.vue +0 -415
  68. package/example/src/views/table/Test.tsx +0 -42
  69. package/example/src/views/table/TestModal.vue +0 -64
  70. package/example/src/views/table/WorkStatusRound.vue +0 -31
  71. package/example/src/views/table/components/AddForm.vue +0 -44
  72. package/example/src/views/table/hooks.ts +0 -106
  73. package/example/src/views/task/Todo.vue +0 -6
  74. package/example/tsconfig.json +0 -16
  75. package/example/utils/http.ts +0 -107
  76. package/example/vite-env.d.ts +0 -8
  77. package/example/vite.config.ts +0 -10
  78. package/src/_utils/html.ts +0 -17
  79. package/src/_utils/install.ts +0 -12
  80. package/src/components.ts +0 -10
  81. package/src/config/Config.vue +0 -8
  82. package/src/date/RangePicker.tsx +0 -93
  83. package/src/date/index.ts +0 -9
  84. package/src/desensitize/Desensitize.tsx +0 -97
  85. package/src/desensitize/index.ts +0 -9
  86. package/src/desensitize/style/index.scss +0 -8
  87. package/src/dic/DicReplace.tsx +0 -63
  88. package/src/dic/index.ts +0 -8
  89. package/src/dic/replace.worker.ts +0 -25
  90. package/src/form/DQueryForm.tsx +0 -258
  91. package/src/form/index.ts +0 -9
  92. package/src/form/style/index.less +0 -0
  93. package/src/grid/Grid.tsx +0 -83
  94. package/src/grid/GridItem.tsx +0 -15
  95. package/src/grid/index.md +0 -4
  96. package/src/grid/index.ts +0 -16
  97. package/src/grid/style/index.scss +0 -70
  98. package/src/index.scss +0 -19
  99. package/src/index.ts +0 -49
  100. package/src/json-scheme-render/JsonSchemeRender.tsx +0 -101
  101. package/src/json-scheme-render/index.ts +0 -9
  102. package/src/layout/Breadcrumb.vue +0 -39
  103. package/src/layout/FuckMain.vue +0 -90
  104. package/src/layout/List.vue +0 -145
  105. package/src/layout/Main.vue +0 -97
  106. package/src/layout/NavTabs.vue +0 -129
  107. package/src/layout/Show.vue +0 -136
  108. package/src/layout/index.ts +0 -24
  109. package/src/layout/style/breadcrumb.scss +0 -61
  110. package/src/layout/style/fuckmain.scss +0 -21
  111. package/src/layout/style/index.scss +0 -35
  112. package/src/layout/style/list.scss +0 -26
  113. package/src/layout/style/main.scss +0 -75
  114. package/src/layout/style/navtab.scss +0 -146
  115. package/src/layout/style/show.scss +0 -50
  116. package/src/menu/Menu.tsx +0 -181
  117. package/src/menu/style/index.scss +0 -26
  118. package/src/modal/Modal.tsx +0 -83
  119. package/src/modal/index.ts +0 -9
  120. package/src/modal/style/index.scss +0 -74
  121. package/src/select/Select.vue +0 -177
  122. package/src/select/dic.worker.ts +0 -32
  123. package/src/select/index.ts +0 -9
  124. package/src/table/Field.vue +0 -44
  125. package/src/table/Table.tsx +0 -515
  126. package/src/table/index.md +0 -1
  127. package/src/table/index.ts +0 -9
  128. package/src/table/interface/table.ts +0 -64
  129. package/src/table/style/index.scss +0 -10
  130. package/src/theme/index.ts +0 -1
  131. package/src/theme/theme.scss +0 -1
  132. package/src/theme/variable.scss +0 -67
@@ -1,90 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * FUCK MAIN 入口文件
4
- */
5
- import { computed, provide } from "vue";
6
- import { MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons-vue";
7
- import { useKeepAliveStore, useSettingsStore } from "@ditari/store";
8
-
9
- //标签页组件
10
- import DNavTabs from "./NavTabs.vue";
11
- // 菜单组件
12
- import Menu from "../menu/Menu";
13
-
14
- const props = withDefaults(
15
- defineProps<{
16
- showConfig?: any;
17
- breadcrumbStatus?: boolean;
18
- }>(),
19
- {
20
- showConfig: { backBtn: "LeftOutlined" } as any
21
- }
22
- );
23
-
24
- // 注入show组件的配置文件
25
- // eslint-disable-next-line vue/no-setup-props-destructure
26
- provide("showConfig", props.showConfig);
27
-
28
- // 缓存store
29
- const store = useKeepAliveStore();
30
- // 缓存的names
31
- const keepAliveNames = computed(() => store.get);
32
- // 设置store
33
- const settingsStore = useSettingsStore();
34
- const { switchCollapsed } = settingsStore;
35
- const collapsedStatus = computed(() => settingsStore.getCollapsed);
36
- </script>
37
- <template>
38
- <a-layout class="ditari-layout">
39
- <a-layout-sider
40
- v-model:collapsed="collapsedStatus"
41
- :trigger="null"
42
- collapsible
43
- class="ditari-layout-sider"
44
- >
45
- <div class="ditari-logo">
46
- <slot name="logo"></slot>
47
- </div>
48
- <div class="ditari-menu">
49
- <Menu />
50
- </div>
51
- </a-layout-sider>
52
- <a-layout>
53
- <div
54
- class="ditari-fuck-top-layout"
55
- :style="{ left: collapsedStatus ? '80px' : '200px' }"
56
- >
57
- <div class="ditari-side-collapsed" @click="switchCollapsed">
58
- <menu-unfold-outlined
59
- v-if="collapsedStatus"
60
- class="trigger"
61
- style="font-size: 16px; font-weight: bold; cursor: pointer"
62
- />
63
- <menu-fold-outlined
64
- v-else
65
- style="font-size: 16px; font-weight: bold; cursor: pointer"
66
- />
67
- </div>
68
- <d-nav-tabs />
69
- <div class="ditari-user-menu">
70
- <slot name="operation"></slot>
71
- </div>
72
- </div>
73
- <a-layout-content
74
- style="margin-top: 42px"
75
- class="ditari-layout-content"
76
- :style="{ marginLeft: collapsedStatus ? '80px' : '200px' }"
77
- >
78
- <router-view v-slot="{ Component }">
79
- <transition name="main" mode="out-in" appear>
80
- <keep-alive ref="keepAliveRef" :include="keepAliveNames">
81
- <component :is="Component" :key="$route.path" />
82
- </keep-alive>
83
- </transition>
84
- </router-view>
85
- <slot name="micro"></slot>
86
- </a-layout-content>
87
- </a-layout>
88
- </a-layout>
89
- <a-back-top class="ditari-ant-back-top" :visibility-height="50"></a-back-top>
90
- </template>
@@ -1,145 +0,0 @@
1
- <script setup lang="ts">
2
- import {
3
- useSlots,
4
- ref,
5
- onActivated,
6
- watch,
7
- onDeactivated,
8
- onUnmounted,
9
- WatchStopHandle,
10
- inject,
11
- nextTick
12
- } from "vue";
13
- import { useElementSize, useResizeObserver } from "@vueuse/core";
14
- import { useSettingsStore } from "@ditari/store";
15
- import { storeToRefs } from "pinia";
16
- import { useRoute } from "vue-router";
17
-
18
- const emits = defineEmits<{ (e: "refresh"): void }>();
19
-
20
- const slots = useSlots();
21
- const store = useSettingsStore();
22
- const route = useRoute();
23
- const configProvider = inject("configProvider") as any;
24
-
25
- const { refresh } = storeToRefs(store);
26
-
27
- const toolsRef = ref();
28
- const tableRef = ref();
29
- const marginBottom = 16;
30
- const show = ref(false);
31
- const height = ref(0);
32
-
33
- let stopHandleWatch: WatchStopHandle;
34
-
35
- watch(
36
- () => configProvider?.componentSize,
37
- () => {
38
- calcHeight();
39
- }
40
- );
41
-
42
- useReload();
43
- // 处理标签重载
44
- function useReload() {
45
- // !route.meta.keepAlive
46
- if (!route.name) {
47
- stopHandleWatch = useWatch();
48
- // 卸载未缓存的组件
49
- onUnmounted(() => {
50
- stopHandleWatch && stopHandleWatch();
51
- });
52
- } else {
53
- // 激活缓存页面
54
- onActivated(() => {
55
- if (refresh.value) {
56
- refresh.value = false;
57
- emits("refresh");
58
- }
59
- stopHandleWatch = useWatch();
60
- });
61
- // 离开缓存页面
62
- onDeactivated(() => {
63
- stopHandleWatch && stopHandleWatch();
64
- });
65
- }
66
- }
67
-
68
- function useWatch() {
69
- //点击了标签重载图标
70
- return watch(
71
- () => refresh.value,
72
- (val) => {
73
- if (val) {
74
- // 发送刷新事件到列表页面
75
- emits("refresh");
76
- }
77
- }
78
- );
79
- }
80
-
81
- // 监听表单高度变化
82
- // 然后再获取表格高度
83
- // 在表格高度动态变化的时候会被监听到
84
- const formRef = ref(null);
85
- const { height: formHeight } = useElementSize(formRef);
86
- watch(
87
- () => formHeight.value,
88
- () => {
89
- nextTick(() => {
90
- calcHeight();
91
- });
92
- }
93
- );
94
-
95
- const { stop } = useResizeObserver(document.body, () => {
96
- calcHeight();
97
- });
98
-
99
- onUnmounted(() => {
100
- stop();
101
- });
102
-
103
- // 动态计算高度
104
- function calcHeight() {
105
- show.value = false;
106
- nextTick(() => {
107
- height.value = tableRef?.value?.offsetHeight;
108
- show.value = true;
109
- });
110
- }
111
- </script>
112
- <template>
113
- <div class="ditari-list-layout">
114
- <div ref="contentRef" class="wrapper">
115
- <a-card
116
- ref="formRef"
117
- :bordered="false"
118
- :class="{ 'ditari-list-form': slots.form }"
119
- :style="{ 'margin-bottom': slots.form ? marginBottom + 'px' : 0 }"
120
- >
121
- <slot name="form" />
122
- </a-card>
123
- <a-card class="ditari-list-table" :bordered="false">
124
- <div
125
- ref="toolsRef"
126
- class="xi-tools"
127
- :style="{ 'margin-bottom': slots.tools ? marginBottom + 'px' : 0 }"
128
- >
129
- <a-space>
130
- <slot name="tools"></slot>
131
- </a-space>
132
- </div>
133
- <div ref="tableRef" style="flex: 1">
134
- <div v-show="show" style="height: 100%">
135
- <slot name="table" :height="height" />
136
- </div>
137
- </div>
138
- </a-card>
139
- </div>
140
- <div class="ditari-content-extra">
141
- <slot></slot>
142
- </div>
143
- </div>
144
- </template>
145
- <style></style>
@@ -1,97 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * 入口文件
4
- */
5
- import { computed, provide } from "vue";
6
- import { MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons-vue";
7
- import { useKeepAliveStore, useSettingsStore } from "@ditari/store";
8
-
9
- //标签页组件
10
- import DNavTabs from "./NavTabs.vue";
11
- //面包屑组件
12
- import DBreadcrumb from "./Breadcrumb.vue";
13
- // 菜单组件
14
- import Menu from "../menu/Menu";
15
-
16
- const props = withDefaults(
17
- defineProps<{
18
- showConfig?: any;
19
- breadcrumbStatus?: boolean;
20
- }>(),
21
- {
22
- showConfig: { backBtn: "LeftOutlined" } as any
23
- }
24
- );
25
- // 注入show组件的配置文件
26
- // eslint-disable-next-line vue/no-setup-props-destructure
27
- provide("showConfig", props.showConfig);
28
- // 缓存store
29
- const store = useKeepAliveStore();
30
- // 缓存的names
31
- const keepAliveNames = computed(() => store.get);
32
- // 设置store
33
- const settingsStore = useSettingsStore();
34
- const { switchCollapsed } = settingsStore;
35
- const collapsedStatus = computed(() => settingsStore.getCollapsed);
36
- </script>
37
- <template>
38
- <a-layout class="ditari-layout">
39
- <a-layout-sider
40
- v-model:collapsed="collapsedStatus"
41
- :trigger="null"
42
- collapsible
43
- class="ditari-layout-sider"
44
- >
45
- <div>
46
- <div class="ditari-logo">
47
- <slot name="logo"></slot>
48
- </div>
49
- <div class="ditari-menu">
50
- <Menu />
51
- </div>
52
- </div>
53
- </a-layout-sider>
54
- <a-layout>
55
- <div
56
- class="ditari-top-layout"
57
- :style="{ left: collapsedStatus ? '80px' : '200px' }"
58
- >
59
- <d-nav-tabs />
60
- <div class="ditari-layout-header">
61
- <div class="ditari-layout-header-left">
62
- <div class="ditari-side-collapsed" @click="switchCollapsed">
63
- <menu-unfold-outlined
64
- v-if="collapsedStatus"
65
- class="trigger"
66
- style="font-size: 16px; font-weight: bold; cursor: pointer"
67
- />
68
- <menu-fold-outlined
69
- v-else
70
- style="font-size: 16px; font-weight: bold; cursor: pointer"
71
- />
72
- </div>
73
- <d-breadcrumb />
74
- </div>
75
- <div class="ditari-user-menu">
76
- <slot name="operation"></slot>
77
- </div>
78
- </div>
79
- </div>
80
- <a-layout-content
81
- class="ditari-layout-content"
82
- :style="{ marginLeft: collapsedStatus ? '80px' : '200px' }"
83
- >
84
- <router-view v-slot="{ Component }">
85
- <transition name="main" mode="out-in" appear>
86
- <keep-alive ref="keepAliveRef" :include="keepAliveNames">
87
- <component :is="Component" :key="$route.path" />
88
- </keep-alive>
89
- </transition>
90
- </router-view>
91
- <slot name="micro"></slot>
92
- </a-layout-content>
93
- </a-layout>
94
- </a-layout>
95
- <a-back-top class="ditari-ant-back-top" :visibility-height="50"></a-back-top>
96
- </template>
97
- <style lang="scss"></style>
@@ -1,129 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * 标签组件
4
- */
5
- import { computed, Ref, watch, watchEffect, ref } from "vue";
6
- import { useRoute, useRouter } from "vue-router";
7
- import { CloseOutlined } from "@ant-design/icons-vue";
8
- import { storeToRefs } from "pinia";
9
-
10
- import {
11
- useNavTabsStore,
12
- useKeepAliveStore,
13
- useMenuStore
14
- } from "@ditari/store";
15
-
16
- import { prefixName } from "../theme";
17
-
18
- const route = useRoute();
19
- const router = useRouter();
20
-
21
- const navStore = useNavTabsStore();
22
- const keepAliveStore = useKeepAliveStore();
23
- const menuStore = useMenuStore();
24
-
25
- //class名称
26
- const baseClassName = `${prefixName}-nav`;
27
-
28
- //标签列表
29
- const navTabs: Ref<any[]> = computed(() => navStore.getList);
30
- // 被选中的菜单
31
- const { selectedMenuKeys } = storeToRefs(menuStore);
32
- //当前被激活的标签 通过选中的菜单得到
33
- const activeKey = ref("");
34
- watchEffect(() => {
35
- activeKey.value =
36
- selectedMenuKeys.value.length > 0 ? selectedMenuKeys.value[0] : "";
37
- });
38
- //首次进入页面或者刷新的时候执行
39
- setNavTabs();
40
- // 监听路由变化
41
- watch(
42
- () => route.path,
43
- () => {
44
- //TODO 需要优化 确保只有未打开过的标签 进入保存
45
- setNavTabs();
46
- }
47
- );
48
-
49
- //设置标签
50
- function setNavTabs() {
51
- // 保存标签
52
- navStore.save(route);
53
- // 设置激活的标签
54
- //navStore.setActiveKey(route.path);
55
- selectedMenuKeys.value = [route.path];
56
- keepAliveStore.save(route);
57
- }
58
-
59
- /**
60
- * 切换标签
61
- * @param nav
62
- */
63
- const onClick = (key: string) => {
64
- if (key !== route.path) {
65
- // 匹配打开的标签路由数据
66
- const rs = navTabs.value.filter((item: any) => item.path === key)[0];
67
- // 打开路由
68
- router.push({
69
- path: rs.path,
70
- query: rs.query,
71
- params: rs.params,
72
- fullPath: rs.fullPath
73
- } as any);
74
- }
75
- };
76
-
77
- /**
78
- * 关闭标签
79
- * @param $event
80
- * @param targetKey
81
- */
82
- const onClose = ($event: any, key: string) => {
83
- //const rs = navTabs.value.find((item) => item.fullPath === key) as any;
84
- //阻止冒泡
85
- $event.stopPropagation();
86
- // 删除标签
87
- navStore.deleteTabs(key);
88
- // 重新push已打开的路由
89
- router.push(navTabs.value[navTabs.value.length - 1].fullPath);
90
-
91
- //根据name 删除缓存的组件
92
- // if (rs.name) {
93
- // keepAliveStore.deleteKeepAlive(rs.name);
94
- // }
95
- };
96
-
97
- /**
98
- * 是否显示标签关闭按钮函数
99
- * @param item
100
- * 根据item和当前 navTabs 长度来判断是否要隐藏关闭标签按钮
101
- */
102
- const closeStatus = (item: any) => {
103
- // 如果meta有设置keepOpen或者当前打开的标签只有一个的话不显示关闭按钮
104
- if (item.meta?.keepOpen) {
105
- return false;
106
- } else {
107
- // 如果只有一个标签,则隐藏关闭按钮
108
- return navTabs.value.length === 1 ? false : true;
109
- }
110
- };
111
- </script>
112
- <template>
113
- <div :class="baseClassName">
114
- <a-tabs v-model:activeKey="activeKey" type="card" @tabClick="onClick">
115
- <a-tab-pane v-for="item in navTabs" :key="item.path">
116
- <template #tab>
117
- <div class="tab-dividers"></div>
118
- <div class="tab-item" :class="{ active: activeKey === item.path }">
119
- {{ item.meta.title }}
120
- </div>
121
- <div v-if="closeStatus(item)" class="tab-close">
122
- <CloseOutlined @click="onClose($event, item.fullPath)" />
123
- </div>
124
- </template>
125
- </a-tab-pane>
126
- </a-tabs>
127
- </div>
128
- </template>
129
- <style lang="scss"></style>
@@ -1,136 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * 详情/新增/编辑组件
4
- */
5
- import { computed, inject, useSlots, watch, h, resolveComponent } from "vue";
6
- import { useRoute, useRouter } from "vue-router";
7
- import { useScrollLock, useWindowScroll } from "@vueuse/core";
8
- import { LeftOutlined } from "@ant-design/icons-vue";
9
- import { useNavTabsStore, useSettingsStore } from "@ditari/store";
10
-
11
- import { storeToRefs } from "pinia";
12
-
13
- const props = withDefaults(
14
- defineProps<{
15
- // 点击返回的时候是否关闭标签
16
- close?: boolean;
17
- // 请求数据的时候开启加载效果
18
- loading?: boolean;
19
- // 是否显示返回按钮
20
- showBack?: boolean;
21
- }>(),
22
- {
23
- close: false,
24
- loading: false,
25
- showBack: true
26
- }
27
- );
28
-
29
- const router = useRouter();
30
- const route = useRoute();
31
- const slots = useSlots();
32
-
33
- const navTabStore = useNavTabsStore();
34
- const settingsStore = useSettingsStore();
35
-
36
- const showConfig = inject("showConfig") as any;
37
- const collapsedStatus = computed(() => settingsStore.getCollapsed);
38
- const btnRender = () => {
39
- if (!showConfig) {
40
- return h(LeftOutlined);
41
- } else {
42
- return h(resolveComponent(showConfig.backBtn));
43
- }
44
- };
45
-
46
- const { refresh } = storeToRefs(settingsStore);
47
-
48
- const showLoading = computed(() => props.loading);
49
-
50
- const contentStyle = {
51
- padding: `10px 10px ${slots.footer ? "70px" : "10px"} 10px`
52
- };
53
-
54
- /**
55
- * 点击返回
56
- */
57
- const onBack = () => {
58
- if (props.close) {
59
- // 返回关闭标签
60
- navTabStore.deleteTabs(route.path);
61
- router.go(-1);
62
- } else {
63
- // 不关闭标签
64
- router.go(-1);
65
- }
66
- };
67
-
68
- /**
69
- * 对外暴露方法 调用后关闭标签 并且出发List组件刷新动作
70
- */
71
- const onRefresh = () => {
72
- refresh.value = true;
73
- navTabStore.deleteTabs(route.fullPath);
74
- router.go(-1);
75
- };
76
-
77
- /**
78
- * 监听屏幕滚动,滚动大于0的时候给a-page-header组件添加阴影
79
- */
80
- const { y } = useWindowScroll();
81
- // 锁定屏幕
82
- const isLocked = useScrollLock(document.body);
83
-
84
- watch(
85
- () => props.loading,
86
- (val) => {
87
- isLocked.value = val;
88
- }
89
- );
90
-
91
- const delayTime = 200;
92
- defineExpose({
93
- closePage: onRefresh
94
- });
95
- </script>
96
- <template>
97
-
98
- <div class="ditari-show-layout">
99
- <a-page-header
100
- v-if="showBack"
101
- class="ditari-page-header"
102
- :class="{ active: y > 0 }"
103
- :ghost="false"
104
- @back="onBack"
105
- >
106
- <template #backIcon>
107
- <btn-render />
108
- </template>
109
- <template #title>{{ $route.meta.title }} </template>
110
- <template #subTitle>
111
- <slot name="subTitle"></slot>
112
- </template>
113
- <template #extra>
114
- <slot name="extra"></slot>
115
- </template>
116
- </a-page-header>
117
- <a-spin
118
- tip="正在处理..."
119
- :spinning="showLoading"
120
- :delay="delayTime"
121
- size="large"
122
- >
123
- <div class="ditari-show-content" :style="contentStyle">
124
- <slot></slot>
125
- </div>
126
- <div
127
- v-if="$slots.footer"
128
- class="ditari-show-footer"
129
- :style="{ left: collapsedStatus ? '80px' : '200px' }"
130
- >
131
- <slot name="footer"></slot>
132
- </div>
133
- </a-spin>
134
- </div>
135
- </template>
136
- <style lang="scss"></style>
@@ -1,24 +0,0 @@
1
- import type { App } from "vue";
2
- import List from "./List.vue";
3
- import Main from "./Main.vue";
4
- import FuckMain from "./FuckMain.vue";
5
- import Show from "./Show.vue";
6
-
7
- List.install = function (app: App) {
8
- app.component("DListLayout", List);
9
- return app;
10
- };
11
- Main.install = function (app: App) {
12
- app.component("DMainLayout", Main);
13
- return app;
14
- };
15
- FuckMain.install = function (app: App) {
16
- app.component("DFuckMain", FuckMain);
17
- return app;
18
- };
19
- Show.install = function (app: App) {
20
- app.component("DShowLayout", Show);
21
- return app;
22
- };
23
-
24
- export { List, Main, FuckMain, Show };
@@ -1,61 +0,0 @@
1
- @import "../../theme/variable.scss";
2
- .#{$prefix-name}-breadcrumb {
3
- .ant-breadcrumb-separator {
4
- display: none;
5
- }
6
- .breadcrumb {
7
- display: flex;
8
- .breadcrumb-item {
9
- color: $bread-txt-color;
10
- &:first-child {
11
- .breadcrumb-link {
12
- border-radius: 6px 0 0 6px;
13
- clip-path: polygon(
14
- 0 0,
15
- calc(100% - 8px) 0,
16
- 100% 50%,
17
- calc(100% - 8px) 100%,
18
- 0 100%
19
- );
20
- }
21
- }
22
- &:last-child {
23
- &:not(:first-child) {
24
- .breadcrumb-link {
25
- border-radius: 0 6px 6px 0;
26
- clip-path: polygon(0 0,100% 0,100% 100%,0 100%,8px 50%);
27
- }
28
- }
29
- }
30
- }
31
- }
32
-
33
- .breadcrumb-link {
34
- display: block;
35
- padding: 4px 12px;
36
- background: #f0f2f5;
37
- clip-path: polygon(
38
- 0 0,
39
- calc(100% - 8px) 0,
40
- 100% 50%,
41
- calc(100% - 8px) 100%,
42
- 0 100%,
43
- 8px 50%
44
- );
45
- }
46
- a{
47
- &.breadcrumb-link{
48
- color: $bread-link-txt-color;
49
- }
50
- }
51
- }
52
-
53
- .breadcrumb-enter-active {
54
- transition: all 0.25s;
55
- }
56
-
57
- .breadcrumb-enter-from,
58
- .breadcrumb-leave-active {
59
- opacity: 0;
60
- transform: translateX(30px) skewX(-50deg);
61
- }
@@ -1,21 +0,0 @@
1
- @import "../../theme/variable.scss";
2
- .ditari-fuck-top-layout {
3
- position: fixed;
4
- left: 200px;
5
- right: 0;
6
- z-index: 210;
7
- display: flex;
8
- background: $nav-tab-bg-color;
9
- .ditari-bsui-nav {
10
- flex: 1;
11
- min-width: 0;
12
- }
13
- .ditari-side-collapsed{
14
- display: flex;
15
- align-items: center;
16
- justify-content: center;
17
- width: 42px;
18
- cursor: pointer;
19
- color: $fuck-main-collapsed-color
20
- }
21
- }