centaline-data-driven 1.1.62 → 1.1.66

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.
Files changed (30) hide show
  1. package/build/centaline/centaline.path.js +1 -0
  2. package/package.json +1 -1
  3. package/src/Form.vue +1 -1
  4. package/src/SearchList.vue +8 -0
  5. package/src/SearchTree.vue +1 -1
  6. package/src/assets/vertical.png +0 -0
  7. package/src/centaline/css/common.css +6 -5
  8. package/src/centaline/css/max.css +22 -0
  9. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +25 -9
  10. package/src/centaline/dynamicForm/src/dynamicForm.vue +12 -4
  11. package/src/centaline/dynamicHyperLinkList/index.js +11 -0
  12. package/src/centaline/dynamicHyperLinkList/src/dynamicHyperLinkList.vue +58 -0
  13. package/src/centaline/dynamicL/src/dynamicL.vue +1 -1
  14. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +5 -2
  15. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +46 -16
  16. package/src/centaline/dynamicSearchList/src/dynamicTableStats.vue +193 -0
  17. package/src/centaline/dynamicSearchList/src/dynamicTableToolbar.vue +1 -1
  18. package/src/centaline/dynamicT/src/dynamicT.vue +1 -1
  19. package/src/centaline/dynamicTree/src/dynamicTreeList.vue +4 -3
  20. package/src/centaline/loader/src/ctl/Detail.js +19 -40
  21. package/src/centaline/loader/src/ctl/HyperLinkList.js +69 -0
  22. package/src/centaline/loader/src/ctl/SearchScreen.js +80 -2
  23. package/src/centaline/loader/src/ctl/SearchStats.js +133 -0
  24. package/src/centaline/loader/src/ctl/SearchTable.js +28 -19
  25. package/src/centaline/loader/src/ctl/lib/Enum.js +2 -0
  26. package/src/centaline/loader/src/ctl/lib/LibFunction.js +5 -0
  27. package/src/centaline/loader/src/ctl.js +2 -0
  28. package/wwwroot/static/centaline/centaline-data-driven.js +1 -1
  29. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
  30. package/src/centaline/dynamicSearchList/src/dynamicTableStatistics.vue +0 -41
