centaline-data-driven-v3 0.0.50 → 0.0.51

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.50",
3
+ "version": "0.0.51",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -15,6 +15,7 @@
15
15
  "element-plus": "^2.5.5",
16
16
  "moment": "^2.30.1",
17
17
  "photo-sphere-viewer": "^4.8.1",
18
+ "sortablejs": "^1.15.6",
18
19
  "vant": "^4.8.0",
19
20
  "vite-plugin-css-injected-by-js": "^3.3.0",
20
21
  "vue": "^3.3.4",
@@ -1,15 +1,17 @@
1
1
  <template>
2
2
  <div class="van-uploader" style="margin:10px 10px 0 10px; ">
3
3
  <div class="van-uploader__wrapper">
4
- <draggable :list="photoList" v-bind="dragOptions" :distance="1" @change="onEnd" class="card" @dragover.prevent @drop.prevent>
5
- <template #item="{ element, index }">
6
- <div class="van-uploader__preview" style="display:inline-block;" @click="viewerfile(photoList, index)">
4
+ <div ref="uploadImgItem">
5
+ <template v-for="(element, index) in photoList" :key="element.mediaCode">
6
+ <div class="van-uploader__preview" style="display:inline-block;"
7
+ @click="viewerfile(photoList, index)">
7
8
  <div class="van-image van-uploader__preview-image">
8
9
  <img :src="element.thumbnailUrl" class="van-image__img" style="object-fit: cover;">
9
10
  <div class="van-uploader__preview-cover">
10
11
  <div class="preview-cover van-ellipsis">{{ element.mediaLabelName }}</div>
11
12
  </div>
12
- <div class="swiper-i" @click="viewerfile(photoList, index)" v-if="element.mediaTypeID == '7'">
13
+ <div class="swiper-i" @click="viewerfile(photoList, index)"
14
+ v-if="element.mediaTypeID == '7'">
13
15
  <img :src="util.getAssetsImage('p3602x.png')" class="hous-icon" />
14
16
  </div>
15
17
  </div>
@@ -21,7 +23,7 @@
21
23
 
22
24
  </div>
23
25
  </template>
24
- </draggable>
26
+ </div>
25
27
  <div class="van-uploader__upload" v-if="!model.locked && photoList.length < max" @click="handleOpen()">
26
28
  <i class="van-badge__wrapper van-icon van-icon-plus van-uploader__upload-icon"></i>
27
29
  </div>
@@ -29,12 +31,12 @@
29
31
  </div>
30
32
  </template>
31
33
  <script setup lang="ts">
32
- import { ref, nextTick } from 'vue'
34
+ import { ref, nextTick, onMounted } from 'vue'
33
35
  import { ElMessage } from 'element-plus'
34
36
  import common from '../../utils/common'
35
37
  import util from '../../utils/pub-use'
36
38
  import PhotoSelect from '../../loader/src/PhotoSelect';
37
- import draggable from "vuedraggable";
39
+ import Sortable from 'sortablejs'
38
40
  const emit = defineEmits(['loaded'])
