centaline-data-driven-v3 0.0.53 → 0.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -63,6 +63,7 @@ import { ref, nextTick } from 'vue'
63
63
  import { showToast, showConfirmDialog } from 'vant';
64
64
  import { changeHandler } from '../../utils/mixins';
65
65
  import { uploadByPieces } from '../../loader/src/SliceUpload';
66
+ import common from '../../utils/common'
66
67
  import File from '../../loader/src/File';
67
68
  import util from '../../utils/pub-use'
68
69
  import draggable from "vuedraggable";
@@ -145,9 +146,9 @@ function uploadProcess(file) {
145
146
  function handleRemove(file) {
146
147
  showConfirmDialog({
147
148
  title: "提示",
148
- confirmButtonText: "确定",
149
+ confirmButtonText: common.LocalizedString("确定","確認"),
149
150
  cancelButtonText: "取消",
150
- message: "确定删除该附件?",
151
+ message: common.LocalizedString("确定删除该附件?","確定刪除該附件?"),
151
152
  })
152
153
  .then(() => {
153
154
  File.deleteFile(file, false, model.value);
@@ -166,7 +166,7 @@ function Init() {
166
166
  model.value.validExcute = () => {
167
167
  var rtn = fieldsValidExcute();
168
168
  if (!rtn) {
169
- model.value.displayValidMessage = '请填写[' + model.value.controlLabel + ']'
169
+ model.value.displayValidMessage = common.LocalizedString('请填写','請填寫')+'[' + model.value.controlLabel + ']'
170
170
  }
171
171
  return fieldsValidExcute();
172
172
  }
@@ -78,6 +78,7 @@ import { ref, nextTick } from 'vue'
78
78
  import { showToast, showConfirmDialog } from 'vant';
79
79
  import { changeHandler } from '../../utils/mixins';
80
80
  import { uploadByPieces } from '../../loader/src/SliceUpload';
81
+ import common from '../../utils/common'
81
82
  import Photo from '../../loader/src/Photo';
82
83
  import util from '../../utils/pub-use'
83
84
  const emit = defineEmits(['loaded', "change", "click"])
@@ -134,9 +135,9 @@ function uploadProcess(file) {
134
135
  function handleRemove(file) {
135
136
  showConfirmDialog({
136
137
  title: "提示",
137
- confirmButtonText: "确定",
138
+ confirmButtonText: common.LocalizedString("确定","確認"),
138
139
  cancelButtonText: "取消",
139
- message: "确定删除该附件?",
140
+ message: common.LocalizedString("确定删除该附件?","確定刪除該附件?"),
140
141
  })
141
142
  .then(() => {
142
143
  Photo.deleteFile(file, false, model.value);
@@ -261,8 +261,8 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
261
261
  function handleRemove(file) {
262
262
 
263
263
 
264
- common.confirm("确定删除该附件?", "提示", {
265
- confirmButtonText: "确定",
264
+ common.confirm(common.LocalizedString("确定删除该附件?","確定刪除該附件?"), "提示", {
265
+ confirmButtonText: common.LocalizedString("确定","確認"),
266
266
  cancelButtonText: "取消",
267
267
  //type: 'warning'
268
268
  }).then(() => {
@@ -633,17 +633,28 @@ function PasteUpload(event) {
633
633
  // 获取粘贴板中的图片
634
634
  const clipboardDatas = (event.clipboardData || event.originalEvent.clipboardData);
635
635
  const items = clipboardDatas.items;
636
+ //检测是否全是文件才上传
637
+ let fileSum = 0;
636
638
  for (let index in items) {
637
639
  const item = items[index];
638
640
  if (item.kind === 'file') {
639
-
640
- const file = item.getAsFile();
641
- let uid = File.uploadguid();
642
-
643
- file.uid = file.uid || uid;
644
- refupload.value.handleStart(file);
645
- // 提交上传队列
646
- refupload.value.submit();
641
+ ++fileSum;
642
+ }
643
+ }
644
+
645
+ if (fileSum == items.length) {
646
+ for (let index in items) {
647
+ const item = items[index];
648
+ if (item.kind === 'file') {
649
+
650
+ const file = item.getAsFile();
651
+ let uid = File.uploadguid();
652
+
653
+ file.uid = file.uid || uid;
654
+ refupload.value.handleStart(file);
655
+ // 提交上传队列
656
+ refupload.value.submit();
657
+ }
647
658
  }
648
659
  }
649
660
  }
@@ -179,7 +179,7 @@ model.value.$vue = { insertOrUpdateRow, insertRow, delRow, deleteAll, insertSing
179
179
  model.value.validExcute = () => {
180
180
  var rtn=fieldsValidExcute();
181
181
  if(!rtn){
182
- model.value.displayValidMessage='请填写['+model.value.controlLabel+']'
182
+ model.value.displayValidMessage=common.LocalizedString('请填写','請填寫')+'['+model.value.controlLabel+']'
183
183
  }
184
184
  return fieldsValidExcute();
185
185
  }
@@ -13,12 +13,13 @@
13
13
  <div style="width: 100%;position: relative" ref="refct_Photo" class="block ct-file"
14
14
  :style="{ 'width': (model.maxValue1 || 100) + 'px', 'height': (model.minValue1 || 100) + 'px' }"
15
15
  :class="[model.attrs.size ? 'ct-checkbox-' + model.attrs.size : '']">
16
-
17
- <el-upload :class="model.disableUpload ? 'ct-upload-display-none' : ''" v-bind="UploadhttpRequest" :uploadStatus="!model.disableUpload&&!model.locked?'upload':'lock'"
18
- ref="refupload" :disabled="model.locked" :accept="model.fileAccept1" :on-change="handleChange"
19
- :multiple="false" :auto-upload="true" :action="action()" :headers="headers"
20
- :before-upload="beforeUploadProcess" :on-success="handleAvatarSuccess" :on-error="handleAvatarError"
21
- :on-progress="uploadProcess" :on-exceed="handleExceed" :show-file-list="false">
16
+
17
+ <el-upload :class="model.disableUpload ? 'ct-upload-display-none' : ''" v-bind="UploadhttpRequest"
18
+ :uploadStatus="!model.disableUpload && !model.locked ? 'upload' : 'lock'" ref="refupload" :disabled="model.locked"
19
+ :accept="model.fileAccept1" :on-change="handleChange" :multiple="false" :auto-upload="true"
20
+ :action="action()" :headers="headers" :before-upload="beforeUploadProcess" :on-success="handleAvatarSuccess"
21
+ :on-error="handleAvatarError" :on-progress="uploadProcess" :on-exceed="handleExceed"
22
+ :show-file-list="false">
22
23
 
23
24
 
24
25
  <el-icon class="avatar-uploader-icon"
@@ -93,9 +94,8 @@
93
94
  </div>
94
95
  </template>
95
96
  <div class="qrcode-target" v-if="model.QRCodeAction">
96
- <img @click.stop="qrcodeFn" ref="QRCodeRef"
97
- :src="util.getAssetsImage('serw1.png')" style="width: 35px;height: 35px; float: right; " alt="扫码上传"
98
- title="扫码上传" />
97
+ <img @click.stop="qrcodeFn" ref="QRCodeRef" :src="util.getAssetsImage('serw1.png')"
98
+ style="width: 35px;height: 35px; float: right; " alt="扫码上传" title="扫码上传" />
99
99
  </div>
100
100
  <div class="ScanUploadPhoto" v-if="model.qrcodeVisible" @click.stop="qrcodeVisible = true"
101
101
  :style="{ top: model.QRCodeRefTop + 'px', left: model.QRCodeRefLeft + 'px' }">
@@ -143,9 +143,9 @@ const props = defineProps({
143
143
  })
144
144
  const refct_Photo = ref()
145
145
  const refupload = ref()
146
- const QRCodeRef = ref()
146
+ const QRCodeRef = ref()
147
147
  const UploadhttpRequest = ref({})
148
- const model = ref(null)
148
+ const model = ref(null)
149
149
 
150
150
  const headers = computed(() => {
151
151
  return common.getDataDrivenOpts().handler.getRequestHeaders();
@@ -215,8 +215,8 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
215
215
  function handleRemove(file) {
216
216
 
217
217
 
218
- common.confirm("确定删除该附件?", "提示", {
219
- confirmButtonText: "确定",
218
+ common.confirm(common.LocalizedString("确定删除该附件?","確定刪除該附件?"), "提示", {
219
+ confirmButtonText: common.LocalizedString("确定","確認"),
220
220
  cancelButtonText: "取消",
221
221
  //type: 'warning'
222
222
  }).then(() => {
@@ -476,55 +476,66 @@ function QRCodeLocate() {
476
476
  function viewerfile(file) {
477
477
  Photo.viewerfile(file, model.value)
478
478
  }
479
-
479
+
480
480
  function PasteUpload(event) {
481
481
  if (!model.value.locked) {
482
482
  // 获取粘贴板中的图片
483
483
  const clipboardDatas = (event.clipboardData || event.originalEvent.clipboardData);
484
484
  const items = clipboardDatas.items;
485
+ //检测是否全是文件才上传
486
+ let fileSum = 0;
485
487
  for (let index in items) {
486
488
  const item = items[index];
487
489
  if (item.kind === 'file') {
488
-
489
- const file = item.getAsFile();
490
- let uid = Photo.uploadguid();
491
-
492
- file.uid = file.uid || uid;
493
- refupload.value.handleStart(file);
494
- // 提交上传队列
495
- refupload.value.submit();
490
+ ++fileSum;
491
+ }
492
+ }
493
+
494
+ if (fileSum == items.length) {
495
+ for (let index in items) {
496
+ const item = items[index];
497
+ if (item.kind === 'file') {
498
+
499
+ const file = item.getAsFile();
500
+ let uid = Photo.uploadguid();
501
+
502
+ file.uid = file.uid || uid;
503
+ refupload.value.handleStart(file);
504
+ // 提交上传队列
505
+ refupload.value.submit();
506
+ }
496
507
  }
497
508
  }
498
509
  }
499
510
  }
500
511
 
501
- function ListenerPaste(event) {
512
+ function ListenerPaste(event) {
502
513
 
503
- var target = event.target;
504
- const uploads = document.querySelectorAll('[uploadStatus="upload"]');
514
+ var target = event.target;
515
+ const uploads = document.querySelectorAll('[uploadStatus="upload"]');
505
516
 
506
- if (!window.uploads) {
507
- window.uploads = { count: 0, length: uploads.length };
508
- }
509
- if (uploads.length > 1) {
510
- window.uploads.count = window.uploads.count + 1;
511
- window.uploads.length = uploads.length;
517
+ if (!window.uploads) {
518
+ window.uploads = { count: 0, length: uploads.length };
519
+ }
520
+ if (uploads.length > 1) {
521
+ window.uploads.count = window.uploads.count + 1;
522
+ window.uploads.length = uploads.length;
512
523
 
513
- if (window.uploads.count == window.uploads.length) {
514
- window.uploads = null;
515
- ElMessage({
516
- message: "存在多个上传组件,请点击上传!",
517
- type: 'info',
518
- showClose: true,
519
- });
520
- return false;
521
- }
522
- }
523
- else if (uploads.length == 1) {
524
+ if (window.uploads.count == window.uploads.length) {
524
525
  window.uploads = null;
525
- PasteUpload(event);
526
+ ElMessage({
527
+ message: "存在多个上传组件,请点击上传!",
528
+ type: 'info',
529
+ showClose: true,
530
+ });
531
+ return false;
526
532
  }
527
-
533
+ }
534
+ else if (uploads.length == 1) {
535
+ window.uploads = null;
536
+ PasteUpload(event);
537
+ }
538
+
528
539
  }
529
540
 
530
541
  // 添加粘贴事件监听器
@@ -668,7 +679,7 @@ defineExpose({
668
679
 
669
680
  :deep(.qrcode-target) {
670
681
  position: absolute;
671
- right: 3px;
682
+ right: 3px;
672
683
  width: 35px;
673
684
  height: 35px;
674
685
  color: red;
@@ -585,7 +585,7 @@ function selfValidExcute(eventName, model) {
585
585
  }
586
586
  if (model.required) {
587
587
  if (File.getfileListLength(model) === 0) {
588
- model.validMessage = "必须上传附件";
588
+ model.validMessage = common.LocalizedString("必须上传附件","必須上傳附件");
589
589
  model.valid = false;
590
590
  model.displayValidMessage = model.validMessage;
591
591
  return false;
@@ -380,7 +380,7 @@ function viewerfile(file, model) {
380
380
  function selfValidExcute(eventName, model) {
381
381
  if (model.required) {
382
382
  if (Photo.getfileListLength(model) === 0) {
383
- model.validMessage = "必须上传附件";
383
+ model.validMessage = common.LocalizedString("必须上传附件","必須上傳附件");
384
384
  model.valid = false;
385
385
  model.displayValidMessage = model.validMessage;
386
386
  return false;