@@ -0,0 +1,193 @@
1
+ <template>
2
+ <div class="ct-table-Statistics" ref="tableStatistics">
3
+
4
+ <!--计算占用宽度-->
5
+ <div style="position:relative" v-if="FlagStatistics">
6
+ <div style="position:absolute;left:-10000px" class="tab-list">
7
+ <label v-for="(item, index) in data" class="btnTab" :class="[selectStats==item.code1?'active':'']" :ref="'StatisticsItem'+index">{{item.controlLabel}}</label>111
8
+ </div>
9
+ </div>
10
+ <!--展示-->
11
+ <div v-if="FlagStatistics" class="tab-list">
12
+ <template v-if="showData.length===1">
13
+ <label class="btnTab" v-for="(item, index) in showData[0]" :class="[selectStats==item.code1?'active':'']" @click="handleClick($event,item)">{{item.controlLabel}}</label>
14
+ </template>
15
+ <template v-else-if="showData.length>1">
16
+ <label class="btnTab" v-for="(item, index) in showData[0]" :class="[selectStats==item.code1?'active':'']" @click="handleClick($event,item)">{{item.controlLabel}}</label>
17
+ <el-popover :append-to-table="option.appendId?option.appendId:''"
18
+ :placement="option.placement?option.placement:'left'"
19
+ :trigger="option.trigger?option.trigger:''"
20
+ class="tabl-el">
21
+ <label class="tablf" v-for="(item, index) in showData[1]" :class="[selectStats==item.code1?'active':'']" @click="handleClick($event,item)">{{item.controlLabel}}</label>
22
+ <i slot="reference" class="icon-more"></i>
23
+
24
+ </el-popover>
25
+ </template>
26
+ </div>
27
+ </div>
28
+ </template>
29
+ <script>
30
+ import dynamicElement from '../../mixins/dynamicElement';
31
+
32
+ export default {
33
+ name: 'ct-tableStatistics',
34
+ mixins: [dynamicElement],
35
+ props: {
36
+ api: String,
37
+ searchModel: Object,
38
+ },
39
+ data() {
40
+ return {
41
+ FlagStatistics: false,
42
+ showWidth: 0,
43
+ selectStats: [],
44
+ data: [],
45
+ showData: [],
46
+ option: {
47
+ isHidden: true,//是否开启操作栏隐藏设置,默认开启
48
+ showNum: 3,//如果isHidden为true时,个数大于3就会隐藏,默认是3
49
+ appendId: '.s-table',//将浮动栏添加到对应id或者class节点中。或者.xxx。传空字符串是添加到body中。
50
+ trigger: 'hover',//触发方式,传值可查看Popper UI组件trigger属性
51
+ placement: 'bottom-start'//方向,传值可查看Popper UI组件placement属性
52
+ },
53
+ }
54
+ },
55
+ mounted() {
56
+ var self = this;
57
+ self.showWidth = self.$refs.tableStatistics.offsetWidth || document.body.clientWidth;
58
+ window.onresize = () => {
59
+ self.showWidth = self.$refs.tableStatistics.offsetWidth || document.body.clientWidth;
60
+ };
61
+ },
62
+ methods: {
63
+ load(data) {
64
+ var self = this;
65
+ self.model = data;
66
+ self.FlagStatistics = false;
67
+ self.data = data.source.content;
68
+ self.selectVa = "";
69
+ if (self.data.length > 0) {
70
+ if (self.selectStats == []) {
71
+ debugger
72
+ self.selectStats = self.data[0].code1;
73
+ }
74
+ self.FlagStatistics = true;
75
+ self.showStats();
76
+ }
77
+ },
78
+ showStats() {
79
+ var self = this;
80
+ this.$nextTick(function () {
81
+ if (self.data.length > 0) {
82
+ var showIndex = 0;
83
+ var sumWidth = 0;
84
+ for (var i = 0; i < self.data.length; i++) {
85
+ var moreWidth = 20;
86
+ sumWidth = sumWidth + self.$refs["StatisticsItem" + i][0].offsetWidth;
87
+ var nextWidth = 0;
88
+ if (i + 1 < self.data.length) {
89
+ try {
90
+ nextWidth = self.$refs["StatisticsItem" + (i + 1)][0].offsetWidth;
91
+ } catch (e) {
92
+
93
+ }
94
+ }
95
+ else {
96
+ moreWidth = 0;
97
+ }
98
+ if (self.showWidth < (sumWidth + moreWidth)) {
99
+ showIndex = i;
100
+ break;
101
+ }
102
+ else if (self.showWidth < (nextWidth + moreWidth)) {
103
+ showIndex = i + 1;
104
+ break;
105
+ }
106
+ }
107
+ if (showIndex > 0) {
108
+ self.showData = [self.data.slice(0, showIndex), self.data.slice(showIndex)];
109
+ } else {
110
+ self.showData = [self.data];
111
+ }
112
+
113
+ }
114
+ });
115
+ },
116
+ handleClick(ev, obj) {
117
+ var self = this;
118
+ self.selectStats = obj.code1;
119
+ var fields = self.model.searchData(obj.fieldName1, obj.code1, obj.controlType, obj.searchDataType);
120
+ var model = {
121
+ "searchData": fields
122
+ };
123
+ self.$emit('searchStats', model);
124
+ },
125
+ searchStatsComplate(selectItem) {
126
+ var self = this;
127
+ this.$nextTick(function () {
128
+ if (typeof self.api !== 'undefined') {
129
+ self.loaderObj.SearchStats(self.api, self.load, this.searchModel);
130
+ }
131
+ if (typeof self.source !== 'undefined') {
132
+ self.load(self.loaderObj.SearchStats(self.source));
133
+ }
134
+ if (self.vmodel) {
135
+ self.load(self.vmodel);
136
+ }
137
+ });
138
+ }
139
+ },
140
+ watch: {
141
+ showWidth: function (newVal, oldVal) {
142
+ this.showStats();
143
+ }
144
+ }
145
+ }
146
+ </script>
147
+ <style>
148
+ </style>
149
+
150
+ <style>
151
+
152
+ .tab-list {
153
+ height: 30px;
154
+ border-bottom: 1px solid #E0E0E0;
155
+ margin-bottom: 10px;
156
+ }
157
+
158
+ .btnTab {
159
+ font-size: 14px !important;
160
+ font-weight: bold;
161
+ padding: 5px 20px;
162
+ }
163
+
164
+ .btnTab:hover ,.tablf:hover{
165
+ color: #ee5d56;
166
+ }
167
+ .tabl-el{
168
+ max-width: 150px;
169
+ box-shadow: 0 6px 12px rgb(0 0 0 / 18%);
170
+ }
171
+ .tablf{
172
+ font-size: 14px !important;
173
+ font-weight: bold;
174
+ text-align: center;
175
+ padding: 5px 10px;
176
+ display: block;
177
+ }
178
+ .active {
179
+ color: #ee5d56 !important;
180
+ border-bottom: solid 3px #ee5d56 !important;
181
+ background: none;
182
+ border-radius: 0 !important;
183
+ }
184
+
185
+ .icon-more {
186
+ background: url(../../../assets/vertical.png)no-repeat;
187
+ background-size: 80% 80%;
188
+ height: 20px;
189
+ width: 7px;
190
+ display: inline-block;
191
+ vertical-align: bottom;
192
+ }
193
+ </style>
@@ -44,7 +44,7 @@
44
44
  width:100%;
