xs-common-plugins 1.2.3 → 1.2.5
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 +298 -298
- package/common.js +110 -110
- package/index.js +1 -1
- package/package.json +16 -16
- package/src/App.vue +12 -12
- package/src/common/common.js +551 -549
- package/src/common/createMenuId.js +7 -7
- package/src/common/uploadImgToBase64.js +12 -12
- package/src/common/utils.js +95 -95
- package/src/components/Breadcrumb/index.vue +81 -81
- package/src/components/CheckBox_Cmp/index.vue +62 -62
- package/src/components/Col_TableCell/data.js +4 -4
- package/src/components/Col_TableCell/index.scss +77 -77
- package/src/components/Col_TableCell/index.vue +43 -43
- package/src/components/Col_TableCell/methods.js +19 -19
- package/src/components/FormItem/index.vue +92 -92
- package/src/components/Hamburger/index.vue +44 -44
- package/src/components/ReportCmp/data.js +3 -3
- package/src/components/ReportCmp/index.scss +29 -29
- package/src/components/ReportCmp/index.vue +76 -76
- package/src/components/ReportCmp/methods.js +30 -30
- package/src/components/Search/cascader/data.js +3 -3
- package/src/components/Search/cascader/index.scss +17 -17
- package/src/components/Search/cascader/index.vue +96 -96
- package/src/components/Search/cascader/methods.js +41 -41
- package/src/components/Search/data.js +5 -5
- package/src/components/Search/hk_cascader/index.vue +104 -104
- package/src/components/Search/hk_cascader_qudao/index.vue +94 -94
- package/src/components/Search/index.scss +219 -219
- package/src/components/Search/index.vue +410 -410
- package/src/components/Search/methods.js +86 -86
- package/src/components/Search/product_option/data.js +3 -3
- package/src/components/Search/product_option/index.scss +68 -68
- package/src/components/Search/product_option/index.vue +412 -412
- package/src/components/Search/product_option/methods.js +58 -58
- package/src/components/Search/select/data.js +3 -3
- package/src/components/Search/select/index.scss +2 -2
- package/src/components/Search/select/index.vue +114 -114
- package/src/components/Search/select/methods.js +51 -51
- package/src/components/Search_filter/data.js +5 -5
- package/src/components/Search_filter/index.scss +104 -104
- package/src/components/Search_filter/index.vue +88 -88
- package/src/components/Search_filter/methods.js +43 -43
- package/src/components/TableCmp/data.js +3 -3
- package/src/components/TableCmp/index.scss +22 -22
- package/src/components/TableCmp/index.vue +98 -98
- package/src/components/TableCmp/methods.js +35 -35
- package/src/components/TableItem/TableItem.vue +55 -55
- package/src/components/TextOVer/index.vue +55 -55
- package/src/components/UploadImg/index.vue +177 -177
- package/src/components/home/BarChart.vue +118 -118
- package/src/components/home/LineChart.vue +146 -146
- package/src/components/home/Panel.vue +135 -135
- package/src/components/home/PanelGroup.vue +146 -146
- package/src/components/home/PieChart.vue +81 -81
- package/src/components/home/RaddarChart.vue +119 -119
- package/src/components/home/TabLayout.vue +88 -88
- package/src/components/home/TableList.vue +158 -158
- package/src/components/home/Teng.vue +248 -248
- package/src/components/home/TransactionTable.vue +49 -49
- package/src/components/home/mixins/resize.js +55 -55
- package/src/components/im/index.vue +155 -155
- package/src/components/im/methods.js +25 -25
- package/src/components/im/pages/chatList/index.vue +45 -45
- package/src/components/im/pages/chatRoom/index.vue +159 -159
- package/src/components/image-singleUpload/data.js +3 -3
- package/src/components/image-singleUpload/index.scss +26 -26
- package/src/components/image-singleUpload/index.vue +56 -56
- package/src/components/image-singleUpload/methods.js +30 -30
- package/src/components/image-upload/data.js +7 -7
- package/src/components/image-upload/index.vue +41 -41
- package/src/components/image-upload/methods.js +80 -80
- package/src/components/multiple-image-upload/data.js +11 -11
- package/src/components/multiple-image-upload/index.scss +8 -8
- package/src/components/multiple-image-upload/index.vue +63 -63
- package/src/components/multiple-image-upload/methods.js +45 -45
- package/src/components/pro-upload/data.js +3 -3
- package/src/components/pro-upload/index.scss +4 -4
- package/src/components/pro-upload/index.vue +89 -89
- package/src/components/pro-upload/methods.js +86 -86
- package/src/components/report_set/index.scss +44 -44
- package/src/components/report_set/index.vue +153 -153
- package/src/components/search-page/src/index.scss +5 -5
- package/src/components/search-page/src/index.vue +76 -76
- package/src/components/search-page/src/methods.js +36 -36
- package/src/components/xsSelect/index.vue +125 -125
- package/src/mixin/dialog.js +31 -31
- package/src/mixin/dlg.js +46 -46
- package/src/mixin/keepAlive.js +53 -52
- package/src/mixin/newDialog.js +19 -19
- package/src/mixin/report.js +82 -82
- package/src/mixin/table.js +93 -93
- package/src/mixin/tableCell/colTableCell_analysis.js +103 -103
- package/src/mixin/upload.js +22 -22
- package/src/mixin/vmodel.js +26 -26
- package/src/plugins/im/components/chat/index.scss +163 -163
- package/src/plugins/im/components/chat/index.vue +144 -144
- package/src/plugins/im/components/chat/methods.js +149 -149
- package/src/plugins/im/components/conversation-list/index.css +91 -91
- package/src/plugins/im/components/conversation-list/index.json +3 -3
- package/src/plugins/im/components/conversation-list/index.vue +89 -89
- package/src/plugins/im/components/loading/loading.css +69 -69
- package/src/plugins/im/components/loading/loading.json +3 -3
- package/src/plugins/im/components/loading/loading.vue +14 -14
- package/src/plugins/im/components/msg-image/index.json +3 -3
- package/src/plugins/im/components/msg-image/index.vue +40 -40
- package/src/plugins/im/components/msg-text/index.json +3 -3
- package/src/plugins/im/components/msg-text/index.vue +24 -24
- package/src/plugins/im/components/send-msg/index.scss +164 -164
- package/src/plugins/im/components/send-msg/index.vue +107 -107
- package/src/plugins/im/components/send-msg/methods.js +125 -125
- package/src/plugins/im/components/template-message/index.vue +76 -76
- package/src/plugins/im/components/without.vue +19 -19
- package/src/plugins/im/im-plug-in/Protobuf-2.3.7.min.js +1 -1
- package/src/plugins/im/im-plug-in/RongCallLib-3.1.5.min.js +74 -74
- package/src/plugins/im/im-plug-in/RongIMLib-4.1.0.js +17420 -17420
- package/src/plugins/im/im-plug-in/init.js +216 -216
- package/src/plugins/im/im-plug-in/qiniu.js +266 -266
- package/src/plugins/im/im-plug-in/send-data.js +431 -431
- package/src/plugins/im/im-plug-in/upload.js +232 -232
- package/src/plugins/im/index.js +31 -31
- package/src/plugins/im/lib/RongIMEmoji-2.2.6.js +332 -332
- package/src/plugins/im/lib/RongIMLib-3.0.7.2-dev.js +11635 -11635
- package/src/plugins/im/lib/RongIMLib-3.0.7.2-dev.min.js +6 -6
- package/src/plugins/im/utils/services.js +625 -625
- package/src/plugins/im/utils/underscore-1.8.3.js +1531 -1531
- package/src/plugins/im/utils/utils.js +149 -149
- package/src/plugins/index.js +60 -60
- package/src/plugins/row-col-cmp/colCmp/data.js +3 -3
- package/src/plugins/row-col-cmp/colCmp/index.scss +50 -50
- package/src/plugins/row-col-cmp/colCmp/index.vue +53 -53
- package/src/plugins/row-col-cmp/colCmp/methods.js +25 -25
- package/src/plugins/row-col-cmp/index.js +20 -20
- package/src/plugins/row-col-cmp/rowCmp/data.js +3 -3
- package/src/plugins/row-col-cmp/rowCmp/index.scss +3 -3
- package/src/plugins/row-col-cmp/rowCmp/index.vue +43 -43
- package/src/plugins/row-col-cmp/rowCmp/methods.js +29 -29
- package/src/router/index.js +58 -58
- package/src/router/permission.js +126 -126
- package/src/store/getters.js +13 -13
- package/src/store/index.js +60 -60
- package/src/store/modules/app.js +55 -55
- package/src/store/modules/dic.js +74 -74
- package/src/store/modules/oss.js +40 -40
- package/src/store/modules/settings.js +28 -28
- package/src/store/modules/tagsView.js +160 -160
- package/src/store/modules/user.js +94 -94
- package/src/store/modules/widgetdata.js +42 -42
- package/src/styles/element-ui.scss +49 -49
- package/src/styles/index.scss +91 -91
- package/src/styles/mixin.scss +28 -28
- package/src/styles/sidebar.scss +210 -210
- package/src/styles/table.scss +90 -90
- package/src/styles/transition.scss +48 -48
- package/src/styles/variables.scss +25 -25
- package/src/utils/api.js +54 -54
- package/src/utils/auth.js +38 -38
- package/src/utils/concat_batch_btns.js +88 -88
- package/src/utils/enum.js +150 -150
- package/src/utils/filter.js +5 -5
- package/src/utils/filterRules.js +55 -55
- package/src/utils/get-page-title.js +10 -10
- package/src/utils/getMenu.js +82 -82
- package/src/utils/global-config.js +15 -15
- package/src/utils/global_directive.js +10 -10
- package/src/utils/index.js +332 -332
- package/src/utils/localStorage.js +21 -21
- package/src/utils/ossService.js +55 -55
- package/src/utils/prototype.js +46 -46
- package/src/utils/search.js +33 -33
- package/src/utils/signalR.js +24 -24
- package/src/utils/validate.js +20 -20
- package/src/views/callback/index.vue +35 -35
- package/src/views/home/index.vue +25 -25
- package/src/views/layout/components/AllSearch/index.vue +44 -44
- package/src/views/layout/components/AppMain.vue +66 -66
- package/src/views/layout/components/Sidebar/FixiOSBug.js +26 -26
- package/src/views/layout/components/Sidebar/Item.vue +28 -28
- package/src/views/layout/components/Sidebar/Link.vue +34 -34
- package/src/views/layout/components/Sidebar/Logo.vue +79 -79
- package/src/views/layout/components/Sidebar/SidebarItem.vue +67 -67
- package/src/views/layout/components/Sidebar/index.vue +114 -114
- package/src/views/layout/components/TagsView/ScrollPane.vue +94 -94
- package/src/views/layout/components/TagsView/index.vue +330 -330
- package/src/views/layout/components/index.js +3 -3
- package/src/views/layout/index.vue +107 -107
- package/src/views/redirect/index.vue +12 -12
- package/src/views/slienceAuth/index.vue +42 -42
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import Storage from 'web-storage-cache'
|
|
2
|
-
|
|
3
|
-
const localStorage = new Storage()
|
|
4
|
-
|
|
5
|
-
export function getLocalStorage(key) {
|
|
6
|
-
return localStorage.get(key)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function setLocalStorage(key, value, expire = 30 * 24 * 3600) {
|
|
10
|
-
return localStorage.set(key, value, {
|
|
11
|
-
exp: expire
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function removeLocalStorage(key) {
|
|
16
|
-
return localStorage.delete(key)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function clearLocalStorage() {
|
|
20
|
-
return localStorage.clear()
|
|
21
|
-
}
|
|
1
|
+
import Storage from 'web-storage-cache'
|
|
2
|
+
|
|
3
|
+
const localStorage = new Storage()
|
|
4
|
+
|
|
5
|
+
export function getLocalStorage(key) {
|
|
6
|
+
return localStorage.get(key)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function setLocalStorage(key, value, expire = 30 * 24 * 3600) {
|
|
10
|
+
return localStorage.set(key, value, {
|
|
11
|
+
exp: expire
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function removeLocalStorage(key) {
|
|
16
|
+
return localStorage.delete(key)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function clearLocalStorage() {
|
|
20
|
+
return localStorage.clear()
|
|
21
|
+
}
|
package/src/utils/ossService.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import OSS from 'ali-oss'
|
|
2
|
-
import { requestApi as axios} from 'xs-request'
|
|
3
|
-
import store from '../store/index'
|
|
4
|
-
import { getLocalStorage } from "@/utils/localStorage";
|
|
5
|
-
import {getConfig} from '@/utils/global-config'
|
|
6
|
-
|
|
7
|
-
// 去哪个服务下 获取 token 信息
|
|
8
|
-
function getOssToken () {
|
|
9
|
-
return axios.get('@commng/UserCur/Oss/Config/' + getConfig('CLIENT_ID'))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let ossCfg = {}
|
|
13
|
-
// 从 vuex 中 获取初始化值
|
|
14
|
-
const initToken = function() {
|
|
15
|
-
ossCfg = store.getters.ossCfg
|
|
16
|
-
let timestamp = new Date().getTime()
|
|
17
|
-
// 有效期内不发送获取token 请求
|
|
18
|
-
if (ossCfg.region && ossCfg.timeout > timestamp) { return }
|
|
19
|
-
getOssToken()
|
|
20
|
-
.then(({ data }) => {
|
|
21
|
-
ossCfg.region = data.ossEndpoint
|
|
22
|
-
ossCfg.bucket = data.bucketName
|
|
23
|
-
ossCfg.accessKeyId = data.stsAccessKeyId
|
|
24
|
-
ossCfg.accessKeySecret = data.stsAccessKeySecret
|
|
25
|
-
ossCfg.stsToken = data.stsSecurityToken
|
|
26
|
-
ossCfg.baseDir = data.baseDir
|
|
27
|
-
ossCfg.timeout = timestamp + (data.durationSeconds * 1000)
|
|
28
|
-
store.commit("oss/SET_OSS", ossCfg)
|
|
29
|
-
})
|
|
30
|
-
.catch((err) => {
|
|
31
|
-
console.log('获取Token错误', err)
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
const newFileName = function(id = getConfig('CLIENT_ID'), userid = getLocalStorage("userProfile").id) {
|
|
35
|
-
let dt = new Date()
|
|
36
|
-
let y = dt.getFullYear()
|
|
37
|
-
let m = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1
|
|
38
|
-
let d = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate()
|
|
39
|
-
return `${ossCfg.baseDir}/${userid}/${y}${m}${d}/${id}_${dt.getTime()}` // 定义唯一的文件名
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const ossService = {
|
|
43
|
-
token: ossCfg,
|
|
44
|
-
initToken,
|
|
45
|
-
newFileName,
|
|
46
|
-
_ossClient: null,
|
|
47
|
-
getOssClient() {
|
|
48
|
-
if (this._ossClient == null) { this._ossClient = new OSS(ossCfg) }
|
|
49
|
-
return this._ossClient
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default ossService
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import OSS from 'ali-oss'
|
|
2
|
+
import { requestApi as axios} from 'xs-request'
|
|
3
|
+
import store from '../store/index'
|
|
4
|
+
import { getLocalStorage } from "@/utils/localStorage";
|
|
5
|
+
import {getConfig} from '@/utils/global-config'
|
|
6
|
+
|
|
7
|
+
// 去哪个服务下 获取 token 信息
|
|
8
|
+
function getOssToken () {
|
|
9
|
+
return axios.get('@commng/UserCur/Oss/Config/' + getConfig('CLIENT_ID'))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let ossCfg = {}
|
|
13
|
+
// 从 vuex 中 获取初始化值
|
|
14
|
+
const initToken = function() {
|
|
15
|
+
ossCfg = store.getters.ossCfg
|
|
16
|
+
let timestamp = new Date().getTime()
|
|
17
|
+
// 有效期内不发送获取token 请求
|
|
18
|
+
if (ossCfg.region && ossCfg.timeout > timestamp) { return }
|
|
19
|
+
getOssToken()
|
|
20
|
+
.then(({ data }) => {
|
|
21
|
+
ossCfg.region = data.ossEndpoint
|
|
22
|
+
ossCfg.bucket = data.bucketName
|
|
23
|
+
ossCfg.accessKeyId = data.stsAccessKeyId
|
|
24
|
+
ossCfg.accessKeySecret = data.stsAccessKeySecret
|
|
25
|
+
ossCfg.stsToken = data.stsSecurityToken
|
|
26
|
+
ossCfg.baseDir = data.baseDir
|
|
27
|
+
ossCfg.timeout = timestamp + (data.durationSeconds * 1000)
|
|
28
|
+
store.commit("oss/SET_OSS", ossCfg)
|
|
29
|
+
})
|
|
30
|
+
.catch((err) => {
|
|
31
|
+
console.log('获取Token错误', err)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
const newFileName = function(id = getConfig('CLIENT_ID'), userid = getLocalStorage("userProfile").id) {
|
|
35
|
+
let dt = new Date()
|
|
36
|
+
let y = dt.getFullYear()
|
|
37
|
+
let m = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1
|
|
38
|
+
let d = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate()
|
|
39
|
+
return `${ossCfg.baseDir}/${userid}/${y}${m}${d}/${id}_${dt.getTime()}` // 定义唯一的文件名
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const ossService = {
|
|
43
|
+
token: ossCfg,
|
|
44
|
+
initToken,
|
|
45
|
+
newFileName,
|
|
46
|
+
_ossClient: null,
|
|
47
|
+
getOssClient() {
|
|
48
|
+
if (this._ossClient == null) { this._ossClient = new OSS(ossCfg) }
|
|
49
|
+
return this._ossClient
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default ossService
|
|
54
|
+
|
|
55
|
+
|
package/src/utils/prototype.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { Module_Search } from '@modules/module.config'
|
|
3
|
-
import 'moment-duration-format'
|
|
4
|
-
import moment from 'moment'// 导入文件
|
|
5
|
-
import ask from '@/automatically/api'
|
|
6
|
-
import {requestApi} from 'xs-request'
|
|
7
|
-
import echarts from 'echarts';
|
|
8
|
-
import {loadTableData, loadReportData, msg, countDownSetColor, showDlg} from '@/utils/index'
|
|
9
|
-
import signalr from '@/utils/signalR'
|
|
10
|
-
import {Enum, OrgEnum, EnumList} from '@/utils/enum'
|
|
11
|
-
import common from '@/common/common'
|
|
12
|
-
import Common_Search from '@/utils/search';
|
|
13
|
-
import filterRules from './filterRules'
|
|
14
|
-
import ossService from '@/utils/ossService'
|
|
15
|
-
|
|
16
|
-
//新版api 请求
|
|
17
|
-
Vue.prototype.$ask = ask
|
|
18
|
-
//旧版 请求
|
|
19
|
-
Vue.prototype.$http = requestApi
|
|
20
|
-
Vue.prototype.$echarts = echarts;
|
|
21
|
-
// 日期格式
|
|
22
|
-
Vue.prototype.$moment = moment// 赋值使用
|
|
23
|
-
// 加载表格数据
|
|
24
|
-
Vue.prototype.loadTableData = loadTableData
|
|
25
|
-
// 加载报表数据
|
|
26
|
-
Vue.prototype.loadReportData = loadReportData
|
|
27
|
-
// 消息
|
|
28
|
-
Vue.prototype.$msg = msg
|
|
29
|
-
Vue.$SearchTool = Object.assign({}, Common_Search, Module_Search ? Module_Search : {})
|
|
30
|
-
Vue.prototype.countDownSetColor = countDownSetColor
|
|
31
|
-
Vue.prototype.signalr = signalr
|
|
32
|
-
Vue.prototype.$enum = Enum
|
|
33
|
-
Vue.prototype.$orgEnum = OrgEnum
|
|
34
|
-
Vue.prototype.$enumList = EnumList
|
|
35
|
-
Vue.prototype.$common = common
|
|
36
|
-
Vue.http = requestApi;
|
|
37
|
-
Vue.Enum = Enum;
|
|
38
|
-
Vue.OrgEnum = OrgEnum;
|
|
39
|
-
Vue.EnumList = EnumList;
|
|
40
|
-
// 显示弹出对话框
|
|
41
|
-
Vue.prototype.showDlg =showDlg
|
|
42
|
-
|
|
43
|
-
// 校验
|
|
44
|
-
Vue.prototype.$filterRules = filterRules
|
|
45
|
-
|
|
46
|
-
// oss 图片上次服务
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { Module_Search } from '@modules/module.config'
|
|
3
|
+
import 'moment-duration-format'
|
|
4
|
+
import moment from 'moment'// 导入文件
|
|
5
|
+
import ask from '@/automatically/api'
|
|
6
|
+
import {requestApi} from 'xs-request'
|
|
7
|
+
import echarts from 'echarts';
|
|
8
|
+
import {loadTableData, loadReportData, msg, countDownSetColor, showDlg} from '@/utils/index'
|
|
9
|
+
import signalr from '@/utils/signalR'
|
|
10
|
+
import {Enum, OrgEnum, EnumList} from '@/utils/enum'
|
|
11
|
+
import common from '@/common/common'
|
|
12
|
+
import Common_Search from '@/utils/search';
|
|
13
|
+
import filterRules from './filterRules'
|
|
14
|
+
import ossService from '@/utils/ossService'
|
|
15
|
+
|
|
16
|
+
//新版api 请求
|
|
17
|
+
Vue.prototype.$ask = ask
|
|
18
|
+
//旧版 请求
|
|
19
|
+
Vue.prototype.$http = requestApi
|
|
20
|
+
Vue.prototype.$echarts = echarts;
|
|
21
|
+
// 日期格式
|
|
22
|
+
Vue.prototype.$moment = moment// 赋值使用
|
|
23
|
+
// 加载表格数据
|
|
24
|
+
Vue.prototype.loadTableData = loadTableData
|
|
25
|
+
// 加载报表数据
|
|
26
|
+
Vue.prototype.loadReportData = loadReportData
|
|
27
|
+
// 消息
|
|
28
|
+
Vue.prototype.$msg = msg
|
|
29
|
+
Vue.$SearchTool = Object.assign({}, Common_Search, Module_Search ? Module_Search : {})
|
|
30
|
+
Vue.prototype.countDownSetColor = countDownSetColor
|
|
31
|
+
Vue.prototype.signalr = signalr
|
|
32
|
+
Vue.prototype.$enum = Enum
|
|
33
|
+
Vue.prototype.$orgEnum = OrgEnum
|
|
34
|
+
Vue.prototype.$enumList = EnumList
|
|
35
|
+
Vue.prototype.$common = common
|
|
36
|
+
Vue.http = requestApi;
|
|
37
|
+
Vue.Enum = Enum;
|
|
38
|
+
Vue.OrgEnum = OrgEnum;
|
|
39
|
+
Vue.EnumList = EnumList;
|
|
40
|
+
// 显示弹出对话框
|
|
41
|
+
Vue.prototype.showDlg =showDlg
|
|
42
|
+
|
|
43
|
+
// 校验
|
|
44
|
+
Vue.prototype.$filterRules = filterRules
|
|
45
|
+
|
|
46
|
+
// oss 图片上次服务
|
|
47
47
|
Vue.prototype.$ossService = ossService
|
package/src/utils/search.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export function qcDateRange(_fieldName = '', _defaultValue = '', options) {
|
|
2
|
-
return Object.assign({}, {
|
|
3
|
-
fieldName: 'datepic',
|
|
4
|
-
defaultValue: _defaultValue,
|
|
5
|
-
conditionType: 4,
|
|
6
|
-
url: '',
|
|
7
|
-
dataSource: '',
|
|
8
|
-
displayNam: '',
|
|
9
|
-
dataSourceType: 1,
|
|
10
|
-
sort: 0,
|
|
11
|
-
isIndex: true
|
|
12
|
-
}, options)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function qcInput(_fieldName = '', _defaultValue, options) {
|
|
16
|
-
return Object.assign({}, {
|
|
17
|
-
displayName: "",
|
|
18
|
-
fieldName: _fieldName,
|
|
19
|
-
defaultValue: _defaultValue,
|
|
20
|
-
conditionType: 0,
|
|
21
|
-
url: "",
|
|
22
|
-
dataSource: "",
|
|
23
|
-
dataSourceType: 0,
|
|
24
|
-
sort: 0,
|
|
25
|
-
isIndex: true,
|
|
26
|
-
}, options)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
qcDateRange,
|
|
32
|
-
qcInput
|
|
33
|
-
}
|
|
1
|
+
export function qcDateRange(_fieldName = '', _defaultValue = '', options) {
|
|
2
|
+
return Object.assign({}, {
|
|
3
|
+
fieldName: 'datepic',
|
|
4
|
+
defaultValue: _defaultValue,
|
|
5
|
+
conditionType: 4,
|
|
6
|
+
url: '',
|
|
7
|
+
dataSource: '',
|
|
8
|
+
displayNam: '',
|
|
9
|
+
dataSourceType: 1,
|
|
10
|
+
sort: 0,
|
|
11
|
+
isIndex: true
|
|
12
|
+
}, options)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function qcInput(_fieldName = '', _defaultValue, options) {
|
|
16
|
+
return Object.assign({}, {
|
|
17
|
+
displayName: "",
|
|
18
|
+
fieldName: _fieldName,
|
|
19
|
+
defaultValue: _defaultValue,
|
|
20
|
+
conditionType: 0,
|
|
21
|
+
url: "",
|
|
22
|
+
dataSource: "",
|
|
23
|
+
dataSourceType: 0,
|
|
24
|
+
sort: 0,
|
|
25
|
+
isIndex: true,
|
|
26
|
+
}, options)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
qcDateRange,
|
|
32
|
+
qcInput
|
|
33
|
+
}
|
|
34
34
|
|
package/src/utils/signalR.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as signalR from '@microsoft/signalr'
|
|
2
|
-
import { getToken } from '@/utils/auth'
|
|
3
|
-
|
|
4
|
-
const signalr = create('signalR/WorkerHub')
|
|
5
|
-
import { getConfig } from '@/utils/global-config'
|
|
6
|
-
const tokenKey = `${getConfig('CLIENT_ID')}_token`
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function create(url) {
|
|
10
|
-
const signalUrl = `../${url}`
|
|
11
|
-
|
|
12
|
-
return new signalR.HubConnectionBuilder()
|
|
13
|
-
// 服务器地址
|
|
14
|
-
.withUrl(signalUrl, { accessTokenFactory: () => getToken(tokenKey) })
|
|
15
|
-
.withAutomaticReconnect({
|
|
16
|
-
nextRetryDelayInMilliseconds: retryContext => {
|
|
17
|
-
console.log(retryContext.elapsedMilliseconds, '重新链接所花费的时间')
|
|
18
|
-
return 1001 // 每秒请求
|
|
19
|
-
}
|
|
20
|
-
}) // 自动重连
|
|
21
|
-
.build()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default signalr
|
|
1
|
+
import * as signalR from '@microsoft/signalr'
|
|
2
|
+
import { getToken } from '@/utils/auth'
|
|
3
|
+
|
|
4
|
+
const signalr = create('signalR/WorkerHub')
|
|
5
|
+
import { getConfig } from '@/utils/global-config'
|
|
6
|
+
const tokenKey = `${getConfig('CLIENT_ID')}_token`
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function create(url) {
|
|
10
|
+
const signalUrl = `../${url}`
|
|
11
|
+
|
|
12
|
+
return new signalR.HubConnectionBuilder()
|
|
13
|
+
// 服务器地址
|
|
14
|
+
.withUrl(signalUrl, { accessTokenFactory: () => getToken(tokenKey) })
|
|
15
|
+
.withAutomaticReconnect({
|
|
16
|
+
nextRetryDelayInMilliseconds: retryContext => {
|
|
17
|
+
console.log(retryContext.elapsedMilliseconds, '重新链接所花费的时间')
|
|
18
|
+
return 1001 // 每秒请求
|
|
19
|
+
}
|
|
20
|
+
}) // 自动重连
|
|
21
|
+
.build()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default signalr
|
package/src/utils/validate.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by PanJiaChen on 16/11/18.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param {string} path
|
|
7
|
-
* @returns {Boolean}
|
|
8
|
-
*/
|
|
9
|
-
export function isExternal(path) {
|
|
10
|
-
return /^(https?:|mailto:|tel:)/.test(path)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {string} str
|
|
15
|
-
* @returns {Boolean}
|
|
16
|
-
*/
|
|
17
|
-
export function validUsername(str) {
|
|
18
|
-
const valid_map = ['admin', 'editor']
|
|
19
|
-
return valid_map.indexOf(str.trim()) >= 0
|
|
20
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Created by PanJiaChen on 16/11/18.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} path
|
|
7
|
+
* @returns {Boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function isExternal(path) {
|
|
10
|
+
return /^(https?:|mailto:|tel:)/.test(path)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} str
|
|
15
|
+
* @returns {Boolean}
|
|
16
|
+
*/
|
|
17
|
+
export function validUsername(str) {
|
|
18
|
+
const valid_map = ['admin', 'editor']
|
|
19
|
+
return valid_map.indexOf(str.trim()) >= 0
|
|
20
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<template></template>
|
|
2
|
-
<script>
|
|
3
|
-
import { setToken } from "@/utils/auth"; // get token from cookie
|
|
4
|
-
import { getQuery } from "@/common/utils";
|
|
5
|
-
import { getConfig } from "@/utils/global-config";
|
|
6
|
-
import { setLocalStorage } from "@utils/localStorage";
|
|
7
|
-
const endTimestamp = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
|
|
8
|
-
export default {
|
|
9
|
-
mounted() {
|
|
10
|
-
if (getConfig("ID4_LOGINTYPE")) {
|
|
11
|
-
const that = this;
|
|
12
|
-
window.$mgr.signinRedirectCallback().then(function () {
|
|
13
|
-
window.$mgr.getUser().then((user) => {
|
|
14
|
-
setToken(user.access_token);
|
|
15
|
-
setToken("LoginUserName", user.profile.name);
|
|
16
|
-
setLocalStorage("userProfile", user.profile);
|
|
17
|
-
localStorage.setItem("token", user.access_token);
|
|
18
|
-
// 作为第三方系统被嵌套在iframe中使用
|
|
19
|
-
sessionStorage.setItem("token", user.access_token);
|
|
20
|
-
sessionStorage.setItem("iframeAuthExpireTime", endTimestamp);
|
|
21
|
-
var redic_url = getQuery(window.location.href, "redic_url");
|
|
22
|
-
that.$router.push(
|
|
23
|
-
redic_url ? decodeURIComponent(redic_url).substr(1) : `/`
|
|
24
|
-
);
|
|
25
|
-
})
|
|
26
|
-
.catch(function (e) {
|
|
27
|
-
console.log("getUser", e);
|
|
28
|
-
});
|
|
29
|
-
})
|
|
30
|
-
.catch(function (e) {
|
|
31
|
-
console.log("getToken", e);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
};
|
|
1
|
+
<template></template>
|
|
2
|
+
<script>
|
|
3
|
+
import { setToken } from "@/utils/auth"; // get token from cookie
|
|
4
|
+
import { getQuery } from "@/common/utils";
|
|
5
|
+
import { getConfig } from "@/utils/global-config";
|
|
6
|
+
import { setLocalStorage } from "@utils/localStorage";
|
|
7
|
+
const endTimestamp = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
|
|
8
|
+
export default {
|
|
9
|
+
mounted() {
|
|
10
|
+
if (getConfig("ID4_LOGINTYPE")) {
|
|
11
|
+
const that = this;
|
|
12
|
+
window.$mgr.signinRedirectCallback().then(function () {
|
|
13
|
+
window.$mgr.getUser().then((user) => {
|
|
14
|
+
setToken(user.access_token);
|
|
15
|
+
setToken("LoginUserName", user.profile.name);
|
|
16
|
+
setLocalStorage("userProfile", user.profile);
|
|
17
|
+
localStorage.setItem("token", user.access_token);
|
|
18
|
+
// 作为第三方系统被嵌套在iframe中使用
|
|
19
|
+
sessionStorage.setItem("token", user.access_token);
|
|
20
|
+
sessionStorage.setItem("iframeAuthExpireTime", endTimestamp);
|
|
21
|
+
var redic_url = getQuery(window.location.href, "redic_url");
|
|
22
|
+
that.$router.push(
|
|
23
|
+
redic_url ? decodeURIComponent(redic_url).substr(1) : `/`
|
|
24
|
+
);
|
|
25
|
+
})
|
|
26
|
+
.catch(function (e) {
|
|
27
|
+
console.log("getUser", e);
|
|
28
|
+
});
|
|
29
|
+
})
|
|
30
|
+
.catch(function (e) {
|
|
31
|
+
console.log("getToken", e);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
36
|
</script>
|
package/src/views/home/index.vue
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="home-wrapper" />
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
export default {
|
|
6
|
-
beforeRouteEnter(to, from, next) {
|
|
7
|
-
next((vm) => {
|
|
8
|
-
vm.apartyGetToken(to, next, vm)
|
|
9
|
-
})
|
|
10
|
-
},
|
|
11
|
-
methods: {
|
|
12
|
-
async apartyGetToken(to, next, vm) {
|
|
13
|
-
// 识别被哪个 iframe 引用;qualityTestParty=质检详情
|
|
14
|
-
if (window.parent !== window.self && window.name === 'qualityTestParty') {
|
|
15
|
-
if (to.query.orderId && to.query.orderId != 'undefined') {
|
|
16
|
-
sessionStorage.setItem('iframeOrderId', to.query.orderId)
|
|
17
|
-
}
|
|
18
|
-
next('/zhijian-details')
|
|
19
|
-
} else {
|
|
20
|
-
next()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="home-wrapper" />
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
export default {
|
|
6
|
+
beforeRouteEnter(to, from, next) {
|
|
7
|
+
next((vm) => {
|
|
8
|
+
vm.apartyGetToken(to, next, vm)
|
|
9
|
+
})
|
|
10
|
+
},
|
|
11
|
+
methods: {
|
|
12
|
+
async apartyGetToken(to, next, vm) {
|
|
13
|
+
// 识别被哪个 iframe 引用;qualityTestParty=质检详情
|
|
14
|
+
if (window.parent !== window.self && window.name === 'qualityTestParty') {
|
|
15
|
+
if (to.query.orderId && to.query.orderId != 'undefined') {
|
|
16
|
+
sessionStorage.setItem('iframeOrderId', to.query.orderId)
|
|
17
|
+
}
|
|
18
|
+
next('/zhijian-details')
|
|
19
|
+
} else {
|
|
20
|
+
next()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="allSearch-wrapper">
|
|
3
|
-
<el-input
|
|
4
|
-
v-if="search"
|
|
5
|
-
suffix-icon="el-icon-search"
|
|
6
|
-
clearable
|
|
7
|
-
size="small"
|
|
8
|
-
v-model="globalSearch"
|
|
9
|
-
placeholder="请输入内容"
|
|
10
|
-
@change="changeHandler"
|
|
11
|
-
maxlength="50"
|
|
12
|
-
></el-input>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { mapState } from "vuex";
|
|
18
|
-
export default {
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
// 全局搜索
|
|
22
|
-
globalSearch: ""
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
methods: {
|
|
26
|
-
/**
|
|
27
|
-
* 搜索框选中操作
|
|
28
|
-
*/
|
|
29
|
-
changeHandler(val) {
|
|
30
|
-
this.search(val);
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
...mapState({
|
|
35
|
-
search: state => state.search
|
|
36
|
-
})
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<style lang="scss">
|
|
42
|
-
.allSearch-wrapper .el-input--small .el-input__inner {
|
|
43
|
-
width: 300px;
|
|
44
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="allSearch-wrapper">
|
|
3
|
+
<el-input
|
|
4
|
+
v-if="search"
|
|
5
|
+
suffix-icon="el-icon-search"
|
|
6
|
+
clearable
|
|
7
|
+
size="small"
|
|
8
|
+
v-model="globalSearch"
|
|
9
|
+
placeholder="请输入内容"
|
|
10
|
+
@change="changeHandler"
|
|
11
|
+
maxlength="50"
|
|
12
|
+
></el-input>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import { mapState } from "vuex";
|
|
18
|
+
export default {
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
// 全局搜索
|
|
22
|
+
globalSearch: ""
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
/**
|
|
27
|
+
* 搜索框选中操作
|
|
28
|
+
*/
|
|
29
|
+
changeHandler(val) {
|
|
30
|
+
this.search(val);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
...mapState({
|
|
35
|
+
search: state => state.search
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="scss">
|
|
42
|
+
.allSearch-wrapper .el-input--small .el-input__inner {
|
|
43
|
+
width: 300px;
|
|
44
|
+
}
|
|
45
45
|
</style>
|