centaline-data-driven 1.2.74 → 1.2.77

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.2.74",
3
+ "version": "1.2.77",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
package/src/Form.vue CHANGED
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div id="app-form" class="data-driven" style="width:100%;height:100%;overflow:auto">
3
- <ct-form :api="'/salematter/squareupload/readDetail'" :apiParam="apiParam"></ct-form>
3
+ <!-- <ct-form :api="'/salematter/squareupload/readDetail'" :apiParam="apiParam"></ct-form> -->
4
4
  <!-- <ct-form :api="'/PropertyRET/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
5
5
  <!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
6
- <!-- <ct-form :api="'/api/third-dept-tran/transaction/detail'" :apiParam="apiParam"></ct-form> -->
6
+ <ct-form :api="'/salematter/priceupload/readDetail'" :apiParam="apiParam"></ct-form>
7
7
  <!--<ct-form :api="'api/Form/formdata'"></ct-form>-->
8
8
  <ct-dialog-list></ct-dialog-list>
9
9
  </div>
@@ -18,7 +18,7 @@
18
18
  // apiParam: {headerParam: {}, urlParam: {contractID: "06cad32e-4d0d-4b6f-bd24-16a28629a550", actionType: "0"}}
19
19
  // apiParam: {originalTraId: "1475658732246241281", actionType: 2, chanceID: "1"} ,
20
20
  // apiParam: {originalTraId: "1516290587463507969", actionType: "3", pageStyle: "2", pageTitle: "成交报告",pageOnly: "true"}
21
- apiParam:{"actionType":2,"jsonData":{}}
21
+ apiParam:{"actionType":2}
22
22
  }
23
23
  },