45
45
  position:relative;
46
46
  float:left;
47
- padding:0 5px 10px 15px;
47
+ padding:0 5px 10px 0px;
48
48
  background-color:#fff;
49
49
  border-radius: 6px;
50
50
  }
@@ -11,7 +11,7 @@
11
11
  @keyup.enter.native="search()">
12
12
  <span slot="suffix" v-if="model.unitName" class="ct-unitname">{{model.unitName}}</span>
13
13
 
14
- <span slot="suffix" class="el-input__suffix el-input--mini" v-if="showClear" :class="model.unitName?'ct-right-10':'ct-right-0'">
14
+ <span slot="suffix" class="el-input__suffix el-input--mini" v-if="!model.isPassword&&showClear" :class="model.unitName?'ct-right-10':'ct-right-0'">
15
15
  <span class="el-input__suffix-inner ct-close">
16
16
  <i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
17
17
  </span>
@@ -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="15%" style="background-color:white">
4
+ <el-aside :width="leftWidth?leftWidth+'px':'15%'" style="background-color:white">
5
5
  <ct-searchtree :flagsearch="true" :searchConditionApi="searchConditionApi" :searchDataApi="searchDataApi" @loaded="loaded"></ct-searchtree>
6
6
  </el-aside>
7
7
  <el-main v-if="isShowSearchlist">
@@ -27,7 +27,8 @@
27
27
  props: {
28
28
  vmodel: Object,
29
29
  searchConditionApi: String,
30
- searchDataApi: String
30
+ searchDataApi: String,
31
+ leftWidth: Number,
31
32
  },
32
33
  data() {
33
34
  return {
@@ -69,6 +70,6 @@
69
70
  }
70
71
 
71
72
  #app-Tree .el-main .ct-table-content {
72
- padding: 0 0 0 15px;
73
+ padding: 0;
73
74
  }
74
75
  </style>
