centaline-data-driven 1.2.75 → 1.2.78

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.75",
3
+ "version": "1.2.78",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
package/src/Detail.vue CHANGED
@@ -10,7 +10,7 @@
10
10
  name: 'DataDrivendetail',
11
11
  data() {
12
12
  return {
13
- apiParam: {actionType: 1,chanceID: "3"} ,
13
+ apiParam: {actionType: 1,chanceID: "1"} ,
14
14
  }
15
15
  },
16
16
  mounted() {
package/src/Form.vue CHANGED
@@ -1,9 +1,8 @@
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> -->
4
3
  <!-- <ct-form :api="'/PropertyRET/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
5
4
  <!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
6
- <ct-form :api="'/api/third-dept-tran/transaction/detail'" :apiParam="apiParam"></ct-form>
5
+ <ct-form :api="'/api/third-dept-tran/second-hand-transaction/add-detail'" :apiParam="apiParam"></ct-form>
7
6
  <!--<ct-form :api="'api/Form/formdata'"></ct-form>-->
8
7
  <ct-dialog-list></ct-dialog-list>
9
8
  </div>
@@ -18,11 +17,12 @@
18
17
  // apiParam: {headerParam: {}, urlParam: {contractID: "06cad32e-4d0d-4b6f-bd24-16a28629a550", actionType: "0"}}
19
18
  // apiParam: {originalTraId: "1475658732246241281", actionType: 2, chanceID: "1"} ,
20
19
  // apiParam: {originalTraId: "1516290587463507969", actionType: "3", pageStyle: "2", pageTitle: "成交报告",pageOnly: "true"}
21
- apiParam:{actionType: "3",
22
- originalTraId: "1522961155108978690",
23
- pageOnly: "true",
24
- pageStyle: "2",
25
- pageTitle: "成交报告"}
20
+ apiParam:{actionType: 2,
21
+ externalPropertyId: "54802",
22
+ pageOnly: true,
23
+ pageStyle: 2,
24
+ propertyNo: "SHHKS000032362"
25
+ }
26
26
  }
27
27
  },
28
28
  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
@@ -53,7 +53,7 @@
53
53
  </el-button>
54
54
  <el-button v-else class="max"
55
55
  :type="model.isHyperLink ? 'text' : 'primary'"
56
- v-bind="model.attrs" @click="$emit('click',model)"
56
+ v-bind="model.attrs" @click="clickHandle"
57
57
  :style="{color:model.textColor,backgroundColor:model.imgUrl?'transparent':model.bgColor,borderColor:model.imgUrl?'transparent':model.borderColor,padding:model.imgUrl?'0px':null}"
58
58
  :icon="model.icon"
59
59
  :disabled="model.disabled || model.locked">
@@ -149,7 +149,7 @@
149
149
  }
150
150
  }
151
151
  else{
152
- this.$emit('click',this.model);
152
+ this.$emit('click',this.model,this.rowData,this.rowindex);
153
153
  }
154
154
  },
155
155
  callTelClick(data){
@@ -328,16 +328,7 @@
328
328
  }
329
329
 
330
330
  if (!submitData) {
331
- submitData = {};
332
- var tempFormData = self.model.getFormObj();
333
- if(field.flagAttachSearchCondition){
334
- submitData.jsonData=tempFormData;
335
- }
336
- else{
337
- field.submitFormField.forEach((v) => {
338
- submitData[v] = tempFormData[v];
339
- });
340
- }
331
+ submitData = self.getFileData(field);
341
332
  }
342
333
 
343
334
  if (field.isOpenForm) {
@@ -619,6 +610,7 @@
619
610
  return formData;
620
611
  },
