@dt-frames/ui 1.0.3 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/imgs/header/avatar.png +0 -0
- package/es/components/curd/src/components/dialog.d.ts +21 -58
- package/es/components/curd/src/types/curd.type.d.ts +2 -1
- package/es/components/dialog/index.d.ts +2 -0
- package/es/components/dialog/src/hooks/useDialog.d.ts +3 -0
- package/es/components/forms/index.d.ts +2 -2
- package/es/components/forms/src/components/formIcon.d.ts +4 -47
- package/es/components/forms/src/index.d.ts +2 -6
- package/es/components/iframe/index.d.ts +2 -2
- package/es/components/index.d.ts +3 -2
- package/es/components/modal/src/components/close-icon.d.ts +0 -43
- package/es/components/modal/src/index.d.ts +0 -43
- package/es/components/source/src/types/table.type.d.ts +1 -1
- package/es/components/table/index.d.ts +1 -1
- package/es/components/table/src/components/setting/Column.d.ts +6 -5
- package/es/components/table/src/hooks/useColumns.d.ts +1 -1
- package/es/components/table/src/hooks/useDataSource.d.ts +1 -3
- package/es/components/table/src/hooks/useHeaderCode.d.ts +2 -0
- package/es/components/table/src/hooks/useRowSelection.d.ts +2 -3
- package/es/components/table/src/index.d.ts +15 -3
- package/es/components/table/src/props.d.ts +7 -1
- package/es/index.js +284 -272
- package/es/style/components/forms/{src/index.less → index.less} +2 -0
- package/es/style/components/icons/index.less +1 -0
- package/es/style/components/iframe/index.less +3 -0
- package/es/style/components/modal/{src/index.less → index.less} +0 -0
- package/es/style/components/table/{src/index.less → index.less} +12 -1
- package/es/style/theme/header/index.less +8 -4
- package/es/style/theme/theme.less +2 -1
- package/es/theme/header/components/logo.d.ts +43 -0
- package/es/theme/header/components/notify.d.ts +0 -1
- package/package.json +1 -1
- package/src/assets/imgs/header/avatar.png +0 -0
- package/src/components/curd/src/components/dialog.vue +11 -5
- package/src/components/curd/src/hooks/useCurd.tsx +24 -9
- package/src/components/curd/src/types/curd.type.ts +3 -1
- package/src/components/dialog/index.ts +5 -0
- package/src/components/dialog/src/hooks/useDialog.ts +85 -0
- package/src/components/forms/{src/index.less → index.less} +2 -0
- package/src/components/forms/index.ts +3 -4
- package/src/components/forms/src/components/formButton.vue +1 -1
- package/src/components/icons/{src/index.less → index.less} +1 -0
- package/src/components/iframe/index.less +3 -0
- package/src/components/iframe/index.ts +2 -2
- package/src/components/index.ts +5 -3
- package/src/components/modal/{src/index.less → index.less} +0 -0
- package/src/components/modal/src/components/close-icon.vue +3 -4
- package/src/components/modal/src/components/modal.tsx +1 -1
- package/src/components/modal/src/components/modalFooter.vue +1 -1
- package/src/components/modal/src/hooks/useModal.ts +0 -1
- package/src/components/source/src/hooks/useFetch.ts +3 -4
- package/src/components/source/src/hooks/useSource.ts +4 -3
- package/src/components/source/src/types/table.type.ts +1 -1
- package/src/components/table/{src/index.less → index.less} +12 -1
- package/src/components/table/index.ts +1 -1
- package/src/components/table/src/components/TableActions.vue +2 -2
- package/src/components/table/src/components/setting/Column.vue +1 -2
- package/src/components/table/src/hooks/useColumns.ts +2 -2
- package/src/components/table/src/hooks/useHeaderCode.ts +82 -0
- package/src/components/table/src/hooks/useRowSelection.ts +2 -3
- package/src/components/table/src/hooks/useTable.ts +13 -1
- package/src/components/table/src/hooks/useTableScroll.ts +5 -3
- package/src/components/table/src/index.vue +18 -19
- package/src/components/table/src/props.ts +8 -3
- package/src/directives/index.ts +0 -1
- package/src/directives/permission.ts +2 -3
- package/src/theme/footer/index.vue +1 -1
- package/src/theme/header/components/bread-crumb.vue +1 -1
- package/src/theme/header/components/fullscreen.vue +0 -2
- package/src/theme/header/components/logo.vue +4 -2
- package/src/theme/header/components/notify.vue +1 -2
- package/src/theme/header/components/user-info.vue +22 -5
- package/src/theme/header/helper/menu-tree.ts +3 -6
- package/src/theme/header/index.less +8 -4
- package/src/theme/sider/helper/split-menu.ts +1 -2
- package/src/theme/tabs/components/TabContent.vue +0 -1
- package/src/theme/tabs/index.vue +1 -1
- package/src/theme/theme.less +2 -1
- package/src/theme/theme.vue +4 -3
- package/es/assets/app-antd-dark-theme-style.e3b0c442.css +0 -0
- package/es/assets/app-theme-style.e3b0c442.css +0 -0
- package/es/assets/data/icon.d.ts +0 -4
- package/es/assets/data/icon.ts +0 -69
- package/es/assets/data/icon11.ts +0 -69
- package/es/assets/style/var.less +0 -42
- package/es/components/icons/pick-icon.d.ts +0 -529
- package/es/components/icons/svg-icon.d.ts +0 -44
- package/es/components/table/src/hooks/useFormat.d.ts +0 -2
- package/es/components/table/src/hooks/useVirtualScroll.d.ts +0 -5
- package/es/components/table/src/utils/format.d.ts +0 -1
- package/es/index.css +0 -1
- package/es/style/assets/style/var.less +0 -42
- package/es/style/components/icons/src/index.less +0 -96
- package/es/theme/content/index.d.ts +0 -27
- package/es/theme/header/components/menu-search.d.ts +0 -528
- package/es/theme/header/components/setting-theme.d.ts +0 -2580
- package/es/theme/header/components/user-info.d.ts +0 -452
- package/es/theme/header/index.d.ts +0 -4369
- package/es/theme/header/multiple-header.d.ts +0 -2001
- package/es/theme/styles/hooks/changeTheme.d.ts +0 -1
- package/es/theme/styles/hooks/generate.d.ts +0 -13
- package/es/theme/styles/index.d.ts +0 -2
- package/es/theme/tabs/components/TabRedo.d.ts +0 -7
- package/es/theme/tabs/index.d.ts +0 -2478
- package/es/theme/theme/initTheme.d.ts +0 -3
- package/es/theme/theme/util.d.ts +0 -5
- package/es/theme/theme.d.ts +0 -22
|
@@ -99,11 +99,10 @@
|
|
|
99
99
|
import { Tooltip, Popover, Checkbox, Button, CheckboxGroup, Divider } from 'ant-design-vue'
|
|
100
100
|
import { getPopupContainer as getParentContainer, isNullAndUnDef } from '@dt-frames/core'
|
|
101
101
|
import { DtIcon } from '../../../../icons/index'
|
|
102
|
-
import { computed, reactive, ref, unref, watchEffect, useAttrs } from 'vue'
|
|
102
|
+
import { computed, reactive, ref, unref, watchEffect, useAttrs, nextTick } from 'vue'
|
|
103
103
|
import type { ColumnStateType, ColumnOptionsType } from '../../types/tableHeader.type'
|
|
104
104
|
import { getTableInstance } from '../../hooks/useTableInstance'
|
|
105
105
|
import { BasicColumn } from '../../types/table.type'
|
|
106
|
-
import { nextTick } from 'process'
|
|
107
106
|
import { isFunction } from '@vueuse/core'
|
|
108
107
|
import { cloneDeep, omit } from 'lodash-es'
|
|
109
108
|
|
|
@@ -147,7 +147,7 @@ function handleActionColumn(propsRef: ComputedRef<BasicTableProps>, columns: Bas
|
|
|
147
147
|
title: '操作',
|
|
148
148
|
align: 'center',
|
|
149
149
|
expand,
|
|
150
|
-
width: (expand ? (column.btns.length * 30 + 40) : 70)
|
|
150
|
+
width: `${ (expand ? (column.btns.length * 30 + 40) : 70) }px`,
|
|
151
151
|
...column,
|
|
152
152
|
flag: ACTION_COLUMN,
|
|
153
153
|
}
|
|
@@ -256,7 +256,7 @@ export function useColumns(
|
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
// 设置列信息
|
|
259
|
-
function setColumns(columnList: Partial<BasicColumn>[] | string[]) {
|
|
259
|
+
function setColumns(columnList: Partial<BasicColumn>[] | string[] = []) {
|
|
260
260
|
const columns = cloneDeep(columnList)
|
|
261
261
|
|
|
262
262
|
if( !isArray( columns ) ) return
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { error, http, Recordable, useAppStore } from "@dt-frames/core"
|
|
2
|
+
import { BasicColumn, CellFormat } from "../types/table.type"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// 解析header
|
|
6
|
+
export function useHeaderCode(code: string, templates: CellFormat = {}, changeColumns: ( rows: BasicColumn[] ) => void) {
|
|
7
|
+
const { appConf } = useAppStore()
|
|
8
|
+
|
|
9
|
+
if( !appConf.pages.queryColumnApi ) {
|
|
10
|
+
error('请在init.config.ts中配置queryColumnApi!')
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// 设置文字对齐方式
|
|
16
|
+
const getAlign = ( key: number | null ) => key === 0 ? 'center' : key === 2 ? 'right' : 'left'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// 渲染单元格
|
|
20
|
+
const renderCell = ( type: number, ctx: string ): Recordable => {
|
|
21
|
+
switch( type ) {
|
|
22
|
+
// 时间
|
|
23
|
+
case 0: return { date: ctx }
|
|
24
|
+
|
|
25
|
+
// 字典
|
|
26
|
+
case 1: return { dict: ctx }
|
|
27
|
+
|
|
28
|
+
// 百分比
|
|
29
|
+
case 5: return { percent: ctx }
|
|
30
|
+
|
|
31
|
+
// structure
|
|
32
|
+
case 7:
|
|
33
|
+
if( !appConf.structure[ctx] ) {
|
|
34
|
+
error(`未找到structure: ${ ctx } !`)
|
|
35
|
+
return { }
|
|
36
|
+
}
|
|
37
|
+
return { dict: appConf.structure[ctx] }
|
|
38
|
+
|
|
39
|
+
// 自定义模板
|
|
40
|
+
case 10: return templates[ctx]
|
|
41
|
+
|
|
42
|
+
// 数字
|
|
43
|
+
case 11: return { number: ctx }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
function getColumns() {
|
|
49
|
+
http.post(
|
|
50
|
+
appConf.pages.queryColumnApi,
|
|
51
|
+
{ tableCode: code }
|
|
52
|
+
).then( rsp => {
|
|
53
|
+
handleData(rsp)
|
|
54
|
+
} )
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function handleData(data: Recordable[]) {
|
|
58
|
+
let rows: BasicColumn[] = []
|
|
59
|
+
|
|
60
|
+
data.forEach( it => {
|
|
61
|
+
let obj: BasicColumn = {
|
|
62
|
+
title: it.cloumnName,
|
|
63
|
+
dataIndex: it.cloumnCode,
|
|
64
|
+
sorter: it.ifOrder,
|
|
65
|
+
align: getAlign(it.textAlign),
|
|
66
|
+
ifShow: Boolean( it.ifDisplay ),
|
|
67
|
+
defaultHidden: !Boolean( it.ifDisplay )
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if( it.cloumnType !== undefined ) obj.render = renderCell( it.cloumnType, it.dictCode )
|
|
71
|
+
|
|
72
|
+
if( it.width ) obj.width = Number(it.width)
|
|
73
|
+
|
|
74
|
+
rows.push(obj)
|
|
75
|
+
} )
|
|
76
|
+
|
|
77
|
+
changeColumns( rows )
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
getColumns()
|
|
81
|
+
|
|
82
|
+
}
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { isFunction, Recordable } from "@dt-frames/core";
|
|
6
6
|
import type { TableRowSelection } from 'ant-design-vue/lib/table/interface'
|
|
7
|
-
import { computed, ComputedRef, ref, Ref, toRaw, unref, watch, nextTick } from "vue"
|
|
8
|
-
import { BasicTableProps } from "../types/table.type"
|
|
9
|
-
import { omit } from 'lodash-es'
|
|
7
|
+
import { computed, ComputedRef, ref, Ref, toRaw, unref, watch, nextTick } from "vue"
|
|
8
|
+
import { BasicTableProps } from "../types/table.type"
|
|
10
9
|
|
|
11
10
|
interface TreeHelperConfig {
|
|
12
11
|
id: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamicProps, Nullable, getDynamicProps, error } from '@dt-frames/core'
|
|
2
2
|
import { onUnmounted, ref, toRaw, unref, watch } from 'vue'
|
|
3
|
-
import { BasicColumn, BasicTableProps, TableActionType } from '../types/table.type'
|
|
3
|
+
import { BasicColumn, BasicTableProps, CellFormat, TableActionType } from '../types/table.type'
|
|
4
|
+
import { useHeaderCode } from './useHeaderCode'
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
type Props = Partial<DynamicProps<BasicTableProps>>
|
|
@@ -18,6 +19,17 @@ export function useTable(tableProps?: Props) {
|
|
|
18
19
|
if( unref(loadedRef) && instance === unref(tableRef) ) return
|
|
19
20
|
|
|
20
21
|
tableRef.value = instance
|
|
22
|
+
|
|
23
|
+
if( tableProps.columnCode ) {
|
|
24
|
+
useHeaderCode(
|
|
25
|
+
tableProps.columnCode as string,
|
|
26
|
+
tableProps.templates as CellFormat,
|
|
27
|
+
(columns: BasicColumn[]) => {
|
|
28
|
+
tableProps.columns = columns
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
tableProps && instance.setProps(getDynamicProps(tableProps))
|
|
22
34
|
|
|
23
35
|
watch(
|
|
@@ -20,11 +20,12 @@ export function useTableScroll(
|
|
|
20
20
|
const debounceRedoHeight = useDebounceFn( redoHeight, 100 )
|
|
21
21
|
|
|
22
22
|
watch(
|
|
23
|
-
() =>
|
|
24
|
-
() => {
|
|
23
|
+
() => propsRef.value.dataSource,
|
|
24
|
+
(v) => {
|
|
25
25
|
debounceRedoHeight()
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
+
deep: true,
|
|
28
29
|
flush: 'post' // 在dom渲染之后监听
|
|
29
30
|
}
|
|
30
31
|
)
|
|
@@ -194,7 +195,8 @@ export function useTableScroll(
|
|
|
194
195
|
calcScroll(bodyEl)
|
|
195
196
|
|
|
196
197
|
bodyEl.addEventListener('scroll', (e) => {
|
|
197
|
-
|
|
198
|
+
// 这里做一个节流
|
|
199
|
+
useDebounceFn( () => { calcScroll(bodyEl) }, 100 )()
|
|
198
200
|
})
|
|
199
201
|
}
|
|
200
202
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<template #bodyCell="{ column, record, index }">
|
|
17
|
-
<template v-if="column
|
|
17
|
+
<template v-if="column?.render">
|
|
18
18
|
<TableRender :column="column" :record="record" :index="index"></TableRender>
|
|
19
19
|
</template>
|
|
20
20
|
</template>
|
|
@@ -127,6 +127,21 @@
|
|
|
127
127
|
getRowClassName
|
|
128
128
|
} = useRows( getProps )
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* 表格改变
|
|
132
|
+
*/
|
|
133
|
+
const {
|
|
134
|
+
handleTableChange
|
|
135
|
+
} = useDataSource(
|
|
136
|
+
getProps,
|
|
137
|
+
{
|
|
138
|
+
getPaginationInfo,
|
|
139
|
+
setPagination,
|
|
140
|
+
clearSelectedRowKeys
|
|
141
|
+
},
|
|
142
|
+
emit
|
|
143
|
+
)
|
|
144
|
+
|
|
130
145
|
|
|
131
146
|
const getBind = computed(() => {
|
|
132
147
|
return {
|
|
@@ -139,7 +154,7 @@
|
|
|
139
154
|
pagination: toRaw(unref(getPaginationInfo)),
|
|
140
155
|
rowSelection: unref(getRowSelectionRef),
|
|
141
156
|
rowKey: unref(getProps).rowKey,
|
|
142
|
-
columns:
|
|
157
|
+
columns: unref(getViewColumns),
|
|
143
158
|
tableLayout: 'fixed'
|
|
144
159
|
}
|
|
145
160
|
})
|
|
@@ -163,22 +178,6 @@
|
|
|
163
178
|
}
|
|
164
179
|
const { getHeaderProps } = useTableHeader(getProps, slots, handlers)
|
|
165
180
|
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 表格改变
|
|
169
|
-
*/
|
|
170
|
-
const {
|
|
171
|
-
handleTableChange
|
|
172
|
-
} = useDataSource(
|
|
173
|
-
getProps,
|
|
174
|
-
{
|
|
175
|
-
getPaginationInfo,
|
|
176
|
-
setPagination,
|
|
177
|
-
clearSelectedRowKeys
|
|
178
|
-
},
|
|
179
|
-
emit
|
|
180
|
-
)
|
|
181
|
-
|
|
182
181
|
emit('register', tableAction)
|
|
183
182
|
|
|
184
183
|
return {
|
|
@@ -188,7 +187,7 @@
|
|
|
188
187
|
handleTableChange,
|
|
189
188
|
getSelectRows,
|
|
190
189
|
handleResizeColumn: (w, col) => {
|
|
191
|
-
col.width = w
|
|
190
|
+
col.width = w
|
|
192
191
|
setCacheColumnsByField(col.dataIndex, col)
|
|
193
192
|
}
|
|
194
193
|
}
|
|
@@ -3,7 +3,7 @@ import { PropType } from 'vue'
|
|
|
3
3
|
import { DEFAULT_SORT_FN } from './const'
|
|
4
4
|
import type { PaginationProps } from 'ant-design-vue/lib/pagination'
|
|
5
5
|
import type { TableRowSelection } from 'ant-design-vue/lib/table/interface'
|
|
6
|
-
import { ActionType, BasicColumn, BtnsType, SizeType } from './types/table.type'
|
|
6
|
+
import { ActionType, BasicColumn, BtnsType, CellFormat, SizeType } from './types/table.type'
|
|
7
7
|
import { ButtonProps } from '../../forms'
|
|
8
8
|
import { DownloadType } from './types/tableHeader.type'
|
|
9
9
|
|
|
@@ -28,7 +28,7 @@ export const TableProps = {
|
|
|
28
28
|
maxWidth: { type: Number },
|
|
29
29
|
|
|
30
30
|
// 是否需要虚拟滚动
|
|
31
|
-
virtual: { type: Boolean, default:
|
|
31
|
+
virtual: { type: Boolean, default: false },
|
|
32
32
|
|
|
33
33
|
// 排序
|
|
34
34
|
sortFn: { type: Function, default: DEFAULT_SORT_FN },
|
|
@@ -50,6 +50,11 @@ export const TableProps = {
|
|
|
50
50
|
// 默认的排序
|
|
51
51
|
defSort: { type: Object as PropType<Recordable>, default: null },
|
|
52
52
|
|
|
53
|
+
// 列code编码
|
|
54
|
+
columnCode: { type: String },
|
|
55
|
+
// 列自定义的模板
|
|
56
|
+
templates: { type: Object as PropType<CellFormat> },
|
|
57
|
+
|
|
53
58
|
// 列
|
|
54
59
|
columns: { type: [Array] as PropType<BasicColumn[]>, default: () => [] },
|
|
55
60
|
|
|
@@ -82,7 +87,7 @@ export const TableProps = {
|
|
|
82
87
|
|
|
83
88
|
size: {
|
|
84
89
|
type: String as PropType<SizeType>,
|
|
85
|
-
default: '
|
|
90
|
+
default: 'small',
|
|
86
91
|
},
|
|
87
92
|
|
|
88
93
|
// 分页、排序、筛选变化时触发
|
package/src/directives/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 权限控制,不使用传统的通过css隐藏dom元素
|
|
3
3
|
* 使用方法: v-auth="'ADD'"
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { CacheKey, DtCache } from '@dt-frames/core';
|
|
6
6
|
import type { DirectiveBinding } from 'vue';
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,8 +10,7 @@ function hasAuth( el: Element, binding: any ) {
|
|
|
10
10
|
const value = binding.value;
|
|
11
11
|
if (!value) return;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
if(!getAuths.includes( value )) {
|
|
13
|
+
if(!DtCache.getLocal(CacheKey.AUTHS).includes( value )) {
|
|
15
14
|
el.parentNode?.removeChild(el);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script lang="ts" setup>
|
|
12
|
-
import { ref,
|
|
12
|
+
import { ref, watchEffect } from 'vue'
|
|
13
13
|
import { Breadcrumb } from 'ant-design-vue'
|
|
14
14
|
import { getBreadCrumb } from '../helper/menu-tree'
|
|
15
15
|
import { useRouter } from 'vue-router';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="dt-logo" :class="getLogoClass">
|
|
3
|
-
<img src="../../../assets/imgs/logo/logo.
|
|
3
|
+
<!-- <img src="../../../assets/imgs/logo/logo.jpeg" /> -->
|
|
4
|
+
<DtIcon icon-class="logo" :size="42" class-name="brand-logo"></DtIcon>
|
|
4
5
|
<div class="dt-logo__title" v-show="showTitle">
|
|
5
6
|
{{ title }}
|
|
6
7
|
</div>
|
|
@@ -10,8 +11,9 @@
|
|
|
10
11
|
<script lang="ts" setup>
|
|
11
12
|
import { computed, unref } from "vue";
|
|
12
13
|
import { useMenu, useTheme } from "@dt-frames/core"
|
|
14
|
+
import { DtIcon } from "../../../components"
|
|
13
15
|
|
|
14
|
-
const title = '
|
|
16
|
+
const title = '隆基税务后台管理系统';
|
|
15
17
|
const { getCollapsedShowTitle } = useMenu()
|
|
16
18
|
|
|
17
19
|
const props = defineProps({
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
<script lang="ts" setup>
|
|
16
16
|
import { ref } from 'vue';
|
|
17
|
-
import { Popover
|
|
17
|
+
import { Popover } from 'ant-design-vue';
|
|
18
18
|
import { useHeader } from '@dt-frames/core';
|
|
19
19
|
|
|
20
|
-
const activeKey = ref('1');
|
|
21
20
|
const { getShowNotice } = useHeader()
|
|
22
21
|
|
|
23
22
|
</script>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<span v-icon="'ic:baseline-lock'"></span>
|
|
20
20
|
锁定屏幕
|
|
21
21
|
</li>
|
|
22
|
-
<li>
|
|
22
|
+
<li @click="signOut()">
|
|
23
23
|
<span v-icon="'ant-design:logout-outlined'"></span>
|
|
24
24
|
退出系统
|
|
25
25
|
</li>
|
|
@@ -27,17 +27,34 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<div class="userInfo">
|
|
30
|
-
<Avatar :
|
|
31
|
-
|
|
30
|
+
<Avatar :size="28" >
|
|
31
|
+
<template #icon><img src="../../../assets/imgs/header/avatar.png" /></template>
|
|
32
|
+
</Avatar>
|
|
33
|
+
<span class="name">{{ getUserInfo?.userNo }}</span>
|
|
32
34
|
</div>
|
|
33
35
|
</Popover>
|
|
34
36
|
</template>
|
|
35
37
|
|
|
36
38
|
<script setup lang="ts">
|
|
37
39
|
import { Popover, Avatar } from 'ant-design-vue';
|
|
38
|
-
import {
|
|
40
|
+
import { CacheKey, DtCache, useAppStore, useHeader, isObject, isFunction, useGo, Pages } from '@dt-frames/core'
|
|
39
41
|
|
|
40
|
-
const
|
|
42
|
+
const getUserInfo = DtCache.getLocal(CacheKey.USER_INFO)
|
|
41
43
|
const { getUserActions } = useHeader()
|
|
44
|
+
const { appConf } = useAppStore()
|
|
45
|
+
const go = useGo()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// 退出系统
|
|
49
|
+
function signOut() {
|
|
50
|
+
if( isObject(appConf.pages?.ssoLogin) && appConf.pages.ssoLogin?.logout) {
|
|
51
|
+
let redictUrl = isFunction(appConf.pages.ssoLogin.logout)
|
|
52
|
+
? appConf.pages.ssoLogin.logout()
|
|
53
|
+
: appConf.pages.ssoLogin.logout
|
|
42
54
|
|
|
55
|
+
location.href = redictUrl
|
|
56
|
+
} else {
|
|
57
|
+
go(Pages.LOGIN)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
43
60
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** =====================================
|
|
2
2
|
* 定义一些菜单操作的方法
|
|
3
3
|
* =====================================*/
|
|
4
|
-
import { Menus, useAuthStore } from "@dt-frames/core";
|
|
4
|
+
import { CacheKey, DtCache, Menus, useAuthStore } from "@dt-frames/core";
|
|
5
5
|
import { trim } from 'lodash-es'
|
|
6
6
|
|
|
7
7
|
function deleteChildrenProp( menu: any ) {
|
|
@@ -13,8 +13,7 @@ function deleteChildrenProp( menu: any ) {
|
|
|
13
13
|
|
|
14
14
|
// 获取当前路由的面包屑
|
|
15
15
|
export function getBreadCrumb(path: string, menus?: Menus[]) {
|
|
16
|
-
const
|
|
17
|
-
const _menus = menus || getMenus
|
|
16
|
+
const _menus = menus || DtCache.getLocal(CacheKey.MENUS) || []
|
|
18
17
|
|
|
19
18
|
let routes: Menus[] = []
|
|
20
19
|
|
|
@@ -45,8 +44,6 @@ export function getBreadCrumb(path: string, menus?: Menus[]) {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
export function getFilterMenu( filter: string = '', flag: boolean = false) {
|
|
48
|
-
const { getMenus } = useAuthStore()
|
|
49
|
-
|
|
50
47
|
let _menus = [];
|
|
51
48
|
|
|
52
49
|
if( !trim(filter) && !flag ) return _menus;
|
|
@@ -61,7 +58,7 @@ export function getFilterMenu( filter: string = '', flag: boolean = false) {
|
|
|
61
58
|
} )
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
getTargetMenus(
|
|
61
|
+
getTargetMenus( DtCache.getLocal(CacheKey.MENUS) );
|
|
65
62
|
|
|
66
63
|
return _menus;
|
|
67
64
|
}
|
|
@@ -121,10 +121,6 @@
|
|
|
121
121
|
color: #333;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
.icon{
|
|
126
|
-
padding: 0 14px;
|
|
127
|
-
}
|
|
128
124
|
}
|
|
129
125
|
|
|
130
126
|
&--light{
|
|
@@ -209,6 +205,14 @@
|
|
|
209
205
|
right: 4px;
|
|
210
206
|
top: 10px;
|
|
211
207
|
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.brand-logo{
|
|
213
|
+
width: 40px;
|
|
214
|
+
height: 60px;
|
|
215
|
+
margin-left: -7px;
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
.dt-multiple-header{
|
|
@@ -67,8 +67,7 @@ export function useSplitMenu( splitType: Ref<MenuSplitTye> ) {
|
|
|
67
67
|
|
|
68
68
|
async function getMenus() {
|
|
69
69
|
if (unref(normalType)) {
|
|
70
|
-
|
|
71
|
-
menusRef.value = getMenus
|
|
70
|
+
menusRef.value = DtCache.getLocal(CacheKey.MENUS)
|
|
72
71
|
return;
|
|
73
72
|
}
|
|
74
73
|
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
|
|
30
30
|
<script lang="ts" setup>
|
|
31
31
|
import { Dropdown, Menu, MenuDivider, MenuItem } from 'ant-design-vue'
|
|
32
|
-
import { DtIcon } from '../../../components/icons';
|
|
33
32
|
import { useTabDropdown } from '../hooks/useTabDropdown';
|
|
34
33
|
|
|
35
34
|
const { getDropMenuList, handleContext, handleMenuEvent } = useTabDropdown()
|
package/src/theme/tabs/index.vue
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { Tabs, TabPane } from 'ant-design-vue'
|
|
31
31
|
import { computed, ref, unref, watch } from 'vue'
|
|
32
32
|
import { menuList2Map, RouteReuseStore, useGo, useMultipleTab } from '@dt-frames/core'
|
|
33
|
-
import { useRouter
|
|
33
|
+
import { useRouter } from 'vue-router'
|
|
34
34
|
import TabContent from './components/TabContent.vue'
|
|
35
35
|
import TabRedo from './components/TabRedo.vue'
|
|
36
36
|
import { initAffixTabs, useTabsDrag } from './hooks/useMultifyTabs'
|
package/src/theme/theme.less
CHANGED
package/src/theme/theme.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="dt-theme">
|
|
2
|
+
<div class="dt-theme" v-if="currentRoute.fullPath && getAppConf?.router.unRequireAuthPage.length">
|
|
3
3
|
<ConfigProvider :locale="zhCN">
|
|
4
4
|
<!-- 不需要权限登录 -->
|
|
5
|
-
<template v-if="currentRoute.
|
|
5
|
+
<template v-if="getAppConf?.router.unRequireAuthPage.includes(currentRoute.fullPath)">
|
|
6
6
|
<router-view></router-view>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { computed, unref, ref } from 'vue'
|
|
34
34
|
import { useRouter } from 'vue-router'
|
|
35
35
|
import { Layout, ConfigProvider } from 'ant-design-vue'
|
|
36
|
-
import { useHeader, useMenu, useTheme } from '@dt-frames/core'
|
|
36
|
+
import { useAppStore, useHeader, useMenu, useTheme } from '@dt-frames/core'
|
|
37
37
|
|
|
38
38
|
import DtFeature from './feature/index.vue'
|
|
39
39
|
import DtHeader from './header/index.vue'
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
const { getShowFullHeaderRef, getFixed, getHeaderHeight } = useHeader()
|
|
58
58
|
const { getSplit, getShowMenu, getShowSidebar } = useMenu()
|
|
59
59
|
const { getFooter, getShowFooter } = useTheme()
|
|
60
|
+
const { getAppConf } = useAppStore()
|
|
60
61
|
|
|
61
62
|
const { height } = unref(getFooter) as any;
|
|
62
63
|
|
|
File without changes
|
|
File without changes
|
package/es/assets/data/icon.d.ts
DELETED
package/es/assets/data/icon.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export const pickIcons = [
|
|
2
|
-
{
|
|
3
|
-
type: '操作',
|
|
4
|
-
icons: [
|
|
5
|
-
'ic:baseline-3d-rotation',
|
|
6
|
-
'ic:baseline-abc',
|
|
7
|
-
'ic:baseline-accessibility',
|
|
8
|
-
'ic:baseline-accessibility-new',
|
|
9
|
-
'ic:baseline-accessible',
|
|
10
|
-
'ic:baseline-accessible-forward',
|
|
11
|
-
'ic:baseline-account-balance',
|
|
12
|
-
'ic:baseline-account-balance-wallet',
|
|
13
|
-
'ic:baseline-account-box',
|
|
14
|
-
'ic:baseline-account-circle',
|
|
15
|
-
'ic:baseline-add-card',
|
|
16
|
-
'ic:baseline-add-shopping-cart',
|
|
17
|
-
'ic:baseline-add-task',
|
|
18
|
-
'ic:baseline-add-to-drive',
|
|
19
|
-
'ic:baseline-addchart',
|
|
20
|
-
'ic:baseline-admin-panel-settings',
|
|
21
|
-
'ic:baseline-ads-click',
|
|
22
|
-
'ic:baseline-alarm',
|
|
23
|
-
'ic:baseline-alarm-add',
|
|
24
|
-
'ic:baseline-alarm-off',
|
|
25
|
-
'ic:baseline-alarm-on',
|
|
26
|
-
'ic:baseline-all-inbox',
|
|
27
|
-
'ic:baseline-analytics',
|
|
28
|
-
'ic:baseline-anchor',
|
|
29
|
-
'ic:baseline-android',
|
|
30
|
-
'ic:baseline-announcement',
|
|
31
|
-
'ic:baseline-api',
|
|
32
|
-
'ic:baseline-app-blocking',
|
|
33
|
-
'ic:baseline-app-shortcut',
|
|
34
|
-
'ic:baseline-arrow-circle-down'
|
|
35
|
-
]
|
|
36
|
-
}, {
|
|
37
|
-
type: '警告',
|
|
38
|
-
icons: [
|
|
39
|
-
'ic:baseline-add-alert',
|
|
40
|
-
'ic:baseline-auto-delete',
|
|
41
|
-
'ic:baseline-error',
|
|
42
|
-
'ic:baseline-error-outline',
|
|
43
|
-
'ic:baseline-notification-important',
|
|
44
|
-
'ic:baseline-warning',
|
|
45
|
-
'ic:baseline-warning-amber',
|
|
46
|
-
'ic:outline-add-alert',
|
|
47
|
-
'ic:outline-auto-delete',
|
|
48
|
-
'ic:outline-error',
|
|
49
|
-
'ic:outline-error-outline',
|
|
50
|
-
'ic:outline-notification-important',
|
|
51
|
-
'ic:outline-warning',
|
|
52
|
-
'ic:outline-warning-amber',
|
|
53
|
-
'ic:round-add-alert',
|
|
54
|
-
'ic:round-auto-delete',
|
|
55
|
-
'ic:round-error',
|
|
56
|
-
'ic:round-error-outline',
|
|
57
|
-
'ic:round-notification-important',
|
|
58
|
-
'ic:round-warning',
|
|
59
|
-
'ic:round-warning-amber',
|
|
60
|
-
'ic:sharp-add-alert',
|
|
61
|
-
'ic:sharp-auto-delete',
|
|
62
|
-
'ic:sharp-error',
|
|
63
|
-
'ic:sharp-error-outline',
|
|
64
|
-
'ic:sharp-notification-important',
|
|
65
|
-
'ic:sharp-warning',
|
|
66
|
-
'ic:sharp-warning-amber'
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
]
|