@@ -20,9 +20,6 @@ const Detail = function (source,para ,callBack) {
20
20
  _searchConditionApiTags1:null,
21
21
  _searchDataApiTags1:null,
22
22
  _paramDataTags1:null,
23
- _searchConditionApiTags2:null,
24
- _searchDataApiTags2:null,
25
- _paramDataTags2:null,
26
23
  get fields1() {
27
24
  return data.fields1;
28
25
  },
@@ -213,43 +210,25 @@ const Detail = function (source,para ,callBack) {
213
210
  get tags2() {
214
211
  return data.tags2;
215
212
  },
216
- get searchConditionApiTags2() {
217
- if (rtn._searchConditionApiTags2 !==null){
218
- return rtn._searchConditionApiTags2;
219
- }
220
- else if(rtn.tags2 && rtn.tags2.length>0){
221
- rtn._searchConditionApiTags2= rtn.tags2[0].searchConditionApiUrl;
222
- return rtn._searchConditionApiTags2;
223
- }
224
- },
225
- set searchConditionApiTags2(v) {
226
- rtn._searchConditionApiTags2 = v;
227
- },
228
- get searchDataApiTags2() {
229
- if (rtn._searchDataApiTags2 !==null){
230
- return rtn._searchDataApiTags2;
231
- }
232
- else if(rtn.tags2 && rtn.tags2.length>0){
233
- rtn._searchDataApiTags2= rtn.tags2[0].searchDataApiUrl;
234
- return rtn._searchDataApiTags2;
235
- }
236
- },
237
- set searchDataApiTags2(v) {
238
- rtn._searchDataApiTags2 = v;
239
- },
240
- get paramDataTags2() {
241
- if (rtn._paramDataTags2){
242
- return rtn._paramDataTags2;
243
- }
244
- else if(rtn.tags2 && rtn.tags2.length>0){
245
- rtn._paramDataTags2= JSON.parse(rtn.tags2[0].paramData);
246
- return rtn._paramDataTags2;
247
- }
248
- },
249
- set paramDataTags2(v) {
250
- rtn._paramDataTags2={};
251
- if(v)rtn._paramDataTags2 = JSON.parse(v);
252
- },
213
+ set tags2(v) {
214
+ data.tags2=v;
215
+ },
216
+ getTags2List(i){
217
+ if(rtn.tags2 && rtn.tags2[i] && !rtn.tags2[i].list && rtn.tags2[i].searchDataApiUrl){
218
+ let action =rtn.tags2[i].searchDataApiUrl;
219
+ let para={};
220
+ if(rtn.tags2[i].paramData)para = JSON.parse(rtn.tags2[i].paramData);
221
+ Vue.prototype.$api.postHandler(common.globalUri(), { action: action,para:para}).then(
222
+ function (response) {
223
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
224
+ rtn.tags2[i].list=response.content;
225
+ rtn.tags2[i].appID=rtn.tags2[i].appID+'1';
226
+ rtn.tags2[i].key='1';
227
+ }
228
+ }
229
+ );
230
+ }
231
+ }
253
232
  };
254
233
  return rtn;
255
234
  }
@@ -0,0 +1,69 @@
1
+ import base from '../../index';
2
+ import Base from './Base';
3
+
4
+ const HyperLinkList = function (source) {
5
+ var rtn = {
6
+ disabled: false,
7
+ loading: false,
8
+ get api() {
9
+ return source.api;
10
+ },
11
+ get label() {
12
+ return source.controlLabel || '';
13
+ },
14
+ set label(v) {
15
+ source.controlLabel = v;
16
+ },
17
+ get isSubmitDataFromSelf() {
18
+ return true;
19
+ },
20
+ _list: null,
21
+ get list() {
22
+ if (rtn._list !== null) {
23
+ return rtn._list;
24
+ }
25
+ else {
26
+ rtn._list = [];
27
+ if (source.code1) {
28
+ let codeList=JSON.parse(source.code1);
29
+ codeList.forEach((f) => {
30
+ if(!f.flagDeleted){
31
+ let col = {
32
+ get code() {
33
+ return f.code;
34
+ },
35
+ get name() {
36
+ return f.name;
37
+ },
38
+ get isHyperLink() {
39
+ return true;
40
+ },
41
+ attrs: {
42
+ get placeholder() {
43
+ return f.placeholder1 || '';
44
+ },
45
+ get style() {
46
+ return f.style;
47
+ },
48
+ get size() {
49
+ return "mini";
50
+ },
51
+ get class() {
52
+ var size = f.size ? f.size : "mini";
53
+ f.className=f.className||'ct-font-size-' + size;
54
+ return f.className;
55
+ }
56
+ },
57
+ }
58
+ rtn._list.push(col);
59
+ }
60
+ });
61
+ }
62
+ return rtn._list;
63
+ }
64
+ },
65
+ };
66
+ rtn = base.copy(Base(source), rtn);
67
+ return rtn;
68
+ }
69
+ export default HyperLinkList;
@@ -130,24 +130,102 @@ const SearchScreen = function (source, callBack, screenPara) {
130
130
  btn.disabled = loading;
131
131
  });
