imatrix-ui 2.9.18-dw → 2.9.19-boe01

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.
Files changed (199) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +4 -3
  4. package/src/api/sso-service.js +19 -1
  5. package/src/assets/nonemessage.png +0 -0
  6. package/src/i18n/i18n.js +1 -1
  7. package/src/i18n/langs/cn.js +25 -6
  8. package/src/i18n/langs/en.js +27 -7
  9. package/src/permission.js +2 -2
  10. package/src/plugins.js +3 -3
  11. package/src/router/index.js +10 -0
  12. package/src/store/modules/tab-content.js +6 -0
  13. package/src/store/modules/user.js +32 -2
  14. package/src/styles/display-layout.scss +1 -1
  15. package/src/styles/index.scss +74 -4
  16. package/src/styles/theme/black/font-style.scss +70 -0
  17. package/src/styles/theme/black/index.scss +6 -30
  18. package/src/styles/theme/blue/font-style.scss +37 -0
  19. package/src/styles/theme/blue/index.scss +2 -18
  20. package/src/styles/theme/blue2/font-style.scss +70 -0
  21. package/src/styles/theme/blue2/index.scss +3 -13
  22. package/src/styles/theme/dark-blue/card.scss +4 -6
  23. package/src/styles/theme/dark-blue/form.scss +7 -4
  24. package/src/styles/theme/dark-blue/index.scss +30 -5
  25. package/src/styles/theme/dark-blue/input.scss +4 -1
  26. package/src/styles/theme/dark-blue/message.scss +8 -0
  27. package/src/styles/theme/dark-blue/radio.scss +13 -0
  28. package/src/styles/theme/dark-blue/scrollbar-style.scss +8 -3
  29. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  30. package/src/styles/theme/dark-blue/tab.scss +4 -1
  31. package/src/styles/theme/dark-blue/table.scss +2 -2
  32. package/src/styles/theme/dark-blue/tree.scss +35 -10
  33. package/src/styles/theme/gray/card-style.scss +13 -1
  34. package/src/styles/theme/gray/font-style.scss +38 -0
  35. package/src/styles/theme/gray/index.scss +13 -25
  36. package/src/styles/theme/gray/scrollbar-style.scss +37 -0
  37. package/src/styles/theme/gray/sidebar.scss +7 -14
  38. package/src/utils/auth-api.js +47 -1
  39. package/src/utils/calculator/calculator-util.js +14 -0
  40. package/src/utils/common-util.js +22 -81
  41. package/src/utils/jump-page-utils.js +12 -9
  42. package/src/utils/preview-util.js +32 -0
  43. package/src/utils/range-selector.js +185 -0
  44. package/src/utils/request.js +20 -12
  45. package/src/utils/util.js +13 -11
  46. package/src/utils/workflow-util.js +3 -0
  47. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  48. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  49. package/src/views/dsc-component/Sidebar/index.vue +14 -22
  50. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  51. package/src/views/layout/EmptyLayout.vue +4 -1
  52. package/src/views/layout/NewLayout.vue +6 -65
  53. package/src/views/layout/components/AppMain.vue +2 -1
  54. package/src/views/layout/components/Breadcrumb/index.vue +1 -1
  55. package/src/views/layout/components/Menubar/Item.vue +23 -7
  56. package/src/views/layout/components/Menubar/Link.vue +11 -2
  57. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  58. package/src/views/layout/components/Menubar/index.vue +51 -16
  59. package/src/views/layout/components/Sidebar/index.vue +2 -2
  60. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  61. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  62. package/src/views/layout/tab-content-index.vue +84 -0
  63. package/src/views/login/index.vue +1 -1
  64. package/packages/breadcrumb/index.js +0 -6
  65. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  66. package/packages/department-tree/index.js +0 -6
  67. package/packages/department-tree/src/department-tree.vue +0 -108
  68. package/packages/department-tree-inline/index.js +0 -6
  69. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -411
  70. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -293
  71. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  72. package/packages/department-tree-inline/src/department-tree-service.js +0 -275
  73. package/packages/department-tree-inline/src/search-result.vue +0 -176
  74. package/packages/department-user-tree/index.js +0 -6
  75. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  76. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  77. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  78. package/packages/department-user-tree-inline/index.js +0 -6
  79. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -639
  80. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -274
  81. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  82. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  83. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  84. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  85. package/packages/directives/prevent-reclick.js +0 -19
  86. package/packages/dynamic-source-select/index.js +0 -6
  87. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  88. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  89. package/packages/dynamic-source-select/src/events.js +0 -55
  90. package/packages/fs-preview/index.js +0 -6
  91. package/packages/fs-preview/src/fs-preview.vue +0 -226
  92. package/packages/fs-upload/index.js +0 -6
  93. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  94. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  95. package/packages/fs-upload/src/fs-upload.vue +0 -189
  96. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  97. package/packages/fs-upload-list/index.js +0 -6
  98. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  99. package/packages/hamburger/index.js +0 -6
  100. package/packages/hamburger/src/hamburger.vue +0 -38
  101. package/packages/index.js +0 -121
  102. package/packages/multipart-upload/index.js +0 -6
  103. package/packages/multipart-upload/src/index.vue +0 -73
  104. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  105. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  106. package/packages/organization-input/index.js +0 -6
  107. package/packages/organization-input/src/organization-input.vue +0 -542
  108. package/packages/plugins/export-data-new.js +0 -466
  109. package/packages/plugins/export-data.js +0 -361
  110. package/packages/plugins/index.js +0 -15
  111. package/packages/plugins/public-method.js +0 -43
  112. package/packages/remove-department/index.js +0 -6
  113. package/packages/remove-department/src/remove-department.vue +0 -172
  114. package/packages/remove-department/src/remove-dept-service.js +0 -20
  115. package/packages/remove-user/index.js +0 -6
  116. package/packages/remove-user/src/remove-user-service.js +0 -20
  117. package/packages/remove-user/src/remove-user.vue +0 -195
  118. package/packages/remove-workgroup/index.js +0 -6
  119. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  120. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  121. package/packages/rich-editor/index.js +0 -7
  122. package/packages/rich-editor/index.vue +0 -278
  123. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  124. package/packages/rich-editor/viewer.vue +0 -103
  125. package/packages/scan-code-input/index.js +0 -6
  126. package/packages/scan-code-input/src/events.js +0 -33
  127. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  128. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  129. package/packages/secret-info/index.js +0 -7
  130. package/packages/secret-info/index.vue +0 -90
  131. package/packages/super-grid/index.js +0 -7
  132. package/packages/super-grid/src/apis.js +0 -820
  133. package/packages/super-grid/src/columns-config.vue +0 -335
  134. package/packages/super-grid/src/custom-formatter.js +0 -278
  135. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  136. package/packages/super-grid/src/eventBus.js +0 -2
  137. package/packages/super-grid/src/events.js +0 -55
  138. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  139. package/packages/super-grid/src/formatter.js +0 -181
  140. package/packages/super-grid/src/group-column.vue +0 -100
  141. package/packages/super-grid/src/header-context-menu.vue +0 -87
  142. package/packages/super-grid/src/index-column.vue +0 -51
  143. package/packages/super-grid/src/normal-column.vue +0 -775
  144. package/packages/super-grid/src/public-methods.js +0 -31
  145. package/packages/super-grid/src/row-operation.vue +0 -161
  146. package/packages/super-grid/src/search-button.vue +0 -66
  147. package/packages/super-grid/src/search-condition-input.vue +0 -61
  148. package/packages/super-grid/src/search-condition-list.vue +0 -59
  149. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -654
  150. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  151. package/packages/super-grid/src/search-form-item.vue +0 -405
  152. package/packages/super-grid/src/search-form-number.vue +0 -38
  153. package/packages/super-grid/src/search-form-open.vue +0 -170
  154. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  155. package/packages/super-grid/src/search-form.vue +0 -642
  156. package/packages/super-grid/src/search-methods.js +0 -448
  157. package/packages/super-grid/src/selection-column.vue +0 -43
  158. package/packages/super-grid/src/store.js +0 -3
  159. package/packages/super-grid/src/super-grid-service.js +0 -593
  160. package/packages/super-grid/src/super-grid.vue +0 -2873
  161. package/packages/super-grid/src/utils.js +0 -772
  162. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  163. package/packages/super-nine-grid/index.js +0 -7
  164. package/packages/super-nine-grid/src/apis.js +0 -103
  165. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  166. package/packages/super-nine-grid/src/formatter.js +0 -132
  167. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  168. package/packages/super-nine-grid/src/search-form.vue +0 -430
  169. package/packages/super-nine-grid/src/search-methods.js +0 -134
  170. package/packages/super-nine-grid/src/store.js +0 -3
  171. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  172. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  173. package/packages/super-nine-grid/src/utils.js +0 -261
  174. package/packages/svg-icon/index.js +0 -6
  175. package/packages/svg-icon/src/svg-icon.vue +0 -43
  176. package/packages/utils/memory-cache-utils.js +0 -90
  177. package/packages/utils/utils.js +0 -152
  178. package/packages/utils/value-set.js +0 -86
  179. package/packages/valid-code/index.js +0 -7
  180. package/packages/valid-code/src/valid-code.vue +0 -95
  181. package/packages/workflow-button/index.js +0 -6
  182. package/packages/workflow-button/src/workflow-button.vue +0 -325
  183. package/packages/workflow-history-list/index.js +0 -6
  184. package/packages/workflow-history-list/src/api.js +0 -7
  185. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  186. package/packages/workgroup-tree/index.js +0 -6
  187. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  188. package/packages/workgroup-tree-inline/index.js +0 -6
  189. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  190. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  191. package/packages/workgroup-user-tree/index.js +0 -6
  192. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  193. package/packages/workgroup-user-tree-inline/index.js +0 -6
  194. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  195. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  196. package/packages/year-range-picker/index.js +0 -6
  197. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  198. package/src/index.js +0 -93
  199. 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,7 +0,0 @@
1
- import SuperNineGrid from './src/super-nine-grid.vue'
2
-
3
- SuperNineGrid.install = function(Vue) {
4
- Vue.component(SuperNineGrid.name, SuperNineGrid)
5
- }
6
-
7
- export default SuperNineGrid
@@ -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>