centaline-data-driven-v3 0.0.44 → 0.0.45

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.44",
3
+ "version": "0.0.45",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -399,9 +399,8 @@ defineExpose({
399
399
  }
400
400
 
401
401
  .ct-formTable .list-button {
402
- display: flex;
403
- justify-content: right;
404
402
  margin-right: 10px;
403
+ text-align: right;
405
404
  }
406
405
 
407
406
  .select-cost table {
@@ -2,7 +2,8 @@
2
2
  <div class="ct-serach-screen" v-if="model">
3
3
  <div class="screen-serach" style="display: flex;flex-direction: row;">
4
4
  <div style="display: flex; flex: 1;">
5
- <van-dropdown-menu v-if="showScreen && screendata.length > 0" active-color="#EE6B6B" style=" width: 100%;">
5
+ <van-dropdown-menu v-if="showScreen && screendata.length > 0" active-color="#EE6B6B"
6
+ style=" width: 100%;">
6
7
  <van-dropdown-item v-for="(field, index) in screendata" :key="index" ref="Refitem"
7
8
  :title-class="field.searchValue || field.searchValue1 ? 'title color-EE6B6B' : 'title'"
8
9
  @open="open(field)" @close="close(field)">
@@ -32,7 +33,6 @@
32
33
  <component :is="field.is" :vmodel="field" ref="Fields"
33
34
  :parameterAction="model.parameterAction" />
34
35
  </template>
35
-
36
36
  <van-sticky position="bottom">
37
37
  <div style="padding: 5px 16px; display: flex;background-color: #ffffff;">
38
38
  <van-button color="#ECECEC" block @click="reset"
@@ -47,8 +47,11 @@
47
47
  </van-dropdown-item>
48
48
  </van-dropdown-menu>
49
49
  </div>
50
- <div style="display: flex;width: 60px;align-items: center;justify-content: center;" v-if="flagsort" @click="clicksort">
51
- <span class="van-ellipsis" style="font-size: 14px;line-height: 22px;color: #323233;">{{sortname != '' ? sortname : '排序'}}</span>
50
+ <div style="display: flex;width: 60px;align-items: center;justify-content: center;" v-if="flagsort"
51
+ @click="clicksort">
52
+ <span class="van-ellipsis" style="font-size: 14px;line-height: 22px;color: #323233;">{{ sortname != '' ?
53
+ sortname :
54
+ '排序' }}</span>
52
55
  <van-icon name="sort" size="13" color="#323233" />
53
56
  </div>
54
57
  </div>
@@ -329,7 +332,7 @@ function getsortfield(field) {
329
332
  function selectsort(ev) {
330
333
  issort.value = false;
331
334
  sortname.value = "";
332
- if(ev.code){
335
+ if (ev.code) {
333
336
  sortname.value = ev.name;
334
337
  }
335
338
  emit("sort", ev);
@@ -8,10 +8,11 @@
8
8
  :data="model.uploadData" :headers="headers" :before-upload="beforeUploadProcess"
9
9
  :on-success="handleAvatarSuccess" :on-error="handleAvatarError" :on-progress="uploadProcess"
10
10
  :limit="parseInt(model.maxValue1 || 999)" :on-exceed="handleExceed">
11
-
12
11
  <el-icon>
13
12
  <Plus />
14
13
  </el-icon>
14
+ <input style="position: absolute;width: 0px;height: 0px;top: 13px;left: 5px;" type="text" placeholder="粘贴上传"
15
+ source="upload" @paste="handlePaste" ref="refPasteUpload" />
15
16
  <template #tip>
16
17
  <div class="el-upload__tip errorMessage" style="white-space:pre-wrap;" v-show="!model.valid"
17
18
  v-html="model.validMessage">
@@ -19,8 +20,15 @@
19
20
  <div v-show="model.description" v-html="model.description">
20
21
  </div>
21
22
  </template>
22
- <img class="qrcode-target" @click.stop="qrcodeFn" ref="QRCodeRef" v-if="model.QRCodeAction"
23
- :src="util.getAssetsImage('serw1.png')" style="width: 35px;height: 35px;" alt="扫码上传" title="扫码上传">
23
+ <div class="qrcode-target">
24
+ <img @click.stop="qrcodeFn" ref="QRCodeRef" v-if="model.QRCodeAction" :src="util.getAssetsImage('serw1.png')"
25
+ style="width: 35px;height: 35px; float: right; " alt="扫码上传" title="扫码上传" />
26
+ <div style="cursor: pointer; height: 16px;line-height: 16px; float: right;" @click.stop="getFocus">
27
+ <el-icon style="font-size: 14px;" title="粘贴上传">
28
+ <DocumentCopy />
29
+ </el-icon>
30
+ </div>
31
+ </div>
24
32
  <div class="ScanUploadPhoto" v-if="model.qrcodeVisible" @click.stop="qrcodeVisible = true"
25
33
  :style="{ top: model.QRCodeRefTop + 'px', left: model.QRCodeRefLeft + 'px' }">
26
34
  <div style="border-bottom:none">
@@ -103,11 +111,8 @@
103
111
 
104
112
 
105
113
  <div @dragstart="drag($event, file)" @drop="drop($event, file)" @dragover.prevent
106
- @dragenter="dragenter($event, file)" @dragleave="dragleave($event, file)">
107
- <div v-if="file.progressFlag" v-loading="file.progressFlag" style="width: 100px; height: 100px"
108
- element-loading-spinner="el-icon-loading">
109
- </div>
110
- <el-image v-else fit="fill"
114
+ @dragenter="dragenter($event, file)" @dragleave="dragleave($event, file)" >
115
+ <el-image fit="fill"
111
116
  :src="file.url ? file.url : file.mediaUrl ? file.mediaUrl + '/100/100' : util.getAssetsImage('blank.png')"
112
117
  style="width: 100px; height: 100px" :z-index="previewZIndex">
113
118
  </el-image>
@@ -188,10 +193,14 @@ const props = defineProps({
188
193
  const refct_upload = ref()
189
194
  const refupload = ref()
190
195
  const QRCodeRef = ref()
191
-
196
+ const refPasteUpload = ref()
192
197
  const UploadhttpRequest = ref({})
198
+ const startfile = ref();
199
+ const endfile = ref();
200
+ const model = ref(null);
201
+
202
+ const flagPasteUpload = ref(false);
193
203
 
194
- const model = ref(null)
195
204
  const headers = computed(() => {
196
205
  return common.getDataDrivenOpts().handler.getRequestHeaders();
197
206
  })
@@ -222,6 +231,7 @@ function action() {
222
231
  return "";
223
232
  }
224
233
 
234
+
225
235
  function load(data) {
226
236
  model.value = data;
227
237
  model.value.validExcute = () => {
@@ -410,7 +420,7 @@ async function SliceUpload(options) {
410
420
  }
411
421
  // data是上传时附带的额外参数,file是文件
412
422
 
413
- let uid = model.value.uploadguid;
423
+ let uid = File.uploadguid();
414
424
  try {
415
425
  file.uid = file.uid || uid;
416
426
 
@@ -568,8 +578,7 @@ function QRCodeLocate() {
568
578
  }
569
579
 
570
580
 
571
- const startfile = ref();
572
- const endfile = ref();
581
+
573
582
 
574
583
  function drag(e, file) {
575
584
  startfile.value = file;
@@ -624,10 +633,77 @@ function viewerfile(file) {
624
633
  File.viewerfile(file, model.value)
625
634
  }
626
635
 
636
+ function getFocus() {
637
+ refPasteUpload.value.focus();
638
+ }
639
+
640
+ function handlePaste(event) {
641
+ flagPasteUpload.value = true;
642
+ PasteUpload(event);
643
+ }
644
+
645
+ function PasteUpload(event) {
646
+
647
+ // 获取粘贴板中的图片
648
+ const clipboardDatas = (event.clipboardData || event.originalEvent.clipboardData);
649
+ const items = clipboardDatas.items;
650
+ for (let index in items) {
651
+ const item = items[index];
652
+ if (item.kind === 'file') {
653
+
654
+ const file = item.getAsFile();
655
+ let uid = File.uploadguid();
656
+
657
+ file.uid = file.uid || uid;
658
+ refupload.value.handleStart(file);
659
+ // 提交上传队列
660
+ refupload.value.submit();
661
+ }
662
+ }
663
+
664
+ }
665
+
666
+ function ListenerPaste(event) {
667
+ if (!flagPasteUpload.value) {
668
+ var target = event.target;
669
+ const uploads = document.querySelectorAll('input[source="upload"]');
670
+
671
+ if (!window.uploads) {
672
+ window.uploads = { count: 0, length: uploads.length };
673
+ }
674
+ if (uploads.length > 1) {
675
+ window.uploads.count = window.uploads.count + 1;
676
+ window.uploads.length = uploads.length;
677
+
678
+ if (window.uploads.count == window.uploads.length) {
679
+ window.uploads = null;
680
+ ElMessage({
681
+ message: "存在多个上传组件,请点击粘贴上传!",
682
+ type: 'info',
683
+ showClose: true,
684
+ });
685
+ return false;
686
+ }
687
+ }
688
+ else if (uploads.length == 1) {
689
+ window.uploads = null;
690
+ PasteUpload(event);
691
+ }
692
+ }
693
+ else {
694
+ flagPasteUpload.value = false;
695
+ }
696
+
697
+ }
698
+
699
+ // 添加粘贴事件监听器
700
+ document.addEventListener('paste', ListenerPaste);
627
701
  onBeforeUnmount(() => {
628
702
  //销毁定时上传
629
703
  clearTimeout(model.value.qrtimer);
630
704
  window.removeEventListener('scroll', model.value.QRCodeLocate, true)
705
+ //销毁贴事件监听器
706
+ document.removeEventListener('paste', ListenerPaste)
631
707
  })
632
708
 
633
709
  defineExpose({
@@ -764,8 +840,10 @@ defineExpose({
764
840
  position: absolute;
765
841
  top: 3px;
766
842
  right: 3px;
767
- width: 35px;
843
+ width: 50px;
768
844
  height: 35px;
845
+ color: red;
846
+ text-align: right;
769
847
  }
770
848
 
771
849
  :deep(.ScanUploadPhoto) {
@@ -80,15 +80,20 @@ const props = defineProps({
80
80
  Boolean,
81
81
  default: false,
82
82
  },
83
+ apiParam: {
84
+ type: Object,
85
+ default: () => { }
86
+ },
83
87
  })
84
88
  const model = ref(null)
85
89
  const FlagStatistics = ref(false)
86
90
  const sortData = ref(null)
87
- const selectStats = ref([])
91
+ const selectStats = ref('')
88
92
  const showData = ref([])
89
93
  const flagClick = ref(false)
90
94
  const lastWidth = ref(0)
91
95
  const showWidth = ref(0)
96
+ const fieldName1 = ref('')
92
97
  const option = ref({
93
98
  isHidden: true, //是否开启操作栏隐藏设置,默认开启
94
99
  showNum: 3, //如果isHidden为true时,个数大于3就会隐藏,默认是3
@@ -130,12 +135,14 @@ function load(data) {
130
135
  data.source.content.forEach((item, index) => {
131
136
  item.sort = index;
132
137
  item.key = item.fieldName1 + "*" + replabel(item.controlLabel);
138
+ fieldName1.value = item.fieldName1;
133
139
  sortData.value[item.key] = index;
134
140
  });
135
141
  }
136
142
  else {
137
143
  data.source.content.forEach((item, index) => {
138
144
  item.key = item.fieldName1 + "*" + replabel(item.controlLabel);
145
+ fieldName1.value = item.fieldName1;
139
146
  if (sortData.value[item.key] == undefined) {
140
147
  item.sort = index;
141
148
  } else {
@@ -151,11 +158,18 @@ function load(data) {
151
158
  return -1; // 顺序不变
152
159
  }
153
160
  });
154
-
161
+ if (selectStats.value == '') {
162
+ var m = data.source.content.find((v) => {
163
+ return v.code1 === props.apiParam[fieldName1.value];
164
+ });
165
+ if (m) {
166
+ selectStats.value = m.key
167
+ }
168
+ }
155
169
  let i = data.source.content.findIndex(
156
170
  (v) => selectStats.value === v.key
157
171
  );
158
- if (i == -1 || selectStats.value == []) {
172
+ if (i == -1 || selectStats.value == '') {
159
173
  handleClick(data.source.content[0], false);
160
174
  }
161
175
  FlagStatistics.value = true;
@@ -232,7 +246,7 @@ function replabel(labelName) {
232
246
  }
233
247
  function getsearchStats() {
234
248
  let rtn = [];
235
- if (selectStats.value != []) {
249
+ if (selectStats.value != '') {
236
250
  let n = model.value.source.content.find(
237
251
  (v) => selectStats.value === v.key
238
252
  );
@@ -2,7 +2,7 @@
2
2
  <div style="width: 100%" class="ct-searchtable" ref="refSearchTable">
3
3
  <SearchStats ref="refTableStats" v-if="!isLoading && model && searchStatsApi" :api="searchStatsApi"
4
4
  @searchStats="clickSearchStats" :searchModel="model.searchModel" @setTableHeight="setTableHeight"
5
- :flagDisabled="disabledStats">
5
+ :flagDisabled="disabledStats" :apiParam="apiParam">
6
6
  </SearchStats>
7
7
  <TableToolbar ref="refToolbar" v-if="!isLoading && model && model.buttons" :buttons="model.buttons"
8
8
  :key="model.toolbarKey" @click="toolbarClickHandler" @importComplete="importComplete"
@@ -243,6 +243,10 @@ const props = defineProps({
243
243
  api: String,
244
244
  searchStatsApi: String,
245
245
  flagAppMode: Boolean,
246
+ apiParam: {
247
+ type: Object,
248
+ default: () => { }
249
+ },
246
250
  flagFocus: {
247
251
  Boolean,
248
252
  default: true,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div ref="refMain" style="width: 100%;height: 100%;display: flex;" :class="{ 'domDisabled': pageDisabled }">
3
3
  <div class="search-list"
4
- :style="{ 'height': pageHeightReal ? pageHeightReal : '100%', 'width': searchWidth ? searchWidth + 'px' : '100%','background':isLayout?'#ffffff':'' }">
4
+ :style="{ 'height': pageHeightReal ? pageHeightReal : '100%', 'width': searchWidth ? searchWidth + 'px' : '100%', 'background': isLayout ? '#ffffff' : '' }">
5
5
  <div slot="header" class="clearfix" v-if="typeof title !== 'undefined' && showTitle">
6
6
  <span style="font-weight:bold">{{ title }}</span>
7
7
  </div>
@@ -15,10 +15,11 @@
15
15
  <searchTable ref="refTable" :api="searchDataApi" :key="reloadKey" :searchStatsApi="searchStatsApi"
16
16
  :from="from" :isIframe="isIframe" :documentHeight="documentHeight" :documentWidth="documentWidth"
17
17
  :flagPopupSearchlist="flagPopupSearchlist" :screenTop="screenTop" :flagAppMode="flagAppMode"
18
- @searchComplate="searchComplate" @loaded="tableLoaded" @rowClickHandle="rowClickHandle"
19
- @refreshRowHandle="refreshRowHandle" @scrollHandle="scrollHandle" @refreshParent="refreshParentHandler"
20
- @simpleRouterRefreshHandler="simpleRouterRefreshHandler" @closeSideBar="closeSideBar"
21
- @popupClickHandler="popupClickHandler" :dragStartItem="dragStartItem" :dragStartName="dragStartName"
18
+ :apiParam="apiParam" @searchComplate="searchComplate" @loaded="tableLoaded"
19
+ @rowClickHandle="rowClickHandle" @refreshRowHandle="refreshRowHandle" @scrollHandle="scrollHandle"
20
+ @refreshParent="refreshParentHandler" @simpleRouterRefreshHandler="simpleRouterRefreshHandler"
21
+ @closeSideBar="closeSideBar" @popupClickHandler="popupClickHandler" :dragStartItem="dragStartItem"
22
+ :dragStartName="dragStartName"
22
23
  @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
23
24
  </searchTable>
24
25
  </div>
@@ -42,7 +43,7 @@ import SearchCategory from './SearchList/SearchCategory.vue';
42
43
  import SearchSideMenu from './SearchList/SearchSideMenu.vue';
43
44
  import SearchSideRight from './SearchList/SearchSideRight.vue';
44
45
  import { ref, nextTick, onMounted, watch, onActivated } from 'vue'
45
- const emit = defineEmits(['loaded', 'failLoad', 'tableLoaded', 'scrollHandle', 'rowClickHandle', 'refreshParent', 'submit','flagNotificationParentAfterContentChanged'])
46
+ const emit = defineEmits(['loaded', 'failLoad', 'tableLoaded', 'scrollHandle', 'rowClickHandle', 'refreshParent', 'submit', 'flagNotificationParentAfterContentChanged'])
46
47
  const props = defineProps({
47
48
  vmodel: Object,
48
49
  parameterAction: String,
@@ -158,7 +159,7 @@ function screenLoaded(defaultSearch) {
158
159
  if (props.from && props.from == 'detail') {
159
160
  screenTop.value = refScreen.value.$el.offsetTop;
160
161
  }
161
- pageDisabled.value=true;
162
+ pageDisabled.value = true;
162
163
  refTable.value.searchComplate(refScreen.value.model, defaultSearch);
163
164
  emit('loaded', refScreen.value.model);
164
165
  }
@@ -232,10 +233,10 @@ function searchComplate(index) {
232
233
  }
233
234
  function tableLoaded() {
234
235
  title.value = refTable.value.model.title;
235
- pageDisabled.value=false;
236
+ pageDisabled.value = false;
236
237
  flagSideBar.value = refTable.value.model.flagSideBar;
237
238
  flagDefaultDisplaySideBar.value = refTable.value.model.flagDefaultDisplaySideBar;
238
- isLayout.value=refTable.value.model.isLayout;
239
+ isLayout.value = refTable.value.model.isLayout;
239
240
  if (refTable.value.model.rowSelectRouter) {
240
241
  rowSelectRouter.value = refTable.value.model.rowSelectRouter
241
242
  sideBarPageType.value = refTable.value.model.rowSelectRouter.actionSource;
@@ -10,28 +10,28 @@
10
10
  <span v-html="model.preLabel1"></span>
11
11
  </div>
12
12
  </div>
13
-
14
-
15
13
  <div style="width: 100%;position: relative" ref="refct_Photo" class="block ct-file"
16
14
  :style="{ 'width': (model.maxValue1 || 100) + 'px', 'height': (model.minValue1 || 100) + 'px' }"
17
15
  :class="[model.attrs.size ? 'ct-checkbox-' + model.attrs.size : '']">
16
+
17
+ <input style="position: absolute;width: 0px;height: 0px; top: 13px;left: 5px" source="upload" type="text"
18
+ placeholder="粘贴上传" @paste="handlePaste" ref="refPasteUpload" />
19
+
18
20
  <el-upload :class="model.disableUpload ? 'ct-upload-display-none' : ''" v-bind="UploadhttpRequest"
19
21
  ref="refupload" :disabled="model.locked" :accept="model.fileAccept1" :on-change="handleChange"
20
22
  :multiple="false" :auto-upload="true" :action="action()" :headers="headers"
21
23
  :before-upload="beforeUploadProcess" :on-success="handleAvatarSuccess" :on-error="handleAvatarError"
22
- :on-progress="uploadProcess" :on-exceed="handleExceed" :show-file-list="false" >
24
+ :on-progress="uploadProcess" :on-exceed="handleExceed" :show-file-list="false">
23
25
 
24
26
 
25
27
  <el-icon class="avatar-uploader-icon"
26
28
  :style="{ 'width': (model.maxValue1 || 100) + 'px', 'height': (model.minValue1 || 100) + 'px', background: 'var(--el-fill-color-lighter)' }">
27
-
29
+
28
30
  <template v-if="model.fileList && model.fileList.length > 0">
29
31
  <div :style="{ 'width': (model.maxValue1 || 100) + 'px', 'height': (model.minValue1 || 100) + 'px' }"
30
32
  :title="file.fileName" v-for="(file, index) in model.fileList">
31
33
  <div class="cover-list-item">
32
-
33
-
34
- <span class="tool-top" :style="{ right: model.QRCodeAction ? '39px' : '0' }">
34
+ <span class="tool-top" :style="{ right: (model.QRCodeAction ? '54px' : '17px') }">
35
35
 
36
36
  <span v-if="!model.locked && file.rightCrop && file.mediaTypeID == 2" style="cursor: pointer;">
37
37
  <el-icon @click.stop="handleEdit(file)">
@@ -49,6 +49,7 @@
49
49
  <Delete />
50
50
  </el-icon>
51
51
  </span>
52
+
52
53
  </span>
53
54
  <el-image fit="fill"
54
55
  :src="file.url ? file.url : file.mediaUrl ? file.mediaUrl + '/' + (model.maxValue1 || 100) + '/' + (model.minValue1 || 100) : util.getAssetsImage('blank.png')"
@@ -77,9 +78,12 @@
77
78
  </div>
78
79
  </template>
79
80
  <template v-else-if="model.name1">
80
- <img :src="model.name1 ? model.name1 : util.getAssetsImage('blank.png')" class="avatar" /></template>
81
+ <img :src="model.name1 ? model.name1 : util.getAssetsImage('blank.png')" class="avatar" />
82
+ </template>
81
83
  <template v-else>
84
+
82
85
  <Plus :style="{ 'font-size': '30px', 'color': 'var(--el-text-color-secondary)' }" />
86
+
83
87
  </template>
84
88
  </el-icon>
85
89
 
@@ -91,8 +95,17 @@
91
95
  <div v-show="model.description" v-html="model.description">
92
96
  </div>
93
97
  </template>
94
- <img class="qrcode-target" @click.stop="qrcodeFn" ref="QRCodeRef" v-if="model.QRCodeAction"
95
- :src="util.getAssetsImage('serw1.png')" style="width: 35px;height: 35px;" alt="扫码上传" title="扫码上传">
98
+ <div class="qrcode-target">
99
+ <img @click.stop="qrcodeFn" ref="QRCodeRef" v-if="model.QRCodeAction"
100
+ :src="util.getAssetsImage('serw1.png')" style="width: 35px;height: 35px; float: right; " alt="扫码上传"
101
+ title="扫码上传" />
102
+ <div style="cursor: pointer;height: 16px;line-height: 16px; float: right;" @click.stop="getFocus">
103
+ <el-icon title="粘贴上传">
104
+ <DocumentCopy />
105
+ </el-icon>
106
+ </div>
107
+
108
+ </div>
96
109
  <div class="ScanUploadPhoto" v-if="model.qrcodeVisible" @click.stop="qrcodeVisible = true"
97
110
  :style="{ top: model.QRCodeRefTop + 'px', left: model.QRCodeRefLeft + 'px' }">
98
111
  <div style="border-bottom:none">
@@ -140,10 +153,11 @@ const props = defineProps({
140
153
  const refct_Photo = ref()
141
154
  const refupload = ref()
142
155
  const QRCodeRef = ref()
143
-
156
+ const refPasteUpload = ref()
144
157
  const UploadhttpRequest = ref({})
145
-
146
158
  const model = ref(null)
159
+ const flagPasteUpload = ref(false);
160
+
147
161
  const headers = computed(() => {
148
162
  return common.getDataDrivenOpts().handler.getRequestHeaders();
149
163
  })
@@ -175,6 +189,8 @@ function action() {
175
189
  return "";
176
190
  }
177
191
 
192
+
193
+
178
194
  function load(data) {
179
195
  model.value = data;
180
196
  model.value.validExcute = () => {
@@ -315,7 +331,7 @@ async function SliceUpload(options) {
315
331
  }
316
332
  // data是上传时附带的额外参数,file是文件
317
333
 
318
- let uid = model.value.uploadguid;
334
+ let uid = Photo.uploadguid();
319
335
  try {
320
336
  file.uid = file.uid || uid;
321
337
 
@@ -357,7 +373,7 @@ function uploadpro(uploadOptions, res, xhr, flagError) {
357
373
 
358
374
  if (res.content.finished == 1) {
359
375
  handleChange();
360
- QRCodeLocate();
376
+ QRCodeLocate();
361
377
  }
362
378
  return true;
363
379
  }
@@ -472,12 +488,78 @@ function viewerfile(file) {
472
488
  Photo.viewerfile(file, model.value)
473
489
  }
474
490
 
491
+ function getFocus() {
492
+ refPasteUpload.value.focus();
493
+ }
494
+
495
+ function handlePaste(event) {
496
+ flagPasteUpload.value = true;
497
+ PasteUpload(event);
498
+ }
499
+
500
+ function PasteUpload(event) {
501
+
502
+ // 获取粘贴板中的图片
503
+ const clipboardDatas = (event.clipboardData || event.originalEvent.clipboardData);
504
+ const items = clipboardDatas.items;
505
+ for (let index in items) {
506
+ const item = items[index];
507
+ if (item.kind === 'file') {
508
+
509
+ const file = item.getAsFile();
510
+ let uid = Photo.uploadguid();
511
+
512
+ file.uid = file.uid || uid;
513
+ refupload.value.handleStart(file);
514
+ // 提交上传队列
515
+ refupload.value.submit();
516
+ }
517
+ }
518
+
519
+ }
520
+
521
+ function ListenerPaste(event) {
522
+ if (!flagPasteUpload.value) {
523
+ var target = event.target;
524
+ const uploads = document.querySelectorAll('input[source="upload"]');
525
+
526
+ if (!window.uploads) {
527
+ window.uploads = { count: 0, length: uploads.length };
528
+ }
529
+ if (uploads.length > 1) {
530
+ window.uploads.count = window.uploads.count + 1;
531
+ window.uploads.length = uploads.length;
532
+
533
+ if (window.uploads.count == window.uploads.length) {
534
+ window.uploads = null;
535
+ ElMessage({
536
+ message: "存在多个上传组件,请点击粘贴上传!",
537
+ type: 'info',
538
+ showClose: true,
539
+ });
540
+ return false;
541
+ }
542
+ }
543
+ else if (uploads.length == 1) {
544
+ window.uploads = null;
545
+ PasteUpload(event);
546
+ }
547
+ }
548
+ else {
549
+ flagPasteUpload.value = false;
550
+ }
551
+
552
+ }
553
+
554
+ // 添加粘贴事件监听器
555
+ document.addEventListener('paste', ListenerPaste);
475
556
  onBeforeUnmount(() => {
476
557
  //销毁定时上传
477
558
  clearTimeout(model.value.qrtimer);
478
559
  window.removeEventListener('scroll', model.value.QRCodeLocate, true)
560
+ //销毁贴事件监听器
561
+ document.removeEventListener('paste', ListenerPaste)
479
562
  })
480
-
481
563
  defineExpose({
482
564
  model
483
565
  })
@@ -610,10 +692,12 @@ defineExpose({
610
692
 
611
693
  :deep(.qrcode-target) {
612
694
  position: absolute;
613
- top: 3px;
614
695
  right: 3px;
615
- width: 35px;
696
+ width: 50px;
616
697
  height: 35px;
698
+ color: red;
699
+ text-align: right;
700
+ top: 0px;
617
701
  }
618
702
 
619
703
  :deep(.ScanUploadPhoto) {
@@ -101,7 +101,6 @@ function loadFromModel(source, isFormList) {
101
101
  rtn1["options"][0]["label"] = attrValue
102
102
  }
103
103
  }
104
- this.form.$vue.itemKey = Math.random()
105
104
  hiddenHandle(rtn1, this.form);
106
105
  requiredHandle(rtn1, this.form);
107
106
  }
package/src/main.js CHANGED
@@ -63,7 +63,7 @@ app.use(centaline, {
63
63
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
64
64
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
65
65
  //authObject: '{token:"1647-1802885825978044416",platform:"WEB"}',
66
- authObject: '{EmpID:"Token_51301be3-2d94-4a7a-9dec-2747b124d057",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_51301be3-2d94-4a7a-9dec-2747b124d057",Platform:"WEB"}',
66
+ authObject: '{EmpID:"Token_2fdaf18a-b466-4022-a084-8040775a1787",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_2fdaf18a-b466-4022-a084-8040775a1787",Platform:"WEB"}',
67
67
  };
68
68
  },
69
69
  // 请求完成事件,可判断是否登录过期执行响应操作