centaline-data-driven 1.5.5 → 1.5.7

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",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -8,7 +8,7 @@
8
8
 
9
9
  <ct-PropertySimpleDetailRET :api="api" :apiParam="apiParam" :selectIndex="selectIndex" :rowCount="rowCount" class="ct-PropertySimpleDetailRET"
10
10
  @loaded="loaded" @clickNextHandler="clickNextHandler" @clickPrevHandler="clickPrevHandler" @simpleRouterclickHandler="simpleRouterclickHandler"
11
- v-if="pageType=='PropertySimpleDetailRET'" @closeSideHandler="closeSideHandler" :drowerClose="drowerClose"></ct-PropertySimpleDetailRET>
11
+ v-if="pageType=='PropertySimpleDetailRET' || pageType=='PropertySimpleDetailOFI'" @closeSideHandler="closeSideHandler" :drowerClose="drowerClose"></ct-PropertySimpleDetailRET>
12
12
  </div>
13
13
  </template>
14
14
 
@@ -22,16 +22,16 @@
22
22
  </el-image>
23
23
  <span
24
24
  class="cover-list-item-span-delete"
25
- v-if="!modelPhotoselect.lock"
25
+ v-if="!model.lock"
26
26
  >
27
- <i class="el-icon-delete" @click="handleRemove(index)"></i>
27
+ <i class="el-icon-delete" @click="handleRemove(item,index)"></i>
28
28
  </span>
29
29
  <span class="cover-list-item-span">
30
30
  <span class="el-dropdown-link" v-if="item.mediaLabelName">
31
31
  <span style="width: 80px; height: 26px; display: inline-flex;">
32
32
  &nbsp;{{ item.mediaLabelName }} </span>
33
33
  </span>
34
- <template v-if="modelPhotoselect.lock">
34
+ <template v-if="model.lock">
35
35
  <span v-if="item.flagDefault &&(item.flagDefault == true || item.flagDefault == 'true')"
36
36
  class="checked isradio">
37
37
  </span>
@@ -47,7 +47,7 @@
47
47
  </ul>
48
48
  <div
49
49
  class="el-upload el-upload--picture-card"
50
- v-if="!modelPhotoselect.lock && photoList.length < max"
50
+ v-if="!model.lock && photoList.length < max"
51
51
  @click="handleOpen()"
52
52
  >
53
53
  <i class="el-icon-plus"></i>
@@ -78,8 +78,7 @@ export default {
78
78
  radio: "1",
79
79
  max: 99999,
80
80
  validMessage: "",
81
- photoList: [],
82
- modelPhotoselect: {},
81
+ photoList: [],
83
82
  };
84
83
  },
85
84
  computed: {
@@ -100,7 +99,7 @@ export default {
100
99
  },
101
100
  created() {
102
101
  var self = this;
103
- this.$nextTick(function () {
102
+ // this.$nextTick(function () {
104
103
  if (self.vmodel) {
105
104
  self.load(self.vmodel);
106
105
  self.$emit("loaded");
@@ -109,23 +108,22 @@ export default {
109
108
  self.load(data);
110
109
  });
111
110
  }
112
- });
111
+ //});
113
112
  },