621
612
  getFileData(field) {
613
+ var self=this;
622
614
  var submitData = {};
623
615
  var tempFormData = this.model.getFormObj();
624
616
  if(field.flagAttachSearchCondition){
@@ -627,7 +619,12 @@
627
619
  else{
628
620
  if(field.submitFormField){
629
621
  field.submitFormField.forEach((v) => {
630
- submitData[v] = tempFormData[v];
622
+ if(tempFormData[v]){
623
+ submitData[v] = tempFormData[v];
624
+ }
625
+ else{
626
+ submitData[v] = tempFormData[self.$common.initialsToUpperCase(v)];
627
+ }
631
628
  });
632
629
  }
633
630
  }
@@ -22,9 +22,10 @@
22
22
  </template>
23
23
  <template slot-scope="scope">
24
24
  <span v-if="scope.row.isSet">
25
- <component ref="Fields" :is="v.is" :vmodel="model.currentRow.data[v.id]" :api="model.OptApi"
26
- @change="changeHandler(model.currentRow.data[v.id], model.currentRow.data.$sourceIndex)"
27
- @input="inputHandler(model.currentRow.data[v.id], model.currentRow.data.$sourceIndex)"></component>
25
+ <component ref="Fields" :is="model.currentRow.data[v.id].locked || model.currentRow.data[v.id].is!==v.is?model.currentRow.data[v.id].is:v.is"
26
+ :vmodel="model.currentRow.data[v.id]" :api="model.OptApi"
27
+ @change="changeHandler(model.currentRow.data[v.id], model.currentRow.data.$sourceIndex)"
28
+ @input="inputHandler(model.currentRow.data[v.id], model.currentRow.data.$sourceIndex)"></component>
28
29
  </span>
29
30
  <span v-else-if="v.is=='ct-sensitiveeye'">
30
31
  <component v-if ref="Fields" :is="v.is" :vmodel="scope.row[v.id]" :vrowmodel="scope.row" :api="model.OptApi"></component>
@@ -308,7 +309,8 @@
308
309
  const value = Number(curr);
309
310
  if (!isNaN(value)) {
310
311
  return Number(prev + curr);
311
- } else {
312
+ }
313
+ else {
312
314
  return Number(prev);
313
315
  }
314
316
  }, 0);
@@ -316,7 +318,8 @@
316
318
  if (data[0][column.property].decimals && data[0][column.property].decimals > 0) {
317
319
  sums[index] = sums[index].toFixed(data[0][column.property].decimals);
318
320
  }
319
- } else {
321
+ }
322
+ else {
320
323
  sums[index] = 'N/A';
321
324
  }
322
325
  }
@@ -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;
@@ -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,8 +547,8 @@
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
554
  let tableHeight = h1 - h2 - h3 - 270;
@@ -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) {
@@ -148,6 +148,9 @@ const Base = function (source) {
148
148
  get lock() {
149
149
  return source.locked;
150
150
  },
151
+ get locked() {
152
+ return source.locked;
153
+ },
151
154
  set locked(v) {
152
155
  source.locked = v;
153
156
  },
@@ -275,6 +278,9 @@ const Base = function (source) {
275
278
  get singleLine() {
276
279
  return source.singleLine;
277
280
  },
281
+ get decimals() {
282
+ return source.decimals1;
283
+ },
278
284
  };
279
285
 
280
286
  return rtn;
@@ -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) {
@@ -19,9 +19,6 @@ const box = function (source, callBack) {
19
19
  },
20
20
  set clearable(v) {
21
21
  source.clear = v;
22
- },
23
- get decimals() {
24
- return data.decimals1;
25
22
  },
26
23
  get value() {
27
24
  return source.code1;
@@ -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
@@ -12,10 +12,10 @@ Vue.use(ElementUI, { size: 'mini'});
12
12
  // 关闭生产模式下给出的提示
13
13
  Vue.config.productionTip = false;
14
14
  Vue.use(centaline, {
15
- // baseUrl: "http://10.88.22.13:7070/v1/form/router",
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://tjcptest.centaline.com.cn/",
18
- flagRouterSelf: true,
17
+ // baseUrl: "http://10.88.22.69:8080/",
18
+ // flagRouterSelf: true,
19
19
  zindex: 999,
20
20
  showRequestErrorMessage: true,
21
21
  handler: {
@@ -36,10 +36,10 @@ Vue.use(centaline, {
36
36
  // 获取请求头
37
37
  getRequestHeaders: function () {
38
38
  return {
39
- oldToken: 'c72af00a-da9a-430a-b986-2935092b42f6',
39
+ oldToken: '89a43c8a-df03-44b9-a234-8ba34b21b671',
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
  // 请求完成事件,可判断是否登录过期执行响应操作