centaline-data-driven 1.2.18 → 1.2.21

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.
@@ -1,55 +1,43 @@
1
1
  <template>
2
- <div style="width:100%" class="ct-photoSelectList" v-if="FlagPhoto">
3
- <el-main style="position:absolute; top:60px;bottom:60PX;left:0;right:0;">
4
- <el-row :gutter="10">
5
- <el-col :span="24"
6
- :lg="4"
7
- :md="7"
8
- :sm="9"
9
- v-for="(item, index) in imageList"
10
- :key="index">
11
- <el-card class="box-card mb-3 position-relative" :class="{'border-danger': item.ischeck }"
12
- :body-style="{ padding: '0' }"
13
- shadow="hover"
14
- style="cursor:pointer;">
15
- <div class="border ">
16
- <img :src="item.mediaUrl"
17
- alt=""
18
- class="w-100"
19
- style="height:100px;" />
20
- <div class="w-100 text-white px-1"
21
- style="background:rgba(0,0,0,0.5);margin-top:-25px; position:absolute">
22
- <span class="small">{{item.mediaLabelName }}</span>
23
- </div>
24
- <div class="p-2 text-center">
25
- <el-button-group>
26
- <el-button icon="el-icon-view"
27
- size="mini"
28
- class="p-2"
29
- @click="viewerOpen(imageList,index)"></el-button>
30
- <el-button icon="el-icon-shopping-cart-2"
31
- size="mini"
32
- class="p-2"
33
- @click="choose(item)"></el-button>
34
- </el-button-group>
35
- <span class="badge badge-danger"
36
- style="position:absolute;right:0;top:0;"
37
- v-if="item.ischeck"></span>
38
- <!-- <el-tag type="danger" effect="dark" size="mini" >1</el-tag> -->
39
- </div>
40
- </div>
41
- </el-card>
42
- </el-col>
43
- </el-row>
44
- </el-main>
2
+ <div style=" width: 100%;height: 100%;position: relative;
3
+ " class="ct-photoSelectList" v-if="FlagPhoto">
4
+ <el-main style="position: absolute;
5
+ top: 10px;
6
+ bottom: 70PX;
7
+ left: 10px;
8
+ right: 0;
9
+ padding:0px">
10
+ <ul class="el-upload-list el-upload-list--picture-card">
11
+ <li class="el-upload-list__item is-success" :class="{'border-danger': item.ischeck}"
12
+ v-bind:key="index"
13
+ v-for="(item, index) in imageList">
14
+ <div class="cover-list-item">
15
+ <el-image fit="fill"
16
+ :src="item.thumbnailUrl"
17
+ style="width: 100px; height: 100px"
18
+ :z-index="previewZIndex"
19
+ @click="viewerOpen(imageList, index)">
20
+ </el-image>
21
+ <span class="cover-list-item-span" v-if="item.mediaLabelName">
22
+ <span class="el-dropdown-link">
23
+ &nbsp;{{ item.mediaLabelName }}
24
+ </span>
25
+ </span>
26
+ <div class="p-2 text-center">
27
+ <i class="max-view" @click="viewerOpen(imageList,index)"></i>
28
+ <i class="max-success" @click="choose(item)" :class="{'ischeck': item.ischeck }"></i>
45
29
 
30
+ <!-- <el-tag type="danger" effect="dark" size="mini" >1</el-tag> -->
31
+ </div>
32
+ </div>
33
+ </li>
34
+ </ul>
46
35
 
47
- <el-row :gutter="10" t>
48
- <el-col :span="24" :lg="4" :md="6" :sm="8">
49
- <el-button type="primary" @click="handleClick()">选择</el-button>
50
- </el-col>
51
- </el-row>
36
+ </el-main>
52
37
 
38
+ <div style="width:100%;text-align:center">
39
+ <el-button type="primary" style="position:absolute;bottom:30px;" @click="handleClick()">选择</el-button>
40
+ </div>
53
41
  <ct-viewer ref="photoSelectListViewer" />
54
42
 
55
43
  </div>
@@ -99,12 +87,11 @@
99
87
  },
