@fishawack/lab-velocity 2.0.0-beta.10 → 2.0.0-beta.12
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 +31 -6
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -4
- package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
- package/_Build/vue/components/layout/Footer.vue +11 -10
- package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +2 -2
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +7 -7
- package/_Build/vue/components/layout/Layout.vue +74 -0
- package/_Build/vue/components/layout/Navigation.vue +77 -0
- package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +7 -2
- package/_Build/vue/components/layout/SideBar.vue +26 -0
- package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +6 -15
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +15 -17
- package/_Build/vue/components/layout/pageTitle.vue +1 -1
- package/_Build/vue/components/navigation/MenuItem.vue +7 -2
- package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
- package/_Build/vue/modules/AuthModule/js/router.js +21 -89
- package/_Build/vue/modules/AuthModule/js/store.js +13 -4
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +15 -8
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +180 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +15 -8
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +214 -0
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/register.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/reset.vue +9 -8
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +1 -0
- package/components/_header.scss +3 -27
- package/components/_layout.scss +56 -0
- package/components/_sidebar.scss +12 -27
- package/index.js +7 -1
- package/package.json +1 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -259
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -267
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -113
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -101
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -123
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
:password="true"
|
|
37
37
|
/>
|
|
38
38
|
|
|
39
|
-
<
|
|
39
|
+
<VelPasswordValidation
|
|
40
40
|
:password="form.password"
|
|
41
41
|
@passwordValid="updatePasswordValidity"
|
|
42
42
|
/>
|
|
@@ -83,6 +83,14 @@
|
|
|
83
83
|
import Form from "form-backend-validation";
|
|
84
84
|
|
|
85
85
|
export default {
|
|
86
|
+
components: {
|
|
87
|
+
VelPasswordValidation:
|
|
88
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
89
|
+
.default,
|
|
90
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
91
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
92
|
+
},
|
|
93
|
+
|
|
86
94
|
data() {
|
|
87
95
|
return {
|
|
88
96
|
form: new Form(
|
|
@@ -152,12 +160,5 @@ export default {
|
|
|
152
160
|
title: "Reset Password",
|
|
153
161
|
};
|
|
154
162
|
},
|
|
155
|
-
|
|
156
|
-
components: {
|
|
157
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
158
|
-
.default,
|
|
159
|
-
elInput: require("../../../components/form/basic.vue").default,
|
|
160
|
-
elButton: require("../../../components/basic/Button.vue").default,
|
|
161
|
-
},
|
|
162
163
|
};
|
|
163
164
|
</script>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<router-link to="/" class="logo" aria-label="Go to home page">
|
|
6
6
|
<GSvg
|
|
7
7
|
class="AuthModule__logo"
|
|
8
|
-
:name="
|
|
8
|
+
:name="$store.state.auth.logo"
|
|
9
9
|
embed
|
|
10
10
|
asis
|
|
11
11
|
role="presentation"
|
|
@@ -21,14 +21,5 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
export default {
|
|
25
|
-
mounted() {},
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
logoName: process.env.HYDRATE_LOGO,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
components: {},
|
|
33
|
-
};
|
|
24
|
+
export default {};
|
|
34
25
|
</script>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
required
|
|
34
34
|
/>
|
|
35
35
|
|
|
36
|
-
<
|
|
36
|
+
<VelPasswordValidation
|
|
37
37
|
:password="form.password"
|
|
38
38
|
@passwordValid="updatePasswordValidity"
|
|
39
39
|
/>
|
|
@@ -71,6 +71,14 @@
|
|
|
71
71
|
import Form from "form-backend-validation";
|
|
72
72
|
|
|
73
73
|
export default {
|
|
74
|
+
components: {
|
|
75
|
+
VelPasswordValidation:
|
|
76
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
77
|
+
.default,
|
|
78
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
79
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
80
|
+
},
|
|
81
|
+
|
|
74
82
|
data() {
|
|
75
83
|
return {
|
|
76
84
|
form: new Form(
|
|
@@ -136,12 +144,5 @@ export default {
|
|
|
136
144
|
title: "Reset Password",
|
|
137
145
|
};
|
|
138
146
|
},
|
|
139
|
-
|
|
140
|
-
components: {
|
|
141
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
142
|
-
.default,
|
|
143
|
-
elInput: require("../../../components/form/basic.vue").default,
|
|
144
|
-
elButton: require("../../../components/basic/Button.vue").default,
|
|
145
|
-
},
|
|
146
147
|
};
|
|
147
148
|
</script>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:error="form.errors"
|
|
43
43
|
/>
|
|
44
44
|
|
|
45
|
-
<
|
|
45
|
+
<VelPasswordValidation
|
|
46
46
|
:password="form.password"
|
|
47
47
|
@passwordValid="updatePasswordValidity"
|
|
48
48
|
/>
|
|
@@ -86,6 +86,14 @@ import Form from "form-backend-validation";
|
|
|
86
86
|
import { ElNotification } from "element-plus";
|
|
87
87
|
|
|
88
88
|
export default {
|
|
89
|
+
components: {
|
|
90
|
+
VelPasswordValidation:
|
|
91
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
92
|
+
.default,
|
|
93
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
94
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
95
|
+
},
|
|
96
|
+
|
|
89
97
|
data() {
|
|
90
98
|
return {
|
|
91
99
|
form: new Form(
|
|
@@ -160,12 +168,5 @@ export default {
|
|
|
160
168
|
this.isPasswordValid = isValid;
|
|
161
169
|
},
|
|
162
170
|
},
|
|
163
|
-
|
|
164
|
-
components: {
|
|
165
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
166
|
-
.default,
|
|
167
|
-
elInput: require("../../../components/form/basic.vue").default,
|
|
168
|
-
elButton: require("../../../components/basic/Button.vue").default,
|
|
169
|
-
},
|
|
170
171
|
};
|
|
171
172
|
</script>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
required
|
|
24
24
|
/>
|
|
25
25
|
|
|
26
|
-
<
|
|
26
|
+
<VelPasswordValidation
|
|
27
27
|
:password="form.password"
|
|
28
28
|
@passwordValid="updatePasswordValidity"
|
|
29
29
|
/>
|
|
@@ -68,6 +68,14 @@
|
|
|
68
68
|
import Form from "form-backend-validation";
|
|
69
69
|
|
|
70
70
|
export default {
|
|
71
|
+
components: {
|
|
72
|
+
VelPasswordValidation:
|
|
73
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
74
|
+
.default,
|
|
75
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
76
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
77
|
+
},
|
|
78
|
+
|
|
71
79
|
data() {
|
|
72
80
|
return {
|
|
73
81
|
form: new Form(
|
|
@@ -122,12 +130,5 @@ export default {
|
|
|
122
130
|
title: "Reset Password",
|
|
123
131
|
};
|
|
124
132
|
},
|
|
125
|
-
|
|
126
|
-
components: {
|
|
127
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
128
|
-
.default,
|
|
129
|
-
elInput: require("../../../components/form/basic.vue").default,
|
|
130
|
-
elButton: require("../../../components/basic/Button.vue").default,
|
|
131
|
-
},
|
|
132
133
|
};
|
|
133
134
|
</script>
|
package/components/_footer.scss
CHANGED
package/components/_header.scss
CHANGED
|
@@ -1,45 +1,21 @@
|
|
|
1
1
|
.vel-header {
|
|
2
2
|
border-bottom: solid get-ratio(1px) $color4;
|
|
3
3
|
background-color: $color0;
|
|
4
|
-
width: 100%;
|
|
5
|
-
box-sizing: border-box;
|
|
6
4
|
display: flex;
|
|
7
|
-
flex-wrap: wrap;
|
|
8
5
|
align-items: center;
|
|
9
|
-
align-content: center;
|
|
10
|
-
flex-basis: 100%;
|
|
11
6
|
justify-content: space-between;
|
|
12
7
|
padding: 1.5 * $spacing 3 * $spacing;
|
|
13
|
-
|
|
14
|
-
> * {
|
|
15
|
-
max-width: 50%;
|
|
16
|
-
flex-basis: 50%;
|
|
17
|
-
justify-content: flex-end !important;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.icon {
|
|
21
|
-
min-width: $spacing * 2.5;
|
|
22
|
-
max-width: $spacing * 2.5;
|
|
23
|
-
width: $spacing * 2.5;
|
|
24
|
-
height: $spacing * 2.5;
|
|
25
|
-
margin-right: 0.5 * $spacing;
|
|
26
|
-
}
|
|
27
8
|
}
|
|
28
9
|
|
|
29
10
|
.vel-header__list {
|
|
30
11
|
display: flex;
|
|
31
|
-
flex-wrap: wrap;
|
|
32
|
-
align-items: stretch;
|
|
33
|
-
align-content: stretch;
|
|
34
|
-
flex-basis: 100%;
|
|
35
|
-
padding-right: 1.5 * $spacing;
|
|
36
|
-
margin-left: -1.5 * $spacing;
|
|
37
|
-
margin-right: -1.5 * $spacing;
|
|
38
12
|
|
|
39
13
|
> div {
|
|
40
14
|
align-items: center;
|
|
15
|
+
|
|
41
16
|
&:not(:last-child) {
|
|
42
17
|
position: relative;
|
|
18
|
+
|
|
43
19
|
&::after {
|
|
44
20
|
position: absolute;
|
|
45
21
|
content: "";
|
|
@@ -47,7 +23,7 @@
|
|
|
47
23
|
height: 75%;
|
|
48
24
|
transform: translateY(-50%);
|
|
49
25
|
top: 50%;
|
|
50
|
-
right:
|
|
26
|
+
right: 0;
|
|
51
27
|
}
|
|
52
28
|
}
|
|
53
29
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
height: 100%;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.vel-app {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
height: 100dvh;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vel-header {
|
|
14
|
+
flex: 0 0 auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vel-content {
|
|
18
|
+
flex: 1 1 auto;
|
|
19
|
+
min-height: 0; /* allow shrinking */
|
|
20
|
+
display: flex;
|
|
21
|
+
overflow: auto; /* main scroll container */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.vel-sidebar {
|
|
25
|
+
min-height: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.vel-sidebar__inner {
|
|
29
|
+
position: sticky;
|
|
30
|
+
top: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
max-height: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.vel-sidebar__top {
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
min-height: 0;
|
|
39
|
+
overflow: auto; /* optional scroll */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vel-sidebar__bottom {
|
|
43
|
+
flex: 0 0 auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.vel-main {
|
|
47
|
+
flex: 1 1 auto;
|
|
48
|
+
min-height: 0;
|
|
49
|
+
overflow: auto;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.vel-main__inner {
|
|
55
|
+
flex-grow: 1;
|
|
56
|
+
}
|
package/components/_sidebar.scss
CHANGED
|
@@ -1,56 +1,41 @@
|
|
|
1
|
-
.vel-
|
|
2
|
-
|
|
1
|
+
.vel-sidebar {
|
|
2
|
+
width: $spacing * 7.5;
|
|
3
|
+
padding-top: $spacing * 2;
|
|
3
4
|
display: flex;
|
|
4
5
|
flex-direction: column;
|
|
5
|
-
box-shadow:
|
|
6
|
-
|
|
7
|
-
max-height: 100vh;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
transition: flex-basis 0.3s ease-in-out;
|
|
6
|
+
box-shadow: 0 $spacing * 0.5 $spacing * 0.5 0 hsla(0, 0, 0, 0.251);
|
|
7
|
+
transition: width 0.3s ease-in-out;
|
|
10
8
|
background-color: $color0;
|
|
11
9
|
|
|
12
|
-
position: sticky;
|
|
13
|
-
top: 0vh;
|
|
14
|
-
padding-top: 2 * $spacing;
|
|
15
|
-
min-width: get-ratio(64px);
|
|
16
|
-
flex-basis: get-ratio(64px);
|
|
17
|
-
|
|
18
10
|
> div {
|
|
19
11
|
&:first-child {
|
|
20
|
-
flex
|
|
21
|
-
}
|
|
22
|
-
&:last-child {
|
|
23
|
-
margin-bottom: 5.5vh;
|
|
12
|
+
flex: 1;
|
|
24
13
|
}
|
|
25
14
|
}
|
|
26
15
|
|
|
27
16
|
&.active {
|
|
28
|
-
|
|
29
|
-
min-width: 31.5 * $spacing;
|
|
17
|
+
width: 31.5 * $spacing;
|
|
30
18
|
|
|
31
|
-
.vel-
|
|
19
|
+
.vel-sidebar__button {
|
|
32
20
|
transform: rotateY(180deg);
|
|
33
21
|
}
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
24
|
|
|
37
|
-
.vel-
|
|
25
|
+
.vel-sidebar__button {
|
|
38
26
|
outline: none;
|
|
39
27
|
background-color: transparent;
|
|
40
28
|
border: none;
|
|
41
29
|
cursor: pointer;
|
|
30
|
+
|
|
42
31
|
&:focus {
|
|
43
32
|
outline: 1px solid;
|
|
44
33
|
}
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
.vel-
|
|
36
|
+
.vel-sidebar__bottom {
|
|
48
37
|
display: flex;
|
|
49
38
|
justify-content: flex-end;
|
|
50
39
|
border-top: solid 1px #e6e6e6;
|
|
51
|
-
padding: $spacing
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
main {
|
|
55
|
-
overflow: hidden;
|
|
40
|
+
padding: $spacing * 2;
|
|
56
41
|
}
|
package/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export const Auth = {
|
|
|
8
8
|
Store,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
export { default as Resource } from "./_Build/vue/modules/resource/index.js";
|
|
12
|
+
|
|
11
13
|
export { default as Button } from "./_Build/vue/components/basic/Button.vue";
|
|
12
14
|
export { default as Link } from "./_Build/vue/components/basic/link.vue";
|
|
13
15
|
|
|
@@ -24,9 +26,13 @@ export { default as Wysiwyg2 } from "./_Build/vue/components/form/Wysiwyg2.vue";
|
|
|
24
26
|
export { default as Upload } from "./_Build/vue/components/form/Upload.vue";
|
|
25
27
|
export { default as InputNumber } from "./_Build/vue/components/form/InputNumber.vue";
|
|
26
28
|
|
|
27
|
-
export { default as
|
|
29
|
+
export { default as Chip } from "./_Build/vue/components/layout/Chip.vue";
|
|
30
|
+
export { default as Chips } from "./_Build/vue/components/layout/Chips.vue";
|
|
31
|
+
export { default as SideBar } from "./_Build/vue/components/layout/SideBar.vue";
|
|
28
32
|
export { default as Footer } from "./_Build/vue/components/layout/Footer.vue";
|
|
29
33
|
export { default as Header } from "./_Build/vue/components/layout/Header.vue";
|
|
34
|
+
export { default as Layout } from "./_Build/vue/components/layout/Layout.vue";
|
|
35
|
+
export { default as Navigation } from "./_Build/vue/components/layout/Navigation.vue";
|
|
30
36
|
export { default as PageTitle } from "./_Build/vue/components/layout/pageTitle.vue";
|
|
31
37
|
export { default as Alert } from "./_Build/vue/components/layout/Alert.vue";
|
|
32
38
|
export { default as Tooltip } from "./_Build/vue/components/layout/Tooltip.vue";
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vel-side-bar" :class="{ active: active }">
|
|
3
|
-
<div>
|
|
4
|
-
<slot name="navigation" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<div class="vel-side-bar__bottom">
|
|
8
|
-
<button class="vel-side-bar__button" @click="active = !active">
|
|
9
|
-
<slot name="expand"> > </slot>
|
|
10
|
-
</button>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
name: "SideBar",
|
|
18
|
-
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
active: true,
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
</script>
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<VBreadcrumbs :items="breadcrumbs" class="mb-8" container-classes="m-0" />
|
|
3
|
-
|
|
4
|
-
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
5
|
-
<div class="grid__1/2">
|
|
6
|
-
<div class="grid__1/1 grid justify-between mb-4 items-end">
|
|
7
|
-
<h2 class="h1">User import</h2>
|
|
8
|
-
<div>
|
|
9
|
-
<VelButton
|
|
10
|
-
tag="a"
|
|
11
|
-
type="secondary"
|
|
12
|
-
href="/media/content/files/example.csv"
|
|
13
|
-
download
|
|
14
|
-
>
|
|
15
|
-
<GIcon
|
|
16
|
-
class="fill-1 mr-0.5"
|
|
17
|
-
name="icon-download"
|
|
18
|
-
embed
|
|
19
|
-
artboard
|
|
20
|
-
/>
|
|
21
|
-
Download example file
|
|
22
|
-
</VelButton>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="grid__1/1">
|
|
26
|
-
<VelSelect
|
|
27
|
-
v-model="form.roles"
|
|
28
|
-
placeholder="Select"
|
|
29
|
-
multiple
|
|
30
|
-
name="roles"
|
|
31
|
-
:error="form.errors"
|
|
32
|
-
label="Roles"
|
|
33
|
-
:options="[
|
|
34
|
-
{
|
|
35
|
-
label: 'Administrator',
|
|
36
|
-
value: '1',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: 'Subscriber',
|
|
40
|
-
value: '2',
|
|
41
|
-
},
|
|
42
|
-
]"
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
<VelSelect
|
|
46
|
-
v-if="form.roles && form.roles.length"
|
|
47
|
-
v-model="form.permissions"
|
|
48
|
-
placeholder="Select"
|
|
49
|
-
multiple
|
|
50
|
-
name="permissions"
|
|
51
|
-
:error="form.errors"
|
|
52
|
-
label="Permissions"
|
|
53
|
-
:options="[
|
|
54
|
-
{
|
|
55
|
-
label: `Inherit Permissions`,
|
|
56
|
-
value: null,
|
|
57
|
-
},
|
|
58
|
-
//{ // temporarily disabled as not used yet
|
|
59
|
-
// label: "Approve Content",
|
|
60
|
-
// value: "2"
|
|
61
|
-
//},
|
|
62
|
-
{
|
|
63
|
-
label: 'View content',
|
|
64
|
-
value: '3',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
label: 'Write content',
|
|
68
|
-
value: '4',
|
|
69
|
-
disabled: !form.roles.includes(1),
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: 'Delete content',
|
|
73
|
-
value: '5',
|
|
74
|
-
disabled: !form.roles.includes(1),
|
|
75
|
-
},
|
|
76
|
-
]"
|
|
77
|
-
/>
|
|
78
|
-
</div>
|
|
79
|
-
<div class="grid__1/1">
|
|
80
|
-
<hr class="my-3 hr-muted" />
|
|
81
|
-
|
|
82
|
-
<VelUpload
|
|
83
|
-
ref="upload"
|
|
84
|
-
v-model="form.files"
|
|
85
|
-
name="files"
|
|
86
|
-
label="Upload spreadsheet"
|
|
87
|
-
:auto-upload="false"
|
|
88
|
-
:limit="1"
|
|
89
|
-
:on-exceed="handleExceed"
|
|
90
|
-
>
|
|
91
|
-
<template #trigger>
|
|
92
|
-
<VelButton
|
|
93
|
-
class="mt"
|
|
94
|
-
type="primary"
|
|
95
|
-
:disabled="form.processing || form.files.length"
|
|
96
|
-
>Select file</VelButton
|
|
97
|
-
>
|
|
98
|
-
</template>
|
|
99
|
-
|
|
100
|
-
<VelButton
|
|
101
|
-
class="ml relative button--spinner"
|
|
102
|
-
type="success"
|
|
103
|
-
:disabled="form.processing || !form.files.length"
|
|
104
|
-
@click="submitUpload"
|
|
105
|
-
>
|
|
106
|
-
<span :class="{ active: !form.processing }"
|
|
107
|
-
>Upload</span
|
|
108
|
-
>
|
|
109
|
-
<VelSpinner :class="{ active: form.processing }" />
|
|
110
|
-
</VelButton>
|
|
111
|
-
|
|
112
|
-
<small class="block my color-muted"
|
|
113
|
-
>Upload one spreadsheet with a size less than
|
|
114
|
-
50MB</small
|
|
115
|
-
>
|
|
116
|
-
</VelUpload>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<script>
|
|
123
|
-
"use strict";
|
|
124
|
-
|
|
125
|
-
import Form from "form-backend-validation";
|
|
126
|
-
import { ElMessageBox, genFileId } from "element-plus";
|
|
127
|
-
import VelButton from "../../../../../../components/basic/Button.vue";
|
|
128
|
-
import VelSelect from "../../../../../../components/form/Select.vue";
|
|
129
|
-
import VelUpload from "../../../../../../components/form/Upload.vue";
|
|
130
|
-
import VelSpinner from "../../../../../../components/form/Spinner.vue";
|
|
131
|
-
|
|
132
|
-
export default {
|
|
133
|
-
name: "Create",
|
|
134
|
-
|
|
135
|
-
components: {
|
|
136
|
-
VBreadcrumbs: require("../../../../components/VBreadcrumbs.vue")
|
|
137
|
-
.default,
|
|
138
|
-
VelButton,
|
|
139
|
-
VelSelect,
|
|
140
|
-
VelUpload,
|
|
141
|
-
VelSpinner,
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
data() {
|
|
145
|
-
return {
|
|
146
|
-
id: null,
|
|
147
|
-
breadcrumbs: [
|
|
148
|
-
{
|
|
149
|
-
href: {
|
|
150
|
-
name: "index",
|
|
151
|
-
},
|
|
152
|
-
text: "Home",
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
form: new Form(
|
|
156
|
-
{
|
|
157
|
-
step: 0,
|
|
158
|
-
files: [],
|
|
159
|
-
roles: [2],
|
|
160
|
-
permissions: [null],
|
|
161
|
-
company_id: null,
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
http: window.axios,
|
|
165
|
-
},
|
|
166
|
-
),
|
|
167
|
-
};
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
watch: {
|
|
171
|
-
"form.roles": {
|
|
172
|
-
handler(newVal) {
|
|
173
|
-
const subscriptions = [
|
|
174
|
-
3, // view content
|
|
175
|
-
4, // write content
|
|
176
|
-
5, // delete content
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
if (!newVal.includes(1)) {
|
|
180
|
-
this.form.permissions = this.form.permissions.filter(
|
|
181
|
-
(item) => subscriptions.includes(item),
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
if (!newVal.includes(2)) {
|
|
185
|
-
this.form.permissions = this.form.permissions.filter(
|
|
186
|
-
(item) => !subscriptions.includes(item),
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
async mounted() {
|
|
195
|
-
this.id = this.$route.params.id;
|
|
196
|
-
this.form.company_id = this.id;
|
|
197
|
-
window.axios.get(`/api/companies/${this.id}`).then((res) => {
|
|
198
|
-
const company = res.data.data;
|
|
199
|
-
this.breadcrumbs.push(
|
|
200
|
-
{
|
|
201
|
-
href: {
|
|
202
|
-
name: "companies.show",
|
|
203
|
-
param: this.id,
|
|
204
|
-
},
|
|
205
|
-
text: company.name,
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
href: {
|
|
209
|
-
name: "companies.pload",
|
|
210
|
-
},
|
|
211
|
-
text: "User upload",
|
|
212
|
-
},
|
|
213
|
-
);
|
|
214
|
-
});
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
methods: {
|
|
218
|
-
submitUpload() {
|
|
219
|
-
this.form.post(`/api/users/import`).then(({ data }) => {
|
|
220
|
-
this.open(data);
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
handleExceed(files) {
|
|
225
|
-
this.$refs.upload.clearFiles();
|
|
226
|
-
|
|
227
|
-
const file = files[0];
|
|
228
|
-
file.uid = genFileId();
|
|
229
|
-
|
|
230
|
-
this.$refs.upload.handleStart(file);
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
open(data) {
|
|
234
|
-
let html = "Succesfully imported all users";
|
|
235
|
-
|
|
236
|
-
if (data.length > 0) {
|
|
237
|
-
html =
|
|
238
|
-
"Errors detected on upload following emails were not added to the system<table>";
|
|
239
|
-
for (let x = 0; x < data.length; x++) {
|
|
240
|
-
html += `<tr><td>${data[x].email}</td></tr>`;
|
|
241
|
-
}
|
|
242
|
-
html += "</table>";
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
ElMessageBox.alert(html, {
|
|
246
|
-
confirmButtonText: "Ok",
|
|
247
|
-
dangerouslyUseHTMLString: true,
|
|
248
|
-
})
|
|
249
|
-
.then(() => {
|
|
250
|
-
this.$router.replace({
|
|
251
|
-
name: "companies.show",
|
|
252
|
-
params: { id: this.id },
|
|
253
|
-
});
|
|
254
|
-
})
|
|
255
|
-
.catch(() => {});
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
</script>
|