imatrix-ui 2.9.2-dw → 2.9.3-dw-tmp1

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