100
88
  methods: {
101
89
  load(data) {
102
-
103
90
  var self = this;
104
91
  self.model = data;
105
92
 
106
93
  try {
107
- var sourceRows = self.$common.deepClone(data.source.content.rows);
94
+ var sourceRows = self.$common.deepClone(data.source.content);
108
95
 
109
96
  sourceRows.forEach((n) => {
110
97
 
@@ -149,7 +136,11 @@
149
136
  item.ischeck = false;
150
137
  },
151
138
  handleClick() {
152
- this.$emit('handlePhoto', this.chooseList);
139
+ if (this.chooseList && this.chooseList.length > 0) {
140
+ this.$emit('handlePhoto', this.chooseList);
141
+ } else {
142
+ self.$message.warning("请选择至少一张图片");
143
+ }
153
144
 
154
145
  },
155
146
  viewerOpen(list, index) {
@@ -166,6 +157,116 @@
166
157
  </script>
167
158
  <style>
168
159
  .border-danger {
169
- border: 1px solid red;
160
+ border: 1px solid red !important;
161
+ }
162
+ .ct-photoSelectList .cover-list-item-span {
163
+ position: inherit;
164
+ bottom: 0px;
165
+ display: block;
166
+ background-color: #544f48;
167
+ opacity: 0.8;
168
+ text-align: left
169
+ }
170
+ .ct-photoSelectList .el-dropdown-link {
171
+ color: #fff;
172
+ margin-left:5px
173
+ }
174
+ .text-center {
175
+ position: absolute;
176
+ top: 0;
177
+ right: 5px;
178
+ }
179
+ .max-view {
180
+ background: url(../../../assets/ck.png);
181
+ background-size: 100% 100%;
182
+ width: 24px;
183
+ height: 24px;
184
+ display: inline-block;
185
+ }
186
+ .max-success {
187
+ background: url(../../../assets/succe.png);
188
+ background-size: 100% 100%;
189
+ width: 24px;
190
+ height: 24px;
191
+ display: inline-block;
192
+ }
193
+ .ischeck {
194
+ background: url(../../../assets/success.png);
195
+ background-size: 100% 100%;
170
196
  }
197
+
198
+
199
+ .ct-upload-display-none .el-upload--picture-card {
200
+ display: none;
201
+ }
202
+
203
+ .el-upload-list__item .is-ready {
204
+ width: 100px;
205
+ height: 100px;
206
+ }
207
+
208
+ .ct-photoSelectList .cover-list-item {
209
+ position: sticky;
210
+ }
211
+
212
+ .ct-photoSelectList .cover-list-item-span {
213
+ position: inherit;
214
+ bottom: 0px;
215
+ left: 0px;
216
+ display: block;
217
+ background-color: #544f48;
218
+ opacity: 0.8;
219
+ }
220
+
221
+ .ct-photoSelectList .cover-list-item-span-delete {
222
+ position: inherit;
223
+ bottom: 160px;
224
+ left: 130px;
225
+ color: #000000;
226
+ text-align: center;
227
+ }
228
+
229
+ .cover-list-item-span-delete i {
230
+ cursor: pointer;
231
+ vertical-align: sub;
232
+ margin-right: 4px;
233
+ }
234
+
235
+ .ct-photoSelectList .el-dropdown-link {
236
+ cursor: pointer;
237
+ color: #fff;
238
+ }
239
+
240
+ .ct-photoSelectList .el-icon-arrow-down {
241
+ font-size: 12px;
242
+ }
243
+
244
+ .el-collapse-item__content {
245
+ padding-bottom: 18px;
246
+ }
247
+
248
+ .el-upload--picture-card {
249
+ width: 100px;
250
+ height: 100px;
251
+ line-height: initial;
252
+ padding: 34px;
253
+ }
254
+
255
+ .el-upload--picture-card i {
256
+ font-size: 30px;
257
+ }
258
+
259
+ .el-upload-list--picture-card .el-upload-list__item {
260
+ width: 100px;
261
+ height: 100px;
262
+ }
263
+
264
+ .card {
265
+ display: inline-block;
266
+ }
267
+ .ct-photoSelectList .icon{
268
+ cursor: pointer;
269
+ font-size: 20px;
270
+ }
271
+
171
272
  </style>
@@ -725,7 +725,7 @@
725
725
  self.$forceUpdate();
726
726
  self.$refs.footer.$forceUpdate();
727
727
  self.$common.closeDialog(dialogOption.dialog);
728
- self.updateCurrentRow(field);
728
+ self.updateCurrentRow(field,ev);
729
729
  },
730
730
  refreshParent() {
731
731
  self.getPage(1);
@@ -795,7 +795,7 @@
795
795
  }
796
796
  self.$forceUpdate();
797
797
  self.$refs.footer.$forceUpdate();
798
- self.updateCurrentRow(field);
798
+ self.updateCurrentRow(field,data);
799
799
  })
800
800
  }
801
801
  }
@@ -865,14 +865,14 @@
865
865
  //}
