imatrix-ui 2.9.9-dw → 2.9.11-boe1
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/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +2 -2
- package/src/api/sso-service.js +19 -1
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +14 -4
- package/src/i18n/langs/en.js +16 -5
- package/src/permission.js +1 -1
- package/src/plugins.js +3 -3
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/store/modules/user.js +19 -0
- package/src/styles/index.scss +74 -4
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +6 -30
- package/src/styles/theme/blue/font-style.scss +37 -0
- package/src/styles/theme/blue/index.scss +2 -18
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +3 -13
- package/src/styles/theme/dark-blue/index.scss +27 -5
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/table.scss +1 -1
- package/src/styles/theme/gray/card-style.scss +13 -1
- package/src/styles/theme/gray/font-style.scss +38 -0
- package/src/styles/theme/gray/index.scss +13 -25
- package/src/styles/theme/gray/scrollbar-style.scss +32 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +45 -1
- package/src/utils/common-util.js +21 -81
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +6 -3
- package/src/utils/util.js +12 -10
- package/src/views/dsc-component/Sidebar/Item.vue +7 -5
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
- package/src/views/dsc-component/Sidebar/index.vue +12 -20
- package/src/views/dsc-component/tabs/tab-content.vue +1 -5
- package/src/views/layout/NewLayout.vue +6 -65
- package/src/views/layout/components/Menubar/Item.vue +23 -7
- package/src/views/layout/components/Menubar/Link.vue +11 -2
- package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
- package/src/views/layout/components/Menubar/index.vue +51 -16
- package/src/views/layout/components/tabs/tab-content.vue +160 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +85 -0
- package/src/views/login/index.vue +1 -1
- package/packages/breadcrumb/index.js +0 -6
- package/packages/breadcrumb/src/breadcrumb.vue +0 -71
- package/packages/department-tree/index.js +0 -6
- package/packages/department-tree/src/department-tree.vue +0 -108
- package/packages/department-tree-inline/index.js +0 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -245
- package/packages/department-tree-inline/src/search-result.vue +0 -176
- package/packages/department-user-tree/index.js +0 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
- package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
- package/packages/department-user-tree/src/department-user-tree.vue +0 -101
- package/packages/department-user-tree-inline/index.js +0 -6
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
- package/packages/department-user-tree-inline/src/search-result.vue +0 -197
- package/packages/directives/prevent-reclick.js +0 -19
- package/packages/dynamic-source-select/index.js +0 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
- package/packages/dynamic-source-select/src/events.js +0 -55
- package/packages/fs-preview/index.js +0 -6
- package/packages/fs-preview/src/fs-preview.vue +0 -226
- package/packages/fs-upload/index.js +0 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
- package/packages/fs-upload/src/fs-upload-single.vue +0 -312
- package/packages/fs-upload/src/fs-upload.vue +0 -189
- package/packages/fs-upload/src/see-big-picture.vue +0 -55
- package/packages/fs-upload-list/index.js +0 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
- package/packages/hamburger/index.js +0 -6
- package/packages/hamburger/src/hamburger.vue +0 -38
- package/packages/index.js +0 -121
- package/packages/multipart-upload/index.js +0 -6
- package/packages/multipart-upload/src/index.vue +0 -73
- package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
- package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
- package/packages/organization-input/index.js +0 -6
- package/packages/organization-input/src/organization-input.vue +0 -542
- package/packages/plugins/export-data-new.js +0 -453
- package/packages/plugins/export-data.js +0 -361
- package/packages/plugins/index.js +0 -15
- package/packages/plugins/public-method.js +0 -43
- package/packages/remove-department/index.js +0 -6
- package/packages/remove-department/src/remove-department.vue +0 -172
- package/packages/remove-department/src/remove-dept-service.js +0 -20
- package/packages/remove-user/index.js +0 -6
- package/packages/remove-user/src/remove-user-service.js +0 -20
- package/packages/remove-user/src/remove-user.vue +0 -195
- package/packages/remove-workgroup/index.js +0 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
- package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
- package/packages/rich-editor/index.js +0 -7
- package/packages/rich-editor/index.vue +0 -278
- package/packages/rich-editor/langs/zh-Hans.js +0 -1
- package/packages/rich-editor/viewer.vue +0 -103
- package/packages/scan-code-input/index.js +0 -6
- package/packages/scan-code-input/src/events.js +0 -33
- package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
- package/packages/scan-code-input/src/scan-code-input.vue +0 -116
- package/packages/secret-info/index.js +0 -7
- package/packages/secret-info/index.vue +0 -90
- package/packages/super-grid/index.js +0 -7
- package/packages/super-grid/src/apis.js +0 -763
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -250
- package/packages/super-grid/src/dynamic-input.vue +0 -1279
- package/packages/super-grid/src/eventBus.js +0 -2
- package/packages/super-grid/src/events.js +0 -55
- package/packages/super-grid/src/formValidatorUtil.js +0 -226
- package/packages/super-grid/src/formatter.js +0 -181
- package/packages/super-grid/src/group-column.vue +0 -100
- package/packages/super-grid/src/header-context-menu.vue +0 -87
- package/packages/super-grid/src/index-column.vue +0 -51
- package/packages/super-grid/src/normal-column.vue +0 -769
- package/packages/super-grid/src/public-methods.js +0 -31
- package/packages/super-grid/src/row-operation.vue +0 -161
- package/packages/super-grid/src/search-button.vue +0 -66
- package/packages/super-grid/src/search-condition-input.vue +0 -61
- package/packages/super-grid/src/search-condition-list.vue +0 -59
- package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -386
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -162
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
- package/packages/super-grid/src/search-form.vue +0 -634
- package/packages/super-grid/src/search-methods.js +0 -387
- package/packages/super-grid/src/selection-column.vue +0 -43
- package/packages/super-grid/src/store.js +0 -3
- package/packages/super-grid/src/super-grid-service.js +0 -561
- package/packages/super-grid/src/super-grid.vue +0 -2829
- package/packages/super-grid/src/utils.js +0 -763
- package/packages/super-grid/src/view-image-dialog.vue +0 -130
- package/packages/super-nine-grid/index.js +0 -7
- package/packages/super-nine-grid/src/apis.js +0 -103
- package/packages/super-nine-grid/src/custom-formatter.js +0 -66
- package/packages/super-nine-grid/src/formatter.js +0 -132
- package/packages/super-nine-grid/src/search-form-number.vue +0 -38
- package/packages/super-nine-grid/src/search-form.vue +0 -430
- package/packages/super-nine-grid/src/search-methods.js +0 -134
- package/packages/super-nine-grid/src/store.js +0 -3
- package/packages/super-nine-grid/src/super-grid-service.js +0 -91
- package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
- package/packages/super-nine-grid/src/utils.js +0 -261
- package/packages/svg-icon/index.js +0 -6
- package/packages/svg-icon/src/svg-icon.vue +0 -43
- package/packages/utils/utils.js +0 -152
- package/packages/utils/value-set.js +0 -86
- package/packages/valid-code/index.js +0 -7
- package/packages/valid-code/src/valid-code.vue +0 -95
- package/packages/workflow-button/index.js +0 -6
- package/packages/workflow-button/src/workflow-button.vue +0 -325
- package/packages/workflow-history-list/index.js +0 -6
- package/packages/workflow-history-list/src/api.js +0 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
- package/packages/workgroup-tree/index.js +0 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
- package/packages/workgroup-tree-inline/index.js +0 -6
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
- package/packages/workgroup-user-tree/index.js +0 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
- package/packages/workgroup-user-tree-inline/index.js +0 -6
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
- package/packages/year-range-picker/index.js +0 -6
- package/packages/year-range-picker/src/year-range-picker.vue +0 -51
- package/src/index.js +0 -93
- package/src/styles/theme/gray/form-style.scss +0 -41
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
:append-to-body="true"
|
|
4
|
-
:show-close="true"
|
|
5
|
-
:title="$t('imatrixUIPublicModel.preview')"
|
|
6
|
-
:visible="true"
|
|
7
|
-
@close="$emit('close')"
|
|
8
|
-
>
|
|
9
|
-
<template v-slot:title>
|
|
10
|
-
<span>{{ $t('imatrixUIPublicModel.preview') }}
|
|
11
|
-
<!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
|
|
12
|
-
<i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" />
|
|
13
|
-
</span>
|
|
14
|
-
</template>
|
|
15
|
-
<el-carousel :interval="5000" arrow="always" @change="changeFile">
|
|
16
|
-
<el-carousel-item v-for="item in fileList" :key="item.serverName" style="background-color:#eee">
|
|
17
|
-
<el-image v-if="item.isImg" :src="item.src" :preview-src-list="[item.src]" />
|
|
18
|
-
<div v-else style="text-align:center;margin-top: 50px;">
|
|
19
|
-
<div style="font-size: 18px">
|
|
20
|
-
{{ item.showName }}
|
|
21
|
-
</div>
|
|
22
|
-
<div style="padding-top:10px;">
|
|
23
|
-
{{ $t('superGrid.previewTitleWhenNotImg') }}
|
|
24
|
-
</div>
|
|
25
|
-
<div style="padding-top:10px">
|
|
26
|
-
<el-button type="primary" size="small" @click="preview()">
|
|
27
|
-
{{ $t('fsUpload.preview') }}
|
|
28
|
-
</el-button>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</el-carousel-item>
|
|
32
|
-
</el-carousel>
|
|
33
|
-
</el-dialog>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import Vue from 'vue'
|
|
38
|
-
import { isPlateSys, getSystemFrontendUrl } from '../../../src/utils/common-util'
|
|
39
|
-
import { getToken } from '../../../src/utils/auth'
|
|
40
|
-
export default {
|
|
41
|
-
name: 'ViewImageDialog',
|
|
42
|
-
props: {
|
|
43
|
-
fileList: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default: function() {
|
|
46
|
-
return []
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
downloadable: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: function() {
|
|
52
|
-
return true
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
deleteable: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: function() {
|
|
58
|
-
return false
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
data() {
|
|
63
|
-
const token = getToken()
|
|
64
|
-
let previewUrl = Vue.prototype.baseURL + '/common/fs-upload/preview?jwt=' + token
|
|
65
|
-
if (isPlateSys(Vue.prototype.systemCode)) {
|
|
66
|
-
previewUrl = Vue.prototype.baseAPI + '/component/fs-upload/preview?jwt=' + token
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
showName: null,
|
|
70
|
-
serverName: null,
|
|
71
|
-
file: null,
|
|
72
|
-
previewUrl
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
changeFile(currentIndex, origIndex) {
|
|
77
|
-
const file = this.fileList[currentIndex]
|
|
78
|
-
this.file = file
|
|
79
|
-
this.showName = file.showName
|
|
80
|
-
this.serverName = file.serverName
|
|
81
|
-
},
|
|
82
|
-
downloadFile() {
|
|
83
|
-
if (!this.showName) {
|
|
84
|
-
const file = this.fileList[0]
|
|
85
|
-
this.showName = file.showName
|
|
86
|
-
this.serverName = file.serverName
|
|
87
|
-
}
|
|
88
|
-
const token = getToken()
|
|
89
|
-
let url = Vue.prototype.baseURL + '/common/super-form/downloads?jwt=' + token
|
|
90
|
-
if (isPlateSys(Vue.prototype.systemCode)) {
|
|
91
|
-
url = Vue.prototype.baseAPI + '/component/super-form/downloads?jwt=' + token
|
|
92
|
-
}
|
|
93
|
-
window.location.href = url + '&showName=' + encodeURI(this.showName) + '&serverPath=' + this.serverName
|
|
94
|
-
},
|
|
95
|
-
preview() {
|
|
96
|
-
if (!this.showName) {
|
|
97
|
-
const file = this.fileList[0]
|
|
98
|
-
this.showName = file.showName
|
|
99
|
-
this.serverName = file.serverName
|
|
100
|
-
}
|
|
101
|
-
if (Vue.prototype.customPreviewUrl) {
|
|
102
|
-
window.open(getSystemFrontendUrl(Vue.prototype.portalUrl) + '/#/file-service/preview?serverPath=' + this.serverName +
|
|
103
|
-
'&showName=' + encodeURI(this.showName),
|
|
104
|
-
this.showName
|
|
105
|
-
)
|
|
106
|
-
} else {
|
|
107
|
-
window.open(this.previewUrl + '&showName=' + encodeURI(this.showName) + '&serverPath=' + this.serverName)
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
deleteFile() {
|
|
111
|
-
let index
|
|
112
|
-
if (this.fileList && this.fileList.length > 0) {
|
|
113
|
-
if (!this.showName) {
|
|
114
|
-
const file = this.fileList[0]
|
|
115
|
-
this.showName = file.showName
|
|
116
|
-
this.serverName = file.serverName
|
|
117
|
-
}
|
|
118
|
-
const serverName = this.serverName
|
|
119
|
-
index = this.fileList.findIndex(function(item) {
|
|
120
|
-
return item.serverName === serverName
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
this.$emit('delete', this.fileList, index)
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
</script>
|
|
128
|
-
|
|
129
|
-
<style lang="scss" scoped>
|
|
130
|
-
</style>
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import store from './store'
|
|
2
|
-
const apis = {
|
|
3
|
-
// 刷新列表数据
|
|
4
|
-
refresh() {
|
|
5
|
-
return new Promise((resolve, reject) => {
|
|
6
|
-
if (this.$refs) {
|
|
7
|
-
// 刷新列表数据
|
|
8
|
-
if (this.$refs.sf) {
|
|
9
|
-
this.search(this.$refs.sf.searchParams, true).then(() => resolve()).catch(error => reject(error))
|
|
10
|
-
} else {
|
|
11
|
-
this.search(null, true).then(() => resolve()).catch(error => reject(error))
|
|
12
|
-
}
|
|
13
|
-
} else {
|
|
14
|
-
resolve()
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
},
|
|
18
|
-
// 显示查询
|
|
19
|
-
showSearchForm() {
|
|
20
|
-
this.showSearch = true
|
|
21
|
-
this.$emit('showSearch')
|
|
22
|
-
},
|
|
23
|
-
// 取消查询
|
|
24
|
-
cancelSearch() {
|
|
25
|
-
this.showSearch = false
|
|
26
|
-
this.$emit('cancelSearch')
|
|
27
|
-
},
|
|
28
|
-
// 获得查询条件
|
|
29
|
-
getSearchForm() {
|
|
30
|
-
const gridParams = store.get(this.storeId)
|
|
31
|
-
if (gridParams.searchForm) {
|
|
32
|
-
return gridParams.searchForm
|
|
33
|
-
} else {
|
|
34
|
-
return []
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
// 获得列表所有数据
|
|
38
|
-
getGridData(listCode) {
|
|
39
|
-
if (!listCode) {
|
|
40
|
-
listCode = store.get('_nine_list_code')
|
|
41
|
-
}
|
|
42
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
43
|
-
// 拼接默认的九宫格gridId
|
|
44
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
45
|
-
}
|
|
46
|
-
const gridParams = store.get(listCode)
|
|
47
|
-
return gridParams.gridData
|
|
48
|
-
},
|
|
49
|
-
// 获得字段配置
|
|
50
|
-
getColumns(listCode) {
|
|
51
|
-
if (!listCode) {
|
|
52
|
-
listCode = store.get('_nine_list_code')
|
|
53
|
-
}
|
|
54
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
55
|
-
// 拼接默认的九宫格gridId
|
|
56
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
57
|
-
}
|
|
58
|
-
const gridParams = store.get(listCode)
|
|
59
|
-
return gridParams.columns
|
|
60
|
-
},
|
|
61
|
-
// listCode 列表编码~gridId,例如:MMS_BUSSINESS_SYSTEM~grid1
|
|
62
|
-
getPagination(listCode) {
|
|
63
|
-
if (!listCode) {
|
|
64
|
-
listCode = store.get('_nine_list_code')
|
|
65
|
-
}
|
|
66
|
-
if (listCode && listCode.indexOf('~') < 0) {
|
|
67
|
-
// 拼接默认的九宫格gridId
|
|
68
|
-
listCode = listCode + '~' + '_nineGrid'
|
|
69
|
-
}
|
|
70
|
-
const gridParams = store.get(listCode)
|
|
71
|
-
return gridParams.pagination
|
|
72
|
-
},
|
|
73
|
-
// 获得选中的记录集合
|
|
74
|
-
getSelections() {
|
|
75
|
-
return this.selections
|
|
76
|
-
},
|
|
77
|
-
// 获得选中的记录id集合
|
|
78
|
-
getSelectionIds() {
|
|
79
|
-
return this.selectionIds
|
|
80
|
-
},
|
|
81
|
-
// 清空选中的记录
|
|
82
|
-
clearSelections() {
|
|
83
|
-
this.selections = []
|
|
84
|
-
this.selectionIds = []
|
|
85
|
-
this.selectionModels = {}
|
|
86
|
-
this.currentId = null
|
|
87
|
-
},
|
|
88
|
-
// 单选时获得选中的记录
|
|
89
|
-
getSelection() {
|
|
90
|
-
if (this.selections && this.selections.length > 0) {
|
|
91
|
-
return this.selections[0]
|
|
92
|
-
}
|
|
93
|
-
return null
|
|
94
|
-
},
|
|
95
|
-
// 单选时获得选中的记录id集合
|
|
96
|
-
getSelectionId() {
|
|
97
|
-
if (this.selectionIds && this.selectionIds.length > 0) {
|
|
98
|
-
return this.selectionIds[0]
|
|
99
|
-
}
|
|
100
|
-
return null
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
export default apis
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// import Vue from 'vue'
|
|
2
|
-
import { doFormat } from './formatter'
|
|
3
|
-
const customFormatter = {
|
|
4
|
-
isObjectProp(prop) {
|
|
5
|
-
if (prop.indexOf('.') > 0) {
|
|
6
|
-
return true
|
|
7
|
-
} else {
|
|
8
|
-
return false
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
objectPropOriginalValue(row, prop) {
|
|
13
|
-
try {
|
|
14
|
-
// console.log('---super-grid--objectPropOriginalValue--')
|
|
15
|
-
let objValue = row
|
|
16
|
-
const props = prop.split('.')
|
|
17
|
-
props.forEach(subProp => {
|
|
18
|
-
if (objValue) {
|
|
19
|
-
objValue = objValue[subProp]
|
|
20
|
-
} else {
|
|
21
|
-
objValue = ''
|
|
22
|
-
throw objValue
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
return objValue
|
|
26
|
-
} catch (e) {
|
|
27
|
-
// console.log(e)
|
|
28
|
-
return ''
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
objectPropValue(row, column, prop) {
|
|
33
|
-
// console.log('---super-grid--objectPropValue--')
|
|
34
|
-
const val = doFormat(column, this.objectPropOriginalValue(row, prop))
|
|
35
|
-
return val
|
|
36
|
-
},
|
|
37
|
-
getColumnValue(row, column) {
|
|
38
|
-
const prop = column.prop
|
|
39
|
-
let originalValue = row[prop]
|
|
40
|
-
if (this.isObjectProp(prop)) {
|
|
41
|
-
originalValue = this.objectPropOriginalValue(row, prop)
|
|
42
|
-
}
|
|
43
|
-
const formatValue = doFormat(column, originalValue)
|
|
44
|
-
return { originalValue, formatValue }
|
|
45
|
-
},
|
|
46
|
-
onClickFun(row, column, onClick, rowIndex) {
|
|
47
|
-
const values = this.getColumnValue(row, column)
|
|
48
|
-
onClick.call(this, values.originalValue, values.formatValue, row, column, rowIndex)
|
|
49
|
-
},
|
|
50
|
-
isShowButtonFun(entity, button) {
|
|
51
|
-
const isShowFun = button.isShow
|
|
52
|
-
if (isShowFun === undefined) {
|
|
53
|
-
return true
|
|
54
|
-
}
|
|
55
|
-
if (typeof (isShowFun) === 'function') {
|
|
56
|
-
let isShow = isShowFun.call(this, entity, button)
|
|
57
|
-
if (isShow === undefined) {
|
|
58
|
-
isShow = true
|
|
59
|
-
}
|
|
60
|
-
return isShow
|
|
61
|
-
} else {
|
|
62
|
-
return isShowFun
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export default customFormatter
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
const formatter = {
|
|
2
|
-
number: function(value, options) {
|
|
3
|
-
debugger
|
|
4
|
-
// 小数位数
|
|
5
|
-
const precision = options.precision
|
|
6
|
-
// 是否显示千分位
|
|
7
|
-
const isDelimiter = options.delimiter
|
|
8
|
-
// 是否显示科学计数法
|
|
9
|
-
const scientific = options.scientific
|
|
10
|
-
// 几位开始计算
|
|
11
|
-
let scientificNum = options.scientificNum
|
|
12
|
-
if (value != null) {
|
|
13
|
-
if (precision > 0) {
|
|
14
|
-
// 表示有小数
|
|
15
|
-
value = parseFloat(value)
|
|
16
|
-
value = value.toFixed(precision)
|
|
17
|
-
}
|
|
18
|
-
if (isDelimiter) {
|
|
19
|
-
value = value.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
|
|
20
|
-
}
|
|
21
|
-
if (scientific != null) {
|
|
22
|
-
let isScientific = false
|
|
23
|
-
if (scientificNum) {
|
|
24
|
-
scientificNum = parseInt(scientificNum)
|
|
25
|
-
} else {
|
|
26
|
-
scientificNum = 11
|
|
27
|
-
}
|
|
28
|
-
if (value.length >= scientificNum) {
|
|
29
|
-
isScientific = true
|
|
30
|
-
}
|
|
31
|
-
if (isScientific) {
|
|
32
|
-
value = '' + value
|
|
33
|
-
value = parseFloat(value)
|
|
34
|
-
value = value.toExponential() // 转换为标准的科学计数法形式(字符串)
|
|
35
|
-
// const tmpArray = eformat.match(/\d(?:\.(\d*))?e([+-]\d+)/) // 分离出小数值和指数值
|
|
36
|
-
// value = value.toFixed(Math.max(0, (tmpArray[1] || '').length - tmpArray[2]))
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return value
|
|
42
|
-
},
|
|
43
|
-
currency: function(value, options) {
|
|
44
|
-
// 单位:$ 或 ¥
|
|
45
|
-
const sign = options.sign
|
|
46
|
-
return sign + this.number(value, options)
|
|
47
|
-
},
|
|
48
|
-
date: function(value, options) {
|
|
49
|
-
// format格式,例如:yyyy-m-d,yyyy-m-d hh:mm:ss等等
|
|
50
|
-
const format = options.format
|
|
51
|
-
if (value != null) {
|
|
52
|
-
const date = new Date(value)
|
|
53
|
-
var y = date.getFullYear()
|
|
54
|
-
var m = date.getMonth() + 1
|
|
55
|
-
var d = date.getDate()
|
|
56
|
-
var h = date.getHours()
|
|
57
|
-
var min = date.getMinutes()
|
|
58
|
-
var s = date.getSeconds()
|
|
59
|
-
if (m < 10) {
|
|
60
|
-
m = '0' + m
|
|
61
|
-
}
|
|
62
|
-
if (d < 10) {
|
|
63
|
-
d = '0' + d
|
|
64
|
-
}
|
|
65
|
-
if (h < 10) {
|
|
66
|
-
h = '0' + h
|
|
67
|
-
}
|
|
68
|
-
if (min < 10) {
|
|
69
|
-
min = '0' + min
|
|
70
|
-
}
|
|
71
|
-
if (s < 10) {
|
|
72
|
-
s = '0' + s
|
|
73
|
-
}
|
|
74
|
-
return format.replace('yyyy', y)
|
|
75
|
-
.replace('m', m)
|
|
76
|
-
.replace('d', d)
|
|
77
|
-
.replace('hh', h)
|
|
78
|
-
.replace('mm', min)
|
|
79
|
-
.replace('ss', s)
|
|
80
|
-
}
|
|
81
|
-
return value
|
|
82
|
-
},
|
|
83
|
-
time: function(value, options) {
|
|
84
|
-
return this.date(value, options)
|
|
85
|
-
},
|
|
86
|
-
percent: function(value, options) {
|
|
87
|
-
return this.number(value, options) + '%'
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function doFormat(column, value) {
|
|
92
|
-
if (value === undefined || column === undefined) {
|
|
93
|
-
return value
|
|
94
|
-
}
|
|
95
|
-
// 先处理值设置再处理格式化设置:即会对值设置的结果进行格式化设置
|
|
96
|
-
if (column.valueSet !== undefined) {
|
|
97
|
-
const item = column.valueSet.filter(item => {
|
|
98
|
-
return item.value === value + ''
|
|
99
|
-
})
|
|
100
|
-
if (item.length > 0) {
|
|
101
|
-
// 数据库的原始值要显示成label值,后续对这个label进行格式化(不是处理原始值)
|
|
102
|
-
value = item[0].label
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// 获得默认的格式设置
|
|
106
|
-
if (column.formatter === undefined) {
|
|
107
|
-
if (column.dataType === 'DATE') {
|
|
108
|
-
// 默认的“DATE”类型的格式设置
|
|
109
|
-
column.formatter = {
|
|
110
|
-
type: 'date',
|
|
111
|
-
options: {
|
|
112
|
-
format: 'yyyy-m-d'
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
} else if (column.dataType === 'TIME') {
|
|
116
|
-
// 默认的“TIME”类型的格式设置
|
|
117
|
-
column.formatter = {
|
|
118
|
-
type: 'time',
|
|
119
|
-
options: {
|
|
120
|
-
format: 'yyyy-m-d hh:mm:ss'
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const columnFormatter = column.formatter
|
|
126
|
-
if (columnFormatter !== undefined && formatter[columnFormatter.type] !== undefined) {
|
|
127
|
-
return formatter[columnFormatter.type](value, columnFormatter.options)
|
|
128
|
-
} else {
|
|
129
|
-
return value
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-input-number
|
|
4
|
-
v-model="number1"
|
|
5
|
-
@change="setValue()"
|
|
6
|
-
/>
|
|
7
|
-
<span>---</span>
|
|
8
|
-
<el-input-number
|
|
9
|
-
v-model="number2"
|
|
10
|
-
@change="setValue()"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
props: {
|
|
17
|
-
r: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: null
|
|
20
|
-
},
|
|
21
|
-
n: {
|
|
22
|
-
type: Number,
|
|
23
|
-
default: null
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
number1: null,
|
|
29
|
-
number2: null
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
setValue() {
|
|
34
|
-
this.$emit('setValue', [this.number1, this.number2], this.r, this.n)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
</script>
|