n20-common-lib 1.3.105 → 1.3.107
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/package.json
CHANGED
|
@@ -84,7 +84,12 @@
|
|
|
84
84
|
append-to-body
|
|
85
85
|
top="7.5vh"
|
|
86
86
|
>
|
|
87
|
-
<carboncopy-prop
|
|
87
|
+
<carboncopy-prop
|
|
88
|
+
type="addtask"
|
|
89
|
+
:carbon-copy-list="addTaskList"
|
|
90
|
+
@close="setAddtaskV = false"
|
|
91
|
+
@confirm="setAddtaskOk"
|
|
92
|
+
/>
|
|
88
93
|
</cl-dialog>
|
|
89
94
|
</div>
|
|
90
95
|
</template>
|
|
@@ -81,6 +81,10 @@ export default {
|
|
|
81
81
|
carbonCopyList: {
|
|
82
82
|
type: Array,
|
|
83
83
|
default: () => []
|
|
84
|
+
},
|
|
85
|
+
type: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: undefined
|
|
84
88
|
}
|
|
85
89
|
},
|
|
86
90
|
data() {
|
|
@@ -112,6 +116,9 @@ export default {
|
|
|
112
116
|
},
|
|
113
117
|
methods: {
|
|
114
118
|
getList() {
|
|
119
|
+
if (this.type === 'addtask' && window._isAddtask_get_userlist_extend_data_) {
|
|
120
|
+
this.searchObj = Object.assign(this.searchObj, window._isAddtask_get_userlist_extend_data_)
|
|
121
|
+
}
|
|
115
122
|
this.$axios
|
|
116
123
|
.post('/bems/activiti/online/chdUserInfo', {
|
|
117
124
|
data: this.searchObj,
|
|
@@ -19,18 +19,24 @@
|
|
|
19
19
|
/>
|
|
20
20
|
<el-divider class="header-wrap-logo-hr" direction="vertical" />
|
|
21
21
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
22
|
-
<h3 class="header-title" v-html="headerTitle"></h3>
|
|
23
|
-
<el-tooltip :content="'帮助文档' | $lc">
|
|
24
|
-
<span class="set-user-btn n20-icon-xinxitishi header-color" @click="openHelp"></span>
|
|
22
|
+
<h3 class="header-title m-r-auto" v-html="headerTitle"></h3>
|
|
23
|
+
<el-tooltip v-if="!hideHelpDoc" :content="'帮助文档' | $lc">
|
|
24
|
+
<span class="set-user-btn n20-icon-xinxitishi header-color m-l-m" @click="openHelp"></span>
|
|
25
25
|
</el-tooltip>
|
|
26
26
|
|
|
27
27
|
<el-dropdown class="m-l-m" trigger="click" placement="bottom" size="medium" @command="setUserFn">
|
|
28
28
|
<span class="set-user-btn el-icon-setting header-color"></span>
|
|
29
29
|
|
|
30
30
|
<el-dropdown-menu slot="dropdown">
|
|
31
|
-
<el-dropdown-item icon="el-icon-document" command="setLang"
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<el-dropdown-item v-if="!hideLang" icon="el-icon-document" command="setLang"
|
|
32
|
+
>{{ '语言切换' | $lc }}
|
|
33
|
+
</el-dropdown-item>
|
|
34
|
+
<el-dropdown-item v-if="!hideDowApp" icon="el-icon-document" command="dowApp">{{
|
|
35
|
+
'客户端下载' | $lc
|
|
36
|
+
}}</el-dropdown-item>
|
|
37
|
+
<el-dropdown-item v-if="!hideTheme" icon="el-icon-document" command="setTheme">{{
|
|
38
|
+
'主题设置' | $lc
|
|
39
|
+
}}</el-dropdown-item>
|
|
34
40
|
</el-dropdown-menu>
|
|
35
41
|
</el-dropdown>
|
|
36
42
|
|
|
@@ -150,6 +156,8 @@ import dayjs from 'dayjs'
|
|
|
150
156
|
import duration from 'dayjs/plugin/duration'
|
|
151
157
|
dayjs.extend(duration)
|
|
152
158
|
|
|
159
|
+
import { siteTree2menus } from '../../LoginTemporary/utils'
|
|
160
|
+
|
|
153
161
|
const prefix = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || process.env.BASE_URL || '/'
|
|
154
162
|
|
|
155
163
|
export default {
|
|
@@ -186,6 +194,10 @@ export default {
|
|
|
186
194
|
headerColor: undefined,
|
|
187
195
|
headerBgUrl: undefined,
|
|
188
196
|
headerBgColor: undefined,
|
|
197
|
+
hideHelpDoc: undefined,
|
|
198
|
+
hideLang: undefined,
|
|
199
|
+
hideDowApp: undefined,
|
|
200
|
+
hideTheme: undefined,
|
|
189
201
|
userInfo: {},
|
|
190
202
|
userNo: window.sessionStorage.getItem('userNo'),
|
|
191
203
|
durationTime: $lc('00小时00分00秒'),
|
|
@@ -213,6 +225,10 @@ export default {
|
|
|
213
225
|
this.headerColor = _layoutData.headerColor
|
|
214
226
|
this.headerBgUrl = realUrl(_layoutData.headerBgUrl)
|
|
215
227
|
this.headerBgColor = _layoutData.headerBgColor
|
|
228
|
+
this.hideHelpDoc = _layoutData.hideHelpDoc
|
|
229
|
+
this.hideLang = _layoutData.hideLang
|
|
230
|
+
this.hideDowApp = _layoutData.hideDowApp
|
|
231
|
+
this.hideTheme = _layoutData.hideTheme
|
|
216
232
|
|
|
217
233
|
if (_loginSetting !== 'JSON') {
|
|
218
234
|
axios.get(`/bems/1.0/sysSetting/list`, null, { loading: false, noMsg: true }).then(({ data }) => {
|
|
@@ -257,17 +273,21 @@ export default {
|
|
|
257
273
|
},
|
|
258
274
|
// 打开帮助文档
|
|
259
275
|
openHelp() {
|
|
260
|
-
axios
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
276
|
+
axios
|
|
277
|
+
.get(`/bems/1.0/userManual`, {}, { responseType: 'blob' })
|
|
278
|
+
.then((res) => {
|
|
279
|
+
let url = window.URL.createObjectURL(res)
|
|
280
|
+
let win = window.open(url, $lc('帮助文档'))
|
|
281
|
+
setTimeout(function () {
|
|
282
|
+
win.document.title = $lc('帮助文档')
|
|
283
|
+
}, 1000)
|
|
284
|
+
})
|
|
285
|
+
.catch(({ code }) => {
|
|
286
|
+
if (code === 404) {
|
|
287
|
+
this.$message.error($lc('暂无帮助文档,请联系管理员!'))
|
|
288
|
+
return
|
|
289
|
+
}
|
|
290
|
+
})
|
|
271
291
|
},
|
|
272
292
|
setUserFn(c) {
|
|
273
293
|
switch (c) {
|
|
@@ -304,7 +324,15 @@ export default {
|
|
|
304
324
|
this.langV = false
|
|
305
325
|
window.localStorage.setItem('pageLang', this.langVal)
|
|
306
326
|
Cookies.set('language', ['zh-cn', 'zh-hk'].includes(this.langVal) ? 'zh' : this.langVal)
|
|
307
|
-
|
|
327
|
+
|
|
328
|
+
window.localStorage.setItem('pre-change-pageLang', this.langVal)
|
|
329
|
+
auth.setReqLang()
|
|
330
|
+
axios.get('/bems/1.0/menuTree/tree').then(({ data }) => {
|
|
331
|
+
data || (data = [])
|
|
332
|
+
let layoutMenus = siteTree2menus(data)
|
|
333
|
+
sessionStorage.setItem('menuTree', JSON.stringify(layoutMenus))
|
|
334
|
+
window.location.reload()
|
|
335
|
+
})
|
|
308
336
|
},
|
|
309
337
|
setTheme({ value }) {
|
|
310
338
|
this.themeVal = value
|
package/src/utils/auth.js
CHANGED
|
@@ -3,10 +3,7 @@ import Cookies from 'js-cookie'
|
|
|
3
3
|
|
|
4
4
|
const STORAGE = window.sessionStorage
|
|
5
5
|
let ownLoginPath = '/login'
|
|
6
|
-
|
|
7
|
-
let langMap = { 'zh-cn': 'zh_CN', en: 'en_US', 'zh-hk': 'zh_TW' }
|
|
8
|
-
let langKey = window.localStorage.getItem('pageLang') || 'zh-cn'
|
|
9
|
-
let reqLang = langMap[langKey]
|
|
6
|
+
let reqLang = undefined
|
|
10
7
|
|
|
11
8
|
const auth = {
|
|
12
9
|
stokenKey: 'token',
|
|
@@ -53,6 +50,11 @@ const auth = {
|
|
|
53
50
|
window.location.href = loginHref
|
|
54
51
|
}
|
|
55
52
|
},
|
|
53
|
+
setReqLang() {
|
|
54
|
+
let langMap = { 'zh-cn': 'zh_CN', en: 'en_US', 'zh-hk': 'zh_TW' }
|
|
55
|
+
let langKey = window.localStorage.getItem('pageLang') || 'zh-cn'
|
|
56
|
+
reqLang = langMap[langKey]
|
|
57
|
+
},
|
|
56
58
|
setHeaders(headers, desc) {
|
|
57
59
|
let token = auth.getToken()
|
|
58
60
|
let defaultHd = {
|
|
@@ -73,6 +75,7 @@ const auth = {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
|
78
|
+
auth.setReqLang()
|
|
76
79
|
auth.cokenKey = 'Admin-Token'
|
|
77
80
|
|
|
78
81
|
export default auth
|
package/src/utils/axios.js
CHANGED
|
@@ -135,7 +135,7 @@ function request(opt) {
|
|
|
135
135
|
if (opt.responseType === 'blob') {
|
|
136
136
|
let filename = getFilename(res.headers['content-disposition'])
|
|
137
137
|
filename && res.data && (res.data.name = filename.replace(/"/g, ''))
|
|
138
|
-
res.data.size === 0 ? reject(opt.url + $lc('请求返回文件大小0KB')) : resolve(res.data)
|
|
138
|
+
res.data.size === 0 ? reject({ code: 404, msg: opt.url + $lc('请求返回文件大小0KB') }) : resolve(res.data)
|
|
139
139
|
} else {
|
|
140
140
|
if (typeof res.data === 'object' && res.data.data === undefined) {
|
|
141
141
|
res.data.data = {}
|