114
113
  methods: {
115
- load(data) {
116
- this.model = data;
114
+ load(data) {
117
115
  this.max = data.max ? data.max : 99999;
118
- this.modelPhotoselect = data;
119
- this.photoList = data.fileList;
116
+ this.model = data;
117
+ this.photoList = data.fileList;
120
118
  },
121
- handleRemove(index) {
122
- this.modelPhotoselect.delete(index);
119
+ handleRemove(item,index) {
120
+ this.model.delete(item,index);
123
121
  this.photoList.splice(index, 1);
124
122
  },
125
123
  handleOpen() {
126
124
  var self = this;
127
125
  var chooseList = new Array();
128
- if (self.modelPhotoselect.action == "") {
126
+ if (self.model.action == "") {
129
127
  self.$message({
130
128
  message: "请配置parameterAction!",
131
129
  type: 'warning',
@@ -134,8 +132,8 @@ export default {
134
132
  return;
135
133
  }
136
134
  var params = {
137
- paramName: self.modelPhotoselect.paramName,
138
- parentValue: self.modelPhotoselect.getFormParentFieldPara(),
135
+ paramName: self.model.paramName,
136
+ parentValue: self.model.getFormParentFieldPara(),
139
137
  };
140
138
  self.photoList.forEach((n) => {
141
139
  chooseList.push(n);
@@ -148,12 +146,12 @@ export default {
148
146
  {
149
147
  component: "ct-photoSelectList",
150
148
  attrs: {
151
- api: self.modelPhotoselect.action, // self.api,//source.xx
149
+ api: self.model.action, // self.api,//source.xx
152
150
  showTitle: false,
153
151
  Selected: chooseList,
154
152
  mediaViewPageType:(self.model.source.mediaViewPageType||0),
155
- // width: self.modelPhotoselect.router.pageWidth + 'px',
156
- // height: self.modelPhotoselect.router.pageHeight+'px',
153
+ // width: self.model.router.pageWidth + 'px',
154
+ // height: self.model.router.pageHeight+'px',
157
155
  width: "772px",
158
156
  height: "550px",
159
157
  para: params,
@@ -161,10 +159,10 @@ export default {
161
159
  on: {
162
160
  handlePhoto(photoList) {
163
161
  self.$nextTick(function () {
164
- if (this.modelPhotoselect.max) {
165
- if (photoList.length > this.modelPhotoselect.max) {
162
+ if (this.model.max) {
163
+ if (photoList.length > this.model.max) {
166
164
  self.$message({
167
- message: "图片最多" + this.modelPhotoselect.max + "张",
165
+ message: "图片最多" + this.model.max + "张",
168
166
  type: 'warning',
169
167
  showClose:true,
170
168
  });
@@ -172,10 +170,10 @@ export default {
172
170
  setTimeout(() => {
173
171
  self.valid = true;
174
172
  }, 3000);
175
- photoList = photoList.slice(0, this.modelPhotoselect.max);
173
+ photoList = photoList.slice(0, this.model.max);
176
174
  }
177
175
  }
178
- self.modelPhotoselect.setFileList(photoList);
176
+ self.model.setfileSourceList(photoList);
179
177
  self.photoList = photoList;
180
178
 
181
179
  self.$common.closeDialog(dialogOption.dialog);
@@ -202,7 +200,7 @@ export default {
202
200
  onEnd(a, b) {
203
201
  var self = this;
204
202
  self.$nextTick(function () {
205
- self.modelPhotoselect.setFileList(self.photoList);
203
+ self.model.setfileSourceList(self.photoList);
206
204
  });
207
205
  },
208
206
  radiochecked(list, item) {
@@ -211,37 +209,46 @@ export default {
211
209
  v.flagDefault = false;
212
210
  });
213
211
  item.flagDefault = true;
214
- self.modelPhotoselect.setFileList(list);
212
+ self.model.setfileSourceList(list);
215
213
  },
216
214
  //不能共用的数据校验
217
215
  selfValidExcute: function (eventName) {
218
- if (this.modelPhotoselect.required) {
219
- if (this.modelPhotoselect.getfileListLength() === 0) {
216
+ if(!this.model.lock)
217
+ {
218
+ if (this.model.required) {
219
+ if (this.model.getfileListLength() === 0) {
220
220
  this.validMessage = "必须选择图片";
221
221
  this.valid = false;
222
222
  return false;
223
223
  }
224
224
  }
225
225
 
226
- if (this.modelPhotoselect.max) {
226
+ if (this.model.max) {
227
227
  if (
228
- this.modelPhotoselect.getfileListLength() > this.modelPhotoselect.max
228
+ this.model.getfileListLength() > this.model.max
229
229
  ) {
230
- this.validMessage = "图片最多" + this.modelPhotoselect.max + "张";
230
+ this.validMessage = "图片最多" + this.model.max + "张";
231
231
  this.valid = false;
232
232
  return false;
233
233
  }
234
234
  }
235
- if (this.modelPhotoselect.min) {
235
+ if (this.model.min) {
236
236
  if (
237
- this.modelPhotoselect.getfileListLength() < this.modelPhotoselect.min
237
+ this.model.getfileListLength() < this.model.min
238
238
  ) {
239
- this.validMessage = "图片最少" + this.modelPhotoselect.min + "张";
239
+ this.validMessage = "图片最少" + this.model.min + "张";
240
240
  this.valid = false;
241
241
  return false;
242
242
  }
243
243
  }
244
-
244
+ if (this.model.rightDefault && this.model.rightDefault == 1 && eventName == "valid") {
245
+ if (this.model.getfileDefault() <= 0) {
246
+ this.validMessage = "请设置默认封面";
247
+ this.valid = false;
248
+ return false;
249
+ }
250
+ }
251
+ }
245
252
  this.valid = true;
246
253
  return this.valid;
247
254
  },
@@ -244,6 +244,12 @@
244
244
 
245
245
  if(this.flagSideBar){
246
246
  this.selectIndex=-1;
247
+
248
+ if (typeof window.localStorage !== "undefined" && !this.sideBarStatus) {
249
+ var tagkey = window.localStorage.getItem(this.sideBarPageType+"key");
250
+ this.sideBarStatus=tagkey;
251
+ }
252
+
247
253
  if(this.flagDefaultDisplaySideBar && !this.sideBarStatus){
248
254
  this.sideMenuClickHandler('close');
249
255
  }
@@ -313,6 +319,7 @@
313
319
  }
314
320
  }
315
321
  }
322
+ window.localStorage.setItem(this.sideBarPageType+"key", this.sideBarStatus);
316
323
  this.$refs.table.setTableHeight();
317
324
  },
318
325
  closeSideHandler() {
@@ -68,6 +68,7 @@
68
68
  Boolean,
69
69
  default:false,
70
70
  },
71
+ categorySource: String,
71
72
  },
72
73
  created() {
73
74
  this.model = this.vmodel;
@@ -239,6 +240,12 @@
239
240
 
240
241
  if(this.flagSideBar){
241
242
  this.selectIndex=-1;
243
+
244
+ if (typeof window.localStorage !== "undefined" && !this.sideBarStatus) {
245
+ var tagkey = window.localStorage.getItem(this.sideBarPageType+this.categorySource+"key");
246
+ this.sideBarStatus=tagkey;
247
+ }
248
+
242
249
  if(this.flagDefaultDisplaySideBar && !this.sideBarStatus){
243
250
  this.sideMenuClickHandler('close');
244
251
  }
@@ -308,6 +315,7 @@
308
315
  }
309
316
  }
310
317
  }
318
+ window.localStorage.setItem(this.sideBarPageType+this.categorySource+"key", this.sideBarStatus);
311
319
  this.$refs.table.setTableHeight();
312
320
  },
313
321
  closeSideHandler() {
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <div v-if="categorySource" class="el-tabs__content">
23
23
  <div v-for="(col, index) in categorySource.selectItems1" v-show="activeIndex===index" v-loading="isLoading" :key="index" :index="index" class="el-tab-pane" role="tabpanel" aria-hidden="true">
24
- <ct-searchlistOne v-if="col.loaded" :ref="'searchlist'+index" :searchConditionApi="searchConditionApi" :pageHeight="listHeight"
24
+ <ct-searchlistOne v-if="col.loaded" :ref="'searchlist'+index" :searchConditionApi="searchConditionApi" :pageHeight="listHeight" :categorySource="col.code"
25
25
  :searchStatsApi="searchStatsApi" :searchDataApi="searchDataApi" :apiParam="col.screenPara" @tableLoaded="tableLoaded">
26
26
  </ct-searchlistOne>
27
27
  </div>
@@ -119,7 +119,10 @@
119
119
  self.label=self.categorySource.selectItems1[self.activeIndex].displayName;
120
120
  self.categorySource.selectItems1[0].screenPara=parm;
121
121
  self.listHeight=(self.$refs.main.offsetHeight-42)+'px';
122
- self.categorySource.selectItems1[0].loaded=true;
122
+ self.categorySource.selectItems1[0].loaded=true;
123
+ window.addEventListener("resize", (ev) => {
124
+ self.resize();
125
+ });
123
126
  }
124
127
  else{
125
128
  self.categoryLoadedError();
@@ -134,6 +137,7 @@
134
137
  this.label=this.categorySource.selectItems1[i].displayName;
135
138
  if(this.categorySource.selectItems1[i].loaded){
136
139
  this.$refs['searchlist'+i][0].resize();
140
+ this.$refs['searchlist'+i][0].resizeSearchList();
137
141
  this.$refs['searchlist'+i][0].resetScrollActivated();
138
142
  }
139
143
  else {
@@ -157,8 +161,10 @@
157
161
  this.$emit('refreshParent');
158
162
  },
159
163
  resize() {
160
- if(this.$refs['searchlist'+this.activeIndex][0]){
164
+ this.listHeight=(this.$refs.main.offsetHeight-42)+'px';
165
+ if(this.$refs['searchlist'+this.activeIndex] && this.$refs['searchlist'+this.activeIndex][0]){
161
166
  this.$refs['searchlist'+this.activeIndex][0].resize();
167
+ this.$refs['searchlist'+this.activeIndex][0].resizeSearchList();
162
168
  }
163
169
  },
164
170
  },
@@ -128,12 +128,7 @@ export default {
128
128
  });
129
129
 
130
130
  }
131
- this.$nextTick(function () {
132
- if (document.querySelector('.is-select') != null) {
133
- document.querySelector('.is-select').classList.remove("is-select");
134
- }
135
- document.querySelector('.is-current .el-tree-node__label').classList.add("is-select");
136
- })
131
+
137
132
 
138
133
  }
139
134
  },
@@ -146,10 +141,12 @@ export default {
146
141
  .mytree {
147
142
  height: 100%;
148
143
  }
149
- .mytree .is-select {
150
- color: var(--centalineBlue) !important;
151
- }
152
144
 
145
+ .mytree .el-tree-node.is-current > .el-tree-node__content {
146
+ color: var(--centalineBlue) !important;
147
+ }
148
+
149
+
153
150
  .tree-line:first-child div {
154
151
  overflow: hidden;
155
152
  }
@@ -5,7 +5,7 @@ import Vue from 'vue';
5
5
  import common from '../../../common';
6
6
  import valid from '../../../validate/index';
7
7
  //元数据、图片选择元数据、对应router、下拉框数据api
8
- const PhotoSelect = function (source, fileSourceList, router, optionApi) {
8
+ const PhotoSelect = function (source, fileSourceList, router, optionApi,sourceList) {
9
9
  var self = this;
10
10
  var init = function (data) {
11
11
  var rtn = {
@@ -14,13 +14,23 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi) {
14
14
  },
15
15
  get router() {
16
16
  return router;
17
- },
18
- get sourceList() {
19
- return fileSourceList;
20
- },
17
+ },
21
18
  set action(v) {
22
19
  data.action = v;
23
20
  },
21
+ get rightDefault() {
22
+ return data.rightDefault;
23
+ },
24
+ getfileDefault() {
25
+ if (!fileSourceList) {
26
+ return 0;
27
+ }
28
+ let fileList = fileSourceList.filter(item => {
29
+ return item.flagDeleted != true && item.flagDefault == true && item.mediaTypeID == 2
30
+ })
31
+ return fileList.length;
32
+ },
33
+
24
34
  getfileListLength() {
25
35
  if (!fileSourceList) {
26
36
  return 0;
@@ -41,22 +51,52 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi) {
41
51
  })
42
52
  }
43
53
  return rtn._fileList;
54
+ },
55
+ setfileSourceList(newfileList,self) {
56
+ let pushArr = [];
57
+ let deleteItem =fileSourceList.filter((item) => {
58
+ return item.flagDeleted == true;
59
+ });
60
+ pushArr =common.deepClone(deleteItem) ;
61
+
62
+ for (let i = 0; i < deleteItem.length; i++) {
63
+ for (let j = 0; j < newfileList.length; j++) {
64
+ if (newfileList[j].mediaID == deleteItem[i].mediaID) {
65
+ pushArr.splice(i, 1);
66
+ break;
67
+ }
68
+ }
69
+ }
70
+ fileSourceList = [...newfileList,...pushArr];
44
71
  },
45
- setFileList(fileList) {
46
- fileSourceList= fileList;
47
- },
48
- delete(index) {
49
- fileSourceList.splice(index, 1);
72
+ delete(delitem,index) {
73
+ let newVal = true;
74
+ let item = null;
75
+
76
+ let sourceIndex = sourceList.findIndex(v => v.mediaID === delitem.mediaID);
77
+ let i = fileSourceList.findIndex(v => v.mediaID === delitem.mediaID);
78
+ if (sourceIndex === -1) {
79
+ fileSourceList.splice(i, 1);
80
+ }
81
+ else {
82
+ fileSourceList[index].flagDefault = false;
83
+ fileSourceList[index].flagDeleted = true;
84
+ item = fileSourceList[index];
85
+ fileSourceList.splice(index, 1);
86
+ fileSourceList.push(item);
87
+ }
50
88
  },
89
+
51
90
  getFormObj() {
52
91
  var rtnFormObj = {};
92
+
53
93
  Object.defineProperty(rtnFormObj, source.fieldName1, {
54
94
  get: function () {
55
95
  return fileSourceList;
56
96
  },
57
97
  enumerable: true,
58
98
  configurable: true
59
- });
99
+ });
60
100
  return rtnFormObj;
61
101
  }
62
102
  };
@@ -327,7 +327,7 @@ const LibFunction = {
327
327
  }
328
328
  })
329
329
  }
330
- item = PhotoSelect(field, files, router, source.parameterAction);
330
+ item = PhotoSelect(field, files, router, source.parameterAction,files);
331
331
  item.is = 'ct-photoselect';
332
332
  break;
333
333
  case Enum.ControlType.RichText: //富文本框
package/src/main.js CHANGED
@@ -51,7 +51,7 @@ Vue.use(centaline, {
51
51
  getRequestHeaders: function () {
52
52
  return {
53
53
  oldToken: '7227389b-a6c5-4c0a-bc24-d629eaece3cb',
54
- token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjr0OgjAURt-lMzdpe3_KZYPSLj4EAQIJTkYg0RjfXY26uXuGbzjL-W5m3QdTGZSgdRIHkakEEseglDNEK6KYLWLbdvoBfsyXjkLUuk4ByDYClDmB-pgBlZuWUh3aJKYw0-VkKielF0JkV5il396CWfQl9nU6H6brP84dt-WZ1ZFtL0TAQRGoVw9D8Aw0DzzPOgYUNfcHAAAA__8.sJA4ggjcul71iwN0kmGK210TEUKaipDHTsvmEHQSHBM',
54
+ token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe_iOivZ2bXXpnP8aThEZCMjhQqRRAIh7k4Q0NEzxSummXcX81rFTqBh55NREDRZIKM0OMoZgjTGYZaIMY7uA_yYLyNxcN4nBpKDAco6getDBnR6iJQ8x2REJ9r1LHbKWOxZsqJOTGV5C2UJX2Kd22Xfbv84d1qmLdtKZavdARo1uWWPBUrDCpJLlb2ysiGLxxMAAP__.06Kf40mgrNwq8plJUsw0kjmXgIvkx62VNnsFBTmRzSo',
55
55
 
56
56
  originalRequestURL: 'http://10.88.22.67:8080',
57
57
  EstateInfo: '{"estateId":"201703020943128D8A8FCF463E4016D6","estateName":"%E4%B8%87%E7%A7%91%E4%BA%91%E5%9F%8E"}',