132
132
  },
133
+ //如果是复选框则searchValue1格式为 1,2
133
134
  get searchData() {
135
+
136
+ let that=this;
134
137
  var rtn = {
135
138
  fields: []
136
139
  };
137
140
  this.screen.forEach((v) => {
138
- var tempObj = v.searchObj;
141
+ var tempObj = common.deepClone(v.searchObj);
139
142
  if ((tempObj.searchValue1 && tempObj.searchValue1 !== '') || (tempObj.searchValue2 && tempObj.searchValue2 !== '')) {
143
+ if(that.isHandle(v.type))
144
+ {
145
+ tempObj.searchValue1=that.getNewSearchValue(tempObj);
146
+ }
140
147
  rtn.fields.push(tempObj);
148
+
141
149
  }
142
150
  });
143
151
  this.highScreen.forEach((v) => {
144
- var tempObj = v.searchObj;
152
+ var tempObj = common.deepClone(v.searchObj);
145
153
  if ((tempObj.searchValue1 && tempObj.searchValue1 !== '') || (tempObj.searchValue2 && tempObj.searchValue2 !== '')) {
154
+ if(that.isHandle(v.type))
155
+ {
156
+ tempObj.searchValue1=that.getNewSearchValue(tempObj);
157
+ }
146
158
  rtn.fields.push(tempObj);
147
159
  }
148
160
  });
149
161
  return rtn;
150
162
  },