39
41
  const props = defineProps({
40
42
  vmodel: Object,
@@ -42,17 +44,11 @@ const props = defineProps({
42
44
  })
43
45
  const max = ref(99999)
44
46
  const photoList = ref([])
45
- const dragOptions = {
46
- animation: 200,
47
- group: "description",
48
- disabled: false,
49
- 'item-key': "mediaID",
50
- ghostClass: "ghost",
51
- dragClass: "drag",
52
- chosenClass: "chosen",
53
- forceFallback: true,
54
- handle:'.van-uploader__preview-image',
55
- }
47
+ const uploadImgItem = ref()
48
+
49
+ onMounted(() => {
50
+ initDragSort()
51
+ })
56
52
 
57
53
  const model = ref()
58
54
  init();
@@ -63,6 +59,30 @@ function init() {
63
59
  }
64
60
 
65
61
  }
62
+ const initDragSort = () => {
63
+ nextTick(() => {
64
+ // 选择包含所有可排序项目的容器
65
+ const el = uploadImgItem.value
66
+
67
+ // 确保 el 是一个有效的 DOM 元素
68
+ if (el) {
69
+ Sortable.create(el, {
70
+ group: 'shared', // 设置同一组内的元素可以互相排序
71
+ fallbackOnBody: false, // 如果需要的话,可以在 body 上进行拖拽
72
+ swapThreshold: 0.65, // 控制元素交换的阈值
73
+ onEnd: (/** 事件对象 */ evt) => {
74
+ // 获取旧的索引和新索引
75
+ const { oldIndex, newIndex } = evt
76
+ // 交换位置
77
+ const movedItem = photoList.value.splice(oldIndex, 1)[0]
78
+ photoList.value.splice(newIndex, 0, movedItem)
79
+
80
+ PhotoSelect.setfileSourceList(photoList.value, model.value);
81
+ }
82
+ })
83
+ }
84
+ })
85
+ }
66
86
 
67
87
  function load(data) {
68
88
  model.value = data;
@@ -140,22 +160,8 @@ function handleOpen() {
140
160
 
141
161
 
142
162
  }
143
- function onEnd(a, b) {
144
-
145
- nextTick(function () {
146
- PhotoSelect.setfileSourceList(photoList.value, model.value);
147
- });
148
- }
149
- function radiochecked(list, item) {
150
163
 
151
- list.forEach((v) => {
152
- v.flagDefault = false;
153
- });
154
- item.flagDefault = true;
155
- PhotoSelect.setfileSourceList(list, model.value);
156
164
 
157
- selfValidExcute("valid");
158
- }
159
165
  //不能共用的数据校验
160
166
  function selfValidExcute(eventName) {
161
167
  return PhotoSelect.selfValidExcute(eventName, model.value)
@@ -196,6 +202,7 @@ defineExpose({
196
202
  position: absolute;
197
203
  bottom: 0;
198
204
  }
205
+
199
206
  .swiper-i {
200
207
  position: absolute;
201
208
  width: 100%;
@@ -217,9 +224,9 @@ defineExpose({
217
224
  transform: translate(-50%, -50%);
218
225
  }
219
226
 
220
- .van-uploader__preview-image,.van-uploader__upload {
227
+ .van-uploader__preview-image,
228
+ .van-uploader__upload {
221
229
  width: 110px;
222
230
  height: 110px;
223
231
  }
224
-
225
232
  </style>
@@ -29,9 +29,11 @@
29
29
  <template v-else>
30
30
  <van-checkbox-group v-model="checkeds" ref="refCheckboxGroup">
31
31
  <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex">
32
- <van-checkbox v-if="isoperate || flagPopupSearchlist" shape="square"
33
- checked-color="#EE6B6B" icon-size="14px" :name="rowindex" @click="selectRow(row)"
34
- :disabled="!flagSelect(row)"></van-checkbox>
32
+ <template v-if="isoperate || flagPopupSearchlist">
33
+ <van-checkbox v-if="flagSelect(row)" shape="square" checked-color="#EE6B6B"
34
+ icon-size="14px" :name="rowindex" @click="selectRow(row)"></van-checkbox>
35
+ <div class="van-checkbox" v-else></div>
36
+ </template>
35
37
  <ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex"
36
38
  :key="itemKey" @rolRouterclick="rolRouterCellClickHandler"
37
39
  :actionRouter="model.actionRouter"
@@ -167,6 +167,7 @@ function clear() {
167
167
  model.value.value.push(v.code);
168
168
  });
169
169
  }
170
+ model.value.reset();
170
171
  }
171
172
  // 重新计算弹出最小宽度
172
173
  function setminWidth() {
@@ -41,10 +41,23 @@ function complete() {
41
41
 
42
42
  var doc = document.getElementById("previewPdf").contentWindow.document;
43
43
  if (doc) {
44
- doc.getElementById("download").style.display = "none";
45
- doc.getElementById("openFile").style.display = "none";
46
- doc.getElementById("print").style.display = "none";
47
- doc.getElementById("viewBookmark").style.display = "none";
44
+ elementHideById("download", doc)
45
+ elementHideById("openFile", doc)
46
+ elementHideById("print", doc)
47
+ elementHideById("viewBookmark", doc)
48
+
49
+ elementHideById("editorHighlightButton", doc)
50
+ elementHideById("editorFreeText", doc)
51
+ elementHideById("editorInk", doc)
52
+ elementHideById("editorStamp", doc)
53
+ elementHideById("editorModeButtons", doc)
54
+
55
+ elementHideById("printButton", doc)
56
+ elementHideById("downloadButton", doc)
57
+
58
+ elementHideById("secondaryOpenFile", doc)
59
+ elementHideById("cursorToolButtons", doc)
60
+ elementHideById("documentProperties", doc)
48
61
  doc.oncontextmenu = new Function("event.returnValue=false");
49
62
  }
50
63
  }
@@ -71,6 +84,13 @@ function getApplicationPath() {
71
84
  }
72
85
  return url;
73
86
  }
87
+ function elementHideById(elementId, doc) {
88
+ if (doc.getElementById(elementId) != null) {
89
+ if (doc.getElementById(elementId).style) {
90
+ doc.getElementById(elementId).style.display = "none";
91
+ }
92
+ }
93
+ }
74
94
  watch(() => props.src, () => {
75
95
  init(props.src);
76
96
  //complete();
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_4e6cac0d-0185-4e8c-83ca-e4cf26373ff8",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_4e6cac0d-0185-4e8c-83ca-e4cf26373ff8",Platform:"WEB"}',
66
+ authObject: '{EmpID:"Token_5d2d290d-98da-4c00-adef-bb975c372e46",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_5d2d290d-98da-4c00-adef-bb975c372e46",Platform:"WEB"}',
67
67
  };
68
68
  },
69
69
  // 请求完成事件,可判断是否登录过期执行响应操作
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <div id="app-search" style="width:100%;height:100%;position: fixed;">
3
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
4
- :searchDataApi="'/propertyPublishList/getListOfSearchModel'"
5
- :searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist>
3
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
4
+ :searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist>
6
5
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
7
6
 
8
7
  </div>