@utogether/udp-core 1.0.1-beta.27 → 1.0.1-beta.30
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/build/plugins.ts +37 -37
- package/dist/{403-A9aD_bZN.js → 403-DdjDWbkf.js} +1 -1
- package/dist/{404-DREd70aQ.js → 404-D9vF2gFz.js} +1 -1
- package/dist/{500-C5qVXkGt.js → 500-mVaDmUjL.js} +1 -1
- package/dist/{AuthorityInfo-CYO2IVau.js → AuthorityInfo-DOUJ_Zrj.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-V7e_KwWp.js → AuthorityInfo.vue_vue_type_style_index_0_lang-B12sAzqt.js} +1 -1
- package/dist/{Company-CaottHQO.js → Company-DY__kM9F.js} +3 -3
- package/dist/{CompanyPanel-B3hOiXqj.js → CompanyPanel-C5N8QcMA.js} +1 -1
- package/dist/{Department-CHkuRvJN.js → Department-DsuDZdy5.js} +3 -3
- package/dist/{DepartmentPanel-DieWfIxW.js → DepartmentPanel-CdwI7Rzu.js} +2 -2
- package/dist/{DesignPanel-REWXp3x4.js → DesignPanel-B50-g0TL.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-Df0xc5XP.js → DesignPanel.vue_vue_type_style_index_0_lang-KV8JOZ6v.js} +2 -2
- package/dist/{DictView-DnpDHskG.js → DictView-Be2Z5Obk.js} +1 -1
- package/dist/{InvOrganization-DoIsDrAx.js → InvOrganization-Lui1q3Ou.js} +1 -1
- package/dist/{Org-C4P5Cwia.js → Org-qO5ExsPN.js} +1 -1
- package/dist/{Preview-d90pQdFJ.js → Preview-Dq4dfV2D.js} +1 -1
- package/dist/{ReportDefine-DNrp4lFP.js → ReportDefine-DH3FvbS1.js} +1 -1
- package/dist/{ReportDesign-Ch8x6_mW.js → ReportDesign-Bou01Jbr.js} +2 -2
- package/dist/{ReportQuery-C1yR0ULS.js → ReportQuery-BBkmPPSw.js} +1 -1
- package/dist/{ReportQueryFrom-BKwf61CL.js → ReportQueryFrom-BCY8lTJ7.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-D2ddteNz.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CpktcM8J.js} +1 -1
- package/dist/{ReportTemplate-HLHli4Cc.js → ReportTemplate-C_yJXxQ-.js} +1 -1
- package/dist/{Role-4GbuIhk6.js → Role-CTatYsrC.js} +3 -3
- package/dist/{RoleAssign-FGrSCg5R.js → RoleAssign-Cqt3CelK.js} +3 -3
- package/dist/{RolePanel-Ce1eKsM8.js → RolePanel-C3JMpNu8.js} +1 -1
- package/dist/{RolePanel-BcCozGfv.js → RolePanel-brKRJIhD.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BiOcU5GE.js → RolePanel.vue_vue_type_script_setup_true_lang-DD8u9pq8.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CqER1M9Y.js → RolePanel.vue_vue_type_script_setup_true_lang-i6Gq4r5B.js} +3 -3
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-BbgS5f79.js → ScrollPanel.vue_vue_type_style_index_0_lang-CiWKyjm3.js} +1 -1
- package/dist/{Staff-CBt_0rqg.js → Staff-Cd3twQ6Y.js} +3 -3
- package/dist/{StaffInfo-RCdWZr1r.js → StaffInfo-DJp0a0qd.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-Dm8Yin3r.js → StaffInfo.vue_vue_type_script_setup_true_lang-Dp2AhJ4I.js} +1 -1
- package/dist/{StaffPanel-2ka-H3IV.js → StaffPanel-B93hClzs.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-B0u-PqTe.js → StaffPanel.vue_vue_type_script_setup_true_lang-CXjUzq7n.js} +2 -2
- package/dist/{SysUser-Cs7uN3HU.js → SysUser-BvI6vaqI.js} +2 -2
- package/dist/{SysUserPanel-Df3qGMep.js → SysUserPanel-C9V8X-Ek.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-ClwozbZE.js → SysUserPanel.vue_vue_type_script_setup_true_lang-bMqTui07.js} +1 -1
- package/dist/{SystemMenu-BMYVQd-E.js → SystemMenu-D4WME5d0.js} +2 -2
- package/dist/{UserInfo-DDk2iOqY.js → UserInfo-D-AfdfJs.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CEccCnDi.js → UserInfo.vue_vue_type_style_index_0_lang-C-JQYIxe.js} +1 -1
- package/dist/{childView-C7u4Budn.js → childView--WMSo-wH.js} +1 -1
- package/dist/{childView-DFPGu0W-.js → childView-1MTl6Kaj.js} +1 -1
- package/dist/childView.vue_vue_type_style_index_0_lang-B8Losc4Y.js +170 -0
- package/dist/{childView.vue_vue_type_style_index_0_lang-B3fNaibG.js → childView.vue_vue_type_style_index_0_lang-BAVKNIXs.js} +1 -1
- package/dist/{code-rule-BcaRQ1zV.js → code-rule-D-RqrQB6.js} +40 -37
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-DJQLZCsO.js → cron-task-D-X-KFZm.js} +1 -1
- package/dist/{frameView-uPEaJRC7.js → frameView-MAW_-GHJ.js} +1 -1
- package/dist/{index-D7BXpJPu.js → index-Bc9vCX7z.js} +45 -45
- package/dist/{layoutView-zw1-fplL.js → layoutView-De2QIEr2.js} +3 -3
- package/dist/{login-M-rLGYIn.js → login-rdZ0GPYc.js} +1 -1
- package/dist/{lov-view-BVfIna0M.js → lov-view-Ao7LMspL.js} +2 -2
- package/dist/{menuInfo-BTqoNOuZ.js → menuInfo-DmOcK6An.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CHco0XcS.js → menuInfo.vue_vue_type_style_index_0_lang-Ln-zFWV7.js} +1 -1
- package/dist/{pda-app-BzzynCVk.js → pda-app-DY63mQ2T.js} +1 -1
- package/dist/{resource-CJQV7_75.js → resource-B21uV58T.js} +1 -1
- package/dist/{su-welcome-BxQYF4Ou.js → su-welcome-DgjzJeDF.js} +22 -19
- package/dist/{sys-config-DNFqTmvL.js → sys-config-DOtK2I32.js} +1 -1
- package/dist/udp-core.css +1 -1
- package/index.ts +49 -49
- package/package.json +3 -3
- package/src/components/SuScrollTree/ScrollPanel.vue +170 -170
- package/src/components/udp/content/index.vue +89 -0
- package/src/components/udp/form/form.vue +109 -109
- package/src/components/udp/grid/index.vue +524 -524
- package/src/components/udp/index.ts +2 -1
- package/src/components/udp/ut-stamp-badge/index.vue +272 -0
- package/src/components/udp/utils.ts +408 -408
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +94 -94
- package/src/layout/components/lay-tag/index.vue +596 -596
- package/src/layout/hooks/useTag.ts +227 -227
- package/src/main.ts +1 -1
- package/src/plugins/i18n/module/u-workflow.ts +71 -71
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/plugins/vxe-table/render.tsx +945 -945
- package/src/router/index.ts +187 -187
- package/src/router/modules/flow.ts +35 -35
- package/src/router/utils.ts +420 -420
- package/src/store/modules/multiTags.ts +110 -110
- package/src/store/modules/permission.ts +113 -113
- package/src/style/button.scss +85 -85
- package/src/style/vxetable.scss +348 -348
- package/src/views/organization/department/DepartmentPanel.vue +269 -269
- package/src/views/system/menu/SystemMenu.vue +185 -185
- package/src/views/system/menu/menuInfo.vue +384 -384
- package/src/views/system/sysUser/SysUserPanel.vue +348 -348
- package/src/views/udev/coderule/code-rule.vue +17 -5
- package/src/views/udev/dict/DictView.vue +118 -118
- package/src/views/udev/dict/childView.vue +69 -109
- package/src/views/udev/lov/childView.vue +174 -174
- package/src/views/uhome/components/menu-favorite.vue +1 -1
- package/src/views/upms/interface/log-in.vue +100 -100
- package/src/views/upms/user/login-log.vue +54 -54
- package/src/views/utask/flow-task.vue +18 -18
- package/dist/childView.vue_vue_type_style_index_0_lang-BUMcbqzM.js +0 -187
package/index.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: levi7754 levi7754@163.com
|
|
3
|
-
* @Date: 2024-04-14 19:10:28
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-11-10 09:23:24
|
|
6
|
-
* @FilePath: /udp-front/packages/udp-core/index.ts
|
|
7
|
-
* @Description:
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import UInit from './src/main';
|
|
11
|
-
export default UInit;
|
|
12
|
-
|
|
13
|
-
import { store } from './src/store';
|
|
14
|
-
import hasAuthority from './src/utils/authority';
|
|
15
|
-
|
|
16
|
-
import { useSystemStoreHook as useSystemStore } from './src/store/modules/system';
|
|
17
|
-
import { useMultiTagsStoreHook as useMultiTagsStore } from './src/store/modules/multiTags';
|
|
18
|
-
import { usePermissionStoreHook as usePermissionStore } from './src/store/modules/permission';
|
|
19
|
-
|
|
20
|
-
import { handleAliveRoute, delCurrentRoute, getProcessMenu } from './src/router/utils';
|
|
21
|
-
import { useLayout } from './src/layout/hooks/useLayout';
|
|
22
|
-
import { useDataThemeChange } from './src/layout/hooks/useDataThemeChange';
|
|
23
|
-
import { constantRoutes, remainingRouters, routerBefore } from './src/router';
|
|
24
|
-
|
|
25
|
-
import { getServiceApi } from './src/api';
|
|
26
|
-
import { initDict } from './src/api/user';
|
|
27
|
-
|
|
28
|
-
import { lifeCycleEvent, getPlatform, getBrower } from './src/utils';
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
store,
|
|
32
|
-
hasAuthority,
|
|
33
|
-
useSystemStore,
|
|
34
|
-
useMultiTagsStore,
|
|
35
|
-
usePermissionStore,
|
|
36
|
-
delCurrentRoute,
|
|
37
|
-
handleAliveRoute,
|
|
38
|
-
getServiceApi,
|
|
39
|
-
lifeCycleEvent,
|
|
40
|
-
routerBefore,
|
|
41
|
-
constantRoutes,
|
|
42
|
-
remainingRouters,
|
|
43
|
-
useDataThemeChange,
|
|
44
|
-
useLayout,
|
|
45
|
-
initDict,
|
|
46
|
-
getPlatform,
|
|
47
|
-
getBrower,
|
|
48
|
-
getProcessMenu
|
|
49
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2024-04-14 19:10:28
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-10 09:23:24
|
|
6
|
+
* @FilePath: /udp-front/packages/udp-core/index.ts
|
|
7
|
+
* @Description:
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import UInit from './src/main';
|
|
11
|
+
export default UInit;
|
|
12
|
+
|
|
13
|
+
import { store } from './src/store';
|
|
14
|
+
import hasAuthority from './src/utils/authority';
|
|
15
|
+
|
|
16
|
+
import { useSystemStoreHook as useSystemStore } from './src/store/modules/system';
|
|
17
|
+
import { useMultiTagsStoreHook as useMultiTagsStore } from './src/store/modules/multiTags';
|
|
18
|
+
import { usePermissionStoreHook as usePermissionStore } from './src/store/modules/permission';
|
|
19
|
+
|
|
20
|
+
import { handleAliveRoute, delCurrentRoute, getProcessMenu } from './src/router/utils';
|
|
21
|
+
import { useLayout } from './src/layout/hooks/useLayout';
|
|
22
|
+
import { useDataThemeChange } from './src/layout/hooks/useDataThemeChange';
|
|
23
|
+
import { constantRoutes, remainingRouters, routerBefore } from './src/router';
|
|
24
|
+
|
|
25
|
+
import { getServiceApi } from './src/api';
|
|
26
|
+
import { initDict } from './src/api/user';
|
|
27
|
+
|
|
28
|
+
import { lifeCycleEvent, getPlatform, getBrower } from './src/utils';
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
store,
|
|
32
|
+
hasAuthority,
|
|
33
|
+
useSystemStore,
|
|
34
|
+
useMultiTagsStore,
|
|
35
|
+
usePermissionStore,
|
|
36
|
+
delCurrentRoute,
|
|
37
|
+
handleAliveRoute,
|
|
38
|
+
getServiceApi,
|
|
39
|
+
lifeCycleEvent,
|
|
40
|
+
routerBefore,
|
|
41
|
+
constantRoutes,
|
|
42
|
+
remainingRouters,
|
|
43
|
+
useDataThemeChange,
|
|
44
|
+
useLayout,
|
|
45
|
+
initDict,
|
|
46
|
+
getPlatform,
|
|
47
|
+
getBrower,
|
|
48
|
+
getProcessMenu
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utogether/udp-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.1-beta.
|
|
4
|
+
"version": "1.0.1-beta.30",
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"main": "index.ts",
|
|
8
|
+
"main1": "dist/core.es.js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "vite",
|
|
11
11
|
"build": "vite build",
|
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="u-scroll-panel" @click.prevent="handleClickPanel">
|
|
3
|
-
<div class="u-panel-header">
|
|
4
|
-
<h2>{{ title }}</h2>
|
|
5
|
-
<ut-button v-if="showAllButton" content="BtnExpand" @click="handleExpand(data, true)" />
|
|
6
|
-
<ut-button v-if="showAllButton" status="warning" content="BtnCollapse" @click="handleExpand(data, false)" />
|
|
7
|
-
<vxe-button icon="vxe-icon-refresh" @click="onRefresh" />
|
|
8
|
-
</div>
|
|
9
|
-
<div class="u-panel-content system-scrollbar">
|
|
10
|
-
<el-tree
|
|
11
|
-
ref="tree"
|
|
12
|
-
:data="data"
|
|
13
|
-
:props="treeOtions"
|
|
14
|
-
:expand-on-click-node="false"
|
|
15
|
-
style="background-color: #fff"
|
|
16
|
-
class="u-tree-panel"
|
|
17
|
-
node-key="id"
|
|
18
|
-
highlight-current
|
|
19
|
-
@node-click="handleNodeClick"
|
|
20
|
-
>
|
|
21
|
-
<template #default="{ node }">
|
|
22
|
-
<span class="prefix" :class="{ 'is-leaf': node.isLeaf }">
|
|
23
|
-
<i class="ri-folder-2-fill ri-lg mr-1" style="color: #fadb14" />
|
|
24
|
-
</span>
|
|
25
|
-
<span>{{ node.label }}</span>
|
|
26
|
-
</template>
|
|
27
|
-
</el-tree>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script lang="ts" setup>
|
|
33
|
-
import { getServiceApi } from '../../api';
|
|
34
|
-
import type { Ref } from 'vue';
|
|
35
|
-
import { ref, inject, watch, nextTick } from 'vue';
|
|
36
|
-
|
|
37
|
-
interface IProps {
|
|
38
|
-
title: string;
|
|
39
|
-
url: string;
|
|
40
|
-
showAllButton?: boolean;
|
|
41
|
-
treeOtions: Object;
|
|
42
|
-
defaultParams?: Object;
|
|
43
|
-
}
|
|
44
|
-
const props = withDefaults(defineProps<IProps>(), {
|
|
45
|
-
treeOtions: () => {
|
|
46
|
-
return {
|
|
47
|
-
children: 'children',
|
|
48
|
-
label: 'label'
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
defaultParams: () => {
|
|
52
|
-
return {};
|
|
53
|
-
},
|
|
54
|
-
showAllButton: false
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const data = ref<any>([]);
|
|
58
|
-
const tree: Ref<any | null> = ref(null);
|
|
59
|
-
// 当前激活item
|
|
60
|
-
const active: IRecord = inject('active');
|
|
61
|
-
// tree面板变更
|
|
62
|
-
const scrollPanelChange: IRecord = inject('scrollPanelChange');
|
|
63
|
-
// tree 列表
|
|
64
|
-
const treeList: IRecord = inject('treeList');
|
|
65
|
-
|
|
66
|
-
watch(
|
|
67
|
-
() => scrollPanelChange.value,
|
|
68
|
-
() => {
|
|
69
|
-
scrollPanelChange.value && getDataList();
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const getDataList = async (params = {}) => {
|
|
74
|
-
const query = Object.assign(params, props.defaultParams);
|
|
75
|
-
const serverData = (await getServiceApi().get(props.url, query)) as IResponseData;
|
|
76
|
-
data.value = serverData.list || serverData;
|
|
77
|
-
treeList.value = serverData.list || serverData;
|
|
78
|
-
active.value = serverData.list ? serverData.list[0] : serverData[0];
|
|
79
|
-
nextTick(() => {
|
|
80
|
-
tree.value && tree?.value.setCurrentKey(active.value?.id || '');
|
|
81
|
-
});
|
|
82
|
-
scrollPanelChange.value = false;
|
|
83
|
-
};
|
|
84
|
-
const handleNodeClick = (row: any) => {
|
|
85
|
-
active.value = row;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const handleClickPanel = () => {
|
|
89
|
-
active.value = {};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const handleExpand = (array, expanded) => {
|
|
93
|
-
array.forEach(el => {
|
|
94
|
-
tree.value.store.nodesMap[el.id].expanded = expanded;
|
|
95
|
-
if (el.children?.length) {
|
|
96
|
-
handleExpand(el.children, expanded);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
console.log('[ tree.value ] >', tree.value);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const onRefresh = () => {
|
|
103
|
-
getDataList();
|
|
104
|
-
};
|
|
105
|
-
defineExpose({
|
|
106
|
-
onRefresh
|
|
107
|
-
});
|
|
108
|
-
getDataList();
|
|
109
|
-
</script>
|
|
110
|
-
|
|
111
|
-
<style lang="scss">
|
|
112
|
-
.u-scroll-panel {
|
|
113
|
-
display: flex;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
width: 100%;
|
|
116
|
-
height: 100%;
|
|
117
|
-
background: #fff;
|
|
118
|
-
|
|
119
|
-
.u-panel-header {
|
|
120
|
-
display: flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
padding: 10px;
|
|
123
|
-
border-bottom: 1px solid #eee;
|
|
124
|
-
|
|
125
|
-
h2 {
|
|
126
|
-
// display: box;
|
|
127
|
-
height: 30px;
|
|
128
|
-
padding: 0;
|
|
129
|
-
margin: 0;
|
|
130
|
-
margin-right: 20px;
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
-webkit-line-clamp: 1;
|
|
133
|
-
font-size: 14px;
|
|
134
|
-
line-height: 30px;
|
|
135
|
-
-webkit-box-orient: vertical;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.el-input {
|
|
139
|
-
flex: 1;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.u-panel-content {
|
|
144
|
-
flex: 1;
|
|
145
|
-
overflow: auto;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.u-tree-panel {
|
|
149
|
-
height: 100%; // 0630
|
|
150
|
-
:deep(.el-tree-node__content) {
|
|
151
|
-
height: 36px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:deep(.el-tree-node.is-current > .el-tree-node__content) {
|
|
155
|
-
background-color: rgb(64 158 255 / 40%);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:deep(.el-tree-node > .el-tree-node__content) {
|
|
159
|
-
transition: 0.2s;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.el-vl__window {
|
|
164
|
-
height: 360px !important;
|
|
165
|
-
// &:first-child {
|
|
166
|
-
// height: 100% !important;
|
|
167
|
-
// }
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="u-scroll-panel" @click.prevent="handleClickPanel">
|
|
3
|
+
<div class="u-panel-header">
|
|
4
|
+
<h2>{{ title }}</h2>
|
|
5
|
+
<ut-button v-if="showAllButton" content="BtnExpand" @click="handleExpand(data, true)" />
|
|
6
|
+
<ut-button v-if="showAllButton" status="warning" content="BtnCollapse" @click="handleExpand(data, false)" />
|
|
7
|
+
<vxe-button icon="vxe-icon-refresh" @click="onRefresh" />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="u-panel-content system-scrollbar">
|
|
10
|
+
<el-tree
|
|
11
|
+
ref="tree"
|
|
12
|
+
:data="data"
|
|
13
|
+
:props="treeOtions"
|
|
14
|
+
:expand-on-click-node="false"
|
|
15
|
+
style="background-color: #fff"
|
|
16
|
+
class="u-tree-panel"
|
|
17
|
+
node-key="id"
|
|
18
|
+
highlight-current
|
|
19
|
+
@node-click="handleNodeClick"
|
|
20
|
+
>
|
|
21
|
+
<template #default="{ node }">
|
|
22
|
+
<span class="prefix" :class="{ 'is-leaf': node.isLeaf }">
|
|
23
|
+
<i class="ri-folder-2-fill ri-lg mr-1" style="color: #fadb14" />
|
|
24
|
+
</span>
|
|
25
|
+
<span>{{ node.label }}</span>
|
|
26
|
+
</template>
|
|
27
|
+
</el-tree>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { getServiceApi } from '../../api';
|
|
34
|
+
import type { Ref } from 'vue';
|
|
35
|
+
import { ref, inject, watch, nextTick } from 'vue';
|
|
36
|
+
|
|
37
|
+
interface IProps {
|
|
38
|
+
title: string;
|
|
39
|
+
url: string;
|
|
40
|
+
showAllButton?: boolean;
|
|
41
|
+
treeOtions: Object;
|
|
42
|
+
defaultParams?: Object;
|
|
43
|
+
}
|
|
44
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
45
|
+
treeOtions: () => {
|
|
46
|
+
return {
|
|
47
|
+
children: 'children',
|
|
48
|
+
label: 'label'
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
defaultParams: () => {
|
|
52
|
+
return {};
|
|
53
|
+
},
|
|
54
|
+
showAllButton: false
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const data = ref<any>([]);
|
|
58
|
+
const tree: Ref<any | null> = ref(null);
|
|
59
|
+
// 当前激活item
|
|
60
|
+
const active: IRecord = inject('active');
|
|
61
|
+
// tree面板变更
|
|
62
|
+
const scrollPanelChange: IRecord = inject('scrollPanelChange');
|
|
63
|
+
// tree 列表
|
|
64
|
+
const treeList: IRecord = inject('treeList');
|
|
65
|
+
|
|
66
|
+
watch(
|
|
67
|
+
() => scrollPanelChange.value,
|
|
68
|
+
() => {
|
|
69
|
+
scrollPanelChange.value && getDataList();
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const getDataList = async (params = {}) => {
|
|
74
|
+
const query = Object.assign(params, props.defaultParams);
|
|
75
|
+
const serverData = (await getServiceApi().get(props.url, query)) as IResponseData;
|
|
76
|
+
data.value = serverData.list || serverData;
|
|
77
|
+
treeList.value = serverData.list || serverData;
|
|
78
|
+
active.value = serverData.list ? serverData.list[0] : serverData[0];
|
|
79
|
+
nextTick(() => {
|
|
80
|
+
tree.value && tree?.value.setCurrentKey(active.value?.id || '');
|
|
81
|
+
});
|
|
82
|
+
scrollPanelChange.value = false;
|
|
83
|
+
};
|
|
84
|
+
const handleNodeClick = (row: any) => {
|
|
85
|
+
active.value = row;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleClickPanel = () => {
|
|
89
|
+
active.value = {};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const handleExpand = (array, expanded) => {
|
|
93
|
+
array.forEach(el => {
|
|
94
|
+
tree.value.store.nodesMap[el.id].expanded = expanded;
|
|
95
|
+
if (el.children?.length) {
|
|
96
|
+
handleExpand(el.children, expanded);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
console.log('[ tree.value ] >', tree.value);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const onRefresh = () => {
|
|
103
|
+
getDataList();
|
|
104
|
+
};
|
|
105
|
+
defineExpose({
|
|
106
|
+
onRefresh
|
|
107
|
+
});
|
|
108
|
+
getDataList();
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="scss">
|
|
112
|
+
.u-scroll-panel {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
background: #fff;
|
|
118
|
+
|
|
119
|
+
.u-panel-header {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
padding: 10px;
|
|
123
|
+
border-bottom: 1px solid #eee;
|
|
124
|
+
|
|
125
|
+
h2 {
|
|
126
|
+
// display: box;
|
|
127
|
+
height: 30px;
|
|
128
|
+
padding: 0;
|
|
129
|
+
margin: 0;
|
|
130
|
+
margin-right: 20px;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
-webkit-line-clamp: 1;
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
line-height: 30px;
|
|
135
|
+
-webkit-box-orient: vertical;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.el-input {
|
|
139
|
+
flex: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.u-panel-content {
|
|
144
|
+
flex: 1;
|
|
145
|
+
overflow: auto;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.u-tree-panel {
|
|
149
|
+
height: 100%; // 0630
|
|
150
|
+
:deep(.el-tree-node__content) {
|
|
151
|
+
height: 36px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:deep(.el-tree-node.is-current > .el-tree-node__content) {
|
|
155
|
+
background-color: rgb(64 158 255 / 40%);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:deep(.el-tree-node > .el-tree-node__content) {
|
|
159
|
+
transition: 0.2s;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.el-vl__window {
|
|
164
|
+
height: 360px !important;
|
|
165
|
+
// &:first-child {
|
|
166
|
+
// height: 100% !important;
|
|
167
|
+
// }
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-03-09 10:31:45
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-20 10:30:15
|
|
6
|
+
* @Description: 详情统一容器
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div class="ut-content">
|
|
10
|
+
<StampBadge :color="stampOptions.color || 'success'" :content="stampOptions.content" :code="stampOptions.code" />
|
|
11
|
+
<div v-if="showTop && showContentop" class="ut-content-top" :class="title ? 'justify-between' : 'justify-end'">
|
|
12
|
+
<span v-if="title" class="font-black">{{ title }}</span>
|
|
13
|
+
<div class="ut-right-panel">
|
|
14
|
+
<slot name="header" />
|
|
15
|
+
<ut-button
|
|
16
|
+
v-if="showClose"
|
|
17
|
+
status="info"
|
|
18
|
+
:icon="$attrs.icon || 'ri-reply-line'"
|
|
19
|
+
:content="$attrs.content || 'goback'"
|
|
20
|
+
@tap="handleClose()"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="ut-content-body">
|
|
25
|
+
<slot name="body" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { ref } from 'vue';
|
|
32
|
+
import StampBadge from '../ut-stamp-badge/index.vue';
|
|
33
|
+
defineOptions({ name: 'UtContent' });
|
|
34
|
+
|
|
35
|
+
interface Props {
|
|
36
|
+
title?: string;
|
|
37
|
+
showTop?: boolean;
|
|
38
|
+
showClose?: boolean;
|
|
39
|
+
stampOptions?: IRecord;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
withDefaults(defineProps<Props>(), {
|
|
43
|
+
title: '',
|
|
44
|
+
showTop: true,
|
|
45
|
+
showClose: true
|
|
46
|
+
});
|
|
47
|
+
const showContentop = ref(window.top === window.self);
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
50
|
+
|
|
51
|
+
const handleClose = () => {
|
|
52
|
+
emit('close');
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.ut-content {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
padding: 0 8px;
|
|
63
|
+
background-color: #f7f7f7;
|
|
64
|
+
|
|
65
|
+
position: relative;
|
|
66
|
+
|
|
67
|
+
&-top {
|
|
68
|
+
position: sticky;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
z-index: 10;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
height: 36px;
|
|
75
|
+
padding: 2px 12px;
|
|
76
|
+
background-color: #fff;
|
|
77
|
+
border: 1px solid #e0ebf6;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-body {
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
margin: 5px 0;
|
|
84
|
+
background-color: #fff;
|
|
85
|
+
border: 1px solid #e0ebf6;
|
|
86
|
+
border-radius: 5px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|