centaline-data-driven 1.1.16 → 1.1.20
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/centaline/api/index.js +1 -3
- package/src/centaline/comfirm/src/comfirm.vue +15 -6
- package/src/centaline/common/index.js +56 -26
- package/src/centaline/css/common.css +16 -3
- package/src/centaline/dialogList/src/dialogList.vue +3 -1
- package/src/centaline/dynamicCheckbox/src/dynamicCheckbox.vue +3 -5
- package/src/centaline/dynamicDtd/src/dynamicDtd.vue +4 -4
- package/src/centaline/dynamicFile/src/dynamicFile.vue +14 -14
- package/src/centaline/dynamicForm/src/dynamicForm.vue +3 -3
- package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +7 -3
- package/src/centaline/dynamicIti/src/dynamicIti.vue +5 -3
- package/src/centaline/dynamicMo/src/dynamicMo.vue +1 -2
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +7 -3
- package/src/centaline/dynamicSo/src/dynamicSo.vue +1 -1
- package/src/centaline/dynamicSos/src/dynamicSos.vue +1 -2
- package/src/centaline/dynamicT/src/dynamicT.vue +4 -4
- package/src/centaline/dynamicTags/src/dynamicTags.vue +1 -1
- package/src/centaline/dynamicTimeSelect/src/dynamicTimeSelect.vue +0 -1
- package/src/centaline/loader/src/ctl/Checkbox.js +46 -46
- package/src/centaline/loader/src/ctl/FormList.js +1 -1
- package/src/centaline/loader/src/ctl/InputNumber.js +2 -1
- package/src/centaline/loader/src/ctl/Iti.js +1 -1
- package/src/centaline/loader/src/ctl/Router.js +1 -1
- package/src/centaline/loader/src/ctl/SearchTable.js +20 -1
- package/src/centaline/loader/src/ctl/So.js +3 -9
- package/src/centaline/loader/src/ctl/Sos.js +3 -3
- package/src/centaline/loader/src/ctl/T.js +1 -1
- package/src/centaline/loader/src/ctl/TimeSelect.js +7 -4
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +16 -9
- package/src/centaline/loader/src/ctl.js +2 -1
- package/src/centaline/selectOption/src/selectOption.vue +9 -1
- package/src/centaline/selectOption/src/selectOptionVertical.vue +1 -1
- package/src/centaline/templateControls/src/dynamicTableCurrency.vue +1 -1
- package/src/main.js +1 -1
- package/wwwroot/static/centaline/centaline-data-driven.js +2 -2
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -7,55 +7,55 @@ const box = function (source, callBack) {
|
|
|
7
7
|
var self = this;
|
|
8
8
|
var init = function (data) {
|
|
9
9
|
var rtn = {
|
|
10
|
-
get options() {
|
|
11
|
-
return source.selectItems1;
|
|
12
|
-
},
|
|
10
|
+
get options() {
|
|
11
|
+
return source.selectItems1;
|
|
12
|
+
},
|
|
13
13
|
checkedIsInit: false,
|
|
14
14
|
get checkedItemArr() {
|
|
15
15
|
if (this._checkedItemArr === null) {
|
|
16
16
|
return this._checkedItemArr;
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
this._checkedItemArr = this.getCheckedItemArr();
|
|
19
|
+
this._checkedItemArr = this.getCheckedItemArr();
|
|
20
20
|
//return this._checkedItemArr;
|
|
21
21
|
return this._checkedItemArr;
|
|
22
22
|
}
|
|
23
|
-
},
|
|
24
|
-
getCheckedItemArr() {
|
|
25
|
-
var itemArr = [];
|
|
26
|
-
var checked = source.code1 === '' ? [] : [].concat(JSON.parse(source.code1));
|
|
27
|
-
checked.forEach((v) => {
|
|
28
|
-
if (v[this.optionAttrs.value]) {
|
|
23
|
+
},
|
|
24
|
+
getCheckedItemArr() {
|
|
25
|
+
var itemArr = [];
|
|
26
|
+
var checked = source.code1 === '' ? [] : [].concat(JSON.parse(source.code1));
|
|
27
|
+
checked.forEach((v) => {
|
|
28
|
+
if (v[this.optionAttrs.value]) {
|
|
29
29
|
if (!v[this.optionAttrs.flagDeleted]) {
|
|
30
|
-
itemArr.push(v[this.optionAttrs.value]);
|
|
31
|
-
}
|
|
30
|
+
itemArr.push(v[this.optionAttrs.value]);
|
|
31
|
+
}
|
|
32
32
|
}
|
|
33
|
-
});
|
|
34
|
-
return itemArr;
|
|
35
|
-
},
|
|
36
|
-
//checkedItemArr1:[],
|
|
33
|
+
});
|
|
34
|
+
return itemArr;
|
|
35
|
+
},
|
|
36
|
+
//checkedItemArr1:[],
|
|
37
37
|
//手动维护code1值
|
|
38
|
-
updateCode1() {
|
|
39
|
-
let self = this;
|
|
38
|
+
updateCode1() {
|
|
39
|
+
let self = this;
|
|
40
40
|
var currentOptions = this.options.filter((value) => {
|
|
41
41
|
return self.checkedItemArr.indexOf(value[self.optionAttrs.value]) >= 0;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
if (source.code1 !== '') {
|
|
45
|
-
var checked = source.code1 === '' ? [] : [].concat(JSON.parse(source.code1));
|
|
46
|
-
checked.forEach((v) => {
|
|
47
|
-
if (self.checkedItemArr.indexOf(v[this.optionAttrs.value]) > -1) {
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (source.code1 !== '') {
|
|
45
|
+
var checked = source.code1 === '' ? [] : [].concat(JSON.parse(source.code1));
|
|
46
|
+
checked.forEach((v) => {
|
|
47
|
+
if (self.checkedItemArr.indexOf(v[this.optionAttrs.value]) > -1) {
|
|
48
48
|
v[this.optionAttrs.flagDeleted] = false;
|
|
49
|
-
currentOptions.splice(currentOptions.findIndex((op) => { return op[rtn.optionAttrs.value] === v[rtn.optionAttrs.value] }), 1);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
v[this.optionAttrs.flagDeleted] = true;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
checked = checked.concat(currentOptions);
|
|
57
|
-
source.code1 = JSON.stringify(checked);
|
|
58
|
-
}
|
|
49
|
+
currentOptions.splice(currentOptions.findIndex((op) => { return op[rtn.optionAttrs.value] === v[rtn.optionAttrs.value] }), 1);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
v[this.optionAttrs.flagDeleted] = true;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
checked = checked.concat(currentOptions);
|
|
57
|
+
source.code1 = JSON.stringify(checked);
|
|
58
|
+
}
|
|
59
59
|
else {
|
|
60
60
|
if (self.checkedItemArr.length === 0) {
|
|
61
61
|
source.code1 = '';
|
|
@@ -66,23 +66,23 @@ const box = function (source, callBack) {
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
reset() {
|
|
69
|
-
this.value = this.defaultValue;
|
|
69
|
+
this.value = this.defaultValue;
|
|
70
70
|
this.forceUpdate();
|
|
71
71
|
},
|
|
72
72
|
optionAttrs: {
|
|
73
73
|
value: 'code',
|
|
74
|
-
label: 'name',
|
|
75
|
-
actionType: 'actionType',
|
|
74
|
+
label: 'name',
|
|
75
|
+
actionType: 'actionType',
|
|
76
76
|
flagDeleted: 'flagDeleted'
|
|
77
|
-
},
|
|
78
|
-
//用于处理源数据改动,强制更新视图数据(一些无法直接映射的源数据)
|
|
79
|
-
forceUpdate() {
|
|
80
|
-
var self = this;
|
|
81
|
-
Vue.set(self, "checkedItemArr", self.getCheckedItemArr());
|
|
82
|
-
Vue.set(self, "options", source.selectItems1);
|
|
83
|
-
if (this.self.$forceUpdate) {
|
|
84
|
-
this.self.$forceUpdate();
|
|
85
|
-
}
|
|
77
|
+
},
|
|
78
|
+
//用于处理源数据改动,强制更新视图数据(一些无法直接映射的源数据)
|
|
79
|
+
forceUpdate() {
|
|
80
|
+
var self = this;
|
|
81
|
+
Vue.set(self, "checkedItemArr", self.getCheckedItemArr());
|
|
82
|
+
Vue.set(self, "options", source.selectItems1);
|
|
83
|
+
if (this.self.$forceUpdate) {
|
|
84
|
+
this.self.$forceUpdate();
|
|
85
|
+
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
rtn = base.copy(Base(data), rtn);
|
|
@@ -276,7 +276,7 @@ const FormList = function (source, master) {
|
|
|
276
276
|
return isDuplicated;
|
|
277
277
|
},
|
|
278
278
|
deleteRow(index, callback) {
|
|
279
|
-
Vue.prototype.$confirm("确定删除?", "提示", {
|
|
279
|
+
Vue.prototype.$common.confirm("确定删除?", "提示", {
|
|
280
280
|
confirmButtonText: "确定",
|
|
281
281
|
cancelButtonText: "取消",
|
|
282
282
|
//type: 'warning'
|
|
@@ -3,7 +3,7 @@ import common from '../../../common';
|
|
|
3
3
|
import Enum from './lib/Enum';
|
|
4
4
|
const Router = function (source) {
|
|
5
5
|
var rtn = {
|
|
6
|
-
disabled: false,
|
|
6
|
+
disabled: source.selectedMode && source.selectedMode === Enum.ListSelectMode.Multiple ? true : false,
|
|
7
7
|
get id() {
|
|
8
8
|
return source.key;
|
|
9
9
|
},
|
|
@@ -13,6 +13,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
13
13
|
defaultSearchData: defaultSearchData,
|
|
14
14
|
pageIndex: 1,
|
|
15
15
|
selectIndex: 0,
|
|
16
|
+
selectAll: 0,
|
|
16
17
|
get source() {
|
|
17
18
|
return source;
|
|
18
19
|
},
|
|
@@ -191,7 +192,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
191
192
|
}
|
|
192
193
|
|
|
193
194
|
self._columnsArr.push(arr);
|
|
194
|
-
}
|
|
195
|
+
}
|
|
195
196
|
return self._columnsArr;
|
|
196
197
|
}
|
|
197
198
|
},
|
|
@@ -348,6 +349,10 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
348
349
|
this.apiData(callback);
|
|
349
350
|
this.selectIndex = 0;
|
|
350
351
|
this._lastRowspan = null;
|
|
352
|
+
if (index === 1) {
|
|
353
|
+
this.setButtonsDisabled();
|
|
354
|
+
this.selectAll = 0;
|
|
355
|
+
}
|
|
351
356
|
},
|
|
352
357
|
nextPage: function (callback) {
|
|
353
358
|
if (this.flagMoreData && this.flagMoreData !== false) {
|
|
@@ -691,6 +696,20 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
691
696
|
rtn = true;
|
|
692
697
|
}
|
|
693
698
|
return rtn;
|
|
699
|
+
},
|
|
700
|
+
//设置多选按钮是否禁用
|
|
701
|
+
setButtonsDisabled() {
|
|
702
|
+
var selectData = rtn.getSelectRowData({ isMulti: 1 });
|
|
703
|
+
rtn._buttons.forEach((v) => {
|
|
704
|
+
if (v.isMulti) {
|
|
705
|
+
if (selectData != null && selectData.length > 0) {
|
|
706
|
+
v.disabled = false;
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
v.disabled = true;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
});
|
|
694
713
|
}
|
|
695
714
|
};
|
|
696
715
|
if (rtn.template) {
|
|
@@ -9,19 +9,13 @@ const So = function (source, moreActionRouter) {
|
|
|
9
9
|
options: [{ code: source.code1, name: source.name1 }],
|
|
10
10
|
get text() {
|
|
11
11
|
|
|
12
|
-
if (source.isList &&
|
|
13
|
-
return rtn.attrs.placeholder + ":" +
|
|
12
|
+
if (source.isList && source.name1 && rtn.attrs.placeholder) {
|
|
13
|
+
return rtn.attrs.placeholder + ":" + source.name1;
|
|
14
14
|
}
|
|
15
|
-
return source.
|
|
15
|
+
return source.name1;
|
|
16
16
|
},
|
|
17
17
|
set text(v) {
|
|
18
|
-
if(source.displayName1)
|
|
19
|
-
{
|
|
20
|
-
source.displayName1 = v;
|
|
21
|
-
}else
|
|
22
|
-
{
|
|
23
18
|
source.name1 = v;
|
|
24
|
-
}
|
|
25
19
|
},
|
|
26
20
|
get optionColCount() {
|
|
27
21
|
return parseInt(source.optCount) || 5;
|
|
@@ -8,10 +8,10 @@ const Sos = function (source, moreActionRouter) {
|
|
|
8
8
|
var rtn = {
|
|
9
9
|
options: [{ code: source.code1, name: source.name1 }],
|
|
10
10
|
get text() {
|
|
11
|
-
if (source.isList &&
|
|
12
|
-
return rtn.attrs.placeholder + ":" +
|
|
11
|
+
if (source.isList && source.name1 && rtn.attrs.placeholder) {
|
|
12
|
+
return rtn.attrs.placeholder + ":" + source.name1;
|
|
13
13
|
}
|
|
14
|
-
return source.
|
|
14
|
+
return source.name1;
|
|
15
15
|
},
|
|
16
16
|
set text(v) {
|
|
17
17
|
if(source.displayName1)
|
|
@@ -8,7 +8,7 @@ const T = function (source, inputType, readonly, isPassword) {
|
|
|
8
8
|
// clearable: true,
|
|
9
9
|
// },
|
|
10
10
|
get clearable() {
|
|
11
|
-
if (typeof source.clear === 'undefined'&&!readonly) {
|
|
11
|
+
if (typeof source.clear === 'undefined'&&!readonly&&!source.locked) {
|
|
12
12
|
return true;
|
|
13
13
|
}
|
|
14
14
|
if (source.clear) {
|
|
@@ -2,10 +2,9 @@ import base from '../../index';
|
|
|
2
2
|
import Base from './Base';
|
|
3
3
|
import valid from '../../../validate/index';
|
|
4
4
|
import Axios from 'axios';
|
|
5
|
+
import common from '../../../common';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
if (source.code1) source.code1 = new Date('2010-08-01 ' + source.code1);
|
|
8
|
-
if (source.code2) source.code2 = new Date('2010-08-01 ' + source.code2);
|
|
7
|
+
const TimeSelect = function (source, isRange, dateType) {
|
|
9
8
|
var init = function (data) {
|
|
10
9
|
var rtn = {
|
|
11
10
|
isRange: isRange,//是否是区间
|
|
@@ -24,15 +23,19 @@ const box = function (source, isRange, dateType) {
|
|
|
24
23
|
source.valueFormat = v;
|
|
25
24
|
},
|
|
26
25
|
get value() {
|
|
26
|
+
if (source.code1 && Object.prototype.toString.call(source.code1) === "[object String]") source.code1 = new Date(common.formatDate(new Date(), 'yyyy-MM-dd') + ' ' + source.code1);
|
|
27
27
|
return source.code1;
|
|
28
28
|
},
|
|
29
29
|
set value(v) {
|
|
30
|
+
if (v && Object.prototype.toString.call(v) === "[object Date]") v = common.formatDate(v, rtn.valueFormat);
|
|
30
31
|
source.code1 = v;
|
|
31
32
|
},
|
|
32
33
|
get value1() {
|
|
34
|
+
if (source.code2 && Object.prototype.toString.call(source.code2) === "[object String]") source.code2 = new Date(common.formatDate(new Date(), 'yyyy-MM-dd') + ' ' + source.code2);
|
|
33
35
|
return source.code2;
|
|
34
36
|
},
|
|
35
37
|
set value1(v) {
|
|
38
|
+
if (v && Object.prototype.toString.call(v) === "[object Date]") v = common.formatDate(v, rtn.valueFormat);
|
|
36
39
|
source.code2 = v;
|
|
37
40
|
},
|
|
38
41
|
get attrs() {
|
|
@@ -54,4 +57,4 @@ const box = function (source, isRange, dateType) {
|
|
|
54
57
|
return init(source);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
export default
|
|
60
|
+
export default TimeSelect;
|
|
@@ -63,8 +63,8 @@ const LibFunction = {
|
|
|
63
63
|
else if (field.controlType === Enum.ControlType.DateTimeRange) {
|
|
64
64
|
field.width = field.width || 350;
|
|
65
65
|
}
|
|
66
|
-
else if (field.controlType === Enum.ControlType.ButtonSearch ||
|
|
67
|
-
field.controlType === Enum.ControlType.ButtonReset ||
|
|
66
|
+
else if (field.controlType === Enum.ControlType.ButtonSearch ||
|
|
67
|
+
field.controlType === Enum.ControlType.ButtonReset ||
|
|
68
68
|
field.controlType === Enum.ControlType.ButtonAdvancedSearch) {
|
|
69
69
|
field.width = '';
|
|
70
70
|
}
|
|
@@ -149,12 +149,8 @@ const LibFunction = {
|
|
|
149
149
|
// item.is = 'ct-time-select';
|
|
150
150
|
// break;
|
|
151
151
|
case Enum.ControlType.TimeRange://时间区间
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
//break;
|
|
155
|
-
item = L(field);
|
|
156
|
-
item.is = 'ct-labelText';
|
|
157
|
-
item.value = "暂不支持该组件";
|
|
152
|
+
item = TimeSelect(field, true, 'time');
|
|
153
|
+
item.is = 'ct-time-select';
|
|
158
154
|
break;
|
|
159
155
|
case Enum.ControlType.Date://日期
|
|
160
156
|
item = D(field, 'date');
|
|
@@ -237,7 +233,18 @@ const LibFunction = {
|
|
|
237
233
|
var router = source.actionRouters.find((v1) => {
|
|
238
234
|
return v1.key === field.fieldName1;
|
|
239
235
|
});
|
|
240
|
-
|
|
236
|
+
var files = [];
|
|
237
|
+
source.medias.forEach((v, index) => {
|
|
238
|
+
if (v.GroupID) {
|
|
239
|
+
if (v.GroupID == field.fieldName1) {
|
|
240
|
+
files.push(v);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
files.push(v);
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
item = File(field, files, router, source.parameterAction);
|
|
241
248
|
item.is = 'ct-file';
|
|
242
249
|
break;
|
|
243
250
|
case Enum.ControlType.PasswordTextBox://密码
|
|
@@ -22,7 +22,8 @@ const loader = {
|
|
|
22
22
|
Form: require("./ctl/Form.js").default,
|
|
23
23
|
Router: require("./ctl/Router.js").default,
|
|
24
24
|
Tabs: require("./ctl/Tabs.js").default,
|
|
25
|
-
ComboBoxWithTextBox: require("./ctl/ComboBoxWithTextBox.js").default
|
|
25
|
+
ComboBoxWithTextBox: require("./ctl/ComboBoxWithTextBox.js").default,
|
|
26
|
+
Checkbox: require("./ctl/Checkbox.js").default
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export default loader;
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
<el-tag v-if="typeof model.options[(n-1)*model.optionColCount + (m-1)] !== 'undefined'"
|
|
7
7
|
class="ct-option" @click.native="$emit('click',model.options[(n-1)*model.optionColCount + (m-1)][model.optionAttrs.value])"
|
|
8
8
|
:type="getOptionSelect(model.options[(n-1)*model.optionColCount + (m-1)][model.optionAttrs.value])">
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
{{getLabel(n,m)}}
|
|
10
11
|
</el-tag>
|
|
11
12
|
</td>
|
|
12
13
|
</tr>
|
|
@@ -30,6 +31,13 @@
|
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
methods: {
|
|
34
|
+
getLabel(n,m){
|
|
35
|
+
if(this.model.options[(n-1)*this.model.optionColCount + (m-1)][this.model.optionAttrs.displayLabel])
|
|
36
|
+
{
|
|
37
|
+
return this.model.options[(n-1)*this.model.optionColCount + (m-1)][this.model.optionAttrs.displayLabel];
|
|
38
|
+
}
|
|
39
|
+
return this.model.options[(n-1)*this.model.optionColCount + (m-1)][this.model.optionAttrs.label];
|
|
40
|
+
},
|
|
33
41
|
getOptionSelect(value) {
|
|
34
42
|
if (typeof this.model.value === 'object') {
|
|
35
43
|
if (this.model.value.indexOf(value) >= 0) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="ct-selectOptionVertical" style="">
|
|
3
3
|
<ul>
|
|
4
4
|
<li v-for="op in model.options" :class="[getOptionSelect(op[model.optionAttrs.value])?'select':'']" @click="selectOption(op[model.optionAttrs.value])">
|
|
5
|
-
<span>{{op[model.optionAttrs.label]}}</span>
|
|
5
|
+
<span>{{op[model.optionAttrs.displayLabel]||op[model.optionAttrs.label]}}</span>
|
|
6
6
|
</li>
|
|
7
7
|
</ul>
|
|
8
8
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div align="center" :class="isOperationalColumn?'subdiv_allinline':''">
|
|
3
|
-
<img v-if="router.imgUrl" class="ct-tablecurrencyImg ct-tablecurrencyItem" :src="router.imgUrl" :title="label" @click="clickHandler($event);" />
|
|
3
|
+
<img v-if="router.imgUrl" class="ct-tablecurrencyImg ct-tablecurrencyItem" :src="router.imgUrl" :title="router.label" @click="clickHandler($event);" />
|
|
4
4
|
<a v-else href="javascript:void(0);" class="ct-tablecurrencyA ct-tablecurrencyItem" @click="clickHandler($event)">
|
|
5
5
|
{{label}}
|
|
6
6
|
</a>
|
package/src/main.js
CHANGED