866
866
  //self.$refs
867
867
  },
868
- updateCurrentRow(router) {
868
+ updateCurrentRow(router,data) {
869
869
  let self = this;
870
870
  if (router.flagFreshCurrentRow) {
871
871
  self.tableComplate = true;
872
872
  self.model.getCurrentRowApiData(function () {
873
873
  self.$forceUpdate();
874
874
  self.tableComplate = false;
875
- });
875
+ },data,router);
876
876
  }
877
877
  },
878
878
  importComplete(res) {
@@ -100,6 +100,12 @@
100
100
  });
101
101
 
102
102
  }
103
+ this.$nextTick(function () {
104
+ if (document.querySelector('.is-select') != null) {
105
+ document.querySelector('.is-select').classList.remove("is-select");
106
+ }
107
+ document.querySelector('.is-current .el-tree-node__label').classList.add("is-select");
108
+ })
103
109
 
104
110
  }
105
111
  },
@@ -109,6 +115,10 @@
109
115
  }
110
116
  </script>
111
117
  <style lang="scss">
118
+
119
+ .mytree .is-select {
120
+ color: #409eff !important
121
+ }
112
122
  .tree-line:first-child div{
113
123
  overflow: hidden;
114
124
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div id="app-Tree" style="height:100%;">
3
3
  <el-container style="height: calc(100vh - 98px);border: 1px solid #eee">
4
- <el-aside :width="leftWidth?leftWidth+'px':'15%'" style="background-color:white">
4
+ <el-aside :width="leftWidth?leftWidth+'px':'15%'" style="background-color:white;border-radius: 6px;">
5
5
  <ct-searchtree :flagsearch="true" :searchConditionApi="searchConditionApi" :searchDataApi="searchDataApi" @loaded="loaded"></ct-searchtree>
6
6
  </el-aside>
7
7
  <el-main v-if="isShowMain">
@@ -136,20 +136,20 @@ const Detail = function (source,para ,callBack) {
136
136
  return rtn._actionRouters;
137
137
  }
138
138
  else {
139
- if (data.actionRouters) {
140
- rtn._actionRouters = [];
141
- let indexMore=1;
142
- if(data.actionRouters.length===3){
143
- indexMore=2;
144
- }
145
- data.actionRouters.forEach((v,i) => {
146
- if(i<=indexMore){
147
- var router = Router(v);
148
- router.is = "ct-btn";
149
- router.attrs = { size: "mini" }
150
- rtn._actionRouters.push(router);
151
- }
152
- });
139
+ if (data.actionRouters) {
140
+ rtn._actionRouters = [];
141
+ let indexMore=1;
142
+ if(data.actionRouters.length<=3){
143
+ indexMore=2;
144
+ }
145
+ data.actionRouters.forEach((v,i) => {
146
+ if(i<=indexMore){
147
+ var router = Router(v);
148
+ router.is = "ct-btn";
149
+ router.attrs = { size: "mini" }
150
+ rtn._actionRouters.push(router);
151
+ }
152
+ });
153
153
  }
154
154
  return rtn._actionRouters;
155
155
  }
@@ -41,7 +41,13 @@ const box = function (source, fileSourceList, router, optionApi) {
41
41
  return rtn._fileList;
42
42
  },
43
43
  getfileListLength() {
44
- return rtn.fileList.length;
44
+ if (!fileSourceList) {
45
+ return 0;
46
+ }
47
+ let fileList = fileSourceList.filter(item=>{
48
+ return item.flagDeleted != true
49
+ })
50
+ return fileList.length;
45
51
  },
46
52
  optionModel: {
47
53
  options: [],
@@ -210,6 +216,7 @@ const box = function (source, fileSourceList, router, optionApi) {
210
216
  classify.file.source.mediaLabelID = classify.option[rtn.optionModel.optionAttrs.value];
211
217
  },
212
218
  handleAvatarSuccess(res, file, fileList) {
219
+
213
220
  if (res.rtnCode === Enum.ReturnCode.Successful) {
214
221
  //下面的方式绑定,会有一些问题 todo 不强与页面关联
215
222
  fileSourceList.push(res.content[0]);
@@ -238,6 +245,7 @@ const box = function (source, fileSourceList, router, optionApi) {
238
245
  }
239
246
  },
240
247
  deleteFile(file, forceDelete) {
248
+
241
249
  for (let i = 0; i < rtn.fileList.length; i++) {
242
250
  if (rtn.fileList[i].uid === file.uid) {
243
251
  if (forceDelete) {
@@ -268,6 +276,7 @@ const box = function (source, fileSourceList, router, optionApi) {
268
276
  break;
269
277
  }
270
278
  }
279
+ console.log(rtn.fileList)
271
280
  },
272
281
  getFormObj() {
273
282
  var rtnFormObj = {};
@@ -10,7 +10,7 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi) {
10
10
  var init = function (data) {
11
11
  var rtn = {
12
12
  get action() {
13
- return router.action ? router.action : "";
13
+ return optionApi ? optionApi : "";
14
14
  },
15
15
  get router() {
16
16
  return router;
@@ -21,13 +21,18 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi) {
21
21
  set action(v) {
22
22
  data.action = v;
23
23
  },
24
-
24
+ getfileListLength() {
25
+ if (!fileSourceList) {
26
+ return 0;
27
+ }
28
+ return fileSourceList.length;
29
+ },
25
30
  _fileList: [],
26
31
  get fileList() {
27
32
  if (this._fileList.length !== 0) {
28
33
  return rtn._fileList;
29
34
  }
30
- else {
35
+ else {
31
36
  //this._fileList = [];
32
37
  fileSourceList.forEach((v, index) => {
33
38
  if (v.flagDeleted !== 0) {
@@ -37,13 +42,11 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi) {
37
42
  }
38
43
  return rtn._fileList;
39
44
  },
40
- setFileList(fileList) {
41
- fileSourceList = fileList;
42
- rtn.fileList = fileList;
45
+ setFileList(fileList) {
46
+ fileSourceList= fileList;
43
47
  },
44
48
  delete(index) {
45
49
  fileSourceList.splice(index, 1);
46
- rtn.fileList.splice(index, 1);
47
50
  },
48
51
  getFormObj() {
49
52
  var rtnFormObj = {};
@@ -14,55 +14,6 @@ const PhotoSelectList = function (source, callBack,searchModel, defaultSearchDat
14
14
  set source(v) {
15
15
  source = v;
16
16
  },
17
- _rowSelectRouter: null,
18
- get rowSelectRouter() {
19
- if (rtn._rowSelectRouter !== null) {
20
- return rtn._rowSelectRouter;
21
- }
22
- else {
23
- rtn._rowSelectRouter = [];
24
- if (source.content.rowSelectRouter) {
25
- var router = Router(source.content.rowSelectRouter);
26
- rtn._rowSelectRouter = router;
27
- }
28
- return rtn._rowSelectRouter;
29
- }
30
- },
31
- _actionRouter: null,
32
- get actionRouter() {
33
- if (rtn._actionRouter !== null) {
34
- return rtn._actionRouter;
35
- }
36
- else {
37
- rtn._actionRouter = [];
38
- if (source.content.actionRouters) {
39
- source.content.actionRouters.forEach((v) => {
40
- var router = Router(v);
41
- //router.is = "ct-btn";
42
- //router.attrs = { size: "mini" }
43
- rtn._actionRouter.push(router);
44
- });
45
- }
46
- return rtn._actionRouter;
47
- }
48
- },
49
- _rowRouter: null,
50
- get rowRouter() {
51
- if (rtn._rowRouter !== null) {
52
- return rtn._rowRouter;
53
- }
54
- else {
55
- rtn._rowRouter = [];
56
- if (rtn.actionRouter) {
57
- rtn.actionRouter.forEach((v) => {
58
- if (v.show) {
59
- rtn._rowRouter.push(v);
60
- }
61
- });
62
- }
63
- return rtn._rowRouter;
64
- }
65
- },
66
17
  doAction(api, searchModel, callback) {
67
18
  var self = this;
68
19
  var para = searchModel ? searchModel : {};
@@ -88,16 +39,11 @@ const PhotoSelectList = function (source, callBack,searchModel, defaultSearchDat
88
39
  return rtn;
89
40
  };
90
41
  if (typeof source === 'string') {
91
- var apiData = searchModel ? searchModel.searchData : {};
42
+ var para = searchModel ? searchModel : {};
92
43
  Vue.prototype.$api.postHandler(common.globalUri(),
93
44
  {
94
45
  action: source,
95
- para:
96
- {
97
- searchFields: apiData,
98
- pageAttribute: { pageIndex: 1 },
99
- flagSearch: true
100
- }
46
+ para:para
101
47
  }).then(
102
48
  function (response) {
103
49
  if (response.rtnCode === Enum.ReturnCode.Successful) {
@@ -554,7 +554,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
554
554
  console.error(error);
555
555
  });
556
556
  },
557
- getCurrentRowApiData(callback) {
557
+ getCurrentRowApiData(callback,rtnData,router) {
558
558
  var self = this;
559
559
  var searchFields = this.searchModel ? this.searchModel.searchData : { fields: [] };
560
560
  if (self.primaryKey) {
@@ -563,7 +563,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
563
563
  groupName: self.primaryKey,
564
564
  operation: 2,
565
565
  searchDataType: 3,
566
- searchValue1: rtn.listData[rtn.selectIndex][self.primaryKey],
566
+ searchValue1: router.actionType==Enum.ActionType.New? rtnData.responseData.content: rtn.listData[rtn.selectIndex][self.primaryKey],
567
567
  });
568
568
  }
569
569
  Vue.prototype.$api.postHandler(common.globalUri(), {
@@ -577,11 +577,23 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
577
577
  .then(function (response) {
578
578
  if (response.rtnCode === Enum.ReturnCode.Successful) {
579
579
  if (response.content.rows.length > 0) {
580
- response.content.rows.forEach((row) => {
581
- for (var vkey in row) {
582
- rtn.dataDictionary[row[rtn.primaryKey]][vkey] = row[vkey];
583
- }
584
- });
580
+ if(router.actionType==Enum.ActionType.New){
581
+ rtn.setStyleRow(response.content.rows);
582
+ response.content.rows.forEach((nr) => {
583
+ rtn.listData.unshift(nr);
584
+ });
585
+ rtn.dataDictionary = response.content.rows;
586
+
587
+ source.page.rows = source.page.rows + response.content.rows.length;
588
+ rtn.$vue.calculatingRowHeight()
589
+ }
590
+ else{
591
+ response.content.rows.forEach((row) => {
592
+ for (var vkey in row) {
593
+ rtn.dataDictionary[row[rtn.primaryKey]][vkey] = row[vkey];
594
+ }
595
+ });
596
+ }
585
597
  }
586
598
 
587
599
  if (typeof response.content.foot !== 'undefined') {
@@ -218,7 +218,7 @@ const Enum = {
218
218
  /*带标签的超链接列表*/
219
219
  HyperlinkListWithLabel: 44,
220
220
  /// <summary>
221
- /// 图片
221
+ /// 图片选择
222
222
  /// </summary>
223
223
  PhotoSelect: 45,
224
224
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="ct-quickInput">
3
3
 
4
- <el-popover ref="pop" placement="bottom-start" v-model="showDrop" trigger="click">
4
+ <el-popover ref="pop" placement="bottom-start" v-model="showDrop" trigger="click" @show="searchInputHandle">
5
5
  <div>
6
6
  <div>
7
7
  <el-input ref="searchInput" size="mini" suffix-icon="el-icon-search" v-model="searchText" @input="searchInputHandle"></el-input>
@@ -42,7 +42,6 @@
42
42
  else {
43
43
  this.model = this.vmodel;
44
44
  }
45
- this.searchInputHandle();
46
45
  },
47
46
  data() {
48
47
  return {
@@ -125,7 +125,15 @@ const actions = {
125
125
  } else {
126
126
  return false;
127
127
  }
128
- }
128
+ },
129
+ requiredFile(v, o) {
130
+ if (v.getfileListLength()<=0) {
131
+ return false;
132
+ }
133
+ else {
134
+ return true;
135
+ }
136
+ },
129
137
  };
130
138
 
131
139
  const valid = {
@@ -162,6 +170,16 @@ const valid = {
162
170
  message: '值必须是数字',
163
171
  ticker:'input'
164
172
  },
173
+ requiredFile: {
174
+ action: actions.requiredFile,
175
+ message: '必须上传附件',
176
+ ticker: 'input'
177
+ },
178
+ requiredPhoto: {
179
+ action: actions.requiredFile,
180
+ message: '必须选择图片',
181
+ ticker: 'input'
182
+ },
165
183
  //numberDecimal: {
166
184
  // action: actions.numberDecimal,
167
185
  // message: '小数点位数错误',
@@ -262,6 +280,12 @@ const valid = {
262
280
  case Enum.ControlType.Address:
263
281
  rtnValidate.push(valid.requiredMultiCombo);
264
282
  break;
283
+ case Enum.ControlType.File:
284
+ rtnValidate.push(valid.requiredFile);
285
+ break;
286
+ case Enum.ControlType.PhotoSelect:
287
+ rtnValidate.push(valid.requiredPhoto);
288
+ break;
265
289
  default:
266
290
  rtnValidate.push(valid.required);
267
291
  break;