inl-ui 0.0.4 → 0.0.7
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/.babelrc +3 -3
- package/README.md +28 -1
- package/dist/index.js +12707 -67
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/dark.less +204 -182
- package/dist/theme/default.less +109 -1067
- package/package.json +38 -36
- package/conf/config.output.ts +0 -0
- package/conf/cp.js +0 -51
- package/conf/rollup.config.ts +0 -36
- package/dist/theme/dark copy.less +0 -448
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/index.d.ts +0 -7
- package/dist/types/src/pageComponent/api/auth/menuManager.d.ts +0 -23
- package/dist/types/src/pageComponent/api/auth/roleManager.d.ts +0 -27
- package/dist/types/src/pageComponent/api/auth/userManager.d.ts +0 -45
- package/dist/types/src/pageComponent/api/axios.d.ts +0 -4
- package/dist/types/src/pageComponent/api/index.d.ts +0 -30
- package/dist/types/src/pageComponent/api/logManager.d.ts +0 -11
- package/dist/types/src/pageComponent/api/org/depManager.d.ts +0 -55
- package/dist/types/src/pageComponent/api/org/postManager.d.ts +0 -30
- package/dist/types/src/pageComponent/api/org/teamManager.d.ts +0 -38
- package/dist/types/src/pageComponent/api/param.d.ts +0 -32
- package/dist/types/src/pageComponent/components/CommonTree.d.ts +0 -57
- package/dist/types/src/pageComponent/components/DynamicIcon.d.ts +0 -13
- package/dist/types/src/pageComponent/components/EditPasswordForm.d.ts +0 -19
- package/dist/types/src/pageComponent/components/IconSelect.d.ts +0 -12
- package/dist/types/src/pageComponent/components/Navbar.d.ts +0 -13
- package/dist/types/src/pageComponent/components/ProFormItem.d.ts +0 -18
- package/dist/types/src/pageComponent/components/SearchSelect.d.ts +0 -49
- package/dist/types/src/pageComponent/components/Sidebar.d.ts +0 -20
- package/dist/types/src/pageComponent/components/loginBox/index.d.ts +0 -43
- package/dist/types/src/pageComponent/config/global.d.ts +0 -7
- package/dist/types/src/pageComponent/config/install.d.ts +0 -2
- package/dist/types/src/pageComponent/hooks/global.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/manage-module/useModalForm.d.ts +0 -5
- package/dist/types/src/pageComponent/hooks/manage-module/useModalTitle.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/manage-module/useModalVisibleControl.d.ts +0 -5
- package/dist/types/src/pageComponent/hooks/useBus.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/useProxy.d.ts +0 -4
- package/dist/types/src/pageComponent/hooks/useTableList.d.ts +0 -13
- package/dist/types/src/pageComponent/hooks/useVModel.d.ts +0 -1
- package/dist/types/src/pageComponent/index.d.ts +0 -2
- package/dist/types/src/pageComponent/utils/base64.d.ts +0 -14
- package/dist/types/src/pageComponent/utils/index.d.ts +0 -3
- package/dist/types/src/pageComponent/utils/is.d.ts +0 -10
- package/dist/types/src/pageComponent/utils/transform.d.ts +0 -10
- package/dist/types/src/pageComponent/utils/tree.d.ts +0 -16
- package/dist/types/src/pageComponent/utils/validation.d.ts +0 -11
- package/dist/types/src/pageComponent/views/alarms/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/login.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/about.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/index.d.ts +0 -5
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.d.ts +0 -10
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.d.ts +0 -18
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.d.ts +0 -27
- package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/index.d.ts +0 -5
- package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.d.ts +0 -34
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.d.ts +0 -36
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.d.ts +0 -21
- package/dist/types/src/pageComponent/views/systemManager/logManager.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/depTree.d.ts +0 -10
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.d.ts +0 -19
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.d.ts +0 -42
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.d.ts +0 -40
- package/dist/types/src/pageComponent/views/systemManager/orgManager/empManager.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.d.ts +0 -35
- package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.d.ts +0 -35
- package/dist/types/src/pageComponent/views/systemManager/paramManager/collapseContainer.d.ts +0 -20
- package/dist/types/src/pageComponent/views/systemManager/paramManager/dynamicForm.d.ts +0 -11
- package/dist/types/src/pageComponent/views/systemManager/paramManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/paramManager/tabItem.d.ts +0 -11
- package/dist/types/src/pageComponent/views/systemManager/personalSetting.d.ts +0 -2
- package/dist/types/src/utils/className.d.ts +0 -2
- package/dist/types/src/utils/config.d.ts +0 -4
- package/dist/types/src/utils/getSlots.d.ts +0 -3
- package/dist/types/src/utils/index.d.ts +0 -10
- package/dist/types/src/utils/installComponent.d.ts +0 -3
- package/src/components/index.ts +0 -1
- package/src/gl.d.ts +0 -19
- package/src/ht/ht-widget.d.ts +0 -11327
- package/src/ht/ht.d.ts +0 -11410
- package/src/ht/index.d.ts +0 -4
- package/src/index.ts +0 -17
- package/src/pageComponent/api/auth/menuManager.ts +0 -44
- package/src/pageComponent/api/auth/roleManager.ts +0 -50
- package/src/pageComponent/api/auth/userManager.ts +0 -76
- package/src/pageComponent/api/axios.ts +0 -79
- package/src/pageComponent/api/index.ts +0 -25
- package/src/pageComponent/api/logManager.ts +0 -18
- package/src/pageComponent/api/org/depManager.ts +0 -98
- package/src/pageComponent/api/org/postManager.ts +0 -53
- package/src/pageComponent/api/org/teamManager.ts +0 -67
- package/src/pageComponent/api/param.ts +0 -36
- package/src/pageComponent/assets/img/code.png +0 -0
- package/src/pageComponent/assets/img/loginBackground.png +0 -0
- package/src/pageComponent/assets/img/logo.png +0 -0
- package/src/pageComponent/assets/img/mtInfo.png +0 -0
- package/src/pageComponent/assets/img/mtLogoBig.png +0 -0
- package/src/pageComponent/assets/img.d.ts +0 -1
- package/src/pageComponent/assets/logo.png +0 -0
- package/src/pageComponent/assets/styles/const.less +0 -1
- package/src/pageComponent/assets/styles/constant/antd.less +0 -1
- package/src/pageComponent/assets/styles/index.less +0 -15
- package/src/pageComponent/assets/styles/login.less +0 -56
- package/src/pageComponent/assets/styles/loginBox.less +0 -51
- package/src/pageComponent/assets/styles/reset.less +0 -146
- package/src/pageComponent/assets/styles/systemManager/about.less +0 -56
- package/src/pageComponent/assets/styles/systemManager/index.less +0 -89
- package/src/pageComponent/assets/styles/systemManager/menu-manager.less +0 -52
- package/src/pageComponent/assets/styles/systemManager/param-manager.less +0 -44
- package/src/pageComponent/assets/zh-cn.js +0 -134
- package/src/pageComponent/components/CommonTree.tsx +0 -362
- package/src/pageComponent/components/DynamicIcon.tsx +0 -27
- package/src/pageComponent/components/EditPasswordForm.tsx +0 -89
- package/src/pageComponent/components/IconSelect.tsx +0 -51
- package/src/pageComponent/components/Navbar.tsx +0 -96
- package/src/pageComponent/components/ProFormItem.tsx +0 -185
- package/src/pageComponent/components/SearchSelect.tsx +0 -127
- package/src/pageComponent/components/Sidebar.tsx +0 -123
- package/src/pageComponent/components/loginBox/README.md +0 -21
- package/src/pageComponent/components/loginBox/index.tsx +0 -174
- package/src/pageComponent/config/global.ts +0 -20
- package/src/pageComponent/config/htconfig.ts +0 -32
- package/src/pageComponent/config/install.ts +0 -10
- package/src/pageComponent/hooks/global.ts +0 -12
- package/src/pageComponent/hooks/manage-module/useModalForm.ts +0 -37
- package/src/pageComponent/hooks/manage-module/useModalTitle.ts +0 -31
- package/src/pageComponent/hooks/manage-module/useModalVisibleControl.ts +0 -31
- package/src/pageComponent/hooks/useBus.ts +0 -26
- package/src/pageComponent/hooks/useProxy.ts +0 -8
- package/src/pageComponent/hooks/useTableList.ts +0 -57
- package/src/pageComponent/hooks/useVModel.ts +0 -16
- package/src/pageComponent/index.ts +0 -3
- package/src/pageComponent/utils/base64.ts +0 -27
- package/src/pageComponent/utils/index.ts +0 -19
- package/src/pageComponent/utils/is.ts +0 -30
- package/src/pageComponent/utils/transform.ts +0 -27
- package/src/pageComponent/utils/tree.ts +0 -59
- package/src/pageComponent/utils/validation.ts +0 -14
- package/src/pageComponent/views/alarms/index.tsx +0 -7
- package/src/pageComponent/views/index.tsx +0 -20
- package/src/pageComponent/views/login.tsx +0 -66
- package/src/pageComponent/views/systemManager/about.tsx +0 -127
- package/src/pageComponent/views/systemManager/authManager/menuManager/index.tsx +0 -42
- package/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.tsx +0 -174
- package/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.tsx +0 -111
- package/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.tsx +0 -111
- package/src/pageComponent/views/systemManager/authManager/roleManager/index.tsx +0 -233
- package/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.tsx +0 -207
- package/src/pageComponent/views/systemManager/authManager/userManager/index.tsx +0 -255
- package/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.tsx +0 -294
- package/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.tsx +0 -102
- package/src/pageComponent/views/systemManager/logManager.tsx +0 -356
- package/src/pageComponent/views/systemManager/orgManager/depManager/depTree.tsx +0 -101
- package/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.tsx +0 -204
- package/src/pageComponent/views/systemManager/orgManager/depManager/index.tsx +0 -112
- package/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.tsx +0 -249
- package/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.tsx +0 -312
- package/src/pageComponent/views/systemManager/orgManager/empManager.tsx +0 -7
- package/src/pageComponent/views/systemManager/orgManager/postManager/index.tsx +0 -192
- package/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.tsx +0 -153
- package/src/pageComponent/views/systemManager/orgManager/teamManager/index.tsx +0 -191
- package/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.tsx +0 -250
- package/src/pageComponent/views/systemManager/paramManager/collapseContainer.tsx +0 -54
- package/src/pageComponent/views/systemManager/paramManager/dynamicForm.tsx +0 -85
- package/src/pageComponent/views/systemManager/paramManager/index.tsx +0 -47
- package/src/pageComponent/views/systemManager/paramManager/tabItem.tsx +0 -163
- package/src/pageComponent/views/systemManager/personalSetting.tsx +0 -206
- package/src/styles/index.less +0 -1
- package/src/utils/className.ts +0 -16
- package/src/utils/config.ts +0 -5
- package/src/utils/getSlots.ts +0 -18
- package/src/utils/index.ts +0 -7
- package/src/utils/installComponent.ts +0 -12
- package/tsconfig.json +0 -27
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Abstract: 公共树结构组件 菜单管理、部门管理
|
|
3
|
-
* @Author: wang liang
|
|
4
|
-
* @Date: 2022-04-07 14:42:40
|
|
5
|
-
* @LastEditors: wang liang
|
|
6
|
-
* @LastEditTime: 2022-04-25 15:10:09
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { defineComponent, onBeforeUnmount, onMounted, ref } from "vue";
|
|
10
|
-
import useProxy from "@/pageComponent/hooks/useProxy";
|
|
11
|
-
import useBus from "@/pageComponent/hooks/useBus";
|
|
12
|
-
import { debounce } from "lodash";
|
|
13
|
-
import { findById } from "@/pageComponent/utils/tree";
|
|
14
|
-
|
|
15
|
-
import { Tree, Input, Space, Button, Spin, Modal, Empty } from "ant-design-vue";
|
|
16
|
-
import {
|
|
17
|
-
SearchOutlined,
|
|
18
|
-
CloudUploadOutlined,
|
|
19
|
-
CloudDownloadOutlined,
|
|
20
|
-
CopyOutlined,
|
|
21
|
-
EditOutlined,
|
|
22
|
-
DeleteOutlined,
|
|
23
|
-
PlusCircleOutlined,
|
|
24
|
-
HolderOutlined,
|
|
25
|
-
} from "@ant-design/icons-vue";
|
|
26
|
-
|
|
27
|
-
const CommonTree = defineComponent({
|
|
28
|
-
props: {
|
|
29
|
-
downLoadName: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: "树结构数据.json",
|
|
32
|
-
},
|
|
33
|
-
getData: {
|
|
34
|
-
type: Function,
|
|
35
|
-
required: true,
|
|
36
|
-
},
|
|
37
|
-
onSelect: {
|
|
38
|
-
type: Function,
|
|
39
|
-
},
|
|
40
|
-
onCopy: {
|
|
41
|
-
type: Function,
|
|
42
|
-
},
|
|
43
|
-
onDelete: {
|
|
44
|
-
type: Function,
|
|
45
|
-
},
|
|
46
|
-
onEdit: {
|
|
47
|
-
type: Function,
|
|
48
|
-
},
|
|
49
|
-
onAdd: {
|
|
50
|
-
type: Function,
|
|
51
|
-
},
|
|
52
|
-
onDrop: {
|
|
53
|
-
type: Function,
|
|
54
|
-
},
|
|
55
|
-
isJSONOperation: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
setup(props) {
|
|
61
|
-
const proxy = useProxy();
|
|
62
|
-
const bus = useBus("system");
|
|
63
|
-
|
|
64
|
-
const searchText = ref("");
|
|
65
|
-
|
|
66
|
-
const treeData = ref([]);
|
|
67
|
-
const originData = ref([]);
|
|
68
|
-
|
|
69
|
-
const isLoading = ref(false);
|
|
70
|
-
|
|
71
|
-
// 获取数据
|
|
72
|
-
const getTreeData = debounce(async (callback?: () => void) => {
|
|
73
|
-
isLoading.value = true;
|
|
74
|
-
const data = await props.getData(searchText.value);
|
|
75
|
-
treeData.value = data;
|
|
76
|
-
originData.value = data;
|
|
77
|
-
isLoading.value = false;
|
|
78
|
-
// 默认选中第一个
|
|
79
|
-
if (!selectedKeys.value.length) {
|
|
80
|
-
selectedKeys.value[0] = data[0].id;
|
|
81
|
-
handleSelectNode([], { selected: true, node: data[0] });
|
|
82
|
-
}
|
|
83
|
-
callback?.();
|
|
84
|
-
}, 300);
|
|
85
|
-
getTreeData();
|
|
86
|
-
// 暴露刷新数据方法
|
|
87
|
-
proxy._refresh = getTreeData;
|
|
88
|
-
|
|
89
|
-
/* 当前选中的节点 */
|
|
90
|
-
const selectedKeys = ref<any[]>([]);
|
|
91
|
-
const handleSelectNode = (keys: any, { node, selected }: any) => {
|
|
92
|
-
if (!selected) {
|
|
93
|
-
props.onSelect?.(undefined);
|
|
94
|
-
} else {
|
|
95
|
-
props.onSelect?.(node);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
// 更新节点后重新选中节点 展示最新的信息
|
|
99
|
-
proxy._reselect = () => {
|
|
100
|
-
const node: any = findById(treeData.value, selectedKeys.value[0]);
|
|
101
|
-
// const res = getParent(treeData.value, node.id);
|
|
102
|
-
// console.log(res);
|
|
103
|
-
|
|
104
|
-
handleSelectNode([], { node, selected: true });
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/* ===== 节点操作 ===== */
|
|
108
|
-
// 下载JSON文件
|
|
109
|
-
const handleDownload = () => {
|
|
110
|
-
const str = JSON.stringify(originData.value, null, 2);
|
|
111
|
-
const blob = new Blob([str]);
|
|
112
|
-
const url = URL.createObjectURL(blob);
|
|
113
|
-
const aEl = document.createElement("a");
|
|
114
|
-
aEl.href = url;
|
|
115
|
-
aEl.download = props.downLoadName;
|
|
116
|
-
aEl.click();
|
|
117
|
-
};
|
|
118
|
-
// 复制节点
|
|
119
|
-
const handleCopy = (node: any) => {
|
|
120
|
-
Modal.confirm({
|
|
121
|
-
title: "复制菜单",
|
|
122
|
-
content: `确定复制菜单“${node.name}”?`,
|
|
123
|
-
async onOk() {
|
|
124
|
-
props.onCopy?.(node);
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
// 编辑节点
|
|
129
|
-
const handleEdit = (data: any) => {
|
|
130
|
-
props.onEdit?.(data);
|
|
131
|
-
};
|
|
132
|
-
// 添加节点
|
|
133
|
-
const handleAddNodeClick = (data: any) => {
|
|
134
|
-
props.onAdd?.(data);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// 删除节点
|
|
138
|
-
const handleDelete = (node: any) => {
|
|
139
|
-
Modal.confirm({
|
|
140
|
-
title: "删除菜单",
|
|
141
|
-
content: `确定删除菜单“${node.name}”?`,
|
|
142
|
-
async onOk() {
|
|
143
|
-
props.onDelete?.(node);
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/* ===== 拖拽操作 ===== */
|
|
149
|
-
const isDraggable = ref(false);
|
|
150
|
-
const handleDrop = (info: any) => {
|
|
151
|
-
const dropKey = info.node.id;
|
|
152
|
-
const dragKey = info.dragNode.id;
|
|
153
|
-
const dropPos = info.node.pos.split("-");
|
|
154
|
-
const dropPosition =
|
|
155
|
-
info.dropPosition - Number(dropPos[dropPos.length - 1]);
|
|
156
|
-
const loop = (data: any, id: string | number, callback: any) => {
|
|
157
|
-
data.forEach((item: any, index: number) => {
|
|
158
|
-
if (item.id === id) {
|
|
159
|
-
return callback(item, index, data);
|
|
160
|
-
}
|
|
161
|
-
if (item.subList) {
|
|
162
|
-
return loop(item.subList, id, callback);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
const data = [...treeData.value];
|
|
167
|
-
|
|
168
|
-
// Find dragObject
|
|
169
|
-
let dragObj: any;
|
|
170
|
-
loop(data, dragKey, (item: any, index: number, arr: any[]) => {
|
|
171
|
-
arr.splice(index, 1);
|
|
172
|
-
dragObj = item;
|
|
173
|
-
});
|
|
174
|
-
if (!info.dropToGap) {
|
|
175
|
-
// Drop on the content
|
|
176
|
-
loop(data, dropKey, (item: any) => {
|
|
177
|
-
item.subList = item.subList || [];
|
|
178
|
-
/// where to insert 示例添加到头部,可以是随意位置
|
|
179
|
-
item.subList.unshift(dragObj);
|
|
180
|
-
});
|
|
181
|
-
} else if (
|
|
182
|
-
(info.node.subList || []).length > 0 && // Has children
|
|
183
|
-
info.node.expanded && // Is expanded
|
|
184
|
-
dropPosition === 1 // On the bottom gap
|
|
185
|
-
) {
|
|
186
|
-
loop(data, dropKey, (item: any) => {
|
|
187
|
-
item.subList = item.subList || [];
|
|
188
|
-
// where to insert 示例添加到头部,可以是随意位置
|
|
189
|
-
item.subList.unshift(dragObj);
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
let ar: any[] = [];
|
|
193
|
-
let i = 0;
|
|
194
|
-
loop(data, dropKey, (_item: any, index: number, arr: any[]) => {
|
|
195
|
-
ar = arr;
|
|
196
|
-
i = index;
|
|
197
|
-
});
|
|
198
|
-
if (dropPosition === -1) {
|
|
199
|
-
ar.splice(i, 0, dragObj);
|
|
200
|
-
} else {
|
|
201
|
-
ar.splice(i + 1, 0, dragObj);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
// treeData.value = data;
|
|
205
|
-
|
|
206
|
-
/* ----- 转换数据 ----- */
|
|
207
|
-
|
|
208
|
-
// 递归设置sort字段
|
|
209
|
-
const setSort = (node: any, index: number) => {
|
|
210
|
-
node.sort = index + 1;
|
|
211
|
-
if (node.subList.length) {
|
|
212
|
-
node.subList.forEach((sub: any, ind: number) => {
|
|
213
|
-
setSort(sub, ind);
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
// 转换第一层数据
|
|
219
|
-
const res = data.map((item: any, index: number) => {
|
|
220
|
-
setSort(item, index);
|
|
221
|
-
item.id = parseInt(item.id.replace("sys", ""));
|
|
222
|
-
item.menuList = item.subList;
|
|
223
|
-
return item;
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// 发送排序请求 成功后重新查询数据
|
|
227
|
-
props.onDrop?.(res);
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/* ===== 更新树结构数据后刷新 ===== */
|
|
231
|
-
const handleRefresh = async () => {
|
|
232
|
-
await getTreeData(proxy._reselect);
|
|
233
|
-
};
|
|
234
|
-
onMounted(() => bus.on("tree/refresh", handleRefresh));
|
|
235
|
-
onBeforeUnmount(() => bus.off("tree/refresh", handleRefresh));
|
|
236
|
-
|
|
237
|
-
return () => (
|
|
238
|
-
<div class="common-tree">
|
|
239
|
-
{/* 搜索 */}
|
|
240
|
-
<Input
|
|
241
|
-
style={{ marginBottom: "16px" }}
|
|
242
|
-
placeholder="请输入内容"
|
|
243
|
-
allowClear
|
|
244
|
-
suffix={<SearchOutlined />}
|
|
245
|
-
v-model={[searchText.value, "value"]}
|
|
246
|
-
onChange={getTreeData}
|
|
247
|
-
/>
|
|
248
|
-
{/* 工具栏容器 */}
|
|
249
|
-
<div class="utils-container">
|
|
250
|
-
<Space>
|
|
251
|
-
{props.isJSONOperation && (
|
|
252
|
-
<>
|
|
253
|
-
<Button type="link">
|
|
254
|
-
<CloudUploadOutlined />
|
|
255
|
-
上传JSON文件
|
|
256
|
-
</Button>
|
|
257
|
-
<Button type="link" onClick={handleDownload}>
|
|
258
|
-
<CloudDownloadOutlined />
|
|
259
|
-
下载JSON文件
|
|
260
|
-
</Button>
|
|
261
|
-
</>
|
|
262
|
-
)}
|
|
263
|
-
</Space>
|
|
264
|
-
</div>
|
|
265
|
-
<div class="tree-container">
|
|
266
|
-
<Spin spinning={isLoading.value}>
|
|
267
|
-
{treeData.value.length > 0 ? (
|
|
268
|
-
<Tree
|
|
269
|
-
showLine={{ showLeafIcon: true }}
|
|
270
|
-
blockNode
|
|
271
|
-
draggable={isDraggable.value}
|
|
272
|
-
defaultExpandAll
|
|
273
|
-
fieldNames={{ children: "subList", key: "id", title: "name" }}
|
|
274
|
-
treeData={treeData.value}
|
|
275
|
-
v-model={[selectedKeys.value, "selectedKeys"]}
|
|
276
|
-
onSelect={handleSelectNode}
|
|
277
|
-
onDrop={handleDrop}
|
|
278
|
-
>
|
|
279
|
-
{{
|
|
280
|
-
title: ({ name, selected, isSystem, dataRef }: any) => {
|
|
281
|
-
return (
|
|
282
|
-
<span class="tree-node-title">
|
|
283
|
-
<span class="name">{name}</span>
|
|
284
|
-
{/* 当前选中的节点需要展示操作按钮 */}
|
|
285
|
-
{selected && isSystem && (
|
|
286
|
-
<span class="operation" style={{ float: "right" }}>
|
|
287
|
-
<PlusCircleOutlined
|
|
288
|
-
onClick={(e) => {
|
|
289
|
-
e.stopPropagation();
|
|
290
|
-
handleAddNodeClick(dataRef);
|
|
291
|
-
}}
|
|
292
|
-
/>
|
|
293
|
-
</span>
|
|
294
|
-
)}
|
|
295
|
-
{selected && !isSystem && (
|
|
296
|
-
<span class="operation" style={{ float: "right" }}>
|
|
297
|
-
<Space>
|
|
298
|
-
{/* 只能复制没有子菜单的菜单 */}
|
|
299
|
-
{!dataRef.subList.length &&
|
|
300
|
-
props.onCopy !== undefined && (
|
|
301
|
-
<CopyOutlined
|
|
302
|
-
onClick={(e) => {
|
|
303
|
-
e.stopPropagation();
|
|
304
|
-
handleCopy(dataRef);
|
|
305
|
-
}}
|
|
306
|
-
/>
|
|
307
|
-
)}
|
|
308
|
-
<EditOutlined
|
|
309
|
-
onClick={(e) => {
|
|
310
|
-
e.stopPropagation();
|
|
311
|
-
handleEdit(dataRef);
|
|
312
|
-
}}
|
|
313
|
-
/>
|
|
314
|
-
{/* 有子节点的节点不能删除 */}
|
|
315
|
-
{!dataRef.subList.length && (
|
|
316
|
-
<DeleteOutlined
|
|
317
|
-
onClick={(e) => {
|
|
318
|
-
e.stopPropagation();
|
|
319
|
-
handleDelete(dataRef);
|
|
320
|
-
}}
|
|
321
|
-
/>
|
|
322
|
-
)}
|
|
323
|
-
{dataRef.valid === 1 && (
|
|
324
|
-
<PlusCircleOutlined
|
|
325
|
-
onClick={(e) => {
|
|
326
|
-
e.stopPropagation();
|
|
327
|
-
handleAddNodeClick(dataRef);
|
|
328
|
-
}}
|
|
329
|
-
/>
|
|
330
|
-
)}
|
|
331
|
-
{!searchText.value && (
|
|
332
|
-
<HolderOutlined
|
|
333
|
-
onClick={(e) => {
|
|
334
|
-
e.stopPropagation();
|
|
335
|
-
}}
|
|
336
|
-
onMouseover={(e) => {
|
|
337
|
-
isDraggable.value = true;
|
|
338
|
-
}}
|
|
339
|
-
onMouseleave={() => {
|
|
340
|
-
isDraggable.value = false;
|
|
341
|
-
}}
|
|
342
|
-
/>
|
|
343
|
-
)}
|
|
344
|
-
</Space>
|
|
345
|
-
</span>
|
|
346
|
-
)}
|
|
347
|
-
</span>
|
|
348
|
-
);
|
|
349
|
-
},
|
|
350
|
-
}}
|
|
351
|
-
</Tree>
|
|
352
|
-
) : (
|
|
353
|
-
<Empty />
|
|
354
|
-
)}
|
|
355
|
-
</Spin>
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
);
|
|
359
|
-
},
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
export default CommonTree;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Abstract: 动态展示图表
|
|
3
|
-
* @Author: wang liang
|
|
4
|
-
* @Date: 2022-04-14 13:44:35
|
|
5
|
-
* @LastEditors: wang liang
|
|
6
|
-
* @LastEditTime: 2022-04-14 13:47:41
|
|
7
|
-
*/
|
|
8
|
-
import { defineComponent, createVNode } from 'vue';
|
|
9
|
-
import * as icons from '@ant-design/icons-vue';
|
|
10
|
-
|
|
11
|
-
const Dynamicicon = defineComponent({
|
|
12
|
-
props: {
|
|
13
|
-
icon: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: '',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
setup(props, { attrs }) {
|
|
19
|
-
return () => (
|
|
20
|
-
<span class='DynamicIcon'>
|
|
21
|
-
{props.icon ? createVNode((icons as any)[props.icon], attrs) : ''}
|
|
22
|
-
</span>
|
|
23
|
-
);
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export default Dynamicicon;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Abstract: 修改密码表单
|
|
3
|
-
* @Author: wang liang
|
|
4
|
-
* @Date: 2022-04-14 16:10:51
|
|
5
|
-
* @LastEditors: wang liang
|
|
6
|
-
* @LastEditTime: 2022-04-14 16:45:42
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { defineComponent, PropType, ref } from "vue";
|
|
10
|
-
import useVModel from "@/pageComponent/hooks/useVModel";
|
|
11
|
-
import useProxy from "@/pageComponent/hooks/useProxy";
|
|
12
|
-
|
|
13
|
-
import { Form, FormItem, InputPassword } from "ant-design-vue";
|
|
14
|
-
|
|
15
|
-
export interface IEditPasswordForm {
|
|
16
|
-
oldPassWord: string;
|
|
17
|
-
passWord: string;
|
|
18
|
-
checkPassWord: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const Editpasswordform = defineComponent({
|
|
22
|
-
emits: ["udpate:form"],
|
|
23
|
-
props: {
|
|
24
|
-
form: {
|
|
25
|
-
type: Object as PropType<IEditPasswordForm>,
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
setup(props, { emit }) {
|
|
30
|
-
const proxy = useProxy();
|
|
31
|
-
const formModel = useVModel(props, "form", emit);
|
|
32
|
-
|
|
33
|
-
const rules = {
|
|
34
|
-
passWord: {
|
|
35
|
-
async validator(rule: any, value: string) {
|
|
36
|
-
if (!value) throw new Error("请输入新密码");
|
|
37
|
-
if (!formModel.value.checkPassWord) return true;
|
|
38
|
-
if (value !== formModel.value.checkPassWord) {
|
|
39
|
-
throw new Error("新旧密码不一致");
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
checkPassWord: {
|
|
45
|
-
async validator(rule: any, value: string) {
|
|
46
|
-
if (!value) throw new Error("请确认密码");
|
|
47
|
-
if (!formModel.value.passWord) return true;
|
|
48
|
-
if (value !== formModel.value.passWord) {
|
|
49
|
-
throw new Error("新旧密码不一致");
|
|
50
|
-
}
|
|
51
|
-
return true;
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const formRef = ref();
|
|
57
|
-
|
|
58
|
-
proxy._validate = async () => {
|
|
59
|
-
console.log("验证");
|
|
60
|
-
|
|
61
|
-
await formRef.value.validate();
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
return () => (
|
|
65
|
-
<Form
|
|
66
|
-
ref={formRef}
|
|
67
|
-
labelCol={{ style: { width: "100px" } }}
|
|
68
|
-
model={formModel.value}
|
|
69
|
-
rules={rules}
|
|
70
|
-
>
|
|
71
|
-
<FormItem
|
|
72
|
-
name="oldPassWord"
|
|
73
|
-
rules={{ required: true, message: "请输入原密码" }}
|
|
74
|
-
label="原密码"
|
|
75
|
-
>
|
|
76
|
-
<InputPassword v-model={[formModel.value.oldPassWord, "value"]} />
|
|
77
|
-
</FormItem>
|
|
78
|
-
<FormItem name="passWord" label="新密码">
|
|
79
|
-
<InputPassword v-model={[formModel.value.passWord, "value"]} />
|
|
80
|
-
</FormItem>
|
|
81
|
-
<FormItem name="checkPassWord" label="确认新密码">
|
|
82
|
-
<InputPassword v-model={[formModel.value.checkPassWord, "value"]} />
|
|
83
|
-
</FormItem>
|
|
84
|
-
</Form>
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export default Editpasswordform;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Abstract: icon 选择器
|
|
3
|
-
* @Author: wang liang
|
|
4
|
-
* @Date: 2022-04-06 16:06:46
|
|
5
|
-
* @LastEditors: wang liang
|
|
6
|
-
* @LastEditTime: 2022-04-06 16:12:58
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { defineComponent } from "vue";
|
|
10
|
-
import useVModel from "@/pageComponent/hooks/useVModel";
|
|
11
|
-
|
|
12
|
-
import { Select, SelectOption } from "ant-design-vue";
|
|
13
|
-
import {
|
|
14
|
-
CiOutlined,
|
|
15
|
-
UpOutlined,
|
|
16
|
-
ApiOutlined,
|
|
17
|
-
EyeOutlined,
|
|
18
|
-
KeyOutlined,
|
|
19
|
-
} from "@ant-design/icons-vue";
|
|
20
|
-
|
|
21
|
-
const iconsList = [
|
|
22
|
-
{ name: "CiOutlined", icon: CiOutlined },
|
|
23
|
-
{ name: "UpOutlined", icon: UpOutlined },
|
|
24
|
-
{ name: "ApiOutlined", icon: ApiOutlined },
|
|
25
|
-
{ name: "EyeOutlined", icon: EyeOutlined },
|
|
26
|
-
{ name: "KeyOutlined", icon: KeyOutlined },
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
const IconSelect = defineComponent({
|
|
30
|
-
emits: ["update:value"],
|
|
31
|
-
props: {
|
|
32
|
-
value: {
|
|
33
|
-
type: [String, Number],
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
setup(props, { emit }) {
|
|
37
|
-
const selectValue = useVModel(props, "value", emit);
|
|
38
|
-
|
|
39
|
-
return () => (
|
|
40
|
-
<Select v-model={[selectValue.value, "value"]}>
|
|
41
|
-
{iconsList.map((item) => (
|
|
42
|
-
<SelectOption key={item.name}>
|
|
43
|
-
<item.icon />
|
|
44
|
-
</SelectOption>
|
|
45
|
-
))}
|
|
46
|
-
</Select>
|
|
47
|
-
);
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export default IconSelect;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineComponent,
|
|
3
|
-
reactive,
|
|
4
|
-
ref,
|
|
5
|
-
h,
|
|
6
|
-
resolveComponent,
|
|
7
|
-
watch,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import { Menu, MenuItem, SubMenu } from "ant-design-vue";
|
|
10
|
-
import { useRoute, useRouter } from "vue-router";
|
|
11
|
-
|
|
12
|
-
// props
|
|
13
|
-
const props = {
|
|
14
|
-
menu: {
|
|
15
|
-
type: Array,
|
|
16
|
-
default: [],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
interface SOLT {
|
|
21
|
-
icon?: Function;
|
|
22
|
-
title: Function;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface State {
|
|
26
|
-
selectedKeys: Array<string>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default defineComponent({
|
|
30
|
-
components: { Menu, MenuItem, SubMenu },
|
|
31
|
-
props,
|
|
32
|
-
setup(prop, context) {
|
|
33
|
-
const router = useRouter();
|
|
34
|
-
const route = useRoute();
|
|
35
|
-
|
|
36
|
-
const state: State = reactive({
|
|
37
|
-
selectedKeys: [],
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
watch(
|
|
41
|
-
route,
|
|
42
|
-
(nVal) => {
|
|
43
|
-
const urlList = nVal.path.split("/");
|
|
44
|
-
state.selectedKeys = [`/${urlList[1]}`];
|
|
45
|
-
},
|
|
46
|
-
{ deep: true, immediate: true }
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const toPath = (path: string) => {
|
|
50
|
-
router.push({
|
|
51
|
-
path,
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const getSlots = (title: string, icon?: any) => {
|
|
56
|
-
const obj: SOLT = {
|
|
57
|
-
title: () => title,
|
|
58
|
-
};
|
|
59
|
-
if (icon) {
|
|
60
|
-
obj.icon = () => h(resolveComponent(icon));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return obj;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const getMenuItem = (obj: any, fPath?: string) => {
|
|
67
|
-
return obj.map((item: any, index: string) => {
|
|
68
|
-
const { meta } = item;
|
|
69
|
-
let ele;
|
|
70
|
-
if (meta.hide !== true) {
|
|
71
|
-
ele = (
|
|
72
|
-
<MenuItem
|
|
73
|
-
key={item.path}
|
|
74
|
-
onClick={() => toPath((fPath ? `${fPath}/` : "") + item.path)}
|
|
75
|
-
v-slots={getSlots(meta.title, meta?.icon)}
|
|
76
|
-
>
|
|
77
|
-
{meta.title}
|
|
78
|
-
</MenuItem>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return ele;
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
return () => (
|
|
87
|
-
<Menu
|
|
88
|
-
class="topMenu"
|
|
89
|
-
mode="horizontal"
|
|
90
|
-
v-model={[state.selectedKeys, "selectedKeys"]}
|
|
91
|
-
>
|
|
92
|
-
{getMenuItem(prop.menu)}
|
|
93
|
-
</Menu>
|
|
94
|
-
);
|
|
95
|
-
},
|
|
96
|
-
});
|