@scx-js/scx-admin 0.0.3
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/components/crud/crud-add-button.vue +28 -0
- package/components/crud/crud-batch-delete.vue +27 -0
- package/components/crud/crud-edit-dialog.vue +36 -0
- package/components/crud/crud-edit-form.vue +28 -0
- package/components/crud/crud-form-footer.vue +28 -0
- package/components/crud/crud-pagination.vue +51 -0
- package/components/crud/crud-reset-button.vue +19 -0
- package/components/crud/crud-search-button.vue +25 -0
- package/components/crud/crud-table-delete-button.vue +31 -0
- package/components/crud/crud-table-edit-button.vue +26 -0
- package/components/crud/crud-table.vue +131 -0
- package/components/crud/index.css +46 -0
- package/components/crud/index.vue +37 -0
- package/components/easy-ckeditor/default-editor-config.js +199 -0
- package/components/easy-ckeditor/easy-ckeditor-lazy.css +17 -0
- package/components/easy-ckeditor/easy-ckeditor-lazy.vue +106 -0
- package/components/easy-ckeditor/index.css +3 -0
- package/components/easy-ckeditor/index.vue +58 -0
- package/components/easy-ckeditor/plugins/scx-upload-adapter.js +39 -0
- package/components/easy-form-item/index.vue +168 -0
- package/components/easy-image/index.css +24 -0
- package/components/easy-image/index.vue +75 -0
- package/components/easy-monaco-editor/index.css +8 -0
- package/components/easy-monaco-editor/index.vue +70 -0
- package/components/easy-monaco-editor/use-worker.js +27 -0
- package/components/easy-select/index.vue +29 -0
- package/components/easy-upload/index.vue +94 -0
- package/components/easy-upload-list/index.vue +107 -0
- package/components/index.js +69 -0
- package/components/left-tree/index.css +74 -0
- package/components/left-tree/index.vue +130 -0
- package/components/scx-container/index.css +19 -0
- package/components/scx-container/index.vue +22 -0
- package/components/user-profile/change-password-dialog.vue +100 -0
- package/components/user-profile/change-user-avatar.vue +43 -0
- package/components/user-profile/change-username-dialog.vue +82 -0
- package/components/user-profile/index.css +8 -0
- package/components/user-profile/index.vue +77 -0
- package/index.js +4 -0
- package/layout/img/default-avatar.gif +0 -0
- package/layout/index.vue +24 -0
- package/layout/scx-app.vue +110 -0
- package/layout/scx-input.vue +84 -0
- package/layout/scx-logo.vue +65 -0
- package/layout/scx-main.vue +48 -0
- package/layout/scx-menu-item.vue +47 -0
- package/layout/scx-menu-toggle.vue +69 -0
- package/layout/scx-menu.vue +122 -0
- package/layout/scx-navbar.vue +47 -0
- package/layout/scx-notice.vue +211 -0
- package/layout/scx-sidebar.vue +70 -0
- package/layout/scx-theme-switch.vue +54 -0
- package/layout/scx-user-panel.vue +193 -0
- package/package.json +30 -0
- package/routes.js +57 -0
- package/scx/ali-oss.js +87 -0
- package/scx/auth-fetch.js +68 -0
- package/scx/crud-context.js +522 -0
- package/scx/easy-option.js +131 -0
- package/scx/index.js +8 -0
- package/scx/scx-auth-info.js +48 -0
- package/scx/scx-auth.js +197 -0
- package/scx/scx-config-manager.js +105 -0
- package/scx/scx-router.js +273 -0
- package/styles/index.css +37 -0
- package/util/cities.js +350 -0
- package/util/duration-format.js +27 -0
- package/util/element-plus-helper.js +114 -0
- package/util/get-order-number.js +7 -0
- package/util/index.js +4 -0
- package/util/nations.js +16 -0
- package/util/provinces.js +41 -0
- package/views/error-page.vue +79 -0
- package/views/login/index.css +95 -0
- package/views/login/login-and-register.vue +66 -0
- package/views/login/login-bg.vue +121 -0
- package/views/login/login-form-bg.vue +61 -0
- package/views/login/login-form.vue +137 -0
- package/views/login/login-message.js +28 -0
- package/views/login/login.vue +29 -0
- package/views/login/register-form.vue +148 -0
- package/views/no-perm.vue +7 -0
- package/views/not-found.vue +7 -0
- package/views/rocket.vue +84 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
<template>
|
2
|
+
<el-dialog v-model="changePasswordDialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
|
3
|
+
:width="dialogWidth" title="修改密码">
|
4
|
+
<el-form ref="changePasswordRef" :model="changePasswordForm" label-width="100px">
|
5
|
+
<easy-form-item label="原密码" prop="password" required>
|
6
|
+
<el-input v-model="changePasswordForm.password" show-password></el-input>
|
7
|
+
</easy-form-item>
|
8
|
+
<easy-form-item label="新密码" prop="newPassword" required>
|
9
|
+
<el-input v-model="changePasswordForm.newPassword" show-password></el-input>
|
10
|
+
</easy-form-item>
|
11
|
+
<el-form-item :rules="newPassword2Rules" label="确认密码" prop="newPassword2">
|
12
|
+
<el-input v-model="changePasswordForm.newPassword2" show-password></el-input>
|
13
|
+
</el-form-item>
|
14
|
+
</el-form>
|
15
|
+
<span>注意 : 请牢记修改后的密码, 忘记请联系管理员进行找回!!!</span>
|
16
|
+
<template #footer>
|
17
|
+
<el-button @click="changePasswordDialogVisible = false">取 消</el-button>
|
18
|
+
<el-button type="primary" @click="changePassword">确认修改</el-button>
|
19
|
+
</template>
|
20
|
+
</el-dialog>
|
21
|
+
</template>
|
22
|
+
<script setup>
|
23
|
+
import EasyFormItem from "../easy-form-item/index.vue";
|
24
|
+
import {ElMessage} from "element-plus";
|
25
|
+
import {reactive, ref} from "vue";
|
26
|
+
import {useScxReq} from "@scx-js/scx-http";
|
27
|
+
import {useScxFSS} from "@scx-js/scx-app-x";
|
28
|
+
import {useScxUserInfo} from "../../scx/index.js";
|
29
|
+
|
30
|
+
const props = defineProps({
|
31
|
+
dialogWidth: {
|
32
|
+
default: "80%"
|
33
|
+
},
|
34
|
+
});
|
35
|
+
|
36
|
+
const fss = useScxFSS();
|
37
|
+
const req = useScxReq();
|
38
|
+
const userInfo = useScxUserInfo();
|
39
|
+
|
40
|
+
const changePasswordRef = ref();
|
41
|
+
|
42
|
+
const changePasswordDialogVisible = ref(false);
|
43
|
+
|
44
|
+
const changePasswordForm = reactive({
|
45
|
+
password: "",
|
46
|
+
newPassword: "",
|
47
|
+
newPassword2: ""
|
48
|
+
});
|
49
|
+
|
50
|
+
const newPassword2Rules = [{
|
51
|
+
type: "string",
|
52
|
+
trigger: "blur",
|
53
|
+
required: true,
|
54
|
+
validator: (rule, value, callback) => {
|
55
|
+
if (value.trim() === "") {
|
56
|
+
return callback("请再次输入密码 !!!");
|
57
|
+
} else if (changePasswordForm.newPassword !== value) {
|
58
|
+
callback("两次密码不一致 !!!");
|
59
|
+
} else {
|
60
|
+
callback();
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}];
|
64
|
+
|
65
|
+
|
66
|
+
function changePassword() {
|
67
|
+
changePasswordRef.value.validate((valid) => {
|
68
|
+
if (valid) {
|
69
|
+
req.post("api/auth/change-password-by-self", {
|
70
|
+
newPassword: changePasswordForm.newPassword,
|
71
|
+
oldPassword: changePasswordForm.password
|
72
|
+
}).then(data => {
|
73
|
+
ElMessage.success("修改密码成功 !!! 下次登录请使用新密码 !!!");
|
74
|
+
changePasswordDialogVisible.value = false;
|
75
|
+
}).catch(e => {
|
76
|
+
if (e.message === "wrong-password") {
|
77
|
+
ElMessage.error("密码错误 !!!");
|
78
|
+
} else {
|
79
|
+
ElMessage.error("修改密码失败 !!! 请稍后再试 !!!");
|
80
|
+
}
|
81
|
+
});
|
82
|
+
}
|
83
|
+
});
|
84
|
+
}
|
85
|
+
|
86
|
+
function showChangePassword() {
|
87
|
+
changePasswordForm.newPassword = "";
|
88
|
+
changePasswordForm.password = "";
|
89
|
+
changePasswordForm.newPassword2 = "";
|
90
|
+
changePasswordDialogVisible.value = true;
|
91
|
+
}
|
92
|
+
|
93
|
+
defineExpose({
|
94
|
+
showChangePassword
|
95
|
+
});
|
96
|
+
</script>
|
97
|
+
|
98
|
+
<style scoped>
|
99
|
+
|
100
|
+
</style>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<template>
|
2
|
+
<easy-upload v-model="userInfo.avatar" :before-delete="removeAvatar" :upload-handler="upload"/>
|
3
|
+
</template>
|
4
|
+
<script setup>
|
5
|
+
import EasyUpload from "../easy-upload/index.vue";
|
6
|
+
import {ElMessage} from "element-plus";
|
7
|
+
import {useScxUserInfo} from "../../scx/index.js";
|
8
|
+
import {useScxReq} from "@scx-js/scx-http";
|
9
|
+
import {useScxFSS} from "@scx-js/scx-app-x";
|
10
|
+
|
11
|
+
const fss = useScxFSS();
|
12
|
+
const req = useScxReq();
|
13
|
+
const userInfo = useScxUserInfo();
|
14
|
+
|
15
|
+
function removeAvatar(e) {
|
16
|
+
return new Promise((resolve, reject) => {
|
17
|
+
req.post("api/auth/change-user-avatar", {newAvatar: ""}).then(data => {
|
18
|
+
resolve(true);
|
19
|
+
ElMessage.success("移除头像成功 !!!");
|
20
|
+
}).catch(e => {
|
21
|
+
ElMessage.error("移除头像失败 !!!");
|
22
|
+
});
|
23
|
+
});
|
24
|
+
}
|
25
|
+
|
26
|
+
function upload(e) {
|
27
|
+
return new Promise((resolve, reject) => {
|
28
|
+
fss.upload(e).then(data => {
|
29
|
+
req.post("api/auth/change-user-avatar", {newAvatar: data.item.fssObjectID}).then(data => {
|
30
|
+
userInfo.avatar = data.avatar;
|
31
|
+
resolve(userInfo.avatar);
|
32
|
+
ElMessage.success("修改头像成功 !!!");
|
33
|
+
}).catch(e => {
|
34
|
+
ElMessage.error("修改头像失败 !!!");
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
38
|
+
}
|
39
|
+
</script>
|
40
|
+
|
41
|
+
<style scoped>
|
42
|
+
|
43
|
+
</style>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<template>
|
2
|
+
<el-dialog v-model="changeUsernameDialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
|
3
|
+
:width="dialogWidth" title="修改用户名">
|
4
|
+
<el-form ref="changeUsernameRef" :model="changeUsernameForm" label-width="120px">
|
5
|
+
<easy-form-item label="新用户名" prop="newUsername" required>
|
6
|
+
<el-input v-model="changeUsernameForm.newUsername"></el-input>
|
7
|
+
</easy-form-item>
|
8
|
+
<easy-form-item label="密码" prop="password" required>
|
9
|
+
<el-input v-model="changeUsernameForm.password" show-password></el-input>
|
10
|
+
</easy-form-item>
|
11
|
+
</el-form>
|
12
|
+
<span>注意 : 请牢记修改后的用户名, 忘记请联系管理员进行找回!!!</span>
|
13
|
+
<template #footer>
|
14
|
+
<el-button @click="changeUsernameDialogVisible = false">取 消</el-button>
|
15
|
+
<el-button type="primary" @click="changeUsername">确认修改</el-button>
|
16
|
+
</template>
|
17
|
+
</el-dialog>
|
18
|
+
</template>
|
19
|
+
<script setup>
|
20
|
+
import EasyFormItem from "../easy-form-item/index.vue";
|
21
|
+
import {reactive, ref} from "vue";
|
22
|
+
import {ElMessage} from "element-plus";
|
23
|
+
import {useScxUserInfo} from "../../scx/index.js";
|
24
|
+
import {useScxReq} from "@scx-js/scx-http";
|
25
|
+
import {useScxFSS} from "@scx-js/scx-app-x";
|
26
|
+
|
27
|
+
const props = defineProps({
|
28
|
+
dialogWidth: {
|
29
|
+
default: "400px"
|
30
|
+
},
|
31
|
+
});
|
32
|
+
|
33
|
+
const fss = useScxFSS();
|
34
|
+
const req = useScxReq();
|
35
|
+
const userInfo = useScxUserInfo();
|
36
|
+
|
37
|
+
const changeUsernameRef = ref();
|
38
|
+
|
39
|
+
const changeUsernameDialogVisible = ref(false);
|
40
|
+
|
41
|
+
const changeUsernameForm = reactive({
|
42
|
+
newUsername: "",
|
43
|
+
password: ""
|
44
|
+
});
|
45
|
+
|
46
|
+
function changeUsername() {
|
47
|
+
changeUsernameRef.value.validate((valid) => {
|
48
|
+
if (valid) {
|
49
|
+
req.post("api/auth/change-username-by-self", {
|
50
|
+
newUsername: changeUsernameForm.newUsername,
|
51
|
+
password: changeUsernameForm.password
|
52
|
+
}).then(data => {
|
53
|
+
userInfo.username = data.username;
|
54
|
+
ElMessage.success("修改用户名成功 !!! 下次登录请使用新用户名 !!!");
|
55
|
+
changeUsernameDialogVisible.value = false;
|
56
|
+
}).catch(e => {
|
57
|
+
if (e.message === "username-already-exists") {
|
58
|
+
ElMessage.error("用户名已被占用 !!!");
|
59
|
+
} else if (e.message === "wrong-password") {
|
60
|
+
ElMessage.error("密码错误 !!!");
|
61
|
+
} else {
|
62
|
+
ElMessage.error("修改用户名失败 !!! 请稍后再试 !!!");
|
63
|
+
}
|
64
|
+
});
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
function showChangeUsername() {
|
70
|
+
changeUsernameForm.newUsername = userInfo.username;
|
71
|
+
changeUsernameForm.password = "";
|
72
|
+
changeUsernameDialogVisible.value = true;
|
73
|
+
}
|
74
|
+
|
75
|
+
defineExpose({
|
76
|
+
showChangeUsername
|
77
|
+
});
|
78
|
+
</script>
|
79
|
+
|
80
|
+
<style scoped>
|
81
|
+
|
82
|
+
</style>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<template>
|
2
|
+
|
3
|
+
<div class="user-profile">
|
4
|
+
|
5
|
+
<change-user-avatar/>
|
6
|
+
|
7
|
+
<slot name="info">
|
8
|
+
<el-descriptions :column="1" border>
|
9
|
+
<el-descriptions-item align="center" label="用户名" label-align="center" width="150px">
|
10
|
+
{{ userInfo.username }}
|
11
|
+
</el-descriptions-item>
|
12
|
+
</el-descriptions>
|
13
|
+
</slot>
|
14
|
+
|
15
|
+
<el-divider/>
|
16
|
+
<div>
|
17
|
+
<el-button plain type="primary" @click="showChangeUsername">点击修改用户名</el-button>
|
18
|
+
<el-button plain type="success" @click="showChangePassword">点击修改密码</el-button>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<change-username-dialog ref="changeUsernameDialogRef" :dialog-width="dialogWidth"/>
|
23
|
+
|
24
|
+
<change-password-dialog ref="changePasswordDialogRef" :dialog-width="dialogWidth"/>
|
25
|
+
|
26
|
+
</template>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
import "./index.css";
|
30
|
+
import {ref} from "vue";
|
31
|
+
import {useScxUserInfo} from "../../index.js";
|
32
|
+
import EasyUpload from "../easy-upload/index.vue";
|
33
|
+
import EasyFormItem from "../easy-form-item/index.vue";
|
34
|
+
import ChangeUserAvatar from "./change-user-avatar.vue";
|
35
|
+
import ChangeUsernameDialog from "./change-username-dialog.vue";
|
36
|
+
import ChangePasswordDialog from "./change-password-dialog.vue";
|
37
|
+
|
38
|
+
export default {
|
39
|
+
name: "user-profile",
|
40
|
+
components: {
|
41
|
+
ChangeUserAvatar,
|
42
|
+
ChangeUsernameDialog,
|
43
|
+
ChangePasswordDialog,
|
44
|
+
EasyFormItem,
|
45
|
+
EasyUpload
|
46
|
+
},
|
47
|
+
props: {
|
48
|
+
dialogWidth: {
|
49
|
+
default: "400px"
|
50
|
+
},
|
51
|
+
},
|
52
|
+
setup() {
|
53
|
+
|
54
|
+
const userInfo = useScxUserInfo();
|
55
|
+
|
56
|
+
const changeUsernameDialogRef = ref();
|
57
|
+
const changePasswordDialogRef = ref();
|
58
|
+
|
59
|
+
function showChangeUsername() {
|
60
|
+
changeUsernameDialogRef.value.showChangeUsername();
|
61
|
+
}
|
62
|
+
|
63
|
+
function showChangePassword() {
|
64
|
+
changePasswordDialogRef.value.showChangePassword();
|
65
|
+
}
|
66
|
+
|
67
|
+
return {
|
68
|
+
userInfo,
|
69
|
+
changeUsernameDialogRef,
|
70
|
+
changePasswordDialogRef,
|
71
|
+
showChangeUsername,
|
72
|
+
showChangePassword
|
73
|
+
};
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
</script>
|
package/index.js
ADDED
Binary file
|
package/layout/index.vue
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
<template>
|
2
|
+
<!-- element ui 配置 -->
|
3
|
+
<el-config-provider :locale="zhCN">
|
4
|
+
<scx-app/>
|
5
|
+
</el-config-provider>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import zhCN from "element-plus/es/locale/lang/zh-cn";
|
10
|
+
import ScxApp from "./scx-app.vue";
|
11
|
+
|
12
|
+
export default {
|
13
|
+
name: "scx-layout",
|
14
|
+
components: {
|
15
|
+
ScxApp,
|
16
|
+
},
|
17
|
+
setup() {
|
18
|
+
|
19
|
+
return {
|
20
|
+
zhCN
|
21
|
+
};
|
22
|
+
}
|
23
|
+
};
|
24
|
+
</script>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<template>
|
2
|
+
|
3
|
+
<!-- 上下结构 -->
|
4
|
+
<div class="scx-app">
|
5
|
+
|
6
|
+
<!-- 顶栏 -->
|
7
|
+
<scx-navbar>
|
8
|
+
<template #left>
|
9
|
+
<scx-menu-toggle/>
|
10
|
+
<scx-logo/>
|
11
|
+
</template>
|
12
|
+
<template #right>
|
13
|
+
<scx-theme-switch/>
|
14
|
+
<scx-user-panel/>
|
15
|
+
</template>
|
16
|
+
</scx-navbar>
|
17
|
+
|
18
|
+
<!-- 内容区域 -->
|
19
|
+
<div class="scx-content">
|
20
|
+
|
21
|
+
<!-- 左侧边栏 -->
|
22
|
+
<scx-sidebar :class="userConfig.menuCollapse ? 'collapse' : ''">
|
23
|
+
|
24
|
+
<!-- 菜单栏 -->
|
25
|
+
<scx-menu/>
|
26
|
+
|
27
|
+
</scx-sidebar>
|
28
|
+
|
29
|
+
<!-- 右侧主内容容器 -->
|
30
|
+
<scx-main/>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<!-- 右侧通知面板 -->
|
35
|
+
<scx-notice/>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
</template>
|
39
|
+
|
40
|
+
<script>
|
41
|
+
import ScxSidebar from "./scx-sidebar.vue";
|
42
|
+
import ScxMain from "./scx-main.vue";
|
43
|
+
import ScxNotice from "./scx-notice.vue";
|
44
|
+
import ScxUserPanel from "./scx-user-panel.vue";
|
45
|
+
import ScxMenu from "./scx-menu.vue";
|
46
|
+
import ScxMenuToggle from "./scx-menu-toggle.vue";
|
47
|
+
import ScxLogo from "./scx-logo.vue";
|
48
|
+
import ScxNavbar from "./scx-navbar.vue";
|
49
|
+
import ScxThemeSwitch from "./scx-theme-switch.vue";
|
50
|
+
import {useScxUserConfig} from "../scx/index.js";
|
51
|
+
|
52
|
+
export default {
|
53
|
+
name: "scx-app",
|
54
|
+
components: {
|
55
|
+
ScxThemeSwitch,
|
56
|
+
ScxNavbar,
|
57
|
+
ScxLogo,
|
58
|
+
ScxMenuToggle,
|
59
|
+
ScxMenu,
|
60
|
+
ScxUserPanel,
|
61
|
+
ScxSidebar,
|
62
|
+
ScxMain,
|
63
|
+
ScxNotice
|
64
|
+
},
|
65
|
+
setup() {
|
66
|
+
const userConfig = useScxUserConfig();
|
67
|
+
return {
|
68
|
+
userConfig
|
69
|
+
};
|
70
|
+
}
|
71
|
+
};
|
72
|
+
</script>
|
73
|
+
|
74
|
+
<style>
|
75
|
+
.scx-app {
|
76
|
+
position: absolute;
|
77
|
+
display: flex;
|
78
|
+
width: 100%;
|
79
|
+
height: 100%;
|
80
|
+
color: var(--scx-text-color);
|
81
|
+
background: var(--scx-bg);
|
82
|
+
/*使切换主题时颜色过渡平滑一些*/
|
83
|
+
transition: background 200ms ease, color 100ms ease;
|
84
|
+
flex-direction: column;
|
85
|
+
}
|
86
|
+
|
87
|
+
.scx-content {
|
88
|
+
display: flex;
|
89
|
+
height: 100%;
|
90
|
+
overflow: auto;
|
91
|
+
z-index: 3;
|
92
|
+
}
|
93
|
+
|
94
|
+
.scx-sidebar {
|
95
|
+
width: 200px;
|
96
|
+
transition: width 200ms;
|
97
|
+
}
|
98
|
+
|
99
|
+
.scx-sidebar.collapse {
|
100
|
+
width: 54px;
|
101
|
+
}
|
102
|
+
|
103
|
+
.scx-sidebar-top {
|
104
|
+
justify-content: start;
|
105
|
+
}
|
106
|
+
|
107
|
+
.scx-logo {
|
108
|
+
flex-shrink: unset;
|
109
|
+
}
|
110
|
+
</style>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="scx-input">
|
3
|
+
<scx-icon v-if="icon" :icon="icon"/>
|
4
|
+
<input v-model="m" :placeholder="placeholder" type="text"/>
|
5
|
+
<scx-icon v-show="m!==''" icon="outlined-close" @click="m=''"/>
|
6
|
+
</div>
|
7
|
+
</template>
|
8
|
+
|
9
|
+
<script>
|
10
|
+
import {computed} from "vue";
|
11
|
+
|
12
|
+
export default {
|
13
|
+
name: "scx-input",
|
14
|
+
props: {
|
15
|
+
modelValue: {
|
16
|
+
type: String,
|
17
|
+
required: true,
|
18
|
+
default: "",
|
19
|
+
},
|
20
|
+
placeholder: {
|
21
|
+
type: String,
|
22
|
+
default: "输入名称搜索",
|
23
|
+
},
|
24
|
+
icon: {
|
25
|
+
type: String,
|
26
|
+
default: null
|
27
|
+
}
|
28
|
+
},
|
29
|
+
setup(props, context) {
|
30
|
+
|
31
|
+
const m = computed({
|
32
|
+
get() {
|
33
|
+
return props.modelValue;
|
34
|
+
},
|
35
|
+
set(value) {
|
36
|
+
context.emit("update:modelValue", value);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
|
40
|
+
return {m};
|
41
|
+
}
|
42
|
+
};
|
43
|
+
</script>
|
44
|
+
<style>
|
45
|
+
.scx-input {
|
46
|
+
display: flex;
|
47
|
+
justify-content: space-between;
|
48
|
+
align-self: center;
|
49
|
+
align-items: center;
|
50
|
+
/* 32px 是当前这个元素的高度 默认被内部的 input 撑起来的高度*/
|
51
|
+
border-radius: calc(32px / 2);
|
52
|
+
background: var(--scx-input_bg);
|
53
|
+
box-shadow: var(--scx-input_box-shadow);
|
54
|
+
transition: all 100ms cubic-bezier(0.23, 1, 0.32, 1);
|
55
|
+
padding-left: 10px;
|
56
|
+
padding-right: 10px;
|
57
|
+
box-sizing: border-box;
|
58
|
+
}
|
59
|
+
|
60
|
+
.scx-input > input {
|
61
|
+
width: 100%;
|
62
|
+
outline: none;
|
63
|
+
font-size: 15px;
|
64
|
+
height: 30px;
|
65
|
+
border: 0;
|
66
|
+
background-color: transparent;
|
67
|
+
margin-left: 10px;
|
68
|
+
margin-right: 10px;
|
69
|
+
}
|
70
|
+
|
71
|
+
.scx-input > input::placeholder {
|
72
|
+
color: var(--scx-text-placeholder-color);
|
73
|
+
}
|
74
|
+
|
75
|
+
.scx-input > svg {
|
76
|
+
width: 20px;
|
77
|
+
flex-shrink: 0;
|
78
|
+
cursor: pointer;
|
79
|
+
}
|
80
|
+
|
81
|
+
.scx-input:focus-within {
|
82
|
+
box-shadow: var(--scx-input-hover_box-shadow);
|
83
|
+
}
|
84
|
+
</style>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="scx-logo">
|
3
|
+
|
4
|
+
<div class="scx-logo-logo">
|
5
|
+
<scx-icon icon="outlined-scx-logo"/>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="scx-logo-label">
|
9
|
+
{{ systemConfig.title }}
|
10
|
+
</div>
|
11
|
+
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
import {useScxSystemConfig} from "../scx/index.js";
|
17
|
+
|
18
|
+
export default {
|
19
|
+
name: "scx-logo",
|
20
|
+
setup() {
|
21
|
+
const systemConfig = useScxSystemConfig();
|
22
|
+
return {systemConfig};
|
23
|
+
}
|
24
|
+
};
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<style scoped>
|
28
|
+
.scx-logo {
|
29
|
+
height: 50px;
|
30
|
+
display: flex;
|
31
|
+
align-items: center;
|
32
|
+
width: 100%;
|
33
|
+
}
|
34
|
+
|
35
|
+
.scx-logo-logo {
|
36
|
+
padding: 10px;
|
37
|
+
height: 100%;
|
38
|
+
width: 54px;
|
39
|
+
flex-shrink: 0;
|
40
|
+
display: flex;
|
41
|
+
justify-content: center;
|
42
|
+
align-items: center;
|
43
|
+
}
|
44
|
+
|
45
|
+
.scx-logo-logo > .scx-icon {
|
46
|
+
width: 100%;
|
47
|
+
height: 100%;
|
48
|
+
fill: var(--scx-theme);
|
49
|
+
}
|
50
|
+
|
51
|
+
.scx-logo-label {
|
52
|
+
white-space: nowrap;
|
53
|
+
overflow: hidden;
|
54
|
+
color: var(--scx-theme);
|
55
|
+
display: flex;
|
56
|
+
justify-content: start;
|
57
|
+
align-items: center;
|
58
|
+
height: 100%;
|
59
|
+
width: 100%;
|
60
|
+
}
|
61
|
+
|
62
|
+
.collapse .scx-logo-label {
|
63
|
+
visibility: hidden;
|
64
|
+
}
|
65
|
+
</style>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="scx-main">
|
3
|
+
<router-view v-slot="{ Component }">
|
4
|
+
<!-- 路由切换动画 -->
|
5
|
+
<transition mode="out-in" name="scx-main-t">
|
6
|
+
<!-- 对所有页面都进行缓存 v-if 是为了刷新当前路由 -->
|
7
|
+
<keep-alive>
|
8
|
+
<component :is="Component"/>
|
9
|
+
</keep-alive>
|
10
|
+
</transition>
|
11
|
+
</router-view>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
|
17
|
+
export default {
|
18
|
+
name: "scx-main",
|
19
|
+
setup() {
|
20
|
+
return {};
|
21
|
+
}
|
22
|
+
|
23
|
+
};
|
24
|
+
</script>
|
25
|
+
|
26
|
+
<style>
|
27
|
+
.scx-main {
|
28
|
+
height: 100%;
|
29
|
+
width: 100%;
|
30
|
+
overflow: auto;
|
31
|
+
}
|
32
|
+
|
33
|
+
/*---------------------- vue 动画 -----------------------*/
|
34
|
+
.scx-main-t-enter-active,
|
35
|
+
.scx-main-t-leave-active {
|
36
|
+
transition: opacity 200ms, transform 200ms;
|
37
|
+
}
|
38
|
+
|
39
|
+
.scx-main-t-enter-from {
|
40
|
+
opacity: 0;
|
41
|
+
transform: scale(0.98, 0.98);
|
42
|
+
}
|
43
|
+
|
44
|
+
.scx-main-t-leave-to {
|
45
|
+
opacity: 0;
|
46
|
+
transform: scale(1.02, 1.02);
|
47
|
+
}
|
48
|
+
</style>
|