mooho-base-admin-plus 0.1.70 → 0.4.2
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/mooho-base-admin-plus.min.esm.js +17718 -18051
- package/dist/mooho-base-admin-plus.min.js +77 -67
- package/dist/setting.js +6 -17
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/public/setting.js +6 -17
- package/src/api/customModel.js +1 -1
- package/src/api/dataSource.js +1 -1
- package/src/api/dataView.js +1 -1
- package/src/api/i18nText +33 -0
- package/src/api/model.js +1 -1
- package/src/components/home/notice-list.vue +2 -2
- package/src/components/home/shortcut.vue +9 -9
- package/src/components/input/dialog-select.vue +3 -3
- package/src/components/input/item-select.vue +5 -5
- package/src/components/upload/upload-attachment.vue +13 -3
- package/src/components/upload/upload-image.vue +2 -2
- package/src/components/view/column-check.vue +3 -3
- package/src/components/view/column-edit.vue +18 -18
- package/src/components/view/column-select.vue +4 -4
- package/src/components/view/condition-edit.vue +10 -10
- package/src/components/view/filter-edit.vue +30 -13
- package/src/components/view/filter-setting.vue +8 -8
- package/src/components/view/form-setting-layout.vue +24 -24
- package/src/components/view/form-setting.vue +18 -18
- package/src/components/view/group-column.vue +5 -5
- package/src/components/view/group-method.vue +5 -5
- package/src/components/view/modal-form-filter.vue +28 -25
- package/src/components/view/modal-form-sort.vue +32 -27
- package/src/components/view/modal-form.vue +30 -8
- package/src/components/view/modal-table.vue +22 -2
- package/src/components/view/table-filter.vue +18 -11
- package/src/components/view/table-setting.vue +30 -42
- package/src/components/view/view-chart.vue +6 -6
- package/src/components/view/view-form-draggable.vue +3 -3
- package/src/components/view/view-form.vue +23 -13
- package/src/components/view/view-table.vue +83 -39
- package/src/components/workflow/flow-chart.vue +22 -23
- package/src/i18n/index.js +7 -7
- package/src/i18n/locale/en-US.js +1 -1
- package/src/i18n/locale/lang.js +1 -1
- package/src/i18n/locale/zh-CN.js +1 -1
- package/src/index.js +13 -8
- package/src/layouts/basic-layout/header-breadcrumb/index.vue +18 -3
- package/src/layouts/basic-layout/header-i18n/index.vue +5 -6
- package/src/layouts/basic-layout/header-notice/index.vue +2 -2
- package/src/layouts/basic-layout/header-search/index.vue +3 -3
- package/src/layouts/basic-layout/header-user/index.vue +18 -18
- package/src/layouts/basic-layout/menu-side/index.vue +9 -3
- package/src/layouts/basic-layout/menu-side/menu-title.vue +5 -4
- package/src/layouts/basic-layout/mixins/click-item.js +21 -21
- package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -13
- package/src/layouts/basic-layout/mixins/translate-title.js +11 -11
- package/src/layouts/basic-layout/tabs/index.vue +4 -4
- package/src/layouts/basic-layout/water-mark/index.vue +29 -29
- package/src/libs/random_str.js +10 -10
- package/src/libs/request/index.js +18 -4
- package/src/libs/water-mark.js +44 -44
- package/src/mixins/page.js +72 -18
- package/src/pages/account/login.vue +6 -6
- package/src/pages/common/task-form.vue +33 -33
- package/src/pages/common/todo.vue +1 -1
- package/src/pages/system/apiLog.vue +7 -7
- package/src/pages/system/applicationType.vue +6 -6
- package/src/pages/system/customTable.vue +7 -7
- package/src/pages/system/dict.vue +1 -1
- package/src/pages/system/dictType.vue +4 -4
- package/src/pages/system/entityView.vue +3 -3
- package/src/pages/system/error/404.vue +1 -1
- package/src/pages/system/extendColumn.vue +7 -7
- package/src/pages/system/formView.vue +10 -10
- package/src/pages/system/i18nText.vue +98 -0
- package/src/pages/system/log.vue +4 -4
- package/src/pages/system/openUser.vue +5 -5
- package/src/pages/system/organization.vue +1 -1
- package/src/pages/system/permission.vue +5 -5
- package/src/pages/system/planJob.vue +3 -3
- package/src/pages/system/process.vue +10 -10
- package/src/pages/system/role.vue +18 -18
- package/src/pages/system/rolePropertyEdit.vue +83 -100
- package/src/pages/system/systemData.vue +4 -4
- package/src/pages/system/tableView.vue +17 -17
- package/src/pages/system/taskQueue.vue +13 -6
- package/src/pages/system/user.vue +17 -17
- package/src/pages/template/processPage.vue +22 -22
- package/src/plugins/sweetalert2/index.js +1 -5
- package/src/router/dynamic.js +7 -6
- package/src/setting.js +1 -14
- package/src/store/modules/admin/modules/account.js +3 -4
- package/src/store/modules/admin/modules/i18n.js +56 -32
- package/src/store/modules/admin/modules/menu.js +1 -0
- package/src/styles/common.less +47 -47
- package/src/styles/css/default.css +4 -0
- package/src/styles/default/index.less +6 -6
- package/src/styles/font/iconfont.css +47 -47
- package/src/styles/font/iconfont.json +65 -65
- package/src/styles/layout/basic-layout/layout.less +527 -527
- package/src/styles/layout/basic-layout/menu.less +274 -274
- package/src/styles/layout/index.less +2 -2
- package/src/styles/setting.less +6 -6
- package/test/api/barcode.js +1 -1
- package/test/api/inbound.js +1 -1
- package/test/api/movePlan.js +1 -1
- package/test/api/outbound.js +1 -1
- package/test/main.js +4 -4
- package/test/router/routes.js +2 -2
- package/src/i18n/locale.js +0 -102
- package/src/layouts/basic-layout/i18n.js +0 -50
- package/src/plugins/log/index.js +0 -25
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<i-menu-head-title :item="item" :hide-icon="!showBreadcrumbIcon" />
|
|
9
9
|
</BreadcrumbItem>
|
|
10
10
|
<BreadcrumbItem>
|
|
11
|
-
<i-menu-head-title :item="
|
|
11
|
+
<i-menu-head-title :item="currentTitle()" :hide-icon="!showBreadcrumbIcon" />
|
|
12
12
|
</BreadcrumbItem>
|
|
13
13
|
</Breadcrumb>
|
|
14
14
|
</template>
|
|
@@ -43,7 +43,14 @@
|
|
|
43
43
|
items.forEach(i => {
|
|
44
44
|
newItems.push(this.siderMenuObject[i]);
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
if (Setting.layout.showI18n) {
|
|
48
|
+
newItems.forEach(item => {
|
|
49
|
+
item.title = this.$t('Permission_' + item.code);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//items = items.filter(item => item);
|
|
47
54
|
return newItems;
|
|
48
55
|
},
|
|
49
56
|
// 第一级,默认是 menu/header.js 中的第一项
|
|
@@ -51,7 +58,7 @@
|
|
|
51
58
|
return Setting.info.title;
|
|
52
59
|
},
|
|
53
60
|
topItem() {
|
|
54
|
-
return
|
|
61
|
+
return Setting.layout.showI18n ? this.$t('Front_Label_Setting_Info_Title') : Setting.info.title;
|
|
55
62
|
},
|
|
56
63
|
// 得到所有侧边菜单,并转为平级,查询图标及显示对应内容
|
|
57
64
|
allSiderMenu() {
|
|
@@ -84,6 +91,14 @@
|
|
|
84
91
|
this.breadcrumbWidth = parseInt(getStyle($breadcrumb.$el, 'width'));
|
|
85
92
|
}
|
|
86
93
|
});
|
|
94
|
+
},
|
|
95
|
+
currentTitle() {
|
|
96
|
+
let item = this.siderMenuObject[this.activePath];
|
|
97
|
+
if (Setting.layout.showI18n && item) {
|
|
98
|
+
item.title = this.$t('Permission_' + item.code);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return item;
|
|
87
102
|
}
|
|
88
103
|
},
|
|
89
104
|
watch: {
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
</span>
|
|
6
6
|
<template #list>
|
|
7
7
|
<DropdownMenu>
|
|
8
|
-
<DropdownItem v-for="item in languages" :key="
|
|
9
|
-
<
|
|
10
|
-
<span>{{ item.language }}</span>
|
|
8
|
+
<DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key">
|
|
9
|
+
<span>{{ item }}</span>
|
|
11
10
|
</DropdownItem>
|
|
12
11
|
</DropdownMenu>
|
|
13
12
|
</template>
|
|
14
13
|
</Dropdown>
|
|
15
14
|
</template>
|
|
16
15
|
<script>
|
|
17
|
-
import Setting from '../../../setting';
|
|
16
|
+
//import Setting from '../../../setting';
|
|
18
17
|
import { mapState, mapActions } from 'vuex';
|
|
19
18
|
|
|
20
19
|
export default {
|
|
@@ -27,11 +26,11 @@
|
|
|
27
26
|
},
|
|
28
27
|
data() {
|
|
29
28
|
return {
|
|
30
|
-
languages: Setting.i18n.list
|
|
29
|
+
//languages: Setting.i18n.list
|
|
31
30
|
};
|
|
32
31
|
},
|
|
33
32
|
computed: {
|
|
34
|
-
...mapState('admin/i18n', ['locale']),
|
|
33
|
+
...mapState('admin/i18n', ['locale', 'languages']),
|
|
35
34
|
...mapState('admin/layout', ['isMobile'])
|
|
36
35
|
},
|
|
37
36
|
methods: {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<NotificationTab
|
|
18
|
-
title="
|
|
18
|
+
:title="$t('Front_Label_Todo')"
|
|
19
19
|
name="task"
|
|
20
20
|
:count="taskCount"
|
|
21
21
|
:loaded-all="taskFilter.page * taskFilter.per >= taskCount"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/>
|
|
36
36
|
</NotificationTab>
|
|
37
37
|
<NotificationTab
|
|
38
|
-
title="
|
|
38
|
+
:title="$t('Front_Label_Notification')"
|
|
39
39
|
name="notification"
|
|
40
40
|
:count="unreadCount"
|
|
41
41
|
:loaded-all="notificationFilter.page * notificationFilter.per >= notificationCount"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span v-if="isDesktop" class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-layout-header-trigger-nohover">
|
|
3
|
-
<input class="i-layout-header-search" type="text" :placeholder="$t('
|
|
3
|
+
<input class="i-layout-header-search" type="text" :placeholder="$t('Front_Label_Search')" />
|
|
4
4
|
</span>
|
|
5
5
|
<Dropdown v-else trigger="click" class="i-layout-header-search-drop" ref="dropdown">
|
|
6
6
|
<span class="i-layout-header-trigger i-layout-header-trigger-min">
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
<DropdownMenu>
|
|
11
11
|
<Row align="middle">
|
|
12
12
|
<Col flex="auto" class="ivu-pl-4">
|
|
13
|
-
<Input size="large" prefix="ios-search" :placeholder="$t('
|
|
13
|
+
<Input size="large" prefix="ios-search" :placeholder="$t('Front_Label_Search')" />
|
|
14
14
|
</Col>
|
|
15
15
|
<Col flex="80px" class="ivu-text-center">
|
|
16
|
-
<span @click="handleCloseSearch">{{ $t('
|
|
16
|
+
<span @click="handleCloseSearch">{{ $t('Front_Btn_Cancel') }}</span>
|
|
17
17
|
</Col>
|
|
18
18
|
</Row>
|
|
19
19
|
</DropdownMenu>
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
<DropdownItem>
|
|
10
10
|
<label @click="resetPwdOpen">
|
|
11
11
|
<Icon type="ios-lock" />
|
|
12
|
-
<span
|
|
12
|
+
<span>{{ $t('Front_Label_Change_Password') }}</span>
|
|
13
13
|
</label>
|
|
14
14
|
</DropdownItem>
|
|
15
15
|
<DropdownItem>
|
|
16
16
|
<label @click="$refs.form.open(info)">
|
|
17
17
|
<Icon type="ios-contact" />
|
|
18
|
-
<span
|
|
18
|
+
<span>{{ $t('Front_Label_User_Info') }}</span>
|
|
19
19
|
</label>
|
|
20
20
|
</DropdownItem>
|
|
21
21
|
<!-- <i-link to="/setting/user">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</i-link> -->
|
|
33
33
|
<DropdownItem divided name="logout">
|
|
34
34
|
<Icon type="ios-log-out" />
|
|
35
|
-
<span>{{ $t('
|
|
35
|
+
<span>{{ $t('Front_Label_Logout') }}</span>
|
|
36
36
|
</DropdownItem>
|
|
37
37
|
</DropdownMenu>
|
|
38
38
|
</template>
|
|
@@ -41,25 +41,25 @@
|
|
|
41
41
|
<Modal v-model="resetPwdOpened" scrollable>
|
|
42
42
|
<template #header>
|
|
43
43
|
<div>
|
|
44
|
-
<span class="title"
|
|
45
|
-
<span class="description">
|
|
44
|
+
<span class="title">{{ $t('Front_Label_Change_Password') }}</span>
|
|
45
|
+
<span class="description">{{ $t('Front_Label_Change_Password_Desc') }}</span>
|
|
46
46
|
</div>
|
|
47
47
|
</template>
|
|
48
48
|
<div class="ivu-ml-8 ivu-mr-8">
|
|
49
49
|
<Form ref="resetPwdForm" :model="resetPwdData" :rules="resetPwdRule" label-position="top" label-colon=":" class="ivu-mt" @submit.prevent>
|
|
50
50
|
<Row :gutter="24" type="flex">
|
|
51
51
|
<Col v-bind="grid24">
|
|
52
|
-
<FormItem label="
|
|
52
|
+
<FormItem :label="$t('Front_Label_Old_Password')" key="oldPwd" prop="oldPwd">
|
|
53
53
|
<Input type="password" v-model="resetPwdData.oldPwd" />
|
|
54
54
|
</FormItem>
|
|
55
55
|
</Col>
|
|
56
56
|
<Col v-bind="grid24">
|
|
57
|
-
<FormItem label="
|
|
57
|
+
<FormItem :label="$t('Front_Label_New_Password')" key="newPwd" prop="newPwd">
|
|
58
58
|
<Input type="password" v-model="resetPwdData.newPwd" />
|
|
59
59
|
</FormItem>
|
|
60
60
|
</Col>
|
|
61
61
|
<Col v-bind="grid24">
|
|
62
|
-
<FormItem label="
|
|
62
|
+
<FormItem :label="$t('Front_Label_Confirm_Password')" key="checkPwd" prop="checkPwd">
|
|
63
63
|
<Input type="password" v-model="resetPwdData.checkPwd" />
|
|
64
64
|
</FormItem>
|
|
65
65
|
</Col>
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
</Form>
|
|
68
68
|
</div>
|
|
69
69
|
<template #footer>
|
|
70
|
-
<Button type="primary" custom-icon="fa fa-check" @click="submitChangePwd"
|
|
70
|
+
<Button type="primary" custom-icon="fa fa-check" @click="submitChangePwd">{{ $t('Front_Btn_Save') }}</Button>
|
|
71
71
|
</template>
|
|
72
72
|
</Modal>
|
|
73
73
|
</template>
|
|
74
74
|
<modal-form ref="form" view-code="UserInfoEdit">
|
|
75
75
|
<template #footer>
|
|
76
|
-
<Button type="primary" custom-icon="fa fa-save" @click="submitUserInfo"
|
|
76
|
+
<Button type="primary" custom-icon="fa fa-save" @click="submitUserInfo">{{ $t('Front_Btn_Save') }}</Button>
|
|
77
77
|
</template>
|
|
78
78
|
</modal-form>
|
|
79
79
|
</span>
|
|
@@ -95,19 +95,19 @@
|
|
|
95
95
|
oldPwd: {
|
|
96
96
|
type: 'string',
|
|
97
97
|
required: true,
|
|
98
|
-
message: '
|
|
98
|
+
message: this.tParam('Front_Msg_Please_Input|' + this.$t('Front_Label_Old_Password')),
|
|
99
99
|
trigger: 'blur,change'
|
|
100
100
|
},
|
|
101
101
|
newPwd: {
|
|
102
102
|
type: 'string',
|
|
103
103
|
required: true,
|
|
104
|
-
message: '
|
|
104
|
+
message: this.tParam('Front_Msg_Please_Input|' + this.$t('Front_Label_New_Password')),
|
|
105
105
|
trigger: 'blur,change'
|
|
106
106
|
},
|
|
107
107
|
checkPwd: {
|
|
108
108
|
type: 'string',
|
|
109
109
|
required: true,
|
|
110
|
-
message: '
|
|
110
|
+
message: this.tParam('Front_Msg_Please_Input|' + this.$t('Front_Label_Confirm_Password')),
|
|
111
111
|
trigger: 'blur,change'
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -143,17 +143,17 @@
|
|
|
143
143
|
let isOK = await this.$refs.resetPwdForm.validate();
|
|
144
144
|
|
|
145
145
|
if (!isOK) {
|
|
146
|
-
this.error('
|
|
146
|
+
this.error('Front_Msg_Form_Validate_Fail');
|
|
147
147
|
} else {
|
|
148
148
|
if (this.resetPwdData.newPwd != this.resetPwdData.checkPwd) {
|
|
149
|
-
this.error('
|
|
149
|
+
this.error('Front_Msg_Password_Inconsistent');
|
|
150
150
|
} else {
|
|
151
151
|
await userlApi.updatePassword({
|
|
152
152
|
oldPassword: this.resetPwdData.oldPwd,
|
|
153
153
|
newPassword: this.resetPwdData.newPwd
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
this.success('
|
|
156
|
+
this.success('Front_Msg_Success', () => {
|
|
157
157
|
this.resetPwdOpened = false;
|
|
158
158
|
});
|
|
159
159
|
}
|
|
@@ -161,10 +161,10 @@
|
|
|
161
161
|
},
|
|
162
162
|
// 保存用户信息
|
|
163
163
|
submitUserInfo() {
|
|
164
|
-
this.confirm('
|
|
164
|
+
this.confirm('Front_Msg_Sure_To_Save', async () => {
|
|
165
165
|
await userlApi.updateUser(this.$refs.form.data);
|
|
166
166
|
|
|
167
|
-
this.success('
|
|
167
|
+
this.success('Front_Msg_Success', () => {
|
|
168
168
|
this.set(this.$refs.form.data);
|
|
169
169
|
this.$refs.form.opened = false;
|
|
170
170
|
});
|
|
@@ -25,7 +25,13 @@
|
|
|
25
25
|
<i-menu-side-submenu v-else :menu="item" :key="'submenu' + index" />
|
|
26
26
|
</template>
|
|
27
27
|
<template v-else>
|
|
28
|
-
<Tooltip
|
|
28
|
+
<Tooltip
|
|
29
|
+
:content="this.layout.showI18n ? this.$t('Permission_' + item.code) : item.title"
|
|
30
|
+
placement="right"
|
|
31
|
+
v-if="item.children === undefined || !item.children.length"
|
|
32
|
+
:key="index"
|
|
33
|
+
:theme="siderTheme"
|
|
34
|
+
>
|
|
29
35
|
<i-menu-side-item class="i-layout-menu-side-collapse-top-item" :menu="item" hide-title />
|
|
30
36
|
</Tooltip>
|
|
31
37
|
<i-menu-side-collapse v-else :menu="item" top-level :key="'collapse' + index" />
|
|
@@ -42,7 +48,7 @@
|
|
|
42
48
|
import iMenuSideItem from './menu-item.vue';
|
|
43
49
|
import iMenuSideSubmenu from './submenu.vue';
|
|
44
50
|
import iMenuSideCollapse from './menu-collapse.vue';
|
|
45
|
-
import
|
|
51
|
+
import mixinPage from '../../../mixins/page';
|
|
46
52
|
|
|
47
53
|
// 元素是否在可视区域
|
|
48
54
|
function isElementInViewport(el) {
|
|
@@ -57,7 +63,7 @@
|
|
|
57
63
|
|
|
58
64
|
export default {
|
|
59
65
|
name: 'iMenuSide',
|
|
60
|
-
mixins: [
|
|
66
|
+
mixins: [mixinPage],
|
|
61
67
|
components: { iMenuSideItem, iMenuSideSubmenu, iMenuSideCollapse },
|
|
62
68
|
props: {
|
|
63
69
|
hideLogo: {
|
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
}"
|
|
15
15
|
v-if="!hideTitle"
|
|
16
16
|
>
|
|
17
|
-
{{
|
|
18
|
-
<em v-if="menu.subtitle">{{
|
|
17
|
+
{{ this.layout.showI18n ? this.$t('Permission_' + menu.code) : menu.title }}
|
|
18
|
+
<em v-if="menu.subtitle">{{ this.layout.showI18n ? this.$t('Permission_' + menu.code + '_SubName') : menu.subTitle }}</em>
|
|
19
19
|
</span>
|
|
20
20
|
</span>
|
|
21
21
|
</template>
|
|
22
22
|
<script>
|
|
23
|
-
import
|
|
23
|
+
import mixinPage from '../../../mixins/page';
|
|
24
|
+
// import tTitle from '../mixins/translate-title';
|
|
24
25
|
|
|
25
26
|
export default {
|
|
26
27
|
name: 'iMenuSideTitle',
|
|
27
|
-
mixins: [
|
|
28
|
+
mixins: [mixinPage],
|
|
28
29
|
props: {
|
|
29
30
|
menu: {
|
|
30
31
|
type: Object,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { findComponentUpward } from 'view-ui-plus/src/utils/assist';
|
|
2
|
-
import { mapState } from 'vuex';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
computed: {
|
|
6
|
-
...mapState('admin/layout', ['menuSiderReload', 'menuHeaderReload'])
|
|
7
|
-
},
|
|
8
|
-
methods: {
|
|
9
|
-
handleClick(path, type = 'sider') {
|
|
10
|
-
const current = this.$route.path;
|
|
11
|
-
if (current === path) {
|
|
12
|
-
if (type === 'sider' && this.menuSiderReload) this.handleReload();
|
|
13
|
-
else if (type === 'header' && this.menuHeaderReload) this.handleReload();
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
handleReload() {
|
|
17
|
-
const $layout = findComponentUpward(this, 'BasicLayout');
|
|
18
|
-
if ($layout) $layout.handleReload();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
1
|
+
import { findComponentUpward } from 'view-ui-plus/src/utils/assist';
|
|
2
|
+
import { mapState } from 'vuex';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
computed: {
|
|
6
|
+
...mapState('admin/layout', ['menuSiderReload', 'menuHeaderReload'])
|
|
7
|
+
},
|
|
8
|
+
methods: {
|
|
9
|
+
handleClick(path, type = 'sider') {
|
|
10
|
+
const current = this.$route.path;
|
|
11
|
+
if (current === path) {
|
|
12
|
+
if (type === 'sider' && this.menuSiderReload) this.handleReload();
|
|
13
|
+
else if (type === 'header' && this.menuHeaderReload) this.handleReload();
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
handleReload() {
|
|
17
|
+
const $layout = findComponentUpward(this, 'BasicLayout');
|
|
18
|
+
if ($layout) $layout.handleReload();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { mapState } from 'vuex';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
computed: {
|
|
5
|
-
...mapState('admin/menu', ['siderMenuBadge']),
|
|
6
|
-
badgeData() {
|
|
7
|
-
let data = null;
|
|
8
|
-
const siderMenuBadge = this.siderMenuBadge.find(item => item.path === this.menu.path);
|
|
9
|
-
if (siderMenuBadge) data = siderMenuBadge;
|
|
10
|
-
return data;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
};
|
|
1
|
+
import { mapState } from 'vuex';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
computed: {
|
|
5
|
+
...mapState('admin/menu', ['siderMenuBadge']),
|
|
6
|
+
badgeData() {
|
|
7
|
+
let data = null;
|
|
8
|
+
const siderMenuBadge = this.siderMenuBadge.find(item => item.path === this.menu.path);
|
|
9
|
+
if (siderMenuBadge) data = siderMenuBadge;
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
methods: {
|
|
3
|
-
tTitle(title) {
|
|
4
|
-
if (title && title.indexOf('$t:') === 0) {
|
|
5
|
-
return this.$t(title.split('$t:')[1]);
|
|
6
|
-
} else {
|
|
7
|
-
return title;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
methods: {
|
|
3
|
+
tTitle(title) {
|
|
4
|
+
if (title && title.indexOf('$t:') === 0) {
|
|
5
|
+
return this.$t(title.split('$t:')[1]);
|
|
6
|
+
} else {
|
|
7
|
+
return title;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
<DropdownMenu>
|
|
22
22
|
<DropdownItem name="left">
|
|
23
23
|
<Icon type="md-arrow-back" />
|
|
24
|
-
{{ $t('
|
|
24
|
+
{{ $t('Front_Label_Tabs_Left') }}
|
|
25
25
|
</DropdownItem>
|
|
26
26
|
<DropdownItem name="right">
|
|
27
27
|
<Icon type="md-arrow-forward" />
|
|
28
|
-
{{ $t('
|
|
28
|
+
{{ $t('Front_Label_Tabs_Right') }}
|
|
29
29
|
</DropdownItem>
|
|
30
30
|
<DropdownItem name="other">
|
|
31
31
|
<Icon type="md-close" />
|
|
32
|
-
{{ $t('
|
|
32
|
+
{{ $t('Front_Label_Tabs_Other') }}
|
|
33
33
|
</DropdownItem>
|
|
34
34
|
<DropdownItem name="all">
|
|
35
35
|
<Icon type="md-close-circle" />
|
|
36
|
-
{{ $t('
|
|
36
|
+
{{ $t('Front_Label_Tabs_All') }}
|
|
37
37
|
</DropdownItem>
|
|
38
38
|
</DropdownMenu>
|
|
39
39
|
</template>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="styles" v-if="waterMark.show"></div>
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
import { mapState } from 'vuex';
|
|
6
|
-
import getWaterMarkCanvas from '../../../libs/water-mark';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
name: 'i-water-mark',
|
|
10
|
-
computed: {
|
|
11
|
-
...mapState('admin/layout', ['waterMark']),
|
|
12
|
-
styles() {
|
|
13
|
-
const url = getWaterMarkCanvas(this.waterMark.text, this.waterMark.options);
|
|
14
|
-
return {
|
|
15
|
-
width: '100%',
|
|
16
|
-
height: '100%',
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
top: '0',
|
|
19
|
-
left: '0',
|
|
20
|
-
'z-index': '2000',
|
|
21
|
-
'background-size': '320px',
|
|
22
|
-
'background-repeat': 'repeat',
|
|
23
|
-
'background-image': `url(${url})`,
|
|
24
|
-
'pointer-events': 'none'
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="styles" v-if="waterMark.show"></div>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import { mapState } from 'vuex';
|
|
6
|
+
import getWaterMarkCanvas from '../../../libs/water-mark';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'i-water-mark',
|
|
10
|
+
computed: {
|
|
11
|
+
...mapState('admin/layout', ['waterMark']),
|
|
12
|
+
styles() {
|
|
13
|
+
const url = getWaterMarkCanvas(this.waterMark.text, this.waterMark.options);
|
|
14
|
+
return {
|
|
15
|
+
width: '100%',
|
|
16
|
+
height: '100%',
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
top: '0',
|
|
19
|
+
left: '0',
|
|
20
|
+
'z-index': '2000',
|
|
21
|
+
'background-size': '320px',
|
|
22
|
+
'background-repeat': 'repeat',
|
|
23
|
+
'background-image': `url(${url})`,
|
|
24
|
+
'pointer-events': 'none'
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
</script>
|
package/src/libs/random_str.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// 生成随机字符串
|
|
2
|
-
export default function (len = 32) {
|
|
3
|
-
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
|
4
|
-
const maxPos = $chars.length;
|
|
5
|
-
let str = '';
|
|
6
|
-
for (let i = 0; i < len; i++) {
|
|
7
|
-
str += $chars.charAt(Math.floor(Math.random() * maxPos));
|
|
8
|
-
}
|
|
9
|
-
return str;
|
|
10
|
-
}
|
|
1
|
+
// 生成随机字符串
|
|
2
|
+
export default function (len = 32) {
|
|
3
|
+
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
|
4
|
+
const maxPos = $chars.length;
|
|
5
|
+
let str = '';
|
|
6
|
+
for (let i = 0; i < len; i++) {
|
|
7
|
+
str += $chars.charAt(Math.floor(Math.random() * maxPos));
|
|
8
|
+
}
|
|
9
|
+
return str;
|
|
10
|
+
}
|
|
@@ -30,11 +30,10 @@ function errorLog(err) {
|
|
|
30
30
|
console.log(err);
|
|
31
31
|
}
|
|
32
32
|
swal.fire({
|
|
33
|
-
title: err.message,
|
|
33
|
+
title: tParam(err.message),
|
|
34
34
|
icon: 'error',
|
|
35
|
-
confirmButtonText: '
|
|
36
|
-
|
|
37
|
-
cancelButtonText: '取消'
|
|
35
|
+
confirmButtonText: window.$t('Front_Btn_OK'),
|
|
36
|
+
cancelButtonText: window.$t('Front_Btn_Cancel')
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
|
|
@@ -44,6 +43,21 @@ const service = axios.create({
|
|
|
44
43
|
// timeout: 5000 // 请求超时时间
|
|
45
44
|
});
|
|
46
45
|
|
|
46
|
+
// 解析多语言带参数
|
|
47
|
+
const tParam = str => {
|
|
48
|
+
let array = str.split('|');
|
|
49
|
+
let result = window.$t(array[0]);
|
|
50
|
+
|
|
51
|
+
if (array.length > 1) {
|
|
52
|
+
for (let i = 0; i < array.length - 1; i++) {
|
|
53
|
+
result = result.replace('{' + i + '}', array[i + 1]);
|
|
54
|
+
result = result.replace('[' + i + ']', window.$t('Model_' + array[i + 1]));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
|
|
47
61
|
// 请求拦截器
|
|
48
62
|
service.interceptors.request.use(
|
|
49
63
|
config => {
|
package/src/libs/water-mark.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 生成水印
|
|
3
|
-
* */
|
|
4
|
-
export default function getWaterMarkCanvas(text, options) {
|
|
5
|
-
const canvas = document.createElement('canvas');
|
|
6
|
-
const ctx = canvas.getContext('2d');
|
|
7
|
-
const canvasWidth = 400;
|
|
8
|
-
const canvasHeight = 400;
|
|
9
|
-
canvas.width = canvasWidth;
|
|
10
|
-
canvas.height = canvasHeight;
|
|
11
|
-
ctx.textAlign = 'center';
|
|
12
|
-
ctx.textBaseline = 'bottom';
|
|
13
|
-
ctx.globalAlpha = options.globalAlpha || 0.1;
|
|
14
|
-
ctx.font = options.font || '20px Microsoft Yahei';
|
|
15
|
-
|
|
16
|
-
ctx.translate(canvasWidth / 2, canvasHeight / 2);
|
|
17
|
-
ctx.rotate(options.rotateAngle || -0.4);
|
|
18
|
-
|
|
19
|
-
ctx.translate((-canvasWidth / 2) * 1.2, (-canvasHeight / 2) * 1.2);
|
|
20
|
-
|
|
21
|
-
const waterMarkText = [];
|
|
22
|
-
const chunkWidth = options.chunkWidth || 400;
|
|
23
|
-
const chunkHeight = options.chunkHeight || 120;
|
|
24
|
-
const horizontalChunkCount = 0;
|
|
25
|
-
const verticalChunkCount = 1;
|
|
26
|
-
|
|
27
|
-
for (let j = 0, initY = chunkHeight / 2, indent = 0; j <= verticalChunkCount; j += 1) {
|
|
28
|
-
indent = parseInt(j % 2);
|
|
29
|
-
|
|
30
|
-
for (let i = 0, initX = chunkWidth / 2; i <= horizontalChunkCount; i += 1) {
|
|
31
|
-
waterMarkText.push({
|
|
32
|
-
text,
|
|
33
|
-
x: i * chunkWidth + indent * initX,
|
|
34
|
-
y: j * chunkHeight + initY
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
waterMarkText.forEach(item => {
|
|
40
|
-
ctx.fillText(item.text, item.x, item.y);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return ctx.canvas.toDataURL();
|
|
44
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @description 生成水印
|
|
3
|
+
* */
|
|
4
|
+
export default function getWaterMarkCanvas(text, options) {
|
|
5
|
+
const canvas = document.createElement('canvas');
|
|
6
|
+
const ctx = canvas.getContext('2d');
|
|
7
|
+
const canvasWidth = 400;
|
|
8
|
+
const canvasHeight = 400;
|
|
9
|
+
canvas.width = canvasWidth;
|
|
10
|
+
canvas.height = canvasHeight;
|
|
11
|
+
ctx.textAlign = 'center';
|
|
12
|
+
ctx.textBaseline = 'bottom';
|
|
13
|
+
ctx.globalAlpha = options.globalAlpha || 0.1;
|
|
14
|
+
ctx.font = options.font || '20px Microsoft Yahei';
|
|
15
|
+
|
|
16
|
+
ctx.translate(canvasWidth / 2, canvasHeight / 2);
|
|
17
|
+
ctx.rotate(options.rotateAngle || -0.4);
|
|
18
|
+
|
|
19
|
+
ctx.translate((-canvasWidth / 2) * 1.2, (-canvasHeight / 2) * 1.2);
|
|
20
|
+
|
|
21
|
+
const waterMarkText = [];
|
|
22
|
+
const chunkWidth = options.chunkWidth || 400;
|
|
23
|
+
const chunkHeight = options.chunkHeight || 120;
|
|
24
|
+
const horizontalChunkCount = 0;
|
|
25
|
+
const verticalChunkCount = 1;
|
|
26
|
+
|
|
27
|
+
for (let j = 0, initY = chunkHeight / 2, indent = 0; j <= verticalChunkCount; j += 1) {
|
|
28
|
+
indent = parseInt(j % 2);
|
|
29
|
+
|
|
30
|
+
for (let i = 0, initX = chunkWidth / 2; i <= horizontalChunkCount; i += 1) {
|
|
31
|
+
waterMarkText.push({
|
|
32
|
+
text,
|
|
33
|
+
x: i * chunkWidth + indent * initX,
|
|
34
|
+
y: j * chunkHeight + initY
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
waterMarkText.forEach(item => {
|
|
40
|
+
ctx.fillText(item.text, item.x, item.y);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return ctx.canvas.toDataURL();
|
|
44
|
+
}
|