centaline-data-driven 1.3.28 → 1.3.31
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 +1 -1
- package/src/Form.vue +4 -4
- package/src/SearchList.vue +8 -9
- package/src/centaline/dynamicForm/src/dynamicForm.vue +22 -4
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +280 -226
- package/src/centaline/dynamicSearchList/src/dynamicTableToolbar.vue +76 -41
- package/src/centaline/dynamicT/src/dynamicT.vue +6 -3
- package/src/centaline/loader/src/ctl/Form.js +20 -13
- package/src/centaline/loader/src/ctl/Router.js +10 -2
- package/src/centaline/loader/src/ctl/SearchTable.js +104 -108
- package/src/main.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ct-tableToolbar" style="width:100%;" v-if="buttons && buttons.length > 0">
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
<div v-if="buttonsLeft&&buttonsLeft.length>0" class="bool_btn_l">
|
|
5
|
+
<ul>
|
|
6
|
+
<li v-for="btn in buttonsLeft" class="ct-ToolbarButton max-ToolbarButton" :class="{btn_r:btn.isRight}">
|
|
5
7
|
<component :is="btn.is" :vmodel="btn"
|
|
6
8
|
@click="clickHandler(btn,$event)"
|
|
7
9
|
@importComplete="importComplete"
|
|
@@ -9,53 +11,86 @@
|
|
|
9
11
|
:optionApi="optionApi"
|
|
10
12
|
:fileData="getFileData(btn)"></component>
|
|
11
13
|
</li>
|
|
12
|
-
|
|
14
|
+
</ul>
|
|
15
|
+
</div>
|
|
16
|
+
<div v-if="buttonsright&&buttonsright.length>0" class="bool_btn_r">
|
|
17
|
+
<ul>
|
|
18
|
+
<li v-for="btn in buttonsright" class="ct-ToolbarButton max-ToolbarButton" :class="{btn_r:btn.isRight}">
|
|
19
|
+
<component :is="btn.is" :vmodel="btn"
|
|
20
|
+
@click="clickHandler(btn,$event)"
|
|
21
|
+
@importComplete="importComplete"
|
|
22
|
+
v-if="btn.show"
|
|
23
|
+
:optionApi="optionApi"
|
|
24
|
+
:fileData="getFileData(btn)"></component>
|
|
25
|
+
</li>
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
|
|
13
30
|
</div>
|
|
14
31
|
</template>
|
|
15
32
|
<script>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
export default {
|
|
34
|
+
name: "ctTableToolbar",
|
|
35
|
+
props: {
|
|
36
|
+
buttons: Array,
|
|
37
|
+
searchModel: Object,
|
|
38
|
+
optionApi: String
|
|
39
|
+
},
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
buttonsLeft: [],
|
|
43
|
+
buttonsright: []
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
created() {
|
|
47
|
+
this.buttons.forEach(v => {
|
|
48
|
+
if (v.isRight) {
|
|
49
|
+
this.buttonsright.push(v);
|
|
50
|
+
} else {
|
|
51
|
+
this.buttonsLeft.push(v);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
clickHandler(btn, ev) {
|
|
57
|
+
this.$emit("click", btn);
|
|
25
58
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.$emit('click', btn);
|
|
29
|
-
},
|
|
30
|
-
getFileData(btn) {
|
|
31
|
-
if (btn.flagAttachSearchCondition) {
|
|
32
|
-
return this.searchModel ? this.searchModel.searchData : {};
|
|
33
|
-
}
|
|
59
|
+
getFileData(btn) {
|
|
60
|
+
if (btn.flagAttachSearchCondition) {
|
|
34
61
|
return this.searchModel ? this.searchModel.searchData : {};
|
|
35
|
-
},
|
|
36
|
-
importComplete(res) {
|
|
37
|
-
this.$emit('importComplete', res);
|
|
38
62
|
}
|
|
63
|
+
return this.searchModel ? this.searchModel.searchData : {};
|
|
64
|
+
},
|
|
65
|
+
importComplete(res) {
|
|
66
|
+
this.$emit("importComplete", res);
|
|
39
67
|
}
|
|
40
68
|
}
|
|
69
|
+
};
|
|
41
70
|
</script>
|
|
42
71
|
<style>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
.ct-tableToolbar {
|
|
73
|
+
width: 100%;
|
|
74
|
+
position: relative;
|
|
75
|
+
float: left;
|
|
76
|
+
padding: 0 5px 10px 0px;
|
|
77
|
+
background-color: #fff;
|
|
78
|
+
border-radius: 6px;
|
|
79
|
+
}
|
|
80
|
+
.ct-tableToolbar ul {
|
|
81
|
+
list-style: none; /* 去掉ul前面的符号 */
|
|
82
|
+
margin: 0px; /* 与外界元素的距离为0 */
|
|
83
|
+
padding: 0px; /* 与内部元素的距离为0 */
|
|
84
|
+
width: auto; /* 宽度根据元素内容调整 */
|
|
85
|
+
}
|
|
86
|
+
.ct-tableToolbar ul li {
|
|
87
|
+
margin-right: 5px;
|
|
88
|
+
float: left; /* 向左漂移,将竖排变为横排 */
|
|
89
|
+
}
|
|
90
|
+
.bool_btn_l {
|
|
91
|
+
float: left !important;
|
|
92
|
+
}
|
|
93
|
+
.bool_btn_r {
|
|
94
|
+
float: right !important;
|
|
95
|
+
}
|
|
61
96
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="field-top">
|
|
3
|
-
<div style="width:100%;display:
|
|
3
|
+
<div style="width:100%;display:block;">
|
|
4
4
|
<div v-if="model !== null" class="ct-text ct-flex-div max-flex-div" style="flex:1;"
|
|
5
5
|
:class="[model.showLabel?'el-input-group el-input-group--prepend':'',!valid?'inputError':'',model.attrs.size?'ct-font-size-'+model.attrs.size:'']"
|
|
6
6
|
@mouseover="mouseOverHandle" @mouseout="mouseOutHandle">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ctQuickInputSos v-if="!model.lock && model.paramName" class="ct-flex-div-span" :pn="model.paramName" :action="api" :flagNew="true" @click="quickSelect"></ctQuickInputSos>
|
|
25
25
|
</div>
|
|
26
26
|
<transition name="el-fade-in" class="ct-flex-div-span">
|
|
27
|
-
<span v-show="!valid" class="errorMessage ">
|
|
27
|
+
<span v-show="!valid" class="errorMessage errorMessageMarginLeft">
|
|
28
28
|
{{validMessage}}
|
|
29
29
|
</span>
|
|
30
30
|
</transition>
|
|
@@ -102,5 +102,8 @@
|
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
}</script>
|
|
105
|
-
<style>
|
|
105
|
+
<style scoped>
|
|
106
|
+
.errorMessageMarginLeft {
|
|
107
|
+
margin-left: 108px;
|
|
108
|
+
}
|
|
106
109
|
</style>
|
|
@@ -295,8 +295,8 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
295
295
|
}
|
|
296
296
|
//正在编辑的行
|
|
297
297
|
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
let fields = listData.currentRow.data;
|
|
299
|
+
field = fields[fiedlId];
|
|
300
300
|
}
|
|
301
301
|
//源数据
|
|
302
302
|
else {
|
|
@@ -306,17 +306,18 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
306
306
|
|
|
307
307
|
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
308
308
|
try {
|
|
309
|
-
|
|
309
|
+
let fields = listData.rows[rowNum].field;
|
|
310
310
|
field = fields.find((v) => {
|
|
311
311
|
return v.id === fiedlId;
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
catch (e) {
|
|
315
|
+
if (listData.rows.length <= rowNum) {
|
|
315
316
|
var checkMsg = "获取列表行索引超出界限";
|
|
316
317
|
this.message(checkMsg);
|
|
317
|
-
|
|
318
|
-
}
|
|
318
|
+
}
|
|
319
319
|
}
|
|
320
|
+
}
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
return { listData: listData, field: field };
|
|
@@ -350,13 +351,19 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
350
351
|
//若该行正在编辑,则取编辑状态的。
|
|
351
352
|
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
352
353
|
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
353
|
-
|
|
354
|
+
if(fiedlId=='deleted' || fiedlId=='flagDeleted'){
|
|
355
|
+
return data.listData.currentRow.data.deleted || false;
|
|
356
|
+
}
|
|
357
|
+
return data.listData.currentRow.data[fiedlId].source[attrName];
|
|
354
358
|
}
|
|
355
359
|
else if (data && data.field) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
+
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
361
|
+
return defaultValue;
|
|
362
|
+
}
|
|
363
|
+
return data.field.source[attrName];
|
|
364
|
+
}
|
|
365
|
+
else if (data && (fiedlId=='deleted' || fiedlId=='flagDeleted')) {
|
|
366
|
+
return data.listData.rows[rowNum].deleted || false;
|
|
360
367
|
}
|
|
361
368
|
},
|
|
362
369
|
getListFieldValueFromParent(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
@@ -113,6 +113,9 @@ const Router = function (source) {
|
|
|
113
113
|
get isBrowseAttachment() {
|
|
114
114
|
return source.actionType === Enum.ActionType.BrowseAttachment;
|
|
115
115
|
},
|
|
116
|
+
get isRefersh() {
|
|
117
|
+
return source.actionType === Enum.ActionType.Refersh;
|
|
118
|
+
},
|
|
116
119
|
//打开页面(1Form,2SearchList(弹在tab),3Tab,4执行客户端脚本,5SearchList(弹出))
|
|
117
120
|
get navToNewPage() {
|
|
118
121
|
return source.navToNewPage;
|
|
@@ -267,8 +270,7 @@ const Router = function (source) {
|
|
|
267
270
|
}).catch((ex) => {
|
|
268
271
|
callback(ex); //里面需要有data.rtnCode === 200的处理
|
|
269
272
|
});
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
273
|
+
} else {
|
|
272
274
|
callback({
|
|
273
275
|
rtnCode: Enum.ReturnCode.Successful
|
|
274
276
|
});
|
|
@@ -351,6 +353,12 @@ const Router = function (source) {
|
|
|
351
353
|
get align() {
|
|
352
354
|
return source.align;
|
|
353
355
|
},
|
|
356
|
+
get isRight() {
|
|
357
|
+
return Enum.HalignType.Right == source.align;
|
|
358
|
+
},
|
|
359
|
+
get flagAsync() {
|
|
360
|
+
return source.flagAsync;
|
|
361
|
+
},
|
|
354
362
|
};
|
|
355
363
|
return rtn;
|
|
356
364
|
}
|