@dt-frames/ui 1.0.1 → 1.0.4
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/README.md +1 -15
- package/es/assets/style/reset.less +0 -3
- package/es/components/iframe/index.d.ts +2 -2
- package/es/components/index.d.ts +2 -2
- package/es/index.css +1 -1
- package/es/index.js +34 -392
- package/es/style/assets/style/reset.less +0 -3
- package/es/style/components/forms/index.less +84 -0
- package/es/style/components/iframe/index.less +3 -0
- package/es/style/components/modal/index.less +63 -0
- package/es/style/components/table/index.less +162 -0
- package/es/style/theme/sider/index.less +25 -25
- package/es/style/theme/theme.less +2 -1
- package/es/theme/header/components/notify.d.ts +0 -1
- package/es/theme/header/components/user-info.d.ts +1 -1
- package/package.json +47 -40
- package/src/assets/data/icons/actions.ts +427 -0
- package/src/assets/data/icons/code.ts +10 -0
- package/src/assets/data/icons/commuticate.ts +190 -0
- package/src/assets/data/icons/currency.ts +46 -0
- package/src/assets/data/icons/devices.ts +128 -0
- package/src/assets/data/icons/edit.ts +165 -0
- package/src/assets/data/icons/file.ts +104 -0
- package/src/assets/data/icons/math.ts +53 -0
- package/src/assets/data/icons/message.ts +75 -0
- package/src/assets/data/icons/navigate.ts +181 -0
- package/src/assets/data/icons/other.ts +333 -0
- package/src/assets/data/icons.ts +58 -0
- package/src/assets/imgs/logo/logo.png +0 -0
- package/src/assets/locales/en_US.json +3 -0
- package/src/assets/locales/zh_CN.json +3 -0
- package/src/assets/style/index.less +10 -0
- package/src/assets/style/reset.less +17 -0
- package/src/components/container/index.less +85 -0
- package/src/components/container/index.ts +8 -0
- package/src/components/container/src/bar.ts +107 -0
- package/src/components/container/src/lazy-container.vue +9 -0
- package/src/components/container/src/scroll-bar.vue +117 -0
- package/src/components/container/src/scroll-container.vue +61 -0
- package/src/components/curd/index.ts +5 -0
- package/src/components/curd/src/components/dialog.vue +65 -0
- package/src/components/curd/src/components/props.ts +32 -0
- package/src/components/curd/src/hooks/useCurd.tsx +72 -0
- package/src/components/curd/src/types/curd.type.ts +29 -0
- package/src/components/excel/index.ts +6 -0
- package/src/components/excel/src/export2Excel.ts +44 -0
- package/src/components/forms/index.less +84 -0
- package/src/components/forms/index.ts +12 -0
- package/src/components/forms/src/componentMap.ts +44 -0
- package/src/components/forms/src/components/formButton.vue +150 -0
- package/src/components/forms/src/components/formIcon.vue +50 -0
- package/src/components/forms/src/components/formItem.vue +407 -0
- package/src/components/forms/src/components/radioButton.vue +58 -0
- package/src/components/forms/src/const/form.const.ts +7 -0
- package/src/components/forms/src/hooks/helper.ts +70 -0
- package/src/components/forms/src/hooks/useForm.ts +130 -0
- package/src/components/forms/src/hooks/useFormActions.ts +63 -0
- package/src/components/forms/src/hooks/useFormEvents.ts +247 -0
- package/src/components/forms/src/hooks/useFormValue.ts +49 -0
- package/src/components/forms/src/hooks/useFormValues.ts +131 -0
- package/src/components/forms/src/hooks/useLabelWidth.ts +57 -0
- package/src/components/forms/src/index.vue +306 -0
- package/src/components/forms/src/prop.ts +80 -0
- package/src/components/forms/src/types/form.type.ts +269 -0
- package/src/components/icons/index.less +96 -0
- package/src/components/icons/index.ts +7 -0
- package/src/components/icons/src/pick-icon.vue +117 -0
- package/src/components/icons/src/svg-icon.vue +117 -0
- package/src/components/iframe/index.less +3 -0
- package/src/components/iframe/index.ts +5 -0
- package/src/components/iframe/src/index.vue +38 -0
- package/src/components/index.ts +46 -0
- package/src/components/modal/index.less +63 -0
- package/src/components/modal/index.ts +8 -0
- package/src/components/modal/src/components/close-icon.vue +47 -0
- package/src/components/modal/src/components/modal-wrap.vue +118 -0
- package/src/components/modal/src/components/modal.tsx +30 -0
- package/src/components/modal/src/components/modalFooter.vue +38 -0
- package/src/components/modal/src/hooks/useDrag.ts +107 -0
- package/src/components/modal/src/hooks/useFullScreen.ts +27 -0
- package/src/components/modal/src/hooks/useModal.ts +177 -0
- package/src/components/modal/src/index.vue +173 -0
- package/src/components/modal/src/props.ts +43 -0
- package/src/components/modal/src/types/modal.type.ts +27 -0
- package/src/components/router/base-router.vue +11 -0
- package/src/components/router/index.ts +3 -0
- package/src/components/source/index.ts +1 -0
- package/src/components/source/src/hooks/useFetch.ts +70 -0
- package/src/components/source/src/hooks/usePage.ts +3 -0
- package/src/components/source/src/hooks/useSource.ts +178 -0
- package/src/components/source/src/index.ts +5 -0
- package/src/components/source/src/types/source.type.ts +68 -0
- package/src/components/source/src/types/table.type.ts +8 -0
- package/src/components/table/index.less +162 -0
- package/src/components/table/index.ts +7 -0
- package/src/components/table/src/components/TableActions.vue +108 -0
- package/src/components/table/src/components/TableHeader.vue +77 -0
- package/src/components/table/src/components/TableRender.vue +76 -0
- package/src/components/table/src/components/setting/Column.vue +355 -0
- package/src/components/table/src/components/setting/Download.vue +55 -0
- package/src/components/table/src/components/setting/Fullscreen.vue +43 -0
- package/src/components/table/src/components/setting/Size.vue +42 -0
- package/src/components/table/src/components/setting/index.vue +64 -0
- package/src/components/table/src/const.ts +13 -0
- package/src/components/table/src/hooks/useColumns.ts +319 -0
- package/{es/assets/app-antd-dark-theme-style.e3b0c442.css → src/components/table/src/hooks/useCustomRow.ts} +0 -0
- package/src/components/table/src/hooks/useDataSource.ts +99 -0
- package/src/components/table/src/hooks/useLoading.ts +29 -0
- package/src/components/table/src/hooks/usePagination.ts +76 -0
- package/src/components/table/src/hooks/useRowSelection.ts +146 -0
- package/src/components/table/src/hooks/useRows.ts +30 -0
- package/src/components/table/src/hooks/useTable.ts +77 -0
- package/src/components/table/src/hooks/useTableHeader.ts +48 -0
- package/src/components/table/src/hooks/useTableInstance.ts +29 -0
- package/src/components/table/src/hooks/useTableScroll.ts +227 -0
- package/src/components/table/src/index.vue +198 -0
- package/src/components/table/src/props.ts +152 -0
- package/src/components/table/src/types/table.type.ts +133 -0
- package/src/components/table/src/types/tableHeader.type.ts +27 -0
- package/{es/assets/app-theme-style.e3b0c442.css → src/components/type.ts} +0 -0
- package/src/directives/icon.ts +36 -0
- package/src/directives/index.ts +26 -0
- package/src/directives/permission.ts +20 -0
- package/src/global.d.ts +8 -0
- package/src/index.ts +4 -0
- package/src/theme/content/index.vue +37 -0
- package/src/theme/feature/back-top.vue +11 -0
- package/src/theme/feature/index.vue +7 -0
- package/src/theme/footer/index.less +16 -0
- package/src/theme/footer/index.vue +24 -0
- package/src/theme/header/components/bread-crumb.vue +26 -0
- package/src/theme/header/components/fullscreen.vue +12 -0
- package/src/theme/header/components/handler.ts +81 -0
- package/src/theme/header/components/index.ts +21 -0
- package/src/theme/header/components/lang-picker.vue +36 -0
- package/src/theme/header/components/logo.vue +33 -0
- package/src/theme/header/components/menu-search.vue +62 -0
- package/src/theme/header/components/notify.vue +22 -0
- package/src/theme/header/components/setting-theme.vue +123 -0
- package/src/theme/header/components/theme-drawer/enum.ts +12 -0
- package/src/theme/header/components/theme-drawer/feature.vue +75 -0
- package/src/theme/header/components/theme-drawer/index.ts +7 -0
- package/src/theme/header/components/theme-drawer/menu-type.vue +40 -0
- package/src/theme/header/components/theme-drawer/select-item.vue +46 -0
- package/src/theme/header/components/theme-drawer/switch-item.vue +39 -0
- package/src/theme/header/components/theme-drawer/theme-color.vue +26 -0
- package/src/theme/header/components/trigger.vue +14 -0
- package/src/theme/header/components/user-info.vue +43 -0
- package/src/theme/header/const/index.ts +40 -0
- package/src/theme/header/helper/menu-tree.ts +64 -0
- package/src/theme/header/index.less +438 -0
- package/src/theme/header/index.ts +0 -0
- package/src/theme/header/index.vue +96 -0
- package/src/theme/header/multiple-header.vue +67 -0
- package/src/theme/header/set-theme.less +68 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/sider/components/basic-menu/basic-menu-item.vue +14 -0
- package/src/theme/sider/components/basic-menu/basic-menu.vue +122 -0
- package/src/theme/sider/components/basic-menu/basic-sub-menu-item.vue +46 -0
- package/src/theme/sider/components/basic-menu/menu-item-content.vue +13 -0
- package/src/theme/sider/components/drag-bar.vue +26 -0
- package/src/theme/sider/components/layout-menu.vue +132 -0
- package/src/theme/sider/components/props.ts +97 -0
- package/src/theme/sider/components/sider-trigger.vue +24 -0
- package/src/theme/sider/helper/sider.ts +52 -0
- package/src/theme/sider/helper/split-menu.ts +146 -0
- package/src/theme/sider/hooks/useDragLine.ts +86 -0
- package/src/theme/sider/hooks/useOpenKeys.ts +57 -0
- package/src/theme/sider/index.less +203 -0
- package/src/theme/sider/index.vue +88 -0
- package/src/theme/tabs/components/TabContent.vue +36 -0
- package/src/theme/tabs/components/TabRedo.vue +18 -0
- package/src/theme/tabs/hooks/useMultifyTabs.ts +96 -0
- package/src/theme/tabs/hooks/useTabDropdown.ts +89 -0
- package/src/theme/tabs/index.less +165 -0
- package/src/theme/tabs/index.vue +98 -0
- package/src/theme/tabs/types/tabs.type.ts +8 -0
- package/src/theme/theme.less +67 -0
- package/src/theme/theme.vue +90 -0
- package/src/theme/transition.less +99 -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/style/assets/style/var.less +0 -42
- package/es/theme/content/index.d.ts +0 -29
- package/es/theme/header/components/menu-search.d.ts +0 -528
- package/es/theme/header/components/setting-theme.d.ts +0 -2550
- 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 -49
- package/es/theme/tabs/index.d.ts +0 -1399
- 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 -4911
- package/es/themes/generate.ts +0 -74
- package/es/themes/index.ts +0 -10
- package/es/themes/modifyVars.ts +0 -33
- package/es/themes/themePlugiin.ts +0 -74
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core"
|
|
2
|
+
import { VNode } from "vue"
|
|
3
|
+
import { RuleObject } from 'ant-design-vue/lib/form/interface'
|
|
4
|
+
import type { RowProps } from 'ant-design-vue/lib/grid/Row'
|
|
5
|
+
|
|
6
|
+
export type Rule = RuleObject & {
|
|
7
|
+
trigger?: 'blur' | 'change' | ['change', 'blur'];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ButtonFlag = 'OK' | 'CANCEL'
|
|
11
|
+
|
|
12
|
+
export type FormCallBackParams = {
|
|
13
|
+
schema: Omit<FormSchema, 'props'>
|
|
14
|
+
values: Recordable
|
|
15
|
+
model: Recordable
|
|
16
|
+
name: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 组件的类型
|
|
20
|
+
export type ComponentType =
|
|
21
|
+
| 'Input'
|
|
22
|
+
| 'InputGroup'
|
|
23
|
+
| 'InputPassword'
|
|
24
|
+
| 'InputSearch'
|
|
25
|
+
| 'InputTextArea'
|
|
26
|
+
| 'InputNumber'
|
|
27
|
+
| 'InputCountDown'
|
|
28
|
+
| 'Select'
|
|
29
|
+
| 'TreeSelect'
|
|
30
|
+
| 'ApiTree'
|
|
31
|
+
| 'ApiTreeSelect'
|
|
32
|
+
| 'Radio'
|
|
33
|
+
| 'RadioButtonGroup'
|
|
34
|
+
| 'RadioGroup'
|
|
35
|
+
| 'Checkbox'
|
|
36
|
+
| 'CheckboxGroup'
|
|
37
|
+
| 'AutoComplete'
|
|
38
|
+
| 'Cascader'
|
|
39
|
+
| 'DatePicker'
|
|
40
|
+
| 'MonthPicker'
|
|
41
|
+
| 'RangePicker'
|
|
42
|
+
| 'WeekPicker'
|
|
43
|
+
| 'TimePicker'
|
|
44
|
+
| 'Switch'
|
|
45
|
+
| 'Upload'
|
|
46
|
+
| 'IconPicker'
|
|
47
|
+
| 'Render'
|
|
48
|
+
| 'Slider'
|
|
49
|
+
| 'Rate'
|
|
50
|
+
| 'Divider'
|
|
51
|
+
| 'Icon'
|
|
52
|
+
|
|
53
|
+
// 对表单元素进行拓展
|
|
54
|
+
export type ColEx = {
|
|
55
|
+
// 样式
|
|
56
|
+
style?: any
|
|
57
|
+
// 占用空间大小
|
|
58
|
+
span?: number | string
|
|
59
|
+
// 排序
|
|
60
|
+
order?: number | string
|
|
61
|
+
// 偏移量
|
|
62
|
+
offset?: number | string
|
|
63
|
+
// 中等屏幕
|
|
64
|
+
md?: number | string
|
|
65
|
+
// 小电脑屏幕
|
|
66
|
+
xl?: number | string
|
|
67
|
+
// 大屏幕
|
|
68
|
+
xxl?: number | string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ToolTipProps = {
|
|
72
|
+
color: string;
|
|
73
|
+
placement: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 按钮属性
|
|
77
|
+
export type ButtonProps = {
|
|
78
|
+
// 按钮名称
|
|
79
|
+
name?: string
|
|
80
|
+
// 按钮风格
|
|
81
|
+
color?: 'error' | 'warning' | 'success' | ''
|
|
82
|
+
// 按钮类型
|
|
83
|
+
type?: 'primary' | 'ghost' | 'dashed' | 'link' | 'text' | 'default' | undefined
|
|
84
|
+
// 按钮class
|
|
85
|
+
class?: string
|
|
86
|
+
// 是否禁用
|
|
87
|
+
disabled?: boolean
|
|
88
|
+
// 是否显示
|
|
89
|
+
show?: boolean
|
|
90
|
+
// 按钮前面图标
|
|
91
|
+
preIcon?: string
|
|
92
|
+
// 按钮后面图标
|
|
93
|
+
postIcon?: string
|
|
94
|
+
// 按钮权限
|
|
95
|
+
auth?: string
|
|
96
|
+
// 按钮标识
|
|
97
|
+
flag?: ButtonFlag
|
|
98
|
+
// 是否处于加载中
|
|
99
|
+
loading?: boolean
|
|
100
|
+
// 按钮点击事件
|
|
101
|
+
onClick?: (...args) => any
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 整个表单配置项
|
|
105
|
+
export type FormProps = {
|
|
106
|
+
mode?: 'search' | 'dialog',
|
|
107
|
+
// 是否默认查询
|
|
108
|
+
autoFetch?: boolean
|
|
109
|
+
// 对齐方式
|
|
110
|
+
layout?: 'vertical' | 'inline' | 'horizontal'
|
|
111
|
+
// 绑定的model
|
|
112
|
+
model?: Recordable
|
|
113
|
+
// 定义标签的宽度
|
|
114
|
+
labelWidth?: number | string
|
|
115
|
+
// 对齐方式
|
|
116
|
+
labelAlign?: 'left' | 'right'
|
|
117
|
+
// 标签设置
|
|
118
|
+
labelCol?: Partial<ColEx>
|
|
119
|
+
// 包裹设置
|
|
120
|
+
wrapperCol?: Partial<ColEx>
|
|
121
|
+
// 行样式
|
|
122
|
+
rowProps?: RowProps
|
|
123
|
+
// col相关的配置
|
|
124
|
+
colProps?: Partial<ColEx>
|
|
125
|
+
// 表单数据配置
|
|
126
|
+
schemas?: FormSchema[]
|
|
127
|
+
// 尺寸
|
|
128
|
+
size?: 'default' | 'small' | 'large'
|
|
129
|
+
// 是否禁用
|
|
130
|
+
disabled?: boolean
|
|
131
|
+
// 回车键搜索
|
|
132
|
+
autoSubmitOnEnter?: boolean
|
|
133
|
+
// 是否一直显示所有条目
|
|
134
|
+
alwaysShowLines?: number
|
|
135
|
+
// 是否使用紧凑布局
|
|
136
|
+
compact?: boolean
|
|
137
|
+
|
|
138
|
+
// 提交 只有当mode为查询时候有
|
|
139
|
+
onSearch?: Function
|
|
140
|
+
onReset?: Function
|
|
141
|
+
// 最小显示的条目
|
|
142
|
+
minShowColumn?: number
|
|
143
|
+
// 是否显示折叠按钮
|
|
144
|
+
showAdvancedButton?: boolean
|
|
145
|
+
enterToSearch?: boolean
|
|
146
|
+
|
|
147
|
+
// form 按钮
|
|
148
|
+
buttons?: ButtonProps[]
|
|
149
|
+
// 加载状态
|
|
150
|
+
loading?: Recordable,
|
|
151
|
+
// css样式
|
|
152
|
+
style?: Recordable
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 表单当个元素配置项
|
|
156
|
+
export type FormSchema = {
|
|
157
|
+
// 表单绑定的属性,亦作为name属性,用于后期自动化测试
|
|
158
|
+
name: string | string[]
|
|
159
|
+
// 值发生变化触发的函数名
|
|
160
|
+
changeEvent?: string
|
|
161
|
+
// 绑定v-model的值
|
|
162
|
+
valueField?: string
|
|
163
|
+
// 标签名
|
|
164
|
+
label?: string | VNode
|
|
165
|
+
// 标签描述 如 这是标签(subLable): ***
|
|
166
|
+
subLabel?: string
|
|
167
|
+
// 标签宽度
|
|
168
|
+
labelWidth?: string | number
|
|
169
|
+
// 标签对齐方式
|
|
170
|
+
labelAlign?: 'left' | 'right'
|
|
171
|
+
|
|
172
|
+
// 帮助信息
|
|
173
|
+
toolTip?:
|
|
174
|
+
| string
|
|
175
|
+
| (( parms: FormCallBackParams ) => string | string[])
|
|
176
|
+
// tooltip 配置信息
|
|
177
|
+
toolTipProps?: ToolTipProps
|
|
178
|
+
// 表单控件类型
|
|
179
|
+
component: ComponentType
|
|
180
|
+
// 表单控件参数
|
|
181
|
+
props?:
|
|
182
|
+
| ((opt: {
|
|
183
|
+
schema?: FormSchema
|
|
184
|
+
// tableAction: TableActionType
|
|
185
|
+
formActions?: any
|
|
186
|
+
formActionType?: FormActionType
|
|
187
|
+
formModel?: Recordable
|
|
188
|
+
}) => Recordable)
|
|
189
|
+
| object
|
|
190
|
+
required?: boolean | ( ( parms: FormCallBackParams ) => boolean )
|
|
191
|
+
// // 输入框的后缀
|
|
192
|
+
suffix?: string | number | ( ( parms: FormCallBackParams ) => boolean )
|
|
193
|
+
// 验证规则
|
|
194
|
+
rules?: Rule[]
|
|
195
|
+
// 提示信息是否带上lable
|
|
196
|
+
rulesMessageJoinLabel?: boolean
|
|
197
|
+
|
|
198
|
+
// 默认值
|
|
199
|
+
defaultValue?: any;
|
|
200
|
+
|
|
201
|
+
// 占用多少格子
|
|
202
|
+
span?: number
|
|
203
|
+
|
|
204
|
+
// 是否显示
|
|
205
|
+
show?: boolean | ( ( parms: FormCallBackParams ) => boolean )
|
|
206
|
+
|
|
207
|
+
// 渲染item
|
|
208
|
+
render?: (parms: FormCallBackParams) => VNode | VNode[] | string
|
|
209
|
+
|
|
210
|
+
// 渲染col
|
|
211
|
+
renderCol?: (parms: FormCallBackParams) => VNode | VNode[] | string
|
|
212
|
+
|
|
213
|
+
// col相关的配置
|
|
214
|
+
colProps?: Partial<ColEx>
|
|
215
|
+
|
|
216
|
+
// 表单的前后缀、禁用启用, 日期格式
|
|
217
|
+
renderComponent?:
|
|
218
|
+
| ((parms: FormCallBackParams) => Recordable)
|
|
219
|
+
| VNode
|
|
220
|
+
| VNode[]
|
|
221
|
+
| string
|
|
222
|
+
|
|
223
|
+
slot?: string
|
|
224
|
+
colSlot?: string
|
|
225
|
+
|
|
226
|
+
dynamicDisabled?: boolean | ((parms: FormCallBackParams) => boolean)
|
|
227
|
+
dynamicRules?: (parms: FormCallBackParams) => Rule[]
|
|
228
|
+
|
|
229
|
+
// lable后面是否有冒号
|
|
230
|
+
colon?: boolean
|
|
231
|
+
|
|
232
|
+
// 标签宽度
|
|
233
|
+
labelCol?: Partial<ColEx>
|
|
234
|
+
// 内容宽度
|
|
235
|
+
wrapperCol?: Partial<ColEx>
|
|
236
|
+
|
|
237
|
+
// 是否处于收缩状态 仅在 search 模式下使用
|
|
238
|
+
isAdvanced?: boolean
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
// 表单操作类型
|
|
243
|
+
export type FormActionType = {
|
|
244
|
+
setProps: ( props: FormProps ) => Promise<void>
|
|
245
|
+
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>,
|
|
246
|
+
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>,
|
|
247
|
+
clearValidate: (name?: string | string[]) => Promise<void>
|
|
248
|
+
resetForms: (data: Partial<FormSchema> | Partial<FormSchema>[]) => void,
|
|
249
|
+
removeFormByName: (name: string | string[]) => void,
|
|
250
|
+
setFormValues: (values: Recordable) => Promise<void>,
|
|
251
|
+
appendFormItems: (
|
|
252
|
+
schema: FormSchema,
|
|
253
|
+
prefixField: string | undefined,
|
|
254
|
+
first?: boolean | undefined,
|
|
255
|
+
) => void,
|
|
256
|
+
validate: (nameList?: (string | number)[]) => Promise<any>,
|
|
257
|
+
validateFields: (nameList?: (string | number)[]) => Promise<any>,
|
|
258
|
+
getFormValues: () => Recordable,
|
|
259
|
+
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// 按钮收缩相关的操作
|
|
263
|
+
export type AdvanceState = {
|
|
264
|
+
isAdvanced: boolean
|
|
265
|
+
hideAdvanceBtn: boolean
|
|
266
|
+
isLoad: boolean
|
|
267
|
+
actionSpan: number
|
|
268
|
+
}
|
|
269
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@primary-color: #269ac1;
|
|
2
|
+
@icon-pick-hover-color: #269ac1;
|
|
3
|
+
|
|
4
|
+
.svg-icon {
|
|
5
|
+
fill: currentColor;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dt-icon{
|
|
10
|
+
display: inline-block;
|
|
11
|
+
text-align: center;
|
|
12
|
+
& > svg{
|
|
13
|
+
vertical-align: middle;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dt-pick-icon {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
height: 600px;
|
|
21
|
+
|
|
22
|
+
&__menus{
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow-y: auto;
|
|
25
|
+
width: 140px;
|
|
26
|
+
border-right: 1px solid #e7e7e7;
|
|
27
|
+
border-top: 1px solid #e7e7e7;
|
|
28
|
+
background: #fff;
|
|
29
|
+
.menu{
|
|
30
|
+
border-bottom: 1px solid #e7e7e7;
|
|
31
|
+
padding: 8px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transform: all 0.25s;
|
|
35
|
+
p{
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
line-height: 24x;
|
|
38
|
+
span{
|
|
39
|
+
opacity: 0.7;
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
padding-left: 6px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
&.active, &:hover{
|
|
45
|
+
background: @primary-color;
|
|
46
|
+
color: #fff;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__content{
|
|
52
|
+
height: 100%;
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
flex: 1;
|
|
55
|
+
background: #fff;
|
|
56
|
+
|
|
57
|
+
.ant-input-search{
|
|
58
|
+
width: 50%;
|
|
59
|
+
margin: 0 25% 40px 25%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&_item{
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
flex-wrap: wrap;
|
|
66
|
+
padding: 20px;
|
|
67
|
+
a {
|
|
68
|
+
margin: 6px;
|
|
69
|
+
line-height: 22px;
|
|
70
|
+
height: 30px;
|
|
71
|
+
width: 30px;
|
|
72
|
+
text-align: center;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
padding: 4px;
|
|
75
|
+
transform: all 0.2s;
|
|
76
|
+
border: 1px solid #fff;
|
|
77
|
+
&:hover{
|
|
78
|
+
border: 1px solid @primary-color;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
color: @primary-color;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
i{
|
|
86
|
+
font-size: 22px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dt-pick-icon-item{
|
|
92
|
+
.ant-tooltip-inner, .ant-tooltip-arrow-content {
|
|
93
|
+
background: #fff !important;
|
|
94
|
+
color: @icon-pick-hover-color ;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="clsPrefix">
|
|
3
|
+
<div :class="`${clsPrefix}__menus`">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(menu, index) in iconMenus"
|
|
6
|
+
:key="menu.type"
|
|
7
|
+
class="menu"
|
|
8
|
+
@click="activeIndex = index"
|
|
9
|
+
:class="{'active': activeIndex === index}"
|
|
10
|
+
>
|
|
11
|
+
<p>{{ menu.type }}<span>({{ menu.total }})</span></p>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div :class="`${clsPrefix}__content`">
|
|
16
|
+
<keep-alive>
|
|
17
|
+
<div :class="`${clsPrefix}__content_item`">
|
|
18
|
+
<InputSearch
|
|
19
|
+
v-model:value="filter"
|
|
20
|
+
enter-button
|
|
21
|
+
placeholder="请输入过滤条件"
|
|
22
|
+
@search="onFilter"
|
|
23
|
+
></InputSearch>
|
|
24
|
+
|
|
25
|
+
<template v-for="icon in currentIcons" :key="icon">
|
|
26
|
+
<a @click="selectIcon(icon)">
|
|
27
|
+
<Tooltip
|
|
28
|
+
placement="bottom"
|
|
29
|
+
overlayClassName="dt-pick-icon-item">
|
|
30
|
+
<template #title>
|
|
31
|
+
{{ icon }}
|
|
32
|
+
</template>
|
|
33
|
+
<i class="i" :class="icon"></i>
|
|
34
|
+
</Tooltip>
|
|
35
|
+
</a>
|
|
36
|
+
</template>
|
|
37
|
+
</div>
|
|
38
|
+
</keep-alive>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts" setup>
|
|
44
|
+
import { ref, computed, unref, watch } from 'vue'
|
|
45
|
+
import { Tooltip, InputSearch } from 'ant-design-vue'
|
|
46
|
+
import { Icons } from '../../../assets/data/icons'
|
|
47
|
+
|
|
48
|
+
const emits = defineEmits(['chooseIcon'])
|
|
49
|
+
|
|
50
|
+
type IconMenu = {
|
|
51
|
+
type: string,
|
|
52
|
+
total: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const clsPrefix = 'dt-pick-icon'
|
|
56
|
+
const activeIndex = ref(1)
|
|
57
|
+
const filter = ref(null)
|
|
58
|
+
const currentIcons = ref([])
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
const iconMenus = computed(() => {
|
|
62
|
+
let total: number = 0
|
|
63
|
+
let menus: IconMenu[] = []
|
|
64
|
+
|
|
65
|
+
Icons.forEach( it => {
|
|
66
|
+
let cLen = it.children?.length || 0
|
|
67
|
+
total += cLen
|
|
68
|
+
|
|
69
|
+
menus.push({
|
|
70
|
+
type: it.type,
|
|
71
|
+
total: cLen
|
|
72
|
+
})
|
|
73
|
+
} )
|
|
74
|
+
|
|
75
|
+
menus.unshift({
|
|
76
|
+
type: '所有',
|
|
77
|
+
total
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
return menus
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
function getIcons(): string[] {
|
|
84
|
+
|
|
85
|
+
if( unref(activeIndex) ) {
|
|
86
|
+
currentIcons.value = Icons[activeIndex.value - 1].children
|
|
87
|
+
} else {
|
|
88
|
+
currentIcons.value = Icons.reduce( (icons, it) => {
|
|
89
|
+
icons = icons.concat( it.children )
|
|
90
|
+
return icons
|
|
91
|
+
}, [] )
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return unref(currentIcons)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
watch(
|
|
98
|
+
() => activeIndex.value,
|
|
99
|
+
v => {
|
|
100
|
+
getIcons()
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
immediate: true
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
// 过滤
|
|
108
|
+
function onFilter(e) {
|
|
109
|
+
currentIcons.value = getIcons().filter( it => it.indexOf(unref(filter)) !== -1 )
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function selectIcon(icon) {
|
|
113
|
+
emits('chooseIcon', icon)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
</script>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
v-if="isSvgIcon"
|
|
4
|
+
:class="clsName"
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
:style="{
|
|
7
|
+
fontSize: size + 'px',
|
|
8
|
+
width: size + 'px',
|
|
9
|
+
height: size + 'px'
|
|
10
|
+
}">
|
|
11
|
+
<use :xlink:href="iconName" :fill="color" />
|
|
12
|
+
</svg>
|
|
13
|
+
|
|
14
|
+
<i
|
|
15
|
+
v-else
|
|
16
|
+
class="dt-icon i"
|
|
17
|
+
:style="{
|
|
18
|
+
color,
|
|
19
|
+
fontSize: size + 'px'
|
|
20
|
+
}"
|
|
21
|
+
:class="[iconName, clsName]"
|
|
22
|
+
></i>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { isArray, isFunction, isObject, isString, Recordable } from '@dt-frames/core';
|
|
27
|
+
import {computed, defineComponent, unref} from 'vue';
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
props: {
|
|
32
|
+
iconClass: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
className: {
|
|
37
|
+
type: [String, Array],
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
color: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '#555',
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 18,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
setup(props) {
|
|
51
|
+
// 判断是否为svg图标
|
|
52
|
+
const isSvgIcon = computed(() => props.iconClass.indexOf(':') === -1)
|
|
53
|
+
|
|
54
|
+
// 图标名称
|
|
55
|
+
const iconName = computed(() => {
|
|
56
|
+
return unref(isSvgIcon) ? `#icon-${props.iconClass}` : `${props.iconClass}`
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// 定义新的class名称
|
|
61
|
+
const clsName = computed(() => {
|
|
62
|
+
if( unref(isSvgIcon)) {
|
|
63
|
+
return `svg-icon ${ getCls( props.className ) }`
|
|
64
|
+
} else {
|
|
65
|
+
return `${ getCls( props.className ) }`
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
function getCls(className: String | Array<any>): String {
|
|
71
|
+
if( isString( className ) ) {
|
|
72
|
+
return className
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if( isArray( className ) ) {
|
|
76
|
+
const arrClsToStr = ( cls ) => {
|
|
77
|
+
let classNames = []
|
|
78
|
+
|
|
79
|
+
cls
|
|
80
|
+
.forEach( it => {
|
|
81
|
+
if( isString( it ) ) {
|
|
82
|
+
classNames.push( it )
|
|
83
|
+
} else if( isObject( it )){
|
|
84
|
+
classNames.push(...objClsToStr( it ))
|
|
85
|
+
} else if( isFunction( it ) ) {
|
|
86
|
+
classNames.push( it() )
|
|
87
|
+
}
|
|
88
|
+
} )
|
|
89
|
+
|
|
90
|
+
return classNames
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const objClsToStr = ( objCls: Recordable ) => {
|
|
94
|
+
let clsArr = []
|
|
95
|
+
for( let key in objCls ) {
|
|
96
|
+
if( objCls[ key ] ) clsArr.push( key )
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return clsArr
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return arrClsToStr( className )
|
|
103
|
+
.filter( Boolean )
|
|
104
|
+
.join(' ')
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return ''
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
isSvgIcon,
|
|
112
|
+
iconName,
|
|
113
|
+
clsName,
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
})
|
|
117
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="iframe-page">
|
|
3
|
+
<Spin :spinning="loading" size="large">
|
|
4
|
+
<iframe
|
|
5
|
+
:src="src"
|
|
6
|
+
class="iframe-page__main"
|
|
7
|
+
ref="frameRef"
|
|
8
|
+
@load="afterLoaded()"
|
|
9
|
+
></iframe>
|
|
10
|
+
</Spin>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { ref } from 'vue'
|
|
16
|
+
import { Spin } from 'ant-design-vue'
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
showLoading: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
src: {
|
|
24
|
+
type: String
|
|
25
|
+
},
|
|
26
|
+
postMsg: null
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const loading = ref<boolean>(false)
|
|
30
|
+
const frameRef = ref()
|
|
31
|
+
|
|
32
|
+
function afterLoaded() {
|
|
33
|
+
loading.value = false
|
|
34
|
+
|
|
35
|
+
let iframeWin = frameRef.value.contentWindow
|
|
36
|
+
iframeWin.postMessage(props.postMsg, props.src)
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { DtBaseRouter } from './router'
|
|
3
|
+
import { DtIcon, DtPickIcon } from './icons'
|
|
4
|
+
import { DtModal, useModal, useModalOut } from './modal'
|
|
5
|
+
import { DtForm, useForm, FormButtons } from './forms'
|
|
6
|
+
import { DtTable, useTable } from './table'
|
|
7
|
+
import { useSource } from './source'
|
|
8
|
+
import { useCurd } from './curd'
|
|
9
|
+
import { export2Excel } from './excel'
|
|
10
|
+
import { DtIframe } from './iframe'
|
|
11
|
+
|
|
12
|
+
const dtComponents = [
|
|
13
|
+
{ name: 'dt-base-router', component: DtBaseRouter },
|
|
14
|
+
{ name: 'dt-icon', component: DtIcon },
|
|
15
|
+
{ name: 'dt-pick-icon', component: DtPickIcon },
|
|
16
|
+
{ name: 'dt-modal', component: DtModal },
|
|
17
|
+
{ name: 'dt-form', component: DtForm },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
// 初始化所有组件
|
|
22
|
+
export function initComponents() {
|
|
23
|
+
return {
|
|
24
|
+
install(app: App) {
|
|
25
|
+
dtComponents.forEach( comp => app.component(comp.name, comp));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
DtBaseRouter,
|
|
32
|
+
DtIcon,
|
|
33
|
+
DtPickIcon,
|
|
34
|
+
DtModal,
|
|
35
|
+
DtForm,
|
|
36
|
+
DtTable,
|
|
37
|
+
FormButtons,
|
|
38
|
+
DtIframe,
|
|
39
|
+
useForm,
|
|
40
|
+
useTable,
|
|
41
|
+
useSource,
|
|
42
|
+
useCurd,
|
|
43
|
+
useModal,
|
|
44
|
+
useModalOut,
|
|
45
|
+
export2Excel
|
|
46
|
+
}
|