@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,148 @@
|
|
1
|
+
<template>
|
2
|
+
<el-form ref="registerFormRef" :model="registerForm" :rules="registerFormRules">
|
3
|
+
|
4
|
+
<el-form-item prop="registerUsername">
|
5
|
+
<el-input ref="registerUsernameRef" v-model="registerForm.registerUsername"
|
6
|
+
placeholder="用户名由字母和数字组成 大于4位小于15位"
|
7
|
+
@keyup.enter="onRegister">
|
8
|
+
<template v-slot:prefix>
|
9
|
+
<scx-icon icon="outlined-user"/>
|
10
|
+
</template>
|
11
|
+
</el-input>
|
12
|
+
</el-form-item>
|
13
|
+
|
14
|
+
<el-form-item prop="registerPassword">
|
15
|
+
<el-input v-model="registerForm.registerPassword"
|
16
|
+
placeholder="密码由字母,数字或符号组成 大于等于6位小于20位"
|
17
|
+
show-password
|
18
|
+
@keyup.enter="onRegister">
|
19
|
+
<template v-slot:prefix>
|
20
|
+
<scx-icon icon="outlined-unlock"/>
|
21
|
+
</template>
|
22
|
+
</el-input>
|
23
|
+
</el-form-item>
|
24
|
+
|
25
|
+
<el-form-item prop="registerPasswordAgain">
|
26
|
+
<el-input v-model="registerForm.registerPasswordAgain" placeholder="请再次输入密码"
|
27
|
+
show-password
|
28
|
+
@keyup.enter="onRegister">
|
29
|
+
<template v-slot:prefix>
|
30
|
+
<scx-icon icon="outlined-unlock"/>
|
31
|
+
</template>
|
32
|
+
</el-input>
|
33
|
+
</el-form-item>
|
34
|
+
|
35
|
+
<el-button :loading="registerForm.registerBtnLoading" style="width: 100%" type="success" @click="onRegister">
|
36
|
+
注册
|
37
|
+
</el-button>
|
38
|
+
|
39
|
+
</el-form>
|
40
|
+
</template>
|
41
|
+
<script setup>
|
42
|
+
import {reactive, ref} from "vue";
|
43
|
+
import {ElMessage} from "element-plus";
|
44
|
+
import {useScxReq} from "@scx-js/scx-http";
|
45
|
+
|
46
|
+
const emit = defineEmits(["register-success"]);
|
47
|
+
|
48
|
+
const req = useScxReq();
|
49
|
+
|
50
|
+
const registerUsernameRef = ref(null);
|
51
|
+
|
52
|
+
const registerFormRef = ref(null);
|
53
|
+
const registerForm = reactive({
|
54
|
+
registerUsername: "",
|
55
|
+
registerPassword: "",
|
56
|
+
registerPasswordAgain: "",
|
57
|
+
registerBtnLoading: false
|
58
|
+
});
|
59
|
+
|
60
|
+
const registerFormRules = {
|
61
|
+
registerUsername: [{
|
62
|
+
type: "string",
|
63
|
+
trigger: "change",
|
64
|
+
required: true,
|
65
|
+
validator: (rule, value, callback) => {
|
66
|
+
if (value.length < 4) {
|
67
|
+
callback("用户名太短 !!!");
|
68
|
+
} else {
|
69
|
+
return callback();
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}],
|
73
|
+
registerPassword: [{
|
74
|
+
type: "string",
|
75
|
+
required: true,
|
76
|
+
trigger: "change",
|
77
|
+
validator: (rule, value, callback) => {
|
78
|
+
if (value.length < 6) {
|
79
|
+
callback("密码太短 !!!"); // reject with error message
|
80
|
+
} else {
|
81
|
+
return callback();
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}],
|
85
|
+
registerPasswordAgain: [{
|
86
|
+
type: "string",
|
87
|
+
required: true,
|
88
|
+
trigger: "change",
|
89
|
+
validator: (rule, value, callback) => {
|
90
|
+
if (value.trim() === "") {
|
91
|
+
callback("请再次输入密码 !!!");
|
92
|
+
} else if (value !== registerForm.registerPassword) {
|
93
|
+
callback("两次输入密码不一致 !!!");
|
94
|
+
} else {
|
95
|
+
return callback();
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}]
|
99
|
+
};
|
100
|
+
|
101
|
+
|
102
|
+
// 注册方法
|
103
|
+
function onRegister() {
|
104
|
+
registerFormRef.value.validate((valid) => {
|
105
|
+
if (!valid) {
|
106
|
+
return;
|
107
|
+
}
|
108
|
+
registerForm.registerBtnLoading = true;
|
109
|
+
req.post("api/auth/signup", {
|
110
|
+
username: registerForm.registerUsername,
|
111
|
+
password: registerForm.registerPassword,
|
112
|
+
}).then(response => {
|
113
|
+
ElMessage.success("login.registerSuccess");
|
114
|
+
registerForm.registerBtnLoading = false;
|
115
|
+
emit("register-success", {
|
116
|
+
username: registerForm.registerUsername,
|
117
|
+
password: registerForm.registerPassword
|
118
|
+
});
|
119
|
+
}).catch(e => {
|
120
|
+
if (e.message === "userAlreadyExists") {
|
121
|
+
ElMessage.error("用户名已被占用 !!!");
|
122
|
+
} else {
|
123
|
+
ElMessage.error("未知错误 !!!");
|
124
|
+
}
|
125
|
+
registerForm.registerBtnLoading = false;
|
126
|
+
});
|
127
|
+
|
128
|
+
});
|
129
|
+
}
|
130
|
+
|
131
|
+
function focus() {
|
132
|
+
registerUsernameRef.value.focus();
|
133
|
+
}
|
134
|
+
|
135
|
+
function resetFields() {
|
136
|
+
registerFormRef.value.resetFields();
|
137
|
+
}
|
138
|
+
|
139
|
+
defineExpose({
|
140
|
+
focus,
|
141
|
+
resetFields,
|
142
|
+
registerForm
|
143
|
+
});
|
144
|
+
</script>
|
145
|
+
|
146
|
+
<style scoped>
|
147
|
+
|
148
|
+
</style>
|
package/views/rocket.vue
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
<template>
|
2
|
+
<svg height="200" style="overflow: visible" viewBox="0 0 120 120" width="200" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<g fill="none" fill-rule="evenodd">
|
4
|
+
<g class="stars animated">
|
5
|
+
<path d="M32.9862439 29.2981615c.1110863.8208744-.4626987 1.5770446-1.2847376 1.6881041-.8210729.1110595-1.5764599-.4635526-1.6875462-1.2844271-.1120523-.8208744.4626987-1.5760789 1.2837716-1.6881041.8220388-.1110595 1.5774259.4635526 1.6885122 1.2844271"
|
6
|
+
fill="#D0E7FB"/>
|
7
|
+
<path d="M100.94858 6.8876353c-.214287.79954375-1.0363503 1.27471744-1.8366061 1.06131608-.7983596-.21340136-1.2743411-1.03570792-1.0610028-1.83620012.2142866-.80049221 1.0363503-1.2756659 1.8366062-1.06131609.8002557.21434981 1.2752897 1.03570792 1.0610027 1.83620013"
|
8
|
+
fill="#D0E7FB"/>
|
9
|
+
<g transform="translate(0 69)">
|
10
|
+
<mask id="b" fill="#fff">
|
11
|
+
<path id="a" d="M0 4.21585531V.05647427h4.15889198v4.15938104H0z"/>
|
12
|
+
</mask>
|
13
|
+
<path d="M4.0876 2.6727c-.296 1.109-1.436 1.769-2.545 1.472-1.109-.297-1.768-1.436-1.472-2.546.297-1.109 1.436-1.768 2.546-1.471 1.11.296 1.768 1.436 1.471 2.545"
|
14
|
+
fill="#A1D2F8" mask="url(#b)"/>
|
15
|
+
</g>
|
16
|
+
<path d="M106.948688 111.887537c-.212978.799632-1.035129 1.275692-1.835888 1.060907-.80076-.213855-1.276008-1.035802-1.06117-1.835434.212978-.799632 1.036059-1.275692 1.835888-1.061837.80076.213855 1.275078 1.036732 1.06117 1.836364"
|
17
|
+
fill="#A1D2F8"/>
|
18
|
+
<path d="M54.2354557 18.9014571c-1.5953959-.4199186-2.556853-2.0704598-2.1369062-3.6657486.4209514-1.5962933 2.0705988-2.5576859 3.6659948-2.1367627 1.5953959.4209232 2.556853 2.0704598 2.1369062 3.6657486-.4209514 1.5952888-2.0695942 2.5566813-3.6659948 2.1367627z"
|
19
|
+
stroke="#A1D2F8" stroke-width="2"/>
|
20
|
+
<path d="M16.9721415 7.59675618c.2239612 1.64109572-.9269786 3.15263122-2.5690262 3.37559532-1.640039.222964-3.1515262-.9270082-3.3754875-2.56810392-.2229569-1.64210006.9279829-3.1536356 2.5690262-3.37659964 1.6410433-.22296405 3.1525306.92700817 3.3754875 2.56910824"
|
21
|
+
fill="#A1D2F8"/>
|
22
|
+
<path d="M49.2357085 117.901451c-1.5962933-.419947-2.5576859-2.070599-2.1367627-3.665995.4209232-1.595396 2.0704598-2.556853 3.6657486-2.136907 1.5952888.420952 2.5566813 2.070599 2.1367627 3.665995-.4209231 1.595396-2.0694552 2.556853-3.6657486 2.136907z"
|
23
|
+
stroke="#A1D2F8" stroke-width="2"/>
|
24
|
+
</g>
|
25
|
+
<g class="rocket animated">
|
26
|
+
<path d="M53.9118329 92L44 81.3510365 50.0881671 76 60 86.6489635z" fill="#F2F9FE"/>
|
27
|
+
<path d="M53.9118329 92L44 81.3510365 50.0881671 76 60 86.6489635z" stroke="#A1D2F8"
|
28
|
+
stroke-linejoin="round" stroke-width="2"/>
|
29
|
+
<path d="M57 47.0157449L49.8317064 42 24 60.6301909 49.2570499 62z" fill="#FFF"/>
|
30
|
+
<path d="M87.754216 81L92 88.7814042 71 113l1.16221-25.7194181z" fill="#F2F9FE"/>
|
31
|
+
<path d="M108.233532 59.9703727c10.579453-16.2472813 10.22216-27.2231872 9.399093-31.6550767v-.0029805c-.413027-5.3975467-5.752516-6.357243-5.752516-6.357243-4.3323-1.2656865-15.2362027-2.7350352-32.5037006 6.126757-22.9294458 11.767705-28.5485982 30.6029873-28.5485982 30.6029873s-4.8199707 15.3392457 1.1942938 22.6243939c.0288621.0387455.0467766.0824584.0806149.1192169.0338383.0377521.0716576.0695432.1054959.1072953.0328431.037752.0627005.0784845.0965388.1162365.0328431.0357651.0746433.0596084.1104722.0923931 6.6512212 6.7099265 22.4268471 3.4771606 22.4268471 3.4771606s19.3415882-3.6718816 33.3914591-25.2511404"
|
32
|
+
fill="#FFF"/>
|
33
|
+
<path d="M108.214668 59.904736c10.318007-15.8150644 10.338974-26.7477325 9.407418-31.913642-.442314-5.0236555-4.362238-6.8839002-6.034646-7.4529163-.310519-.105447-.646997-.2198471-.998452-.2795341-.309521-.0885357-.642005-.1750818-.993461-.2586436.726874 5.517068.100844 16.050828-9.569167 30.8730987-13.9234193 21.3450646-32.8900212 25.1550846-33.6897816 25.3062916-.5082122.1044523-10.6714593 2.1099353-18.3365784-.7391239.5171983 1.9637021 1.3359293 3.8090251 2.610953 5.3509392l.1936998.233774 1.710349-1.3658374-1.5745595 1.5259975.2546054.2397428c7.1129749 7.0052638 22.6978186 3.9154669 23.3298389 3.7861451.8007589-.151207 19.7663623-3.961227 33.6897814-25.3062916"
|
34
|
+
fill="#F2F9FE"/>
|
35
|
+
<g>
|
36
|
+
<path d="M77.0779 50.9007l4.331 4.795-8.215 7.421c-.817.738-.623 1.045.429.688l17.561-6.405c1.053-.358 1.261-1.362.463-2.245l-4.331-4.795 8.215-7.421c.818-.738.623-1.045-.43-.69l-17.56 6.407c-1.054.356-1.261 1.362-.463 2.245"
|
37
|
+
fill="#FFF"/>
|
38
|
+
<path d="M77.0779 50.9007l4.331 4.795-8.215 7.421c-.817.738-.623 1.045.429.688l17.561-6.405c1.053-.358 1.261-1.362.463-2.245l-4.331-4.795 8.215-7.421c.818-.738.623-1.045-.43-.69l-17.56 6.407c-1.054.356-1.261 1.362-.463 2.245"
|
39
|
+
stroke="#A1D2F8" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
40
|
+
</g>
|
41
|
+
<path d="M108.233532 59.9703727c10.579453-16.2472813 10.22216-27.2231872 9.399093-31.6550767v-.0029805c-.413027-5.3975467-5.752516-6.357243-5.752516-6.357243-4.3323-1.2656865-15.2362027-2.7350352-32.5037006 6.126757-22.9294458 11.767705-28.5485982 30.6029873-28.5485982 30.6029873s-4.8199707 15.3392457 1.1942938 22.6243939c.0288621.0387455.0467766.0824584.0806149.1192169.0338383.0377521.0716576.0695432.1054959.1072953.0328431.037752.0627005.0784845.0965388.1162365.0328431.0357651.0746433.0596084.1104722.0923931 6.6512212 6.7099265 22.4268471 3.4771606 22.4268471 3.4771606s19.3415882-3.6718816 33.3914591-25.2511404z"
|
42
|
+
stroke="#A1D2F8" stroke-width="2"/>
|
43
|
+
<path d="M57 47.0157449L49.8317064 42 24 60.6301909 49.2570499 62z" stroke="#A1D2F8"
|
44
|
+
stroke-linejoin="round" stroke-width="2"/>
|
45
|
+
<path d="M65 72l-31 28" stroke="#A1D2F8" stroke-linecap="round" stroke-linejoin="round"
|
46
|
+
stroke-width="2"/>
|
47
|
+
<path d="M110.154443 64.7093112c1.02326.8964969 1.133632 2.4760391.244468 3.5099781l-5.959048 6.9262459c-.888132 1.033939-2.452937 1.1453504-3.476197.2478122l-.117593-.1030815c-1.0242917-.896497-1.133632-2.4760392-.2455-3.508937l5.96008-6.9272871c.888132-1.033939 2.452937-1.1443091 3.476197-.2478122l.117593.1030816z"
|
48
|
+
fill="#FFF"/>
|
49
|
+
<path d="M110.154443 64.7093112c1.02326.8964969 1.133632 2.4760391.244468 3.5099781l-5.959048 6.9262459c-.888132 1.033939-2.452937 1.1453504-3.476197.2478122l-.117593-.1030815c-1.0242917-.896497-1.133632-2.4760392-.2455-3.508937l5.96008-6.9272871c.888132-1.033939 2.452937-1.1443091 3.476197-.2478122l.117593.1030816z"
|
50
|
+
stroke="#A1D2F8" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
51
|
+
<path d="M91 85.8362964L88.1804586 81l-15.890329 5.9908294L72 93z" fill="#D0E7FB"/>
|
52
|
+
<path d="M87.754216 81L92 88.7814042 71 113l1.16221-25.7194181z" stroke="#A1D2F8"
|
53
|
+
stroke-linejoin="round" stroke-width="2"/>
|
54
|
+
</g>
|
55
|
+
</g>
|
56
|
+
</svg>
|
57
|
+
</template>
|
58
|
+
|
59
|
+
<script>
|
60
|
+
export default {
|
61
|
+
name: "rocket"
|
62
|
+
};
|
63
|
+
</script>
|
64
|
+
|
65
|
+
<style scoped>
|
66
|
+
.rocket {
|
67
|
+
transform: translate(-50px, 30px);
|
68
|
+
}
|
69
|
+
|
70
|
+
.stars {
|
71
|
+
transform: translate(50px, -30px);
|
72
|
+
}
|
73
|
+
|
74
|
+
.rocket.animated,
|
75
|
+
.stars.animated {
|
76
|
+
animation: transform-zero-animation 0.75s cubic-bezier(0.215, 0.61, 0.355, 1) forwards 1;
|
77
|
+
}
|
78
|
+
|
79
|
+
@keyframes transform-zero-animation {
|
80
|
+
100% {
|
81
|
+
transform: translate(0, 0) translateZ(0);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
</style>
|