24
24
  methods: {
@@ -644,7 +644,7 @@ const common = {
644
644
  * @param {String} str 需要转换的字符串
645
645
  * @desc 首字母转小写。
646
646
  */
647
- initialsToUpperCase(str) {
647
+ initialsToLowerCase(str) {
648
648
  if (typeof str === 'undefined') {
649
649
  return str;
650
650
  }
@@ -653,6 +653,15 @@ const common = {
653
653
  str = charUpper + str.slice(1);
654
654
  return str;
655
655
  },
656
+ initialsToUpperCase(str) {
657
+ if (typeof str === 'undefined') {
658
+ return str;
659
+ }
660
+ let char = str.charAt(0);
661
+ let charUpper = char.toUpperCase();
662
+ str = charUpper + str.slice(1);
663
+ return str;
664
+ },
656
665
 
657
666
  /**
658
667
  * @method
@@ -335,7 +335,12 @@
335
335
  }
336
336
  else{
337
337
  field.submitFormField.forEach((v) => {
338
- submitData[v] = tempFormData[v];
338
+ if(tempFormData[v]){
339
+ submitData[v] = tempFormData[v];
340
+ }
341
+ else{
342
+ submitData[v] = tempFormData[self.$common.initialsToUpperCase(v)];
343
+ }
339
344
  });
340
345
  }
341
346
  }
@@ -150,7 +150,6 @@
150
150
  if (!isCancel) {
151
151
  if (app.model.currentRow.isNew) app.model.tableData.splice(index, 1);
152
152
  return row.isSet = !row.isSet;
153
- app.model.currentRow.isSet = false;
154
153
  }
155
154
  //提交数据
156
155
  if (row.isSet) {//保存
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div v-loading="loading" class="ct-Layout" v-if="Layout !== null && !loading">
3
- <ct-layoutchildren v-for="(item, index) in Layout.fields" :key="index":vmodel="item" :rowindex="index" @click="rolRouterClickHandler"></ct-layoutchildren>
3
+ <ct-layoutchildren :rowindex="rowindex" :vmodel="Layout" @click="rolRouterClickHandler"></ct-layoutchildren>
4
4
  </div>
5
5
  </template>
6
6
  <script>
@@ -17,6 +17,8 @@
17
17
  api: String,
18
18
  cellLayout: String,
19
19
  vmodel: Object,
20
+ rowindex: Number,
21
+ actionRouter: Array,
20
22
  listData: Array,
21
23
  apiParam: Object
22
24
  },
@@ -38,30 +40,23 @@
38
40
  self.loaderObj.CellLayout(self.api, self.load, this.apiParam, self.failLoad);
39
41
  }
40
42
  else if (typeof self.vmodel !== 'undefined') {
41
- self.load(self.vmodel);
43
+ self.load(self.vmodel, self.cellLayout);
42
44
  }
43
-
44
45
  });
45
-
46
46
  },
47
47
  failLoad() {
48
48
  this.$emit('failLoad', this.model);
49
49
  },
50
- load(data) {
51
- this.model = data;
52
- if (data.rows.length > 0) {
53
- var str = '<Layout orientation="vertical">';
54
- for (var i = 0; i < data.rows.length; i++) {
55
- str += data.cellLayout.replace(/\{\{(.+?)\}\}/g, (...args) => {
56
- return this.getValue(data.rows[i], args[1])
57
- });
58
- }
59
- str += '</Layout>';
50
+ load(data, cellLayout) {
51
+ var str = '';
52
+ if (typeof data !== 'undefined') {
53
+ str = cellLayout.replace(/\{\{(.+?)\}\}/g, (...args) => {
54
+ return this.getValue(data, args[1])
55
+ });
60
56
  }
61
57
  var xmlDOM = this.loadXML(str);
62
58
  this.Layout = this.xmlToJson(xmlDOM.childNodes[0]);
63
59
  this.loading = false;
64
- this.$emit('loaded', this.model);
65
60
  },
66
61
  getValue(data,val) {
67
62
  return val.split('.').reduce((data, currentVal) => {
@@ -82,7 +77,6 @@
82
77
  xmlToJson(xml) {
83
78
  // Create the return object
84
79
  var obj = {};
85
- var buffer = [];
86
80
  if (xml.nodeType == 1) { // element
87
81
  // do attributes
88
82
  if (xml.attributes.length > 0) {
@@ -128,14 +122,9 @@
128
122
  rolRouterClickHandler(routerKey, rowindex) {
129
123
  var self = this;
130
124
  var submitData = {};
131
- var rowData = self.model.rows[rowindex];
132
- var actionRouter = [];
133
- if (self.model.actionRouters) {
134
- self.model.actionRouters.forEach((v) => {
135
- var field = self.loaderObj.Router(v);
136
- actionRouter.push(field);
137
- });
138
- }
125
+ var rowData = self.vmodel;
126
+ var actionRouter = self.actionRouter;
127
+ debugger
139
128
  let field = actionRouter.find(b => {
140
129
  return b.id === routerKey;
141
130
  });
@@ -17,7 +17,7 @@
17
17
  @rowClickHandle="rowClickHandle"
18
18
  @showTitle="showTitleHandler"></ct-searchtable>
19
19
  </div>
20
- <div v-if="flagSideBar && flagSideBarOfData"
20
+ <div ref="sidebar" v-if="flagSideBar && flagSideBarOfData"
21
21
  :style="{'height': pageHeight? pageHeight:'100%','width':sideBarWidth+'px',right:sideBarRight+'px'}"
22
22
  class="sidebar">
23
23
  <ct-Detail ref="detail" :api="sideBarApi" :apiParam="sideBarApiParam" :pageType="sideBarPageType"
@@ -209,6 +209,7 @@
209
209
  }
210
210
  }
211
211
  }
212
+ this.$emit('tableLoaded', this.$refs.table.model);
212
213
  },
213
214
  rowClickHandle() {
214
215
  var self = this;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div style="width:100%;" class="ct-searchtable" ref="searchTable">
2
+ <div style="width:100%;" class="ct-searchtable" ref="searchTable" :style="{'margin-top':isLayout?'0':'','padding':isLayout?'0':''}">
3
3
  <ct-tableStats ref="tableStats" class="ct-search-table-list-header"
4
4
  v-if="!isLoading&&searchStatsApi"
5
5
  :api="searchStatsApi"
@@ -16,7 +16,7 @@
16
16
  <div v-loading="operationLoading">
17
17
  </div>
18
18
  <div class="ct-tableParent" ref="tableParent" v-bind="model.attrs" v-if="!isLoading"
19
- :style="{'height':from=='form'?'100%':model.tableHeight+'px'}"
19
+ :style="{'height':from=='form'?'100%':model.tableHeight+'px','border-bottom':isLayout?'none':''}"
20
20
  @scroll="scrollHandle($event)" :v-focus="model.flagFocus"
21
21
  @keydown.up="rowKeyDownHandle($event,0)" @keydown.down="rowKeyDownHandle($event,1)"
22
22
  tabindex="-1">
@@ -134,7 +134,9 @@
134
134
  </table>
135
135
  </div>
136
136
  <div v-else>
137
- <ct-layout ref="CellLayout" :vmodel="model.source.content"></ct-layout>
137
+ <div v-for="(row,rowindex) in model.listData" :key="rowindex">
138
+ <ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex" :actionRouter="model.actionRouter"></ct-layout>
139
+ </div>
138
140
  </div>
139
141
  </div>
140
142
  <ct-tabletip ref="listFooter" class="ct-search-table-list-footer" :tip="model.listFooter" v-if="!isLoading&&!isLayout"></ct-tabletip>
@@ -545,11 +547,14 @@
545
547
  });
546
548
  }
547
549
  else {
548
- var h1 = document.body.offsetHeight | 0;
549
550
  if (this.$parent.$parent.$vnode.componentOptions.tag === 'ct-PropertySimpleDetailRET') {
551
+ var h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
550
552
  var h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
551
553
  var h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
552
- let tableHeight = h1 - h2-h3 - 300;
554
+ let tableHeight = h1 - h2 - h3 - 270;
555
+ if (h2 == 0) {
556
+ tableHeight = tableHeight + 15;
557
+ }
553
558
  this.model.tableHeight = tableHeight;
554
559
  this.$nextTick(() => {
555
560
  self.getScrollAttr();
@@ -33,7 +33,7 @@ const formData = {
33
33
  },
34
34
  //获取Field的属性attrKey的值
35
35
  getValueByFieldName(id, attrKey) {
36
- attrKey = this.common.initialsToUpperCase(attrKey);
36
+ attrKey = this.common.initialsToLowerCase(attrKey);
37
37
  var rtn1 = this.fieldsDic[id];
38
38
  if (rtn1) {
39
39
  return rtn1.source[attrKey];
@@ -41,7 +41,7 @@ const formData = {
41
41
  },
42
42
  //设置Field的属性attrKey的值
43
43
  setValueByFieldName(id, attrKey, attrValue) {
44
- attrKey = this.common.initialsToUpperCase(attrKey);
44
+ attrKey = this.common.initialsToLowerCase(attrKey);
45
45
  var rtn1 = this.fieldsDic[id];
46
46
  if (rtn1) {
47
47
  rtn1.source[attrKey] = attrValue;
@@ -151,7 +151,7 @@ const formData = {
151
151
 
152
152
  let data = this.getListField(tableName, rowNum, fiedlId);
153
153
 
154
- attrName = this.common.initialsToUpperCase(attrName);
154
+ attrName = this.common.initialsToLowerCase(attrName);
155
155
  attrName = attrName ? attrName : 'code1';
156
156
 
157
157
  if (!fiedlId) {
@@ -180,7 +180,7 @@ const formData = {
180
180
  tableName = tableName ? tableName : this.form.scripts.$fd;
181
181
  let data = this.getListField(tableName, rowNum, fiedlId);
182
182
 
183
- attrName = this.common.initialsToUpperCase(attrName);
183
+ attrName = this.common.initialsToLowerCase(attrName);
184
184
  attrName = attrName ? attrName : 'code1';
185
185
 
186
186
  if (!fiedlId) {
@@ -33,7 +33,7 @@ const ContactList = function (source,para ,callBack) {
33
33
  return false;
34
34
  },
35
35
  get primaryKey() {
36
- return common.initialsToUpperCase(data.content.primaryFieldName);
36
+ return common.initialsToLowerCase(data.content.primaryFieldName);
37
37
  },
38
38
  get primaryFieldMappingDBName() {
39
39
  return data.content.primaryFieldMappingDBName;
@@ -123,7 +123,7 @@ const ContactList = function (source,para ,callBack) {
123
123
  return v;
124
124
  },
125
125
  get id() {
126
- return common.initialsToUpperCase(v.fieldName);
126
+ return common.initialsToLowerCase(v.fieldName);
127
127
  },
128
128
  get name() {
129
129
  return v.displayName;
@@ -29,7 +29,7 @@ const ContactList = function (source,para ,callBack) {
29
29
  size: 'mini'
30
30
  },
31
31
  get primaryKey() {
32
- return common.initialsToUpperCase(source.content.primaryFieldName);
32
+ return common.initialsToLowerCase(source.content.primaryFieldName);
33
33
  },
34
34
  get primaryFieldMappingDBName() {
35
35
  return source.content.primaryFieldMappingDBName;
@@ -128,7 +128,7 @@ const ContactList = function (source,para ,callBack) {
128
128
  return v;
129
129
  },
130
130
  get id() {
131
- return common.initialsToUpperCase(v.fieldName);
131
+ return common.initialsToLowerCase(v.fieldName);
132
132
  },
133
133
  get name() {
134
134
  return v.displayName;
@@ -188,7 +188,7 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
188
188
  },
189
189
  //获取Field的属性attrKey的值
190
190
  getValueByFieldName(id, attrKey) {
191
- attrKey = this.common.initialsToUpperCase(attrKey);
191
+ attrKey = this.common.initialsToLowerCase(attrKey);
192
192
  var rtn1 = this.fieldsDic[id];
193
193
  if (rtn1) {
194
194
  return rtn1.source[attrKey];
@@ -196,7 +196,7 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
196
196
  },
197
197
  //设置Field的属性attrKey的值
198
198
  setValueByFieldName(id, attrKey, attrValue) {
199
- attrKey = this.common.initialsToUpperCase(attrKey);
199
+ attrKey = this.common.initialsToLowerCase(attrKey);
200
200
  var rtn1 = this.fieldsDic[id];
201
201
  if (rtn1) {
202
202
  rtn1.source[attrKey] = attrValue;
@@ -306,7 +306,7 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
306
306
 
307
307
  let data = this.getListField(tableName, rowNum, fiedlId);
308
308
 
309
- attrName = this.common.initialsToUpperCase(attrName);
309
+ attrName = this.common.initialsToLowerCase(attrName);
310
310
  attrName = attrName ? attrName : 'code1';
311
311
 
312
312
  if (!fiedlId) {
@@ -335,7 +335,7 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
335
335
  tableName = tableName ? tableName : this.form.scripts.$fd;
336
336
  let data = this.getListField(tableName, rowNum, fiedlId);
337
337
 
338
- attrName = this.common.initialsToUpperCase(attrName);
338
+ attrName = this.common.initialsToLowerCase(attrName);
339
339
  attrName = attrName ? attrName : 'code1';
340
340
 
341
341
  if (!fiedlId) {
@@ -118,6 +118,7 @@ const FormList = function (source, master) {
118
118
  source.rows.forEach((r) => {
119
119
  var row = rtn.initRow(r);
120
120
  this._rows.push(row);
121
+ rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
121
122
  });
122
123
  return this._rows;
123
124
  }
@@ -362,6 +363,7 @@ const FormList = function (source, master) {
362
363
  let iRow = this.initRow(sourceRow);
363
364
  iRow.isNewFlag = true;
364
365
  rtn._rows.push(iRow);
366
+ rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
365
367
  Vue.set(row, 'edit', iRow.edit);
366
368
  Vue.set(row, 'delete', iRow.delete);
367
369
  row.$sourceIndex = rtn._rows.length - 1;
@@ -405,6 +407,7 @@ const FormList = function (source, master) {
405
407
  if (!isRepeat) {
406
408
  source.rows.push(row);
407
409
  rtn.rows.push(rowItem);
410
+ rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
408
411
 
409
412
  rowData.$sourceIndex = source.rows.length - 1;
410
413
 
@@ -149,7 +149,7 @@ const Router = function (source) {
149
149
  return source.imgUrl;
150
150
  },
151
151
  get rightField() {
152
- return common.initialsToUpperCase(source.rightField);
152
+ return common.initialsToLowerCase(source.rightField);
153
153
  },
154
154
  get submitFormField() {
155
155
 
@@ -158,7 +158,7 @@ const Router = function (source) {
158
158
  }
159
159
  var submitArr = [];
160
160
  source.refFieldName.split(',').forEach(v => {
161
- submitArr.push(common.initialsToUpperCase(v));
161
+ submitArr.push(common.initialsToLowerCase(v));
162
162
  })
163
163
  return submitArr;
164
164
  },
@@ -168,7 +168,7 @@ const Router = function (source) {
168
168
  }
169
169
  var submitArr = [];
170
170
  source.refFieldName.split(',').forEach(v => {
171
- submitArr.push(common.initialsToUpperCase(v));
171
+ submitArr.push(common.initialsToLowerCase(v));
172
172
  })
173
173
  return submitArr;
174
174
  },
@@ -17,10 +17,10 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
17
17
  selectIndex: 0,
18
18
  selectAll: 0,
19
19
  get title() {
20
- return source.title;
20
+ return source.content.title;
21
21
  },
22
22
  set title(v) {
23
- source.title = v;
23
+ source.content.title = v;
24
24
  },
25
25
  get flagShowTitle() {
26
26
  let v = false;
@@ -58,7 +58,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
58
58
  return v;
59
59
  },
60
60
  get id() {
61
- return common.initialsToUpperCase(v.fieldName);
61
+ return common.initialsToLowerCase(v.fieldName);
62
62
  },
63
63
  get name() {
64
64
  return v.displayName;
@@ -656,7 +656,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
656
656
  return source.content.dataApi;
657
657
  },
658
658
  get primaryKey() {
659
- return common.initialsToUpperCase(source.content.primaryFieldName);
659
+ return common.initialsToLowerCase(source.content.primaryFieldName);
660
660
  },
661
661
  get primaryFieldMappingDBName() {
662
662
  return source.content.primaryFieldMappingDBName;
package/src/main.js CHANGED
@@ -14,7 +14,7 @@ Vue.config.productionTip = false;
14
14
  Vue.use(centaline, {
15
15
  // baseUrl: "http://10.88.22.13:7070/v1/form/router",
16
16
  baseUrl: "http://10.88.23.22:9999/v1/form/router",
17
- // baseUrl: "http://10.1.245.111:38028/api",
17
+ // baseUrl: "http://tjcptest.centaline.com.cn/",
18
18
  // flagRouterSelf: true,
19
19
  zindex: 999,
20
20
  showRequestErrorMessage: true,
@@ -36,10 +36,10 @@ Vue.use(centaline, {
36
36
  // 获取请求头
37
37
  getRequestHeaders: function () {
38
38
  return {
39
- oldToken: '6613f67c-ba83-4065-9570-175c2f74e6d5',
39
+ oldToken: 'c72af00a-da9a-430a-b986-2935092b42f6',
40
40
  originalRequestURL: 'http://10.88.22.67:8080',
41
41
  EstateInfo: ' {"estateId":"201703020943128D8A8FCF463E4016D6","estateName":"undefined"}',
42
- Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI2ZjYwZTBjLWFhYzEtNDgxYy1hYTBkLWMxNjZlNzdjOWZhYyJ9.56V1V4HOhrAdO58i-bg5XG5ZKSSJ-rN1trTEjs0lZCCID0CM8LLBswqrt4_wsbApIdT1QaTA4TtmWmlR3UvxXQ',
42
+ Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijk4NGM0ZjJlLTRhNTgtNDM4YS1iNjkxLWQyMTI4ZjdlYjNlMyJ9.nxO4kEXzIM2RJTXuX_AOoctKFvBiTZUEwHTu1YSFMn8JBjM9p-RK31ZB8ckJvlwgjiDGdbuGt1QOZRRP9KS3qQ',
43
43
  };
44
44
  },
45
45
  // 请求完成事件,可判断是否登录过期执行响应操作