@xilonglab/vue-main 1.6.55 → 1.6.56
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 +88 -86
- package/dist/style/element.css +4 -4
- package/dist/style/reset.css +42 -42
- package/package.json +16 -16
- package/packages/form/XlSearchSelect.vue +5 -28
- package/packages/view/XlDataView.vue +269 -269
package/dist/page/setting.vue
CHANGED
|
@@ -1,87 +1,89 @@
|
|
|
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('
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
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 if (value && value === data.oldPassword) {
|
|
18
|
+
callback(new Error('新密码不能与原密码相同'))
|
|
19
|
+
} else {
|
|
20
|
+
callback()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const rules = {
|
|
25
|
+
oldPassword: [{ required: true, message: "请输入原密码", trigger: "blur" }],
|
|
26
|
+
newPassword: [
|
|
27
|
+
{ required: true, message: "请输入新密码", trigger: "blur" },
|
|
28
|
+
{ validator: validateNewPassword, trigger: "blur" }
|
|
29
|
+
],
|
|
30
|
+
repeatPassword: [{ required: true, message: "请再确认密码", trigger: "blur" }],
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const confirm = async () => {
|
|
34
|
+
const isValid = await refs.form.value.validate()
|
|
35
|
+
if (!isValid) return
|
|
36
|
+
|
|
37
|
+
if (data.newPassword !== data.repeatPassword) {
|
|
38
|
+
error.repeatPassword = '两次输入不一致'
|
|
39
|
+
} else {
|
|
40
|
+
const { oldPassword, newPassword } = data
|
|
41
|
+
const rsp = await User.Password.resource.put({
|
|
42
|
+
userId: store.state.userData.id,
|
|
43
|
+
oldPassword,
|
|
44
|
+
newPassword
|
|
45
|
+
})
|
|
46
|
+
if (rsp?.code === 500 && rsp.msg === '原密码错误') {
|
|
47
|
+
error.oldPassword = '原密码错误'
|
|
48
|
+
} else {
|
|
49
|
+
Object.keys(data).forEach(key => data[key] = '')
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div class="setting">
|
|
57
|
+
<div class="wrapper">
|
|
58
|
+
<el-form class="form" :ref="refs.form" :model="data" :rules="rules">
|
|
59
|
+
<el-form-item label="原密码" prop="oldPassword" :error="error.oldPassword">
|
|
60
|
+
<xl-input type="password" v-model="data.oldPassword" placeholder="" style="width:100%"/>
|
|
61
|
+
</el-form-item>
|
|
62
|
+
<el-form-item label="新密码" prop="newPassword" :error="error.newPassword">
|
|
63
|
+
<xl-input type="password" v-model="data.newPassword" placeholder="" style="width:100%"/>
|
|
64
|
+
</el-form-item>
|
|
65
|
+
<el-form-item label="请确认" prop="repeatPassword" :error="error.repeatPassword">
|
|
66
|
+
<xl-input type="password" v-model="data.repeatPassword" placeholder="" style="width:100%"/>
|
|
67
|
+
</el-form-item>
|
|
68
|
+
<xl-button l="确定" type="primary" @click="confirm"/>
|
|
69
|
+
</el-form>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<style lang="less">
|
|
75
|
+
.setting {
|
|
76
|
+
background: #fff;
|
|
77
|
+
.wrapper {
|
|
78
|
+
height: 100%;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
.form {
|
|
83
|
+
width: 360px;
|
|
84
|
+
height: 300px;
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
87
89
|
</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.56",
|
|
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,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
defineOptions({ name: "XlSearchSelect" })
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { computed, isRef } from 'vue'
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
const emits = defineEmits(['change', 'update:modelValue'])
|
|
@@ -35,7 +35,7 @@ const props = defineProps({
|
|
|
35
35
|
},
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const currentOptions = computed(() => isRef(props.options) ? props.options.value : props.options)
|
|
39
39
|
|
|
40
40
|
const value = computed({
|
|
41
41
|
get() {
|
|
@@ -46,37 +46,14 @@ const value = computed({
|
|
|
46
46
|
emits('update:modelValue', data)
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
function handleClick() {
|
|
51
|
-
showOptions.value = isRef(props.options) ? props.options.value : props.options;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function handleFilter(val) {
|
|
55
|
-
const options = isRef(props.options) ? props.options.value : props.options;
|
|
56
|
-
if (val) {
|
|
57
|
-
showOptions.value = options.filter((item) => {
|
|
58
|
-
return item.label ? item.label.includes(val) : false;
|
|
59
|
-
});
|
|
60
|
-
} else {
|
|
61
|
-
showOptions.value = options;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
watch(() => isRef(props.options) ? props.options.value : props.options, (val) => {
|
|
66
|
-
handleClick()
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
onMounted(() => {
|
|
70
|
-
handleClick()
|
|
71
|
-
})
|
|
72
49
|
</script>
|
|
73
50
|
|
|
74
51
|
|
|
75
52
|
<template>
|
|
76
53
|
<el-select class="xl-search-select xl-form-item" v-model="value" :placeholder="l?l:placeholder" filterable
|
|
77
|
-
:
|
|
78
|
-
:multiple="multiple" clearable>
|
|
79
|
-
<el-option v-for="(option, index) in
|
|
54
|
+
:style="{ width: `${width}px` }" :disabled="disabled"
|
|
55
|
+
:multiple="multiple" :reserve-keyword="false" clearable>
|
|
56
|
+
<el-option v-for="(option, index) in currentOptions" :key="index" :label="option.label" :value="option.value">
|
|
80
57
|
</el-option>
|
|
81
58
|
</el-select>
|
|
82
59
|
</template>
|