centaline-data-driven 1.3.22 → 1.3.25
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/build/centaline/centaline.path.js +67 -60
- package/package.json +1 -1
- package/src/Form.vue +2 -2
- package/src/SearchList.vue +3 -3
- package/src/assets/sort.png +0 -0
- package/src/centaline/dynamicContact/src/dynamicContact.vue +282 -277
- package/src/centaline/dynamicDragSort/index.js +19 -0
- package/src/centaline/dynamicDragSort/src/dynamicDragSort.vue +197 -0
- package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +1 -1
- package/src/centaline/dynamicL/src/dynamicL.vue +1 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +1 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +3 -1
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +19 -29
- package/src/centaline/loader/src/ctl/Base.js +4 -2
- package/src/centaline/loader/src/ctl/DragSort.js +35 -0
- package/src/centaline/loader/src/ctl/SearchTable.js +3 -1
- package/src/centaline/loader/src/ctl/lib/Enum.js +14 -4
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +83 -84
- package/src/main.js +2 -2
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!--使用draggable组件-->
|
|
3
|
+
<div class="dragCol">
|
|
4
|
+
<div class="dragItem">
|
|
5
|
+
<el-checkbox id="all" v-model="checkAll" @change="handleAllChecked" class="checkbox-common">{{ controlLabel
|
|
6
|
+
}}
|
|
7
|
+
</el-checkbox>
|
|
8
|
+
<span class="svgIcon">
|
|
9
|
+
<!-- <svg-icon icon-class="sort" style="cursor: pointer"></svg-icon> -->
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
<draggable v-model="testList" :options="{ group: { name: 'itxst', pull: 'clone' }, sort: true }" animation="300"
|
|
13
|
+
:move="onMove" dragClass="dragClass" ghostClass="ghostClass" chosenClass="chosenClass"
|
|
14
|
+
@input="handleListChange($event)">
|
|
15
|
+
<transition-group>
|
|
16
|
+
<div class="dragItem canDragon" v-for="(item, index) in testList" :key="index">
|
|
17
|
+
<el-checkbox v-model="item.checked" :disabled="item.locked" name="checkItem"
|
|
18
|
+
@change="handleChecked(item, $event)" class="checkbox-common"> {{ item.displayName
|
|
19
|
+
}}</el-checkbox>
|
|
20
|
+
<span class="svgIcon">
|
|
21
|
+
<img :src="iconSort" alt="" width="100%" />
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
</transition-group>
|
|
25
|
+
</draggable>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
//导入draggable组件
|
|
31
|
+
import draggable from 'vuedraggable'
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
//注册draggable组件
|
|
35
|
+
name: 'ct-dragSort',
|
|
36
|
+
components: {
|
|
37
|
+
draggable,
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
vmodel: Object,
|
|
41
|
+
api: String,
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
iconSort: require("../../../assets/sort.png"),
|
|
46
|
+
drag: false,
|
|
47
|
+
checkAll: true,
|
|
48
|
+
controlLabel: '列名',
|
|
49
|
+
//定义要被拖拽对象的数组
|
|
50
|
+
testList: [],
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
watch: {
|
|
54
|
+
testList: { // 监听事件,监听复选框是否全部选中,全部选中则全选的复选框勾选上
|
|
55
|
+
handler(val) {
|
|
56
|
+
var i = 0
|
|
57
|
+
this.testList.forEach(item => {
|
|
58
|
+
if (item.checked === true) {
|
|
59
|
+
i++
|
|
60
|
+
}
|
|
61
|
+
if (i === this.testList.length) {
|
|
62
|
+
this.checkAll = true
|
|
63
|
+
} else {
|
|
64
|
+
this.checkAll = false
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
deep: true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
created() {
|
|
72
|
+
console.log('draglist', this.vmodel.dragList);
|
|
73
|
+
this.$nextTick(function () {
|
|
74
|
+
if (typeof this.vmodel === 'undefined') {
|
|
75
|
+
this.model = this.loaderObj.DragSort(this.source);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.model = this.vmodel;
|
|
79
|
+
this.testList = this.vmodel.dragList;
|
|
80
|
+
console.log('this.testList', this.testList);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
this.testList.forEach(item => { // 处理后端传过来的数据,如果没有可以判断是否勾选复选框的字段,则需给数据作处理,加上一个isChecked字段,判断复选框勾选
|
|
85
|
+
this.$set(item, 'checked', false) // 添加判断的字段
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
// 更新位置
|
|
90
|
+
handleListChange(event) {
|
|
91
|
+
console.log(event);
|
|
92
|
+
this.testList = event;
|
|
93
|
+
|
|
94
|
+
this.testList.forEach((item, i) => {
|
|
95
|
+
this.model.dragList.splice(i, 1, item)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
console.log('handleListChange-testList', this.testList);
|
|
99
|
+
console.log('this.model.code1', this.model.code1);
|
|
100
|
+
},
|
|
101
|
+
//move回调方法
|
|
102
|
+
onMove(e, originalEvent) {
|
|
103
|
+
},
|
|
104
|
+
//开始拖拽事件
|
|
105
|
+
onStart() {
|
|
106
|
+
this.drag = true;
|
|
107
|
+
},
|
|
108
|
+
//拖拽结束事件
|
|
109
|
+
onEnd() {
|
|
110
|
+
this.drag = false;
|
|
111
|
+
// this.handleListChange()
|
|
112
|
+
},
|
|
113
|
+
handleAllChecked(v) { // 实现全选,反选(点击会传递true或者false过来)
|
|
114
|
+
this.testList.map(item => {
|
|
115
|
+
if (!item.locked) {
|
|
116
|
+
item.checked = v
|
|
117
|
+
} else {
|
|
118
|
+
return false
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
this.vmodel.draglist = this.testList
|
|
122
|
+
console.log('this.vmodel.draglist', this.vmodel.dragList);
|
|
123
|
+
},
|
|
124
|
+
handleChecked(item, e) { // 单个选中
|
|
125
|
+
item.checked = e
|
|
126
|
+
console.log('this.testList', this.testList);
|
|
127
|
+
this.vmodel.draglist = this.testList
|
|
128
|
+
console.log('this.vmodel.draglist', this.vmodel.dragList);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
<style scoped>
|
|
134
|
+
/*定义要拖拽元素的样式*/
|
|
135
|
+
.ghostClass {
|
|
136
|
+
background-color: #fff !important;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.chosenClass {
|
|
140
|
+
background-color: #ccc !important;
|
|
141
|
+
opacity: 1 !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* 拖拽过程 */
|
|
145
|
+
.dragClass {
|
|
146
|
+
background-color: #fff !important;
|
|
147
|
+
opacity: 1 !important;
|
|
148
|
+
box-shadow: none !important;
|
|
149
|
+
outline: none !important;
|
|
150
|
+
background-image: none !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.dragCol {
|
|
154
|
+
width: 100%;
|
|
155
|
+
flex: 1;
|
|
156
|
+
border-radius: 5px;
|
|
157
|
+
float: left;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dragCol+.dragCol {
|
|
161
|
+
margin-left: 10px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.dragItem {
|
|
165
|
+
width: auto;
|
|
166
|
+
padding: 12px 10px;
|
|
167
|
+
margin: 0 -5px;
|
|
168
|
+
border-bottom: solid 1px #eee;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-flow: row nowrap;
|
|
171
|
+
justify-content: space-between;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.dragItem:hover {
|
|
175
|
+
background-color: #F5F7FA;
|
|
176
|
+
cursor: move;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.dragItem+.dragItem {
|
|
180
|
+
border-top: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
#all {
|
|
184
|
+
color: #909399;
|
|
185
|
+
font-weight: 700;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.svgIcon {
|
|
189
|
+
width: 16px;
|
|
190
|
+
text-align: center;
|
|
191
|
+
cursor: pointer
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* .checkbox-common>>>span.el-checkbox__label {
|
|
195
|
+
padding-left: 30px;
|
|
196
|
+
} */
|
|
197
|
+
</style>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
@input="inputHandler(model.currentRow.data[v.id], model.currentRow.data.$sourceIndex)"></component>
|
|
29
29
|
</span>
|
|
30
30
|
<span v-else-if="v.is=='ct-sensitiveeye'">
|
|
31
|
-
<component
|
|
31
|
+
<component ref="Fields" :is="v.is" :vmodel="scope.row[v.id]" :vrowmodel="scope.row" :api="model.OptApi"></component>
|
|
32
32
|
</span>
|
|
33
33
|
<!--可点击的列-->
|
|
34
34
|
<span v-else-if="v.router" :class="'cell'" style="display: flex;">
|
|
@@ -277,20 +277,20 @@ export default {
|
|
|
277
277
|
if (rtn) {
|
|
278
278
|
self.$forceUpdate();
|
|
279
279
|
self.$nextTick(() => {
|
|
280
|
-
if
|
|
281
|
-
self.$refs.tableParent.scrollHeight <=
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
self.calculatingRowHeight();
|
|
280
|
+
if(!self.isLayout){
|
|
281
|
+
if (self.$refs.tableParent.scrollHeight <= self.$refs.tableParent.offsetHeight) {
|
|
282
|
+
self.tableLoading = true;
|
|
283
|
+
self.model.nextPage(next);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
self.tableLoading = false;
|
|
287
|
+
self.rowColorChange();
|
|
288
|
+
self.calculatingRowHeight();
|
|
289
|
+
}
|
|
291
290
|
}
|
|
292
291
|
});
|
|
293
|
-
}
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
294
|
self.tableLoading = false;
|
|
295
295
|
}
|
|
296
296
|
};
|
|
@@ -569,34 +569,24 @@ export default {
|
|
|
569
569
|
setTableHeight() {
|
|
570
570
|
var self = this;
|
|
571
571
|
this.$nextTick(() => {
|
|
572
|
-
if (
|
|
573
|
-
this.$refs.searchTable
|
|
574
|
-
this.$refs.toolbar &&
|
|
575
|
-
this.$refs.searchTable.parentElement &&
|
|
576
|
-
!self.isLayout
|
|
577
|
-
) {
|
|
572
|
+
if (this.$refs.searchTable && this.$refs.toolbar &&
|
|
573
|
+
this.$refs.searchTable.parentElement &&!self.isLayout) {
|
|
578
574
|
var h1 = this.$refs.searchTable.parentElement.offsetHeight | 0;
|
|
579
575
|
var h2 = this.$refs.searchTable.offsetTop | 0;
|
|
580
576
|
var h3 = this.$refs.toolbar.$el.offsetHeight | 0;
|
|
581
577
|
var h4 = this.$refs.footer.$el.offsetHeight | 0;
|
|
582
578
|
var h5 = this.$refs.listHeader.$el.offsetHeight | 0;
|
|
583
579
|
var h6 = this.$refs.listFooter.$el.offsetHeight | 0;
|
|
584
|
-
var h7 = this.$refs.tableStats
|
|
585
|
-
? (this.$refs.tableStats.$el.offsetHeight + 7) | 0
|
|
586
|
-
: 0;
|
|
580
|
+
var h7 = this.$refs.tableStats ? (this.$refs.tableStats.$el.offsetHeight + 7) | 0: 0;
|
|
587
581
|
let tableHeight = h1 - h2 - h3 - h4 - h5 - h6 - h7 - 22;
|
|
588
582
|
this.model.tableHeight = tableHeight < 40 ? 350 : tableHeight;
|
|
589
583
|
this.$nextTick(() => {
|
|
590
584
|
self.getScrollAttr();
|
|
591
585
|
});
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
) {
|
|
597
|
-
var h1 =
|
|
598
|
-
this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight |
|
|
599
|
-
0;
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
if (this.$parent.$parent.$vnode.componentOptions.tag === "ct-PropertySimpleDetailRET") {
|
|
589
|
+
var h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
|
|
600
590
|
var h2 = 0;
|
|
601
591
|
if (this.$parent.$parent.$refs.contact) {
|
|
602
592
|
h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
|
|
@@ -59,7 +59,7 @@ const Base = function (source) {
|
|
|
59
59
|
source.code2 = v;
|
|
60
60
|
},
|
|
61
61
|
get labelValue() {
|
|
62
|
-
if (source.code1)
|
|
62
|
+
if (source.code1!=undefined && source.code1!=null)
|
|
63
63
|
return source.code1;
|
|
64
64
|
else
|
|
65
65
|
return '';
|
|
@@ -166,7 +166,9 @@ const Base = function (source) {
|
|
|
166
166
|
return bind;
|
|
167
167
|
},
|
|
168
168
|
reset() {
|
|
169
|
-
if(this.type!==Enum.ControlType.Hidden
|
|
169
|
+
if(this.type!==Enum.ControlType.Hidden
|
|
170
|
+
&& this.type!==Enum.ControlType.Label
|
|
171
|
+
&& this.type!==Enum.ControlType.MultiLineLabel){
|
|
170
172
|
this.value = this.defaultValue;
|
|
171
173
|
}
|
|
172
174
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import base from '../../index';
|
|
2
|
+
import Base from './Base';
|
|
3
|
+
import valid from '../../../validate/index';
|
|
4
|
+
const DragSort = function (source) {
|
|
5
|
+
var init = function (data) {
|
|
6
|
+
var rtn = {
|
|
7
|
+
get tableCol() {
|
|
8
|
+
let l = '';
|
|
9
|
+
if (source.controlLabel) {
|
|
10
|
+
l = source.controlLabel;
|
|
11
|
+
}
|
|
12
|
+
if (source.labelDelimiter) {
|
|
13
|
+
l = l + source.labelDelimiter;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return [{
|
|
17
|
+
prop: 'displayName',
|
|
18
|
+
label: l
|
|
19
|
+
}];
|
|
20
|
+
},
|
|
21
|
+
get dragList() {
|
|
22
|
+
return source.code1;
|
|
23
|
+
},
|
|
24
|
+
set dragList(v) {
|
|
25
|
+
source.code1 = v;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
rtn = base.copy(Base(source), rtn);
|
|
29
|
+
rtn = base.copy(rtn, valid.Init(rtn));
|
|
30
|
+
return rtn;
|
|
31
|
+
|
|
32
|
+
};
|
|
33
|
+
return init(source);
|
|
34
|
+
}
|
|
35
|
+
export default DragSort;
|
|
@@ -608,6 +608,9 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
608
608
|
for (var vkey in row) {
|
|
609
609
|
rtn.dataDictionary[row[rtn.primaryKey]][vkey] = row[vkey];
|
|
610
610
|
}
|
|
611
|
+
for (var vkey in rtn.dataDictionary[row[rtn.primaryKey]]) {
|
|
612
|
+
rtn.dataDictionary[row[rtn.primaryKey]][vkey] = row[vkey]||'';
|
|
613
|
+
}
|
|
611
614
|
});
|
|
612
615
|
if (rtn.cellLayout) {
|
|
613
616
|
rtn.$vue.$set(rtn.listData, rtn.selectIndex, rtn.dataDictionary[searchValue1]);
|
|
@@ -631,7 +634,6 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
631
634
|
}
|
|
632
635
|
})
|
|
633
636
|
.catch((error) => {
|
|
634
|
-
console.error(error);
|
|
635
637
|
if (typeof callback !== 'undefined') {
|
|
636
638
|
callback();
|
|
637
639
|
}
|
|
@@ -4,7 +4,7 @@ const Enum = {
|
|
|
4
4
|
//组件类型
|
|
5
5
|
ControlType: {
|
|
6
6
|
/// <summary>
|
|
7
|
-
///
|
|
7
|
+
/// 单行文本标签
|
|
8
8
|
/// </summary>
|
|
9
9
|
Label: 1,
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ const Enum = {
|
|
|
24
24
|
NumericTextBox: 4,
|
|
25
25
|
|
|
26
26
|
/// <summary>
|
|
27
|
-
///
|
|
27
|
+
/// 文本框+高级搜索
|
|
28
28
|
/// </summary>
|
|
29
29
|
TextBoxWithButton: 5,
|
|
30
30
|
|
|
@@ -38,7 +38,6 @@ const Enum = {
|
|
|
38
38
|
/// </summary>
|
|
39
39
|
EmailText: 7,
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
/// <summary>
|
|
43
42
|
/// 下拉框
|
|
44
43
|
/// </summary>
|
|
@@ -144,7 +143,6 @@ const Enum = {
|
|
|
144
143
|
/// </summary>
|
|
145
144
|
MultiSelectNoSearch: 28,
|
|
146
145
|
|
|
147
|
-
|
|
148
146
|
/// <summary>
|
|
149
147
|
/// 分组间的分隔线
|
|
150
148
|
/// </summary>
|
|
@@ -209,32 +207,44 @@ const Enum = {
|
|
|
209
207
|
/// 敏感数据小眼睛控件
|
|
210
208
|
/// </summary>
|
|
211
209
|
SensitiveEye: 41,
|
|
210
|
+
|
|
212
211
|
/// <summary>
|
|
213
212
|
/// 复选
|
|
214
213
|
/// </summary>
|
|
215
214
|
CheckBox: 43,
|
|
215
|
+
|
|
216
216
|
/*带标签的超链接列表*/
|
|
217
217
|
HyperlinkListWithLabel: 44,
|
|
218
|
+
|
|
218
219
|
/// <summary>
|
|
219
220
|
/// 图片选择
|
|
220
221
|
/// </summary>
|
|
221
222
|
PhotoSelect: 45,
|
|
223
|
+
|
|
222
224
|
/// <summary>
|
|
223
225
|
/// 年份-月份控件
|
|
224
226
|
/// </summary>
|
|
225
227
|
DateYearMonth: 46,
|
|
228
|
+
|
|
226
229
|
/// <summary>
|
|
227
230
|
/// 重复控件
|
|
228
231
|
/// </summary>
|
|
229
232
|
Repeat: 47,
|
|
233
|
+
|
|
230
234
|
/// <summary>
|
|
231
235
|
/// 复合控件
|
|
232
236
|
/// </summary>
|
|
233
237
|
Compound: 48,
|
|
238
|
+
|
|
234
239
|
/// <summary>
|
|
235
240
|
/// 表单
|
|
236
241
|
/// </summary>
|
|
237
242
|
From: 49,
|
|
243
|
+
/// <summary>
|
|
244
|
+
/// 列表的的自定义列
|
|
245
|
+
/// </summary>
|
|
246
|
+
CustomizeColumns: 50,
|
|
247
|
+
|
|
238
248
|
},
|
|
239
249
|
|
|
240
250
|
//返回状态码
|