agilebuilder-ui 1.1.33-sit5 → 1.1.34
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/{401-a19c26f9.js → 401-7193e896.js} +1 -1
- package/lib/{404-97a9542c.js → 404-2852bd20.js} +1 -1
- package/lib/{iframe-page-cb203067.js → iframe-page-bcc25b1c.js} +1 -1
- package/lib/index-d502d8fe.js +72779 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +89 -89
- package/lib/{tab-content-iframe-index-aac9a8b4.js → tab-content-iframe-index-48b3b846.js} +1 -1
- package/lib/{tab-content-index-0a8ddc6b.js → tab-content-index-d25e4873.js} +1 -1
- package/lib/{tache-subprocess-history-be4af7b1.js → tache-subprocess-history-a72dd967.js} +1 -1
- package/package.json +1 -1
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +1 -5
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +368 -343
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +42 -113
- package/packages/organization-input/src/organization-input.vue +0 -11
- package/packages/super-grid/src/apis.js +13 -13
- package/packages/super-grid/src/dynamic-input.vue +1 -11
- package/packages/super-grid/src/formatter.js +56 -55
- package/packages/super-grid/src/normal-column-content.vue +56 -126
- package/packages/super-grid/src/row-operation.vue +18 -35
- package/packages/super-grid/src/super-grid.vue +97 -135
- package/packages/super-icon/src/index.vue +18 -29
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +1 -7
- package/src/utils/auth-api.js +0 -4
- package/src/utils/common-util.js +0 -3
- package/src/utils/dingtalk-util.ts +17 -23
- package/src/views/dsc-component/Sidebar/Item.vue +62 -73
- package/src/views/layout/components/Menubar/Item.vue +74 -94
- package/lib/index-dd28e479.js +0 -73213
|
@@ -65,7 +65,6 @@ import Compressor from 'compressorjs'
|
|
|
65
65
|
import { ElMessage } from 'element-plus'
|
|
66
66
|
import { useI18n } from 'vue-i18n'
|
|
67
67
|
import FileUploadComponent from './file-upload-component.vue'
|
|
68
|
-
import { isRef } from 'vue'
|
|
69
68
|
|
|
70
69
|
const props = defineProps({
|
|
71
70
|
openFsUpload: {
|
|
@@ -182,17 +181,13 @@ const props = defineProps({
|
|
|
182
181
|
default: () => {}
|
|
183
182
|
}
|
|
184
183
|
})
|
|
185
|
-
|
|
186
184
|
const multipleUpload = ref<string | null>(null)
|
|
187
185
|
if (props.multiple) {
|
|
188
186
|
multipleUpload.value = 'multiple'
|
|
189
187
|
}
|
|
190
188
|
const isDingTalk = ref(false)
|
|
191
189
|
const authSource = window.localStorage.getItem('auth_source')
|
|
192
|
-
|
|
193
|
-
if (authSource && authSource === 'dingtalk' && window.top && window.top.$dd) {
|
|
194
|
-
console.log('当前是钉钉环境')
|
|
195
|
-
// 如果是钉钉环境 并且已经加载了钉钉jsapi
|
|
190
|
+
if (authSource && authSource === 'dingtalk') {
|
|
196
191
|
isDingTalk.value = true
|
|
197
192
|
}
|
|
198
193
|
|
|
@@ -256,13 +251,13 @@ function pickBrowserFiles() {
|
|
|
256
251
|
// if (props.openCameraOrChoosePhoto && props.openCameraOrChoosePhoto === 'openCamera') {
|
|
257
252
|
// 只打开相机
|
|
258
253
|
myAccept.value = 'image/*'
|
|
259
|
-
if (isDingTalk.value) {
|
|
260
|
-
|
|
261
|
-
} else {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
254
|
+
// if (isDingTalk.value) {
|
|
255
|
+
// dingtalkChooseImage()
|
|
256
|
+
// } else {
|
|
257
|
+
setTimeout(() => {
|
|
258
|
+
fileRef.value.click()
|
|
259
|
+
})
|
|
260
|
+
// }
|
|
266
261
|
// } else {
|
|
267
262
|
// // 相机和文件都可以选
|
|
268
263
|
// myAccept.value = '*'
|
|
@@ -334,7 +329,7 @@ async function uploadBrowserFile() {
|
|
|
334
329
|
console.error('未选择任何文件')
|
|
335
330
|
return
|
|
336
331
|
}
|
|
337
|
-
let uploadFiles
|
|
332
|
+
let uploadFiles = []
|
|
338
333
|
try {
|
|
339
334
|
uploadFiles = await compressionImg(selectFiles)
|
|
340
335
|
} catch (error) {
|
|
@@ -353,7 +348,32 @@ async function uploadBrowserFile() {
|
|
|
353
348
|
} else {
|
|
354
349
|
param.append('file', uploadFiles[0])
|
|
355
350
|
}
|
|
356
|
-
|
|
351
|
+
param.append('systemCode', props.systemCode)
|
|
352
|
+
|
|
353
|
+
window.$vueApp.config.globalProperties.$http
|
|
354
|
+
.post(defaultAction.value, param, { headers: { 'Content-Type': 'multipart/form-data', Authorization: getToken() } })
|
|
355
|
+
.then((result) => {
|
|
356
|
+
// result:批量上传时返回的是集合,单选上传时返回的是对象
|
|
357
|
+
console.log('上传后返回值==result=', result)
|
|
358
|
+
if (result) {
|
|
359
|
+
if (props.multiple) {
|
|
360
|
+
if (result.length > 0) {
|
|
361
|
+
// this.tempFileList.push(...result)
|
|
362
|
+
uploadComplete(result)
|
|
363
|
+
} else {
|
|
364
|
+
console.error('多选时上传后返回值异常')
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
// this.tempFileList.push(result)
|
|
368
|
+
uploadComplete(result)
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
console.error('上传后返回值异常')
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
.catch(() => {
|
|
375
|
+
isUploading.value = false
|
|
376
|
+
})
|
|
357
377
|
}
|
|
358
378
|
function validateCanUploadFile(file, limitFileSize) {
|
|
359
379
|
let isCanUpload = true
|
|
@@ -379,7 +399,6 @@ function uploadComplete(result) {
|
|
|
379
399
|
} else {
|
|
380
400
|
// 单选时将已选文件移除,然后再替换为新上传的文件
|
|
381
401
|
const rmFiles = JSON.parse(JSON.stringify(fileListResult.value))
|
|
382
|
-
fileListResult.value = []
|
|
383
402
|
fileListResult.value.push(result)
|
|
384
403
|
emits('remove', { rmFiles, serverFiles: fileListResult.value, index: 0 })
|
|
385
404
|
}
|
|
@@ -402,7 +421,7 @@ function uploadBrowserFiles() {
|
|
|
402
421
|
ElMessage({
|
|
403
422
|
showClose: true,
|
|
404
423
|
type: 'warning',
|
|
405
|
-
message:
|
|
424
|
+
message: '文件最大上传数量: 1'
|
|
406
425
|
})
|
|
407
426
|
fileRef.value.value = null
|
|
408
427
|
return
|
|
@@ -423,11 +442,11 @@ function uploadNoNewFiles() {
|
|
|
423
442
|
emits('uploadend', fileListResult.value)
|
|
424
443
|
}
|
|
425
444
|
|
|
426
|
-
function compressionImg(selectFiles
|
|
427
|
-
const uploadFilesPromises
|
|
445
|
+
function compressionImg(selectFiles) {
|
|
446
|
+
const uploadFilesPromises = []
|
|
428
447
|
for (let i = 0; i < selectFiles.length; i++) {
|
|
429
448
|
uploadFilesPromises.push(
|
|
430
|
-
new Promise
|
|
449
|
+
new Promise((resolve, reject) => {
|
|
431
450
|
console.log(`压缩前 size ${selectFiles[i].size / 1024 / 1024} MB`)
|
|
432
451
|
// eslint-disable-next-line no-new
|
|
433
452
|
new Compressor(selectFiles[i], {
|
|
@@ -464,20 +483,7 @@ function dingtalkChooseImage() {
|
|
|
464
483
|
if (props.multiple) {
|
|
465
484
|
count = 20
|
|
466
485
|
if (props.limit) {
|
|
467
|
-
|
|
468
|
-
if (fileListResult.value && fileListResult.value.length > 0) {
|
|
469
|
-
if (props.limit === fileListResult.value.length) {
|
|
470
|
-
ElMessage({
|
|
471
|
-
showClose: true,
|
|
472
|
-
type: 'warning',
|
|
473
|
-
message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit
|
|
474
|
-
})
|
|
475
|
-
return
|
|
476
|
-
}
|
|
477
|
-
count = props.limit - fileListResult.value.length
|
|
478
|
-
} else {
|
|
479
|
-
count = props.limit
|
|
480
|
-
}
|
|
486
|
+
count = props.limit
|
|
481
487
|
}
|
|
482
488
|
}
|
|
483
489
|
window.top.$dd.biz.util
|
|
@@ -485,88 +491,11 @@ function dingtalkChooseImage() {
|
|
|
485
491
|
sourceType: sourceType,
|
|
486
492
|
count: count
|
|
487
493
|
})
|
|
488
|
-
.then(
|
|
489
|
-
|
|
490
|
-
// fileUploadRef.value.changeFileList(fileListResult.value)
|
|
494
|
+
.then((res) => {
|
|
495
|
+
//
|
|
491
496
|
if (res && res.filePaths && res.filePaths.length > 0) {
|
|
492
|
-
fetchDingTalkFile(res.files).then(async (sourceFiles) => {
|
|
493
|
-
let uploadFiles: File[] = []
|
|
494
|
-
try {
|
|
495
|
-
uploadFiles = await compressionImg(sourceFiles)
|
|
496
|
-
} catch (error) {
|
|
497
|
-
console.error('压缩图片失败', error)
|
|
498
|
-
uploadFiles = sourceFiles
|
|
499
|
-
}
|
|
500
|
-
if (uploadFiles && uploadFiles.length > 0) {
|
|
501
|
-
const param = new FormData()
|
|
502
|
-
let limitFileSize = props.limitFileSize
|
|
503
|
-
if (limitFileSize === undefined) {
|
|
504
|
-
// 默认是30M
|
|
505
|
-
limitFileSize = 30
|
|
506
|
-
}
|
|
507
|
-
if (props.multiple) {
|
|
508
|
-
if (fileListResult.value && fileListResult.value.length > 0) {
|
|
509
|
-
if (fileListResult.value.length + uploadFiles.length > props.limit) {
|
|
510
|
-
ElMessage({
|
|
511
|
-
showClose: true,
|
|
512
|
-
type: 'warning',
|
|
513
|
-
message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit
|
|
514
|
-
})
|
|
515
|
-
return
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
for (let i = 0; i < uploadFiles.length; i++) {
|
|
519
|
-
param.append('files', uploadFiles[i])
|
|
520
|
-
}
|
|
521
|
-
} else {
|
|
522
|
-
param.append('file', uploadFiles[0])
|
|
523
|
-
}
|
|
524
|
-
uploadFileToServer(param)
|
|
525
|
-
}
|
|
526
|
-
})
|
|
527
|
-
}
|
|
528
|
-
})
|
|
529
|
-
}
|
|
530
|
-
async function fetchDingTalkFile(files: any) {
|
|
531
|
-
const uploadFiles: any = []
|
|
532
|
-
for (let index = 0; index < files.length; index++) {
|
|
533
|
-
const file = files[index]
|
|
534
|
-
const response = await fetch(file.path)
|
|
535
|
-
const blob = await response.blob()
|
|
536
|
-
// https://resource/216576ea16afcbee18c392d15814827.image
|
|
537
|
-
const fileName = file.path.replace('https://resource/', '').replace('.image', '')
|
|
538
|
-
// 构造 File 对象
|
|
539
|
-
uploadFiles.push(new File([blob], fileName + '.' + file.fileType, { type: blob.type }))
|
|
540
|
-
}
|
|
541
|
-
return uploadFiles
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
function uploadFileToServer(param: FormData) {
|
|
545
|
-
param.append('systemCode', props.systemCode)
|
|
546
|
-
window.$vueApp.config.globalProperties.$http
|
|
547
|
-
.post(defaultAction.value, param, { headers: { 'Content-Type': 'multipart/form-data', Authorization: getToken() } })
|
|
548
|
-
.then((result) => {
|
|
549
|
-
// result:批量上传时返回的是集合,单选上传时返回的是对象
|
|
550
|
-
console.log('上传后返回值==result=', result)
|
|
551
|
-
if (result) {
|
|
552
|
-
if (props.multiple) {
|
|
553
|
-
if (result.length > 0) {
|
|
554
|
-
// this.tempFileList.push(...result)
|
|
555
|
-
uploadComplete(result)
|
|
556
|
-
} else {
|
|
557
|
-
console.error('多选时上传后返回值异常')
|
|
558
|
-
}
|
|
559
|
-
} else {
|
|
560
|
-
// this.tempFileList.push(result)
|
|
561
|
-
uploadComplete(result)
|
|
562
|
-
}
|
|
563
|
-
} else {
|
|
564
|
-
console.error('上传后返回值异常')
|
|
565
497
|
}
|
|
566
498
|
})
|
|
567
|
-
.catch(() => {
|
|
568
|
-
isUploading.value = false
|
|
569
|
-
})
|
|
570
499
|
}
|
|
571
500
|
</script>
|
|
572
501
|
|
|
@@ -411,17 +411,6 @@ export default {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
return branchDeptIds.join(this.separator)
|
|
414
|
-
} else if (orgDataType === 'divisionManager') {
|
|
415
|
-
let divisionManagerArr = []
|
|
416
|
-
if (isUserTree) {
|
|
417
|
-
if (selectNodeInfo.divisionManager && selectNodeInfo.divisionManager.length > 0) {
|
|
418
|
-
divisionManagerArr = selectNodeInfo.divisionManager
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
if (divisionManagerArr && divisionManagerArr.length > 0) {
|
|
422
|
-
return divisionManagerArr.join(this.separator)
|
|
423
|
-
}
|
|
424
|
-
return null
|
|
425
414
|
}
|
|
426
415
|
} else {
|
|
427
416
|
// 单选树时
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import eventBus from './eventBus'
|
|
22
22
|
import { isPromise } from '../../../src/utils/common-util'
|
|
23
23
|
import { updateWithPageValue } from '../../../src/utils/jump-page-utils'
|
|
24
|
-
import { getGuId } from '../../../src/utils/guid.js'
|
|
25
|
-
import { ElMessageBox } from 'element-plus'
|
|
24
|
+
import { getGuId } from '../../../src/utils/guid.js';
|
|
25
|
+
import { ElMessageBox } from 'element-plus';
|
|
26
26
|
|
|
27
27
|
const apis = {
|
|
28
28
|
// 列表工具栏控件刷新列表数据。添加该方法解决工具栏值清空后,列表内容没有还原问题
|
|
@@ -369,7 +369,7 @@ const apis = {
|
|
|
369
369
|
}
|
|
370
370
|
return {
|
|
371
371
|
$rowDataGuId: getGuId(),
|
|
372
|
-
...row
|
|
372
|
+
...row,
|
|
373
373
|
}
|
|
374
374
|
},
|
|
375
375
|
// 设置默认值null
|
|
@@ -459,23 +459,23 @@ const apis = {
|
|
|
459
459
|
if (action === 'confirm') {
|
|
460
460
|
this.saveRow(rowIndex, listCode).then((res) => {
|
|
461
461
|
// this.editRow(rowIndex, listCode, true)
|
|
462
|
-
callback?.('confirm')
|
|
463
|
-
done()
|
|
462
|
+
callback?.('confirm');
|
|
463
|
+
done();
|
|
464
464
|
})
|
|
465
465
|
} else if (action === 'cancel') {
|
|
466
466
|
this.restoreCurrentRow(rowIndex, listCode)
|
|
467
|
-
callback?.('cancel')
|
|
468
|
-
done()
|
|
467
|
+
callback?.('cancel');
|
|
468
|
+
done();
|
|
469
469
|
} else if (action === 'close') {
|
|
470
|
-
done()
|
|
470
|
+
done();
|
|
471
471
|
}
|
|
472
|
-
}
|
|
472
|
+
},
|
|
473
473
|
}
|
|
474
474
|
)
|
|
475
475
|
}
|
|
476
476
|
},
|
|
477
|
-
// 编辑行
|
|
478
|
-
editRow(rowIndex, listCode, isSaveCallback
|
|
477
|
+
// 编辑行
|
|
478
|
+
editRow(rowIndex, listCode, isSaveCallback) {
|
|
479
479
|
if (!listCode) {
|
|
480
480
|
listCode = store.get('_list_code')
|
|
481
481
|
}
|
|
@@ -516,7 +516,7 @@ const apis = {
|
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
let canEdit = true
|
|
519
|
-
if (
|
|
519
|
+
if (isEditOptionFunction('beforeEdit', listCode)) {
|
|
520
520
|
const isSubTableShowPage = gridParams.isSubTableShowPage
|
|
521
521
|
// 每页显示多少条
|
|
522
522
|
const pageSize = gridParams.pagination && gridParams.pagination.pageSize
|
|
@@ -1473,7 +1473,7 @@ export const apisMixin = {
|
|
|
1473
1473
|
isMulitiSelect: false,
|
|
1474
1474
|
sql: false,
|
|
1475
1475
|
restoreCurrentRowTimer: null
|
|
1476
|
-
}
|
|
1476
|
+
};
|
|
1477
1477
|
},
|
|
1478
1478
|
methods: {
|
|
1479
1479
|
...apis
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<div v-else :style="row.validateErrorField && row.validateErrorField === column.prop ? 'border:1px solid red' : ''">
|
|
29
29
|
<!--必须有@input ,否则无法输入值-->
|
|
30
30
|
<el-date-picker
|
|
31
|
-
v-if="type === 'year' || type === 'month'
|
|
31
|
+
v-if="type === 'year' || type === 'month'"
|
|
32
32
|
ref="item"
|
|
33
33
|
v-model="innerValue"
|
|
34
34
|
:disabled="disabled"
|
|
@@ -1844,11 +1844,6 @@ export default {
|
|
|
1844
1844
|
if (this.column.dataType === 'TEXT' || this.column.dataType === 'text') {
|
|
1845
1845
|
return this.isFormat()
|
|
1846
1846
|
}
|
|
1847
|
-
if (this.type === 'week') {
|
|
1848
|
-
if (this.controlConfig && this.controlConfig.valueFormat) {
|
|
1849
|
-
return this.controlConfig.valueFormat
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
1847
|
// timestamp毫秒值为x
|
|
1853
1848
|
return 'x'
|
|
1854
1849
|
},
|
|
@@ -1867,11 +1862,6 @@ export default {
|
|
|
1867
1862
|
return 'MM'
|
|
1868
1863
|
} else if (this.type === 'date') {
|
|
1869
1864
|
return 'YYYY-MM-DD'
|
|
1870
|
-
} else if (this.type === 'week') {
|
|
1871
|
-
if (this.controlConfig && this.controlConfig.format) {
|
|
1872
|
-
return this.controlConfig.format
|
|
1873
|
-
}
|
|
1874
|
-
return 'ww'
|
|
1875
1865
|
} else if (this.type === 'time' || this.column.dataType === 'TIME') {
|
|
1876
1866
|
return 'HH:mm:ss'
|
|
1877
1867
|
} else if (this.column.dataType === 'DATE') {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { isDynamicDataSourceSource } from './utils'
|
|
2
|
-
import dayjs from 'dayjs'
|
|
3
|
-
import weekOfYear from 'dayjs/plugin/weekOfYear'
|
|
4
|
-
dayjs.extend(weekOfYear)
|
|
5
2
|
const formatter = {
|
|
6
3
|
number: function (inputValue, options) {
|
|
7
4
|
// 小数位数
|
|
@@ -22,7 +19,10 @@ const formatter = {
|
|
|
22
19
|
}
|
|
23
20
|
if (isDelimiter) {
|
|
24
21
|
const inputValueStr = inputValue + ''
|
|
25
|
-
const value = inputValueStr.replace(
|
|
22
|
+
const value = inputValueStr.replace(
|
|
23
|
+
/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,
|
|
24
|
+
'$&,'
|
|
25
|
+
)
|
|
26
26
|
if (sign) {
|
|
27
27
|
return value + sign
|
|
28
28
|
} else {
|
|
@@ -65,52 +65,47 @@ const formatter = {
|
|
|
65
65
|
date: function (value, options) {
|
|
66
66
|
// format格式,例如:yyyy-m-d,yyyy-m-d hh:mm:ss等等
|
|
67
67
|
const format = options.format
|
|
68
|
-
|
|
69
68
|
if (value != null) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
if (d < 10) {
|
|
84
|
-
d = '0' + d
|
|
85
|
-
}
|
|
86
|
-
// if (format.indexOf('hh') >= 0) {
|
|
87
|
-
// h = h > 12 ? h - 12 : h
|
|
88
|
-
// } else {
|
|
89
|
-
if (h < 10) {
|
|
90
|
-
h = '0' + h
|
|
91
|
-
}
|
|
92
|
-
// }
|
|
93
|
-
if (min < 10) {
|
|
94
|
-
min = '0' + min
|
|
95
|
-
}
|
|
96
|
-
if (s < 10) {
|
|
97
|
-
s = '0' + s
|
|
98
|
-
}
|
|
99
|
-
const newValue = format
|
|
100
|
-
.replace('yyyy', y)
|
|
101
|
-
.replace('mm', min)
|
|
102
|
-
.replace('M', m)
|
|
103
|
-
.replace('m', m)
|
|
104
|
-
.replace('d', d)
|
|
105
|
-
.replace('hh', h)
|
|
106
|
-
.replace('HH', h)
|
|
107
|
-
.replace('ss', s)
|
|
108
|
-
// 判断格式化的值是否包含NaN,如果包含NaN取数据库的值
|
|
109
|
-
if (newValue.indexOf('NaN') === -1) {
|
|
110
|
-
return newValue
|
|
111
|
-
}
|
|
112
|
-
return value
|
|
69
|
+
const date = new Date(value)
|
|
70
|
+
var y = date.getFullYear()
|
|
71
|
+
var m = date.getMonth() + 1
|
|
72
|
+
var d = date.getDate()
|
|
73
|
+
var h = date.getHours()
|
|
74
|
+
var min = date.getMinutes()
|
|
75
|
+
var s = date.getSeconds()
|
|
76
|
+
if (m < 10) {
|
|
77
|
+
m = '0' + m
|
|
78
|
+
}
|
|
79
|
+
if (d < 10) {
|
|
80
|
+
d = '0' + d
|
|
113
81
|
}
|
|
82
|
+
// if (format.indexOf('hh') >= 0) {
|
|
83
|
+
// h = h > 12 ? h - 12 : h
|
|
84
|
+
// } else {
|
|
85
|
+
if (h < 10) {
|
|
86
|
+
h = '0' + h
|
|
87
|
+
}
|
|
88
|
+
// }
|
|
89
|
+
if (min < 10) {
|
|
90
|
+
min = '0' + min
|
|
91
|
+
}
|
|
92
|
+
if (s < 10) {
|
|
93
|
+
s = '0' + s
|
|
94
|
+
}
|
|
95
|
+
const newValue = format
|
|
96
|
+
.replace('yyyy', y)
|
|
97
|
+
.replace('mm', min)
|
|
98
|
+
.replace('M', m)
|
|
99
|
+
.replace('m', m)
|
|
100
|
+
.replace('d', d)
|
|
101
|
+
.replace('hh', h)
|
|
102
|
+
.replace('HH', h)
|
|
103
|
+
.replace('ss', s)
|
|
104
|
+
// 判断格式化的值是否包含NaN,如果包含NaN取数据库的值
|
|
105
|
+
if (newValue.indexOf('NaN') === -1) {
|
|
106
|
+
return newValue
|
|
107
|
+
}
|
|
108
|
+
return value
|
|
114
109
|
}
|
|
115
110
|
return value
|
|
116
111
|
},
|
|
@@ -122,7 +117,7 @@ const formatter = {
|
|
|
122
117
|
return this.number(value, options) + '%'
|
|
123
118
|
}
|
|
124
119
|
return value
|
|
125
|
-
}
|
|
120
|
+
},
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
export function doFormat(column, value) {
|
|
@@ -137,21 +132,24 @@ export function doFormat(column, value) {
|
|
|
137
132
|
column.formatter = {
|
|
138
133
|
type: 'date',
|
|
139
134
|
options: {
|
|
140
|
-
format: 'yyyy-m-d'
|
|
141
|
-
}
|
|
135
|
+
format: 'yyyy-m-d',
|
|
136
|
+
},
|
|
142
137
|
}
|
|
143
138
|
} else if (column.dataType === 'TIME') {
|
|
144
139
|
// 默认的“TIME”类型的格式设置
|
|
145
140
|
column.formatter = {
|
|
146
141
|
type: 'time',
|
|
147
142
|
options: {
|
|
148
|
-
format: 'yyyy-m-d hh:mm:ss'
|
|
149
|
-
}
|
|
143
|
+
format: 'yyyy-m-d hh:mm:ss',
|
|
144
|
+
},
|
|
150
145
|
}
|
|
151
146
|
}
|
|
152
147
|
}
|
|
153
148
|
const columnFormatter = column.formatter
|
|
154
|
-
if (
|
|
149
|
+
if (
|
|
150
|
+
columnFormatter !== undefined &&
|
|
151
|
+
formatter[columnFormatter.type] !== undefined
|
|
152
|
+
) {
|
|
155
153
|
return formatter[columnFormatter.type](value, columnFormatter.options)
|
|
156
154
|
} else {
|
|
157
155
|
return value
|
|
@@ -165,7 +163,10 @@ export function doFormatWithValueSet(column, value) {
|
|
|
165
163
|
const valueSet = column.valueSet
|
|
166
164
|
// 先处理值设置再处理格式化设置:即会对值设置的结果进行格式化设置
|
|
167
165
|
if (valueSet !== undefined) {
|
|
168
|
-
if (
|
|
166
|
+
if (
|
|
167
|
+
column.componentType === 'multiselect' &&
|
|
168
|
+
!isDynamicDataSourceSource(column)
|
|
169
|
+
) {
|
|
169
170
|
if (typeof value === 'number') {
|
|
170
171
|
// 当value是0时, value instanceof Number 为false
|
|
171
172
|
value += ''
|