163
+ getNewSearchValue(tempObj)
164
+ {
165
+ let codeList=JSON.parse(tempObj.searchValue1);
166
+ let dataType=this.getDataType(tempObj.searchDataType);
167
+ let code='';
168
+ let symbol=',';
169
+ if(dataType==1)
170
+ {
171
+ codeList.forEach((v) => {
172
+ if(!v.flagDeleted&&v.code)
173
+ {
174
+ code+= `'${v.code}'${symbol}`;
175
+ }
176
+ });
177
+ }else
178
+ {
179
+ codeList.forEach((v) => {
180
+ if(!v.flagDeleted&&v.code)
181
+ {
182
+ code+= `${v.code}${symbol}`;
183
+ }
184
+ });
185
+ }
186
+ if(code.endsWith(`${symbol}`))
187
+ {
188
+ code=code.substring(0,code.length-1);
189
+ }
190
+ return code;
191
+ },
192
+ //判断控件是否需要单独处理searchValue1
193
+ isHandle(type)
194
+ {
195
+ let result=false;
196
+ switch (type)
197
+ {
198
+ case Enum.ControlType.CheckBoxList://复选列表
199
+ result=true;
200
+ break;
201
+ default:
202
+ result=false;
203
+ break;
204
+ }
205
+ return result;
206
+ },
207
+ // 1 是字符串 2是数字
208
+ getDataType(searchDataType)
209
+ {
210
+ let dataType=1;
211
+ switch(searchDataType)
212
+ {
213
+ case 2:
214
+ case 6:
215
+ dataType=2;
216
+ break;
217
+ case 1:
218
+ case 3:
219
+ case 4:
220
+ case 5:
221
+ dataType=1;
222
+ break;
223
+ default:
224
+ dataType=1;
225
+ break;
226
+ }
227
+ return dataType;
228
+ },
151
229
  initScreen(screens) {
152
230
  var rtnscreens = [];
153
231
 
@@ -0,0 +1,133 @@
1
+ import common from '../../../common';
2
+ import Router from './Router';
3
+ import Vue from 'vue';
4
+ import Enum from './lib/Enum';
5
+ const SearchStats = function (source, callBack, searchModel, defaultSearchData) {
6
+ var init = function (source) {
7
+ var rtn = {
8
+ searchModel: searchModel,
9
+ tableHeight: 350,
10
+ defaultSearchData: defaultSearchData,
11
+ $vue: null,
12
+ get source() {
13
+ return source;
14
+ },
15
+ set source(v) {
16
+ source = v;
17
+ },
18
+ _rowSelectRouter: null,
19
+ get rowSelectRouter() {
20
+ if (rtn._rowSelectRouter !== null) {
21
+ return rtn._rowSelectRouter;
22
+ }
23
+ else {
24
+ rtn._rowSelectRouter = [];
25
+ if (source.content.rowSelectRouter) {
26
+ var router = Router(source.content.rowSelectRouter);
27
+ rtn._rowSelectRouter = router;
28
+ }
29
+ return rtn._rowSelectRouter;
30
+ }
31
+ },
32
+ _actionRouter: null,
33
+ get actionRouter() {
34
+ if (rtn._actionRouter !== null) {
35
+ return rtn._actionRouter;
36
+ }
37
+ else {
38
+ rtn._actionRouter = [];
39
+ if (source.content.actionRouters) {
40
+ source.content.actionRouters.forEach((v) => {
41
+ var router = Router(v);
42
+ //router.is = "ct-btn";
43
+ //router.attrs = { size: "mini" }
44
+ rtn._actionRouter.push(router);
45
+ });
46
+ }
47
+ return rtn._actionRouter;
48
+ }
49
+ },
50
+ _rowRouter: null,
51
+ get rowRouter() {
52
+ if (rtn._rowRouter !== null) {
53
+ return rtn._rowRouter;
54
+ }
55
+ else {
56
+ rtn._rowRouter = [];
57
+ if (rtn.actionRouter) {
58
+ rtn.actionRouter.forEach((v) => {
59
+ if (v.show) {
60
+ rtn._rowRouter.push(v);
61
+ }
62
+ });
63
+ }
64
+ return rtn._rowRouter;
65
+ }
66
+ },
67
+ searchData(fieldName1, val, operation, searchDataType) {
68
+ var rtn = {
69
+ fields: []
70
+ };
71
+ rtn.fields.push({
72
+ "fieldName1": fieldName1,
73
+ "groupName": fieldName1,
74
+ "operation": operation || 0,
75
+ "searchDataType": searchDataType || 3,
76
+ "searchValue1": val
77
+ });
78
+
79
+
80
+
81
+ return rtn;
82
+ },
83
+ doAction(api, searchModel, callback) {
84
+ var self = this;
85
+ var para = searchModel ? searchModel : {};
86
+ Vue.prototype.$api.postHandler(common.globalUri(), {
87
+ action: api,
88
+ para: para
89
+ })
90
+ .then(function (response) {
91
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
92
+ if (typeof callback !== 'undefined') {
93
+ callback(response.content);
94
+ }
95
+ }
96
+ })
97
+ .catch((error) => {
98
+ console.error(error);
99
+ if (typeof callback !== 'undefined') {
100
+ callback();
101
+ }
102
+ });
103
+ },
104
+ };
105
+ return rtn;
106
+ };
107
+ if (typeof source === 'string') {
108
+ var apiData = searchModel ? searchModel.searchData : {};
109
+ Vue.prototype.$api.postHandler(common.globalUri(),
110
+ {
111
+ action: source,
112
+ para:
113
+ {
114
+ searchFields: apiData,
115
+ pageAttribute: { pageIndex: 1 },
116
+ flagSearch: true
117
+ }
118
+ }).then(
119
+ function (response) {
120
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
121
+ var rtn = init(response);
122
+ if (callBack) {
123
+ callBack(rtn);
124
+ }
125
+ }
126
+ }
127
+ );
128
+ }
129
+ else {
130
+ return init(source);
131
+ }
132
+ };
133
+ export default SearchStats;