@xilonglab/vue-main 1.6.31 → 1.6.35
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/dist/page/app.vue +86 -86
- package/dist/page/login.vue +185 -185
- package/dist/page/setting.vue +86 -71
- package/dist/style/element.css +4 -4
- package/dist/style/reset.css +42 -42
- package/package.json +16 -16
- package/packages/else/XlControlBar.vue +73 -73
- package/packages/form/XlImagesInput.vue +206 -206
- package/packages/form/XlSignatureInput.vue +49 -4
- package/packages/main/XlSingleTabView.vue +60 -60
package/dist/page/setting.vue
CHANGED
|
@@ -1,72 +1,87 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import User from '#/user'
|
|
3
|
-
import { ref, reactive, inject } from 'vue'
|
|
4
|
-
|
|
5
|
-
const store = inject('store')
|
|
6
|
-
const refs = { form: ref(null) }
|
|
7
|
-
const data = reactive({ oldPassword: '', newPassword: '', repeatPassword: '' })
|
|
8
|
-
const error = reactive({ oldPassword: '', newPassword: '', repeatPassword: '' })
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import User from '#/user'
|
|
3
|
+
import { ref, reactive, inject } from 'vue'
|
|
4
|
+
|
|
5
|
+
const store = inject('store')
|
|
6
|
+
const refs = { form: ref(null) }
|
|
7
|
+
const data = reactive({ oldPassword: '', newPassword: '', repeatPassword: '' })
|
|
8
|
+
const error = reactive({ oldPassword: '', newPassword: '', repeatPassword: '' })
|
|
9
|
+
|
|
10
|
+
const validateNewPassword = (rule, value, callback) => {
|
|
11
|
+
if (!value || value.length < 6) {
|
|
12
|
+
callback(new Error('密码长度必须大于等于6位'))
|
|
13
|
+
} else if (/^\d+$/.test(value)) {
|
|
14
|
+
callback(new Error('密码不能为纯数字'))
|
|
15
|
+
} else if (/^[a-zA-Z]+$/.test(value)) {
|
|
16
|
+
callback(new Error('密码不能为纯字母'))
|
|
17
|
+
} else {
|
|
18
|
+
callback()
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const rules = {
|
|
23
|
+
oldPassword: [{ required: true, message: "请输入原密码", trigger: "blur" }],
|
|
24
|
+
newPassword: [
|
|
25
|
+
{ required: true, message: "请输入新密码", trigger: "blur" },
|
|
26
|
+
{ validator: validateNewPassword, trigger: "blur" }
|
|
27
|
+
],
|
|
28
|
+
repeatPassword: [{ required: true, message: "请再确认密码", trigger: "blur" }],
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const confirm = async () => {
|
|
32
|
+
const isValid = await refs.form.value.validate()
|
|
33
|
+
if (!isValid) return
|
|
34
|
+
|
|
35
|
+
if (data.newPassword !== data.repeatPassword) {
|
|
36
|
+
error.repeatPassword = '两次输入不一致'
|
|
37
|
+
} else {
|
|
38
|
+
const { oldPassword, newPassword } = data
|
|
39
|
+
const rsp = await User.Password.resource.put({
|
|
40
|
+
userId: store.state.userData.id,
|
|
41
|
+
oldPassword,
|
|
42
|
+
newPassword
|
|
43
|
+
})
|
|
44
|
+
if (rsp?.code === 500 && rsp.msg === '原密码错误') {
|
|
45
|
+
error.oldPassword = '原密码错误'
|
|
46
|
+
} else {
|
|
47
|
+
Object.keys(data).forEach(key => data[key] = '')
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div class="setting">
|
|
55
|
+
<div class="wrapper">
|
|
56
|
+
<el-form class="form" :ref="refs.form" :model="data" :rules="rules">
|
|
57
|
+
<el-form-item label="原密码" prop="oldPassword" :error="error.oldPassword">
|
|
58
|
+
<xl-input type="password" v-model="data.oldPassword" placeholder="" style="width:100%"/>
|
|
59
|
+
</el-form-item>
|
|
60
|
+
<el-form-item label="新密码" prop="newPassword" :error="error.newPassword">
|
|
61
|
+
<xl-input type="password" v-model="data.newPassword" placeholder="" style="width:100%"/>
|
|
62
|
+
</el-form-item>
|
|
63
|
+
<el-form-item label="请确认" prop="repeatPassword" :error="error.repeatPassword">
|
|
64
|
+
<xl-input type="password" v-model="data.repeatPassword" placeholder="" style="width:100%"/>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
<xl-button l="确定" type="primary" @click="confirm"/>
|
|
67
|
+
</el-form>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<style lang="less">
|
|
73
|
+
.setting {
|
|
74
|
+
background: #fff;
|
|
75
|
+
.wrapper {
|
|
76
|
+
height: 100%;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
.form {
|
|
81
|
+
width: 360px;
|
|
82
|
+
height: 300px;
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
72
87
|
</style>
|
package/dist/style/element.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* Element 弹窗打开时会给 body 增加右侧补偿,当前布局下会出现可见空隙 */
|
|
2
|
-
body.el-popup-parent--hidden {
|
|
3
|
-
width: 100% !important;
|
|
4
|
-
padding-right: 0 !important;
|
|
1
|
+
/* Element 弹窗打开时会给 body 增加右侧补偿,当前布局下会出现可见空隙 */
|
|
2
|
+
body.el-popup-parent--hidden {
|
|
3
|
+
width: 100% !important;
|
|
4
|
+
padding-right: 0 !important;
|
|
5
5
|
}
|
package/dist/style/reset.css
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
@import './element.css';
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
5
|
-
line-height: 1.5;
|
|
6
|
-
font-weight: 400;
|
|
7
|
-
|
|
8
|
-
color-scheme: light dark;
|
|
9
|
-
color: rgba(255, 255, 255, 0.87);
|
|
10
|
-
background-color: #242424;
|
|
11
|
-
|
|
12
|
-
font-synthesis: none;
|
|
13
|
-
text-rendering: optimizeLegibility;
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
-moz-osx-font-smoothing: grayscale;
|
|
16
|
-
-webkit-text-size-adjust: 100%;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
html,
|
|
20
|
-
body,
|
|
21
|
-
#app {
|
|
22
|
-
height: 100%;
|
|
23
|
-
width: 100%;
|
|
24
|
-
margin: 0;
|
|
25
|
-
padding: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
input[type=number]::-webkit-inner-spin-button,
|
|
29
|
-
input[type=number]::-webkit-outer-spin-button {
|
|
30
|
-
-webkit-appearance: none;
|
|
31
|
-
appearance: none;
|
|
32
|
-
margin: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
::-webkit-scrollbar {
|
|
36
|
-
width: 10px;
|
|
37
|
-
height: 10px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
::-webkit-scrollbar-thumb {
|
|
41
|
-
background-color: #e7ebf5;
|
|
42
|
-
border-radius: 10px;
|
|
1
|
+
@import './element.css';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
5
|
+
line-height: 1.5;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
|
|
8
|
+
color-scheme: light dark;
|
|
9
|
+
color: rgba(255, 255, 255, 0.87);
|
|
10
|
+
background-color: #242424;
|
|
11
|
+
|
|
12
|
+
font-synthesis: none;
|
|
13
|
+
text-rendering: optimizeLegibility;
|
|
14
|
+
-webkit-font-smoothing: antialiased;
|
|
15
|
+
-moz-osx-font-smoothing: grayscale;
|
|
16
|
+
-webkit-text-size-adjust: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html,
|
|
20
|
+
body,
|
|
21
|
+
#app {
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
input[type=number]::-webkit-inner-spin-button,
|
|
29
|
+
input[type=number]::-webkit-outer-spin-button {
|
|
30
|
+
-webkit-appearance: none;
|
|
31
|
+
appearance: none;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::-webkit-scrollbar {
|
|
36
|
+
width: 10px;
|
|
37
|
+
height: 10px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
::-webkit-scrollbar-thumb {
|
|
41
|
+
background-color: #e7ebf5;
|
|
42
|
+
border-radius: 10px;
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xilonglab/vue-main",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "xilong vue main",
|
|
5
|
-
"main": "packages/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"author": "xilonglab",
|
|
10
|
-
"license": "ISC",
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@imengyu/vue3-context-menu": "^1.3.3",
|
|
13
|
-
"element-plus": "2.3.6",
|
|
14
|
-
"image-conversion": "^2.1.1",
|
|
15
|
-
"vue-router": "^4.2.2"
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xilonglab/vue-main",
|
|
3
|
+
"version": "1.6.35",
|
|
4
|
+
"description": "xilong vue main",
|
|
5
|
+
"main": "packages/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "xilonglab",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@imengyu/vue3-context-menu": "^1.3.3",
|
|
13
|
+
"element-plus": "2.3.6",
|
|
14
|
+
"image-conversion": "^2.1.1",
|
|
15
|
+
"vue-router": "^4.2.2"
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
defineOptions({ name: "XlControlBar" })
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
leftFlex: {
|
|
6
|
-
type: Number,
|
|
7
|
-
default: 1,
|
|
8
|
-
},
|
|
9
|
-
rightFlex: {
|
|
10
|
-
type: Number,
|
|
11
|
-
default: 3,
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div class="xl-control-bar">
|
|
19
|
-
<div class="wrapper1" :style="`flex: ${props.leftFlex};`">
|
|
20
|
-
<div class="left">
|
|
21
|
-
<slot name="left" />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="wrapper2" :style="`flex: ${props.rightFlex};`">
|
|
25
|
-
<div class="right">
|
|
26
|
-
<slot name="right" />
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<style lang="less">
|
|
34
|
-
.xl-control-bar {
|
|
35
|
-
display: flex;
|
|
36
|
-
position: absolute;
|
|
37
|
-
top: 3px;
|
|
38
|
-
right: 0;
|
|
39
|
-
width: 100%;
|
|
40
|
-
z-index: 1;
|
|
41
|
-
background: transparent;
|
|
42
|
-
min-width: 0;
|
|
43
|
-
|
|
44
|
-
.left {
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.wrapper1 {
|
|
50
|
-
min-width: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.wrapper2 {
|
|
54
|
-
padding: 0;
|
|
55
|
-
min-width: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.right {
|
|
59
|
-
float: right;
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
padding: 3px 40px 3px 5px;
|
|
63
|
-
|
|
64
|
-
.xl-radio-button {
|
|
65
|
-
margin-right: 7px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.xl-button,
|
|
69
|
-
.ant-btn-group {
|
|
70
|
-
margin-left: 3px;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({ name: "XlControlBar" })
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
leftFlex: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 1,
|
|
8
|
+
},
|
|
9
|
+
rightFlex: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 3,
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="xl-control-bar">
|
|
19
|
+
<div class="wrapper1" :style="`flex: ${props.leftFlex};`">
|
|
20
|
+
<div class="left">
|
|
21
|
+
<slot name="left" />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="wrapper2" :style="`flex: ${props.rightFlex};`">
|
|
25
|
+
<div class="right">
|
|
26
|
+
<slot name="right" />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<style lang="less">
|
|
34
|
+
.xl-control-bar {
|
|
35
|
+
display: flex;
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 3px;
|
|
38
|
+
right: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
background: transparent;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
|
|
44
|
+
.left {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wrapper1 {
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wrapper2 {
|
|
54
|
+
padding: 0;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.right {
|
|
59
|
+
float: right;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
padding: 3px 40px 3px 5px;
|
|
63
|
+
|
|
64
|
+
.xl-radio-button {
|
|
65
|
+
margin-right: 7px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.xl-button,
|
|
69
|
+
.ant-btn-group {
|
|
70
|
+
margin-left: 3px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
</style>
|