@fishawack/lab-velocity 2.0.0-beta.2 → 2.0.0-beta.21
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 +439 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Select.vue +2 -2
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +5 -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} +13 -7
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +9 -7
- package/_Build/vue/components/layout/Layout.vue +76 -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} +19 -17
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +35 -25
- 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/axios.js +19 -0
- package/_Build/vue/modules/AuthModule/js/router.js +21 -89
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +32 -17
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +168 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +30 -18
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +202 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +23 -24
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +11 -10
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +24 -28
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/login.vue +9 -13
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +9 -11
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/register.vue +19 -21
- package/_Build/vue/modules/AuthModule/routes/reset.vue +14 -13
- package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +10 -9
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/verify.vue +13 -16
- package/_Build/vue/modules/resource/Children/create.vue +76 -0
- package/_Build/vue/modules/resource/Children/edit.vue +110 -0
- package/_Build/vue/modules/resource/Children/index.vue +47 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +57 -0
- package/_Build/vue/modules/resource/Children/show.vue +97 -0
- package/_Build/vue/modules/resource/index.js +280 -0
- package/_Build/vue/modules/resource/parent.vue +41 -0
- package/_base.scss +0 -1
- package/_defaults.scss +2 -13
- package/_variables.scss +9 -4
- package/components/_alert.scss +5 -0
- package/components/_auth.scss +163 -0
- package/components/_basic.scss +55 -0
- package/components/_breadcrumbs.scss +39 -0
- package/components/_button.scss +304 -0
- package/components/_cascader.scss +12 -0
- package/components/_checkbox.scss +41 -0
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +24 -0
- package/components/_datepicker.scss +52 -0
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +47 -0
- package/components/_form.scss +24 -0
- package/components/_header.scss +30 -0
- package/components/_icon.scss +25 -0
- package/components/_inputNumber.scss +22 -0
- package/components/_layout.scss +56 -0
- package/components/_link.scss +44 -0
- package/components/_loader.scss +43 -0
- package/components/_menu.scss +112 -0
- package/components/_modal.scss +24 -0
- package/components/_pageTitle.scss +8 -0
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +29 -0
- package/components/_sidebar.scss +41 -0
- package/components/_switch.scss +14 -0
- package/components/_table.scss +20 -0
- package/components/_tooltip.scss +4 -0
- package/components/_typography.scss +162 -0
- package/components/_upload.scss +15 -0
- package/components/_wysiwyg.scss +7 -0
- package/components/_wysiwyg2.scss +142 -0
- package/index.js +7 -1
- package/package.json +4 -2
- package/vendor.scss +0 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
- 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 -262
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
- 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
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="grid items-center my-4">
|
|
3
3
|
<slot>
|
|
4
|
-
<
|
|
4
|
+
<VelButton type="primary" native-type="submit" :loading="loading">
|
|
5
5
|
Save changes
|
|
6
|
-
</
|
|
6
|
+
</VelButton>
|
|
7
7
|
|
|
8
|
-
<
|
|
8
|
+
<VelButton tag="a" class="ml-2" @click="$router.go(-1)">
|
|
9
9
|
Discard changes
|
|
10
|
-
</
|
|
10
|
+
</VelButton>
|
|
11
11
|
|
|
12
|
-
<
|
|
12
|
+
<VelButton
|
|
13
13
|
v-if="method === 'patch' && preview"
|
|
14
14
|
class="ml-2"
|
|
15
15
|
tag="a"
|
|
@@ -18,14 +18,20 @@
|
|
|
18
18
|
link
|
|
19
19
|
>
|
|
20
20
|
<span v-text="`Preview`" />
|
|
21
|
-
</
|
|
21
|
+
</VelButton>
|
|
22
22
|
</slot>
|
|
23
23
|
</div>
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
+
import VelButton from "../basic/Button.vue";
|
|
28
|
+
|
|
27
29
|
export default {
|
|
28
|
-
name: "
|
|
30
|
+
name: "FormFooter",
|
|
31
|
+
|
|
32
|
+
components: {
|
|
33
|
+
VelButton,
|
|
34
|
+
},
|
|
29
35
|
|
|
30
36
|
props: {
|
|
31
37
|
loading: {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<template v-if="readonly">
|
|
6
6
|
<p>Roles</p>
|
|
7
7
|
<div v-if="!overrides" class="my-2">
|
|
8
|
-
<
|
|
8
|
+
<VelChip
|
|
9
9
|
class="mr mb inline-block"
|
|
10
10
|
name="inherited"
|
|
11
11
|
label="Inherited"
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
:key="roles.find((d) => d.id === role)"
|
|
18
18
|
class="mr mb inline-block"
|
|
19
19
|
>
|
|
20
|
-
<
|
|
20
|
+
<VelChip
|
|
21
21
|
:name="roles.find((d) => d.id === role)?.name"
|
|
22
22
|
:label="roles.find((d) => d.id === role)?.label"
|
|
23
23
|
/>
|
|
24
24
|
</li>
|
|
25
25
|
</ul>
|
|
26
26
|
</template>
|
|
27
|
-
<
|
|
27
|
+
<VelSelect
|
|
28
28
|
v-else
|
|
29
29
|
v-model="form.roles"
|
|
30
30
|
class="mt-2"
|
|
@@ -49,21 +49,23 @@
|
|
|
49
49
|
:key="index"
|
|
50
50
|
class="mr mb inline-block"
|
|
51
51
|
>
|
|
52
|
-
<
|
|
52
|
+
<VelChip :name="permission.name" :label="permission.label" />
|
|
53
53
|
</li>
|
|
54
54
|
</ul>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
|
-
<
|
|
57
|
+
<VelRoleLegend class="mt-2" />
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
60
|
<script>
|
|
61
61
|
import axios from "axios";
|
|
62
|
+
import VelSelect from "../form/Select.vue";
|
|
62
63
|
|
|
63
64
|
export default {
|
|
64
65
|
components: {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
VelRoleLegend: require("./RoleLegend.vue").default,
|
|
67
|
+
VelChip: require("./Chip.vue").default,
|
|
68
|
+
VelSelect,
|
|
67
69
|
},
|
|
68
70
|
|
|
69
71
|
props: {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vel-app">
|
|
3
|
+
<VelHeader class="justify-end-dive">
|
|
4
|
+
<router-link :to="{ name: 'index' }">
|
|
5
|
+
<GSvg
|
|
6
|
+
class="logo"
|
|
7
|
+
style="width: 180px"
|
|
8
|
+
embed
|
|
9
|
+
asis
|
|
10
|
+
:name="$store.state.auth.logo"
|
|
11
|
+
/>
|
|
12
|
+
</router-link>
|
|
13
|
+
<template #links>
|
|
14
|
+
<div class="flex items-center pr">
|
|
15
|
+
<GIcon
|
|
16
|
+
class="icon fill-1 icon--0.5 mr-0.5"
|
|
17
|
+
name="icon-account-circle"
|
|
18
|
+
embed
|
|
19
|
+
asis
|
|
20
|
+
/>
|
|
21
|
+
<span>{{ $store?.state?.auth?.user?.name }}</span>
|
|
22
|
+
</div>
|
|
23
|
+
<VelButton
|
|
24
|
+
class="ml"
|
|
25
|
+
type="primary"
|
|
26
|
+
tag="a"
|
|
27
|
+
round
|
|
28
|
+
:href="`${$root.spaUrl}?authenticated=1`"
|
|
29
|
+
>
|
|
30
|
+
<span v-text="`Access ${$root.appName}`" />
|
|
31
|
+
</VelButton>
|
|
32
|
+
</template>
|
|
33
|
+
</VelHeader>
|
|
34
|
+
<div class="vel-content">
|
|
35
|
+
<VelSideBar>
|
|
36
|
+
<template #navigation>
|
|
37
|
+
<VelNavigation v-bind="$attrs" />
|
|
38
|
+
</template>
|
|
39
|
+
<template #expand>
|
|
40
|
+
<GIcon
|
|
41
|
+
class="icon icon--0.5"
|
|
42
|
+
name="icon-keyboard-tab"
|
|
43
|
+
embed
|
|
44
|
+
asis
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
</VelSideBar>
|
|
48
|
+
<main class="vel-main">
|
|
49
|
+
<div class="vel-main__inner">
|
|
50
|
+
<slot />
|
|
51
|
+
</div>
|
|
52
|
+
<VelFooter contact="mailTo:det@avalerehealth.com">
|
|
53
|
+
<GSvg
|
|
54
|
+
class="logo fill-0"
|
|
55
|
+
style="width: 180px"
|
|
56
|
+
embed
|
|
57
|
+
asis
|
|
58
|
+
:name="$store.state.auth.logo"
|
|
59
|
+
/>
|
|
60
|
+
</VelFooter>
|
|
61
|
+
</main>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
export default {
|
|
68
|
+
components: {
|
|
69
|
+
VelHeader: require("./Header.vue").default,
|
|
70
|
+
VelSideBar: require("./SideBar.vue").default,
|
|
71
|
+
VelFooter: require("./Footer.vue").default,
|
|
72
|
+
VelNavigation: require("./Navigation.vue").default,
|
|
73
|
+
VelButton: require("../basic/Button.vue").default,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VMenu>
|
|
3
|
+
<template v-for="(link, lkey) in links" :key="lkey">
|
|
4
|
+
<MenuItem v-if="!link.children" :index="lkey">
|
|
5
|
+
<router-link :to="link.href">
|
|
6
|
+
<GIcon
|
|
7
|
+
class="icon icon--0.5"
|
|
8
|
+
:name="link.icon"
|
|
9
|
+
asis
|
|
10
|
+
embed
|
|
11
|
+
/>
|
|
12
|
+
<span>{{ link.title }}</span>
|
|
13
|
+
</router-link>
|
|
14
|
+
</MenuItem>
|
|
15
|
+
<SubMenu v-else :id="lkey" :index="lkey">
|
|
16
|
+
<template #title>
|
|
17
|
+
<GIcon
|
|
18
|
+
class="icon icon--0.5"
|
|
19
|
+
:name="link.icon"
|
|
20
|
+
asis
|
|
21
|
+
embed
|
|
22
|
+
/>
|
|
23
|
+
<span>{{ link.title }}</span>
|
|
24
|
+
</template>
|
|
25
|
+
<MenuItem
|
|
26
|
+
v-for="(child, cindex) in link.children"
|
|
27
|
+
:key="cindex"
|
|
28
|
+
:index="lkey + '-1-' + cindex"
|
|
29
|
+
>
|
|
30
|
+
<router-link :to="child.href">
|
|
31
|
+
<span>{{ child.title }}</span>
|
|
32
|
+
</router-link>
|
|
33
|
+
</MenuItem>
|
|
34
|
+
</SubMenu>
|
|
35
|
+
</template>
|
|
36
|
+
</VMenu>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: "Navigation",
|
|
42
|
+
|
|
43
|
+
components: {
|
|
44
|
+
VMenu: require("../navigation/Menu.vue").default,
|
|
45
|
+
MenuItem: require("../navigation/MenuItem.vue").default,
|
|
46
|
+
SubMenu: require("../navigation/SubMenu.vue").default,
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
props: {
|
|
50
|
+
links: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => [
|
|
53
|
+
{
|
|
54
|
+
title: "Home",
|
|
55
|
+
href: { name: "index" },
|
|
56
|
+
icon: "icon-home",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: "Companies",
|
|
60
|
+
href: { name: "companies.index" },
|
|
61
|
+
icon: "icon-cases",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: "Users",
|
|
65
|
+
href: { name: "users.index" },
|
|
66
|
+
icon: "icon-user",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: "Utilities",
|
|
70
|
+
href: { name: "index" },
|
|
71
|
+
icon: "icon-utility",
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
<div
|
|
6
6
|
class="p-1.5 mr-2 border-radius border border-solid border-muted flex items-center justify-center"
|
|
7
7
|
>
|
|
8
|
-
<GIcon
|
|
8
|
+
<GIcon
|
|
9
|
+
class="fill-1 icon--0.5"
|
|
10
|
+
:name="icon"
|
|
11
|
+
embed
|
|
12
|
+
artboard
|
|
13
|
+
/>
|
|
9
14
|
</div>
|
|
10
15
|
</span>
|
|
11
16
|
|
|
@@ -22,7 +27,7 @@
|
|
|
22
27
|
|
|
23
28
|
<script>
|
|
24
29
|
export default {
|
|
25
|
-
name: "
|
|
30
|
+
name: "PageHeader",
|
|
26
31
|
|
|
27
32
|
props: {
|
|
28
33
|
icon: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vel-sidebar" :class="{ active: active }">
|
|
3
|
+
<div class="vel-sidebar__inner">
|
|
4
|
+
<div class="vel-sidebar__top">
|
|
5
|
+
<slot name="navigation" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="vel-sidebar__bottom">
|
|
8
|
+
<button class="vel-sidebar__button" @click="active = !active">
|
|
9
|
+
<slot name="expand"> > </slot>
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: "SideBar",
|
|
19
|
+
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
active: true,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-table
|
|
3
3
|
:data="$props.data"
|
|
4
|
-
:height="fixedHeight ? 762 :
|
|
4
|
+
:height="fixedHeight ? 762 : undefined"
|
|
5
5
|
style="width: 100%"
|
|
6
6
|
@sort-change="handleSort"
|
|
7
7
|
>
|
|
@@ -13,24 +13,17 @@
|
|
|
13
13
|
<el-table-column
|
|
14
14
|
:width="item.width ?? 'auto'"
|
|
15
15
|
:sortable="!!item.sortable ? 'custom' : false"
|
|
16
|
-
:label="
|
|
16
|
+
:label="
|
|
17
|
+
item.label ||
|
|
18
|
+
item.key[0].toUpperCase() + item.key.slice(1)
|
|
19
|
+
"
|
|
17
20
|
:prop="item.key"
|
|
18
21
|
:show-overflow-tooltip="true"
|
|
19
22
|
>
|
|
20
23
|
<!-- Support a custom render function -->
|
|
21
24
|
<template v-if="item.render" #default="scope">
|
|
22
|
-
{{ item.render(scope.row) }}
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<!-- Support module passed (as a raw component or :is property) -->
|
|
26
|
-
<template v-else-if="item.component" #default="scope">
|
|
27
25
|
<component
|
|
28
|
-
:is="
|
|
29
|
-
item.component.is
|
|
30
|
-
? item.component.is(scope.row)
|
|
31
|
-
: item.component.module(scope.row)
|
|
32
|
-
"
|
|
33
|
-
v-bind="item.component.props(scope.row)"
|
|
26
|
+
:is="item.render({ model: scope.row, ...this })"
|
|
34
27
|
/>
|
|
35
28
|
</template>
|
|
36
29
|
</el-table-column>
|
|
@@ -47,18 +40,18 @@
|
|
|
47
40
|
v-if="$props.displayShowAction"
|
|
48
41
|
:to="$props.targetAction($props.data[scope.$index])"
|
|
49
42
|
>
|
|
50
|
-
<
|
|
43
|
+
<VelButton size="small" type="primary">
|
|
51
44
|
{{ `View` }}
|
|
52
|
-
</
|
|
45
|
+
</VelButton>
|
|
53
46
|
</router-link>
|
|
54
47
|
<router-link
|
|
55
48
|
v-if="$props.displayEditAction"
|
|
56
49
|
class="ml"
|
|
57
50
|
:to="$props.editAction($props.data[scope.$index])"
|
|
58
51
|
>
|
|
59
|
-
<
|
|
52
|
+
<VelButton size="small">
|
|
60
53
|
{{ `Edit` }}
|
|
61
|
-
</
|
|
54
|
+
</VelButton>
|
|
62
55
|
</router-link>
|
|
63
56
|
</template>
|
|
64
57
|
</el-table-column>
|
|
@@ -67,9 +60,18 @@
|
|
|
67
60
|
</template>
|
|
68
61
|
|
|
69
62
|
<script>
|
|
63
|
+
import { ElTable, ElTableColumn } from "element-plus";
|
|
64
|
+
import VelButton from "../basic/Button.vue";
|
|
65
|
+
|
|
70
66
|
export default {
|
|
71
67
|
name: "VTable",
|
|
72
68
|
|
|
69
|
+
components: {
|
|
70
|
+
ElTable,
|
|
71
|
+
ElTableColumn,
|
|
72
|
+
VelButton,
|
|
73
|
+
},
|
|
74
|
+
|
|
73
75
|
props: {
|
|
74
76
|
data: {
|
|
75
77
|
type: [Array, Object],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</p>
|
|
14
14
|
</div>
|
|
15
15
|
<div class="flex justify-end items-end grid__2/3">
|
|
16
|
-
<
|
|
16
|
+
<VelBasic
|
|
17
17
|
v-if="jsonData.searchable"
|
|
18
18
|
ref="search"
|
|
19
19
|
v-model="search"
|
|
@@ -25,11 +25,15 @@
|
|
|
25
25
|
@update:model-value="handleSearch"
|
|
26
26
|
>
|
|
27
27
|
<template #prepend
|
|
28
|
-
><GIcon
|
|
28
|
+
><GIcon
|
|
29
|
+
embed
|
|
30
|
+
asis
|
|
31
|
+
name="icon-search"
|
|
32
|
+
class="icon--0.5"
|
|
29
33
|
/></template>
|
|
30
|
-
</
|
|
34
|
+
</VelBasic>
|
|
31
35
|
<slot v-if="displayActions" name="table-action">
|
|
32
|
-
<
|
|
36
|
+
<VelButton
|
|
33
37
|
v-if="displayEditAction"
|
|
34
38
|
size="large"
|
|
35
39
|
type="primary"
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
class="ml-2"
|
|
38
42
|
@click="
|
|
39
43
|
$router.push({
|
|
40
|
-
name: `${jsonData.
|
|
44
|
+
name: `${jsonData.slug}.create`,
|
|
41
45
|
})
|
|
42
46
|
"
|
|
43
47
|
>
|
|
@@ -45,16 +49,16 @@
|
|
|
45
49
|
name="icon-plus"
|
|
46
50
|
embed
|
|
47
51
|
asis
|
|
48
|
-
class="fill-0 mr-0.5"
|
|
52
|
+
class="fill-0 icon--0.5 mr-0.5"
|
|
49
53
|
/>
|
|
50
54
|
Create new {{ jsonData.label }}
|
|
51
|
-
</
|
|
55
|
+
</VelButton>
|
|
52
56
|
</slot>
|
|
53
57
|
</div>
|
|
54
58
|
</slot>
|
|
55
59
|
</div>
|
|
56
60
|
<div class="bg-0 p-0.5 box-shadow-1 border-r-4">
|
|
57
|
-
<
|
|
61
|
+
<VelTable
|
|
58
62
|
:data="table_data"
|
|
59
63
|
:structure="jsonData.tableStructure"
|
|
60
64
|
:label="jsonData.label"
|
|
@@ -62,13 +66,13 @@
|
|
|
62
66
|
:fixed-height="fixedHeight"
|
|
63
67
|
:target-action="
|
|
64
68
|
(item) => ({
|
|
65
|
-
name: `${jsonData.
|
|
69
|
+
name: `${jsonData.slug}.show`,
|
|
66
70
|
params: { id: item.id },
|
|
67
71
|
})
|
|
68
72
|
"
|
|
69
73
|
:edit-action="
|
|
70
74
|
(item) => ({
|
|
71
|
-
name: `${jsonData.
|
|
75
|
+
name: `${jsonData.slug}.edit`,
|
|
72
76
|
params: { id: item.id },
|
|
73
77
|
})
|
|
74
78
|
"
|
|
@@ -78,7 +82,7 @@
|
|
|
78
82
|
@sort="handleSort"
|
|
79
83
|
>
|
|
80
84
|
<slot name="table-content"></slot>
|
|
81
|
-
</
|
|
85
|
+
</VelTable>
|
|
82
86
|
|
|
83
87
|
<div class="flex justify-center items-center py-2">
|
|
84
88
|
<el-pagination
|
|
@@ -93,32 +97,37 @@
|
|
|
93
97
|
</div>
|
|
94
98
|
</div>
|
|
95
99
|
<div v-else class="absolute transform-center text-center">
|
|
96
|
-
<
|
|
97
|
-
<p v-text="`Loading...`" />
|
|
100
|
+
<VelSpinner />
|
|
98
101
|
</div>
|
|
99
102
|
</template>
|
|
100
103
|
|
|
101
104
|
<script>
|
|
105
|
+
import axios from "axios";
|
|
106
|
+
import { ElPagination } from "element-plus";
|
|
107
|
+
import VelButton from "../basic/Button.vue";
|
|
108
|
+
import VelBasic from "../form/basic.vue";
|
|
109
|
+
import VelSpinner from "../form/Spinner.vue";
|
|
110
|
+
|
|
102
111
|
export default {
|
|
103
|
-
name: "
|
|
112
|
+
name: "TableSorter",
|
|
104
113
|
|
|
105
114
|
components: {
|
|
106
|
-
|
|
115
|
+
VelTable: require("./Table.vue").default,
|
|
116
|
+
VelButton,
|
|
117
|
+
VelBasic,
|
|
118
|
+
ElPagination,
|
|
119
|
+
VelSpinner,
|
|
107
120
|
},
|
|
108
121
|
|
|
109
122
|
props: {
|
|
110
123
|
jsonData: {
|
|
111
124
|
required: true,
|
|
112
|
-
type:
|
|
125
|
+
type: Object,
|
|
113
126
|
},
|
|
114
127
|
fixedHeight: {
|
|
115
128
|
default: true,
|
|
116
129
|
type: Boolean,
|
|
117
130
|
},
|
|
118
|
-
api: {
|
|
119
|
-
required: true,
|
|
120
|
-
type: String,
|
|
121
|
-
},
|
|
122
131
|
defaults: {
|
|
123
132
|
required: false,
|
|
124
133
|
type: String,
|
|
@@ -193,11 +202,12 @@ export default {
|
|
|
193
202
|
`page=${page}`,
|
|
194
203
|
];
|
|
195
204
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
const query = mergedQuery.join("&");
|
|
206
|
+
|
|
207
|
+
return axios
|
|
208
|
+
.get(`${this.$props.jsonData.api}${query ? "?" + query : ""}`)
|
|
209
|
+
.then((res) => res.data)
|
|
210
|
+
.catch(console.log);
|
|
201
211
|
},
|
|
202
212
|
|
|
203
213
|
getStatusLabel(status) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-menu-item
|
|
2
|
+
<el-menu-item class="vel-menu-item" v-bind="$props" :index="`${index}`">
|
|
3
3
|
<template #title>
|
|
4
4
|
<slot name="title" />
|
|
5
5
|
</template>
|
|
@@ -15,6 +15,11 @@ export default {
|
|
|
15
15
|
components: {
|
|
16
16
|
ElMenuItem,
|
|
17
17
|
},
|
|
18
|
-
props:
|
|
18
|
+
props: {
|
|
19
|
+
index: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
19
24
|
};
|
|
20
25
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-sub-menu
|
|
2
|
+
<el-sub-menu v-bind="$props" :index="`${index}`">
|
|
3
3
|
<template #title>
|
|
4
4
|
<slot name="title" />
|
|
5
5
|
</template>
|
|
@@ -15,6 +15,11 @@ export default {
|
|
|
15
15
|
components: {
|
|
16
16
|
ElSubMenu,
|
|
17
17
|
},
|
|
18
|
-
props:
|
|
18
|
+
props: {
|
|
19
|
+
index: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
19
24
|
};
|
|
20
25
|
</script>
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import debounce from "lodash/debounce";
|
|
3
|
+
|
|
4
|
+
import { ElNotification } from "element-plus";
|
|
5
|
+
|
|
6
|
+
const displayErrorNotification = debounce(async function errors(e) {
|
|
7
|
+
if (e.response && !e.response.data.errors) {
|
|
8
|
+
ElNotification.error({
|
|
9
|
+
title: "Error",
|
|
10
|
+
message:
|
|
11
|
+
e.response.data.message ||
|
|
12
|
+
`${e.response.status}: ${
|
|
13
|
+
e.response.statusText || "Please try again later!"
|
|
14
|
+
}`,
|
|
15
|
+
duration: 10000,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}, 250);
|
|
2
19
|
|
|
3
20
|
function setAxiosDefaults(baseUrl, router) {
|
|
4
21
|
axios.defaults.baseURL = baseUrl;
|
|
@@ -25,6 +42,8 @@ function setAxiosDefaults(baseUrl, router) {
|
|
|
25
42
|
}
|
|
26
43
|
}
|
|
27
44
|
|
|
45
|
+
displayErrorNotification(error);
|
|
46
|
+
|
|
28
47
|
return Promise.reject(error);
|
|
29
48
|
});
|
|
30
49
|
|