yh-pub 1.0.0 → 1.0.2
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 +19 -19
- package/layout/admin/adminIndex.vue +104 -104
- package/layout/admin/api/loginApi.js +24 -24
- package/layout/admin/api/routers.js +93 -93
- package/layout/admin/api/tenantApi.js +123 -123
- package/layout/admin/home/homeIndex.vue +25 -25
- package/layout/admin/login/login.vue +161 -161
- package/layout/admin/menu/MenuIndex.vue +648 -648
- package/layout/admin/menu/icon.vue +108 -108
- package/layout/admin/menu/iconList.js +934 -934
- package/layout/admin/saTenant/saTenant.vue +173 -173
- package/layout/admin/saTenant/saTenantForm.js +80 -80
- package/layout/admin/saTenant/saTenantForm.vue +61 -61
- package/layout/admin/saTenant/saTenantRoleManage.js +417 -417
- package/layout/admin/saTenant/saTenantRoleManage.vue +99 -99
- package/layout/admin/user/saUser.less +6 -6
- package/layout/admin/user/saUser.vue +72 -72
- package/layout/main/components/console/console.vue +205 -205
- package/layout/main/components/error-store/error-store.vue +72 -72
- package/layout/main/components/error-store/index.js +2 -2
- package/layout/main/components/fullscreen/fullscreen.vue +57 -57
- package/layout/main/components/fullscreen/index.js +2 -2
- package/layout/main/components/language/language.vue +71 -71
- package/layout/main/components/side-menu/side-menu.less +73 -73
- package/layout/main/components/side-menu/side-menu.vue +75 -75
- package/layout/main/components/tags-nav/tags-nav.less +44 -44
- package/layout/main/components/tags-nav/tags-nav.vue +144 -144
- package/layout/main/components/user/user.less +12 -12
- package/layout/main/components/user/user.vue +185 -185
- package/layout/main/home/home.vue +480 -480
- package/layout/main/home/index.js +2 -2
- package/layout/main/home/toDoList.vue +32 -32
- package/layout/main/login/login.less +93 -93
- package/layout/main/login/login.vue +151 -151
- package/layout/main/main.less +81 -81
- package/layout/main/main.vue +254 -202
- package/layout/main/system/dict.vue +64 -64
- package/layout/main/system/orgManage.vue +473 -473
- package/layout/main/system/roleManage.js +807 -755
- package/layout/main/system/roleManage.vue +424 -399
- package/package.json +11 -11
- package/view/basic/error-logger.vue +74 -74
- package/view/basic/error-page/401.vue +22 -22
- package/view/basic/error-page/404.vue +22 -22
- package/view/basic/error-page/500.vue +22 -22
- package/view/basic/error-page/back-btn-group.vue +48 -48
- package/view/basic/error-page/error-content.vue +28 -28
- package/view/basic/error-page/error.less +46 -46
- package/view/config/component/confFormItem.vue +49 -49
- package/view/config/config.scss +45 -45
- package/view/config/configIndex.vue +150 -150
- package/view/config/subPage/router-config.vue +4 -4
- package/view/config/subPage/sys-config.vue +249 -249
- package/view/window/IframeFReportView.vue +27 -27
- package/view/window/windowIndex.vue +22 -22
package/view/config/config.scss
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
.config-container {
|
|
2
|
-
padding: 16px 8px 8px 0;
|
|
3
|
-
display: flex;
|
|
4
|
-
height: 100%;
|
|
5
|
-
.config-navitor {
|
|
6
|
-
.el-tabs {
|
|
7
|
-
height: 100%;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
.config-context {
|
|
11
|
-
flex: 1;
|
|
12
|
-
.project-info {
|
|
13
|
-
display: flex;
|
|
14
|
-
padding: 0 0 16px 0;
|
|
15
|
-
> * + * {
|
|
16
|
-
margin-left: 10px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.config-upload {
|
|
20
|
-
width: 100%;
|
|
21
|
-
.el-upload-dragger {
|
|
22
|
-
height: 32px;
|
|
23
|
-
padding: 0;
|
|
24
|
-
}
|
|
25
|
-
.el-upload__text {
|
|
26
|
-
color: var(--el-text-color-secondary);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.can-use-config {
|
|
32
|
-
height: 100%;
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
align-items: center;
|
|
37
|
-
h3 {
|
|
38
|
-
font-size: 1.1em;
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
color: var(--el-text-color-secondary);
|
|
41
|
-
}
|
|
42
|
-
ul {
|
|
43
|
-
padding-left: 1em;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
.config-container {
|
|
2
|
+
padding: 16px 8px 8px 0;
|
|
3
|
+
display: flex;
|
|
4
|
+
height: 100%;
|
|
5
|
+
.config-navitor {
|
|
6
|
+
.el-tabs {
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.config-context {
|
|
11
|
+
flex: 1;
|
|
12
|
+
.project-info {
|
|
13
|
+
display: flex;
|
|
14
|
+
padding: 0 0 16px 0;
|
|
15
|
+
> * + * {
|
|
16
|
+
margin-left: 10px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.config-upload {
|
|
20
|
+
width: 100%;
|
|
21
|
+
.el-upload-dragger {
|
|
22
|
+
height: 32px;
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
.el-upload__text {
|
|
26
|
+
color: var(--el-text-color-secondary);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.can-use-config {
|
|
32
|
+
height: 100%;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
h3 {
|
|
38
|
+
font-size: 1.1em;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
color: var(--el-text-color-secondary);
|
|
41
|
+
}
|
|
42
|
+
ul {
|
|
43
|
+
padding-left: 1em;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section
|
|
3
|
-
class="config-container"
|
|
4
|
-
v-if="hasFSA">
|
|
5
|
-
<aside class="config-navitor">
|
|
6
|
-
<el-tabs
|
|
7
|
-
tab-position="left"
|
|
8
|
-
v-model="configType">
|
|
9
|
-
<el-tab-pane
|
|
10
|
-
name="sysConfig"
|
|
11
|
-
label="系统配置"></el-tab-pane>
|
|
12
|
-
<el-tab-pane
|
|
13
|
-
name="routerConfig"
|
|
14
|
-
label="路由配置"></el-tab-pane>
|
|
15
|
-
</el-tabs>
|
|
16
|
-
</aside>
|
|
17
|
-
<main class="config-context">
|
|
18
|
-
<section class="project-info">
|
|
19
|
-
<template v-if="projectDirHandle">
|
|
20
|
-
当前目录:
|
|
21
|
-
<el-tag>{{ projectDirHandle.name }}</el-tag>
|
|
22
|
-
</template>
|
|
23
|
-
<template v-else>
|
|
24
|
-
<el-alert
|
|
25
|
-
title="请先选择目录!"
|
|
26
|
-
description="本工具,基于您选择的Vue3项目目录,请选择目录后使用"
|
|
27
|
-
type="warning"
|
|
28
|
-
:closable="false" />
|
|
29
|
-
<el-button @click="chooseDirHandler">选择目录</el-button>
|
|
30
|
-
</template>
|
|
31
|
-
</section>
|
|
32
|
-
<keep-alive v-if="projectDirHandle">
|
|
33
|
-
<component
|
|
34
|
-
:is="configType"
|
|
35
|
-
:dir-handle="projectDirHandle"
|
|
36
|
-
:routers="routers"></component>
|
|
37
|
-
</keep-alive>
|
|
38
|
-
</main>
|
|
39
|
-
</section>
|
|
40
|
-
<section
|
|
41
|
-
class="can-use-config"
|
|
42
|
-
v-else>
|
|
43
|
-
<div>
|
|
44
|
-
<h3>可视化配置功能使用了浏览器的文件AIP,对浏览器版本有要求</h3>
|
|
45
|
-
<h3>您的浏览器无法支持本功能,请升级</h3>
|
|
46
|
-
<ul>
|
|
47
|
-
<li>Chrome 108+</li>
|
|
48
|
-
<li>Edge 108+</li>
|
|
49
|
-
<li>相同内核符合版本的浏览器</li>
|
|
50
|
-
</ul>
|
|
51
|
-
</div>
|
|
52
|
-
</section>
|
|
53
|
-
</template>
|
|
54
|
-
<script>
|
|
55
|
-
import sysConfig from "./subPage/sys-config.vue";
|
|
56
|
-
import routerConfig from "./subPage/router-config.vue";
|
|
57
|
-
|
|
58
|
-
import $ from "gogocode";
|
|
59
|
-
import { hasFileSystemAccess, chooseDirectory, getChildFile } from "yh-fsa";
|
|
60
|
-
import { defineComponent } from "vue";
|
|
61
|
-
|
|
62
|
-
export default defineComponent({
|
|
63
|
-
components: {
|
|
64
|
-
sysConfig,
|
|
65
|
-
routerConfig,
|
|
66
|
-
},
|
|
67
|
-
watch: {
|
|
68
|
-
projectDirHandle: {
|
|
69
|
-
async handler(val) {
|
|
70
|
-
if (val !== null) {
|
|
71
|
-
this.getPackageJSON();
|
|
72
|
-
this.getRouters();
|
|
73
|
-
} else {
|
|
74
|
-
this.projectPackageJSON = null;
|
|
75
|
-
this.routers = [];
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
deep: true,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
data() {
|
|
82
|
-
let hasFSA = hasFileSystemAccess();
|
|
83
|
-
return {
|
|
84
|
-
configType: "sysConfig",
|
|
85
|
-
hasFSA,
|
|
86
|
-
projectDirHandle: null,
|
|
87
|
-
projectPackageJSON: null,
|
|
88
|
-
routers: [],
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
created() {},
|
|
92
|
-
methods: {
|
|
93
|
-
async chooseDirHandler() {
|
|
94
|
-
this.projectDirHandle = await chooseDirectory({
|
|
95
|
-
id: "configDirChoose",
|
|
96
|
-
mode: "readwrite",
|
|
97
|
-
startIn: "desktop",
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
async getPackageJSON() {
|
|
101
|
-
let packageJSONText = await getChildFile("package.json", this.projectDirHandle);
|
|
102
|
-
if (packageJSONText) {
|
|
103
|
-
this.projectPackageJSON = JSON.parse(packageJSONText);
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
async getRouters() {
|
|
107
|
-
let routerMap = new Map();
|
|
108
|
-
const disposeRouter = (item, parentPath = "") => {
|
|
109
|
-
if ("children" in item) {
|
|
110
|
-
item.children.forEach((jItem) => {
|
|
111
|
-
disposeRouter(jItem, item.path);
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
let { path, name, meta } = item;
|
|
115
|
-
path = parentPath ? `${parentPath}${path && parentPath !== "/" ? "/" : ""}${path}` : path;
|
|
116
|
-
if (!["/401", "/conifg", "/500", "/:pathMatch(.*)*"].includes(path)) {
|
|
117
|
-
routerMap.set(path, {
|
|
118
|
-
path,
|
|
119
|
-
name,
|
|
120
|
-
meta,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
let pubRoutersText = await getChildFile("pub/router/routers.js", this.projectDirHandle);
|
|
126
|
-
if (pubRoutersText) {
|
|
127
|
-
let pubAST = $(pubRoutersText);
|
|
128
|
-
pubAST.find("export const $_$1 = $_$2").each((node, index) => {
|
|
129
|
-
eval(node[0].match[2][0].value).forEach((item) => {
|
|
130
|
-
disposeRouter(item);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
let customRoutersText = await getChildFile("src/router/routers.js", this.projectDirHandle);
|
|
135
|
-
if (customRoutersText) {
|
|
136
|
-
let customAST = $(customRoutersText);
|
|
137
|
-
customAST.find("export const $_$1 = $_$2").each((node, index) => {
|
|
138
|
-
eval(node[0].match[2][0].value).forEach((item) => {
|
|
139
|
-
disposeRouter(item);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
this.routers = [...routerMap.values()];
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
</script>
|
|
148
|
-
<style lang="scss">
|
|
149
|
-
@import "config.scss";
|
|
150
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="config-container"
|
|
4
|
+
v-if="hasFSA">
|
|
5
|
+
<aside class="config-navitor">
|
|
6
|
+
<el-tabs
|
|
7
|
+
tab-position="left"
|
|
8
|
+
v-model="configType">
|
|
9
|
+
<el-tab-pane
|
|
10
|
+
name="sysConfig"
|
|
11
|
+
label="系统配置"></el-tab-pane>
|
|
12
|
+
<el-tab-pane
|
|
13
|
+
name="routerConfig"
|
|
14
|
+
label="路由配置"></el-tab-pane>
|
|
15
|
+
</el-tabs>
|
|
16
|
+
</aside>
|
|
17
|
+
<main class="config-context">
|
|
18
|
+
<section class="project-info">
|
|
19
|
+
<template v-if="projectDirHandle">
|
|
20
|
+
当前目录:
|
|
21
|
+
<el-tag>{{ projectDirHandle.name }}</el-tag>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-else>
|
|
24
|
+
<el-alert
|
|
25
|
+
title="请先选择目录!"
|
|
26
|
+
description="本工具,基于您选择的Vue3项目目录,请选择目录后使用"
|
|
27
|
+
type="warning"
|
|
28
|
+
:closable="false" />
|
|
29
|
+
<el-button @click="chooseDirHandler">选择目录</el-button>
|
|
30
|
+
</template>
|
|
31
|
+
</section>
|
|
32
|
+
<keep-alive v-if="projectDirHandle">
|
|
33
|
+
<component
|
|
34
|
+
:is="configType"
|
|
35
|
+
:dir-handle="projectDirHandle"
|
|
36
|
+
:routers="routers"></component>
|
|
37
|
+
</keep-alive>
|
|
38
|
+
</main>
|
|
39
|
+
</section>
|
|
40
|
+
<section
|
|
41
|
+
class="can-use-config"
|
|
42
|
+
v-else>
|
|
43
|
+
<div>
|
|
44
|
+
<h3>可视化配置功能使用了浏览器的文件AIP,对浏览器版本有要求</h3>
|
|
45
|
+
<h3>您的浏览器无法支持本功能,请升级</h3>
|
|
46
|
+
<ul>
|
|
47
|
+
<li>Chrome 108+</li>
|
|
48
|
+
<li>Edge 108+</li>
|
|
49
|
+
<li>相同内核符合版本的浏览器</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
</template>
|
|
54
|
+
<script>
|
|
55
|
+
import sysConfig from "./subPage/sys-config.vue";
|
|
56
|
+
import routerConfig from "./subPage/router-config.vue";
|
|
57
|
+
|
|
58
|
+
import $ from "gogocode";
|
|
59
|
+
import { hasFileSystemAccess, chooseDirectory, getChildFile } from "yh-fsa";
|
|
60
|
+
import { defineComponent } from "vue";
|
|
61
|
+
|
|
62
|
+
export default defineComponent({
|
|
63
|
+
components: {
|
|
64
|
+
sysConfig,
|
|
65
|
+
routerConfig,
|
|
66
|
+
},
|
|
67
|
+
watch: {
|
|
68
|
+
projectDirHandle: {
|
|
69
|
+
async handler(val) {
|
|
70
|
+
if (val !== null) {
|
|
71
|
+
this.getPackageJSON();
|
|
72
|
+
this.getRouters();
|
|
73
|
+
} else {
|
|
74
|
+
this.projectPackageJSON = null;
|
|
75
|
+
this.routers = [];
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
deep: true,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
let hasFSA = hasFileSystemAccess();
|
|
83
|
+
return {
|
|
84
|
+
configType: "sysConfig",
|
|
85
|
+
hasFSA,
|
|
86
|
+
projectDirHandle: null,
|
|
87
|
+
projectPackageJSON: null,
|
|
88
|
+
routers: [],
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
created() {},
|
|
92
|
+
methods: {
|
|
93
|
+
async chooseDirHandler() {
|
|
94
|
+
this.projectDirHandle = await chooseDirectory({
|
|
95
|
+
id: "configDirChoose",
|
|
96
|
+
mode: "readwrite",
|
|
97
|
+
startIn: "desktop",
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
async getPackageJSON() {
|
|
101
|
+
let packageJSONText = await getChildFile("package.json", this.projectDirHandle);
|
|
102
|
+
if (packageJSONText) {
|
|
103
|
+
this.projectPackageJSON = JSON.parse(packageJSONText);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
async getRouters() {
|
|
107
|
+
let routerMap = new Map();
|
|
108
|
+
const disposeRouter = (item, parentPath = "") => {
|
|
109
|
+
if ("children" in item) {
|
|
110
|
+
item.children.forEach((jItem) => {
|
|
111
|
+
disposeRouter(jItem, item.path);
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
let { path, name, meta } = item;
|
|
115
|
+
path = parentPath ? `${parentPath}${path && parentPath !== "/" ? "/" : ""}${path}` : path;
|
|
116
|
+
if (!["/401", "/conifg", "/500", "/:pathMatch(.*)*"].includes(path)) {
|
|
117
|
+
routerMap.set(path, {
|
|
118
|
+
path,
|
|
119
|
+
name,
|
|
120
|
+
meta,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
let pubRoutersText = await getChildFile("pub/router/routers.js", this.projectDirHandle);
|
|
126
|
+
if (pubRoutersText) {
|
|
127
|
+
let pubAST = $(pubRoutersText);
|
|
128
|
+
pubAST.find("export const $_$1 = $_$2").each((node, index) => {
|
|
129
|
+
eval(node[0].match[2][0].value).forEach((item) => {
|
|
130
|
+
disposeRouter(item);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
let customRoutersText = await getChildFile("src/router/routers.js", this.projectDirHandle);
|
|
135
|
+
if (customRoutersText) {
|
|
136
|
+
let customAST = $(customRoutersText);
|
|
137
|
+
customAST.find("export const $_$1 = $_$2").each((node, index) => {
|
|
138
|
+
eval(node[0].match[2][0].value).forEach((item) => {
|
|
139
|
+
disposeRouter(item);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
this.routers = [...routerMap.values()];
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
</script>
|
|
148
|
+
<style lang="scss">
|
|
149
|
+
@import "config.scss";
|
|
150
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>路由配置</div>
|
|
3
|
-
</template>
|
|
4
|
-
<script setup>
|
|
1
|
+
<template>
|
|
2
|
+
<div>路由配置</div>
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
5
|
</script>
|