imatrix-ui 2.9.0-dw → 2.9.0-dw-tmp3

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 (172) hide show
  1. package/.babelrc +17 -0
  2. package/build/components.json +31 -0
  3. package/build/gen-style.js +32 -0
  4. package/build/webpack.base.js +140 -0
  5. package/build/webpack.component.js +40 -0
  6. package/build/webpack.prod.js +35 -0
  7. package/lib/breadcrumb.js +2 -0
  8. package/lib/department-tree.js +8 -0
  9. package/lib/department-user-tree.js +8 -0
  10. package/lib/dynamic-source-select.js +8 -0
  11. package/lib/fs-preview.js +15 -0
  12. package/lib/fs-upload-list.js +15 -0
  13. package/lib/fs-upload.js +9 -0
  14. package/lib/hamburger.js +2 -0
  15. package/lib/inline-department-tree.js +8 -0
  16. package/lib/inline-department-user-tree.js +8 -0
  17. package/lib/inline-workgroup-tree.js +8 -0
  18. package/lib/inline-workgroup-user-treee.js +8 -0
  19. package/lib/multipart-upload.js +15 -0
  20. package/lib/organization-input.js +8 -0
  21. package/lib/remove-department.js +2 -0
  22. package/lib/remove-user.js +2 -0
  23. package/lib/remove-workgroup.js +2 -0
  24. package/lib/rich-editor.js +8 -0
  25. package/lib/scan-code-input.js +2 -0
  26. package/lib/secret-info.js +2 -0
  27. package/lib/super-grid.js +28 -0
  28. package/lib/super-nine-grid.js +9 -0
  29. package/lib/super-ui.min.js +72 -0
  30. package/lib/svg-icon.js +2 -0
  31. package/lib/valid-code.js +2 -0
  32. package/lib/workflow-button.js +8 -0
  33. package/lib/workflow-history-list.js +8 -0
  34. package/lib/workgroup-tree.js +8 -0
  35. package/lib/workgroup-user-tree.js +8 -0
  36. package/lib/year-range-picker.js +2 -0
  37. package/package.json +49 -24
  38. package/lib/super-ui.css +0 -1
  39. package/lib/super-ui.umd.min.js +0 -67
  40. package/packages/breadcrumb/index.js +0 -6
  41. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  42. package/packages/department-tree/index.js +0 -6
  43. package/packages/department-tree/src/department-tree.vue +0 -108
  44. package/packages/department-tree-inline/index.js +0 -6
  45. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  46. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  47. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  48. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  49. package/packages/department-tree-inline/src/search-result.vue +0 -176
  50. package/packages/department-user-tree/index.js +0 -6
  51. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  52. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  53. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  54. package/packages/department-user-tree-inline/index.js +0 -6
  55. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  56. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  57. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  58. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  59. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  60. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  61. package/packages/directives/prevent-reclick.js +0 -19
  62. package/packages/dynamic-source-select/index.js +0 -6
  63. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  64. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  65. package/packages/dynamic-source-select/src/events.js +0 -55
  66. package/packages/fs-preview/index.js +0 -6
  67. package/packages/fs-preview/src/fs-preview.vue +0 -226
  68. package/packages/fs-upload/index.js +0 -6
  69. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  70. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  71. package/packages/fs-upload/src/fs-upload.vue +0 -189
  72. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  73. package/packages/fs-upload-list/index.js +0 -6
  74. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  75. package/packages/hamburger/index.js +0 -6
  76. package/packages/hamburger/src/hamburger.vue +0 -38
  77. package/packages/index.js +0 -121
  78. package/packages/multipart-upload/index.js +0 -6
  79. package/packages/multipart-upload/src/index.vue +0 -73
  80. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  81. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  82. package/packages/organization-input/index.js +0 -6
  83. package/packages/organization-input/src/organization-input.vue +0 -542
  84. package/packages/plugins/export-data-new.js +0 -453
  85. package/packages/plugins/export-data.js +0 -361
  86. package/packages/plugins/index.js +0 -15
  87. package/packages/plugins/public-method.js +0 -43
  88. package/packages/remove-department/index.js +0 -6
  89. package/packages/remove-department/src/remove-department.vue +0 -172
  90. package/packages/remove-department/src/remove-dept-service.js +0 -20
  91. package/packages/remove-user/index.js +0 -6
  92. package/packages/remove-user/src/remove-user-service.js +0 -20
  93. package/packages/remove-user/src/remove-user.vue +0 -195
  94. package/packages/remove-workgroup/index.js +0 -6
  95. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  96. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  97. package/packages/rich-editor/index.js +0 -7
  98. package/packages/rich-editor/index.vue +0 -278
  99. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  100. package/packages/rich-editor/viewer.vue +0 -103
  101. package/packages/scan-code-input/index.js +0 -6
  102. package/packages/scan-code-input/src/events.js +0 -33
  103. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  104. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  105. package/packages/secret-info/index.js +0 -7
  106. package/packages/secret-info/index.vue +0 -90
  107. package/packages/super-grid/index.js +0 -7
  108. package/packages/super-grid/src/apis.js +0 -763
  109. package/packages/super-grid/src/columns-config.vue +0 -335
  110. package/packages/super-grid/src/custom-formatter.js +0 -250
  111. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  112. package/packages/super-grid/src/eventBus.js +0 -2
  113. package/packages/super-grid/src/events.js +0 -55
  114. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  115. package/packages/super-grid/src/formatter.js +0 -181
  116. package/packages/super-grid/src/group-column.vue +0 -100
  117. package/packages/super-grid/src/header-context-menu.vue +0 -87
  118. package/packages/super-grid/src/index-column.vue +0 -51
  119. package/packages/super-grid/src/normal-column.vue +0 -769
  120. package/packages/super-grid/src/public-methods.js +0 -31
  121. package/packages/super-grid/src/row-operation.vue +0 -161
  122. package/packages/super-grid/src/search-button.vue +0 -66
  123. package/packages/super-grid/src/search-condition-input.vue +0 -61
  124. package/packages/super-grid/src/search-condition-list.vue +0 -59
  125. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  126. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  127. package/packages/super-grid/src/search-form-item.vue +0 -386
  128. package/packages/super-grid/src/search-form-number.vue +0 -38
  129. package/packages/super-grid/src/search-form-open.vue +0 -162
  130. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  131. package/packages/super-grid/src/search-form.vue +0 -634
  132. package/packages/super-grid/src/search-methods.js +0 -387
  133. package/packages/super-grid/src/selection-column.vue +0 -43
  134. package/packages/super-grid/src/store.js +0 -3
  135. package/packages/super-grid/src/super-grid-service.js +0 -561
  136. package/packages/super-grid/src/super-grid.vue +0 -2793
  137. package/packages/super-grid/src/utils.js +0 -763
  138. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  139. package/packages/super-nine-grid/index.js +0 -7
  140. package/packages/super-nine-grid/src/apis.js +0 -103
  141. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  142. package/packages/super-nine-grid/src/formatter.js +0 -132
  143. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  144. package/packages/super-nine-grid/src/search-form.vue +0 -430
  145. package/packages/super-nine-grid/src/search-methods.js +0 -134
  146. package/packages/super-nine-grid/src/store.js +0 -3
  147. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  148. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  149. package/packages/super-nine-grid/src/utils.js +0 -261
  150. package/packages/svg-icon/index.js +0 -6
  151. package/packages/svg-icon/src/svg-icon.vue +0 -43
  152. package/packages/utils/utils.js +0 -152
  153. package/packages/utils/value-set.js +0 -86
  154. package/packages/valid-code/index.js +0 -7
  155. package/packages/valid-code/src/valid-code.vue +0 -95
  156. package/packages/workflow-button/index.js +0 -6
  157. package/packages/workflow-button/src/workflow-button.vue +0 -325
  158. package/packages/workflow-history-list/index.js +0 -6
  159. package/packages/workflow-history-list/src/api.js +0 -7
  160. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  161. package/packages/workgroup-tree/index.js +0 -6
  162. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  163. package/packages/workgroup-tree-inline/index.js +0 -6
  164. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  165. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  166. package/packages/workgroup-user-tree/index.js +0 -6
  167. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  168. package/packages/workgroup-user-tree-inline/index.js +0 -6
  169. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  170. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  171. package/packages/year-range-picker/index.js +0 -6
  172. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
@@ -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>