centaline-data-driven-v3 0.0.56 → 0.0.58
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/dist/centaline-data-driven-v3.umd.js +78 -78
- package/package.json +1 -1
- package/src/assets/commonWeb.css +1 -1
- package/src/components/Layout/Layout.vue +7 -2
- package/src/components/Layout/LayoutField.vue +1 -1
- package/src/components/app/SearchList/SearchTable.vue +18 -7
- package/src/components/web/Button.vue +3 -3
- package/src/components/web/Form.vue +40 -7
- package/src/components/web/FormList.vue +28 -8
- package/src/components/web/GroupList.vue +36 -0
- package/src/components/web/NumberWithPlusAndMinus.vue +110 -0
- package/src/components/web/PopupGroupList.vue +6 -0
- package/src/components/web/SearchList/SearchTable.vue +138 -43
- package/src/components/web/SearchList.vue +7 -2
- package/src/components/web/Steps.vue +3 -1
- package/src/components/web/other/PopupSearchListTable.vue +8 -2
- package/src/loader/src/DatePicker.js +17 -4
- package/src/loader/src/Field.js +43 -17
- package/src/loader/src/Form.js +85 -1
- package/src/loader/src/FormList.js +30 -1
- package/src/loader/src/GroupList.js +14 -0
- package/src/loader/src/LibFunction.js +19 -6
- package/src/loader/src/NumberWithPlusAndMinus.js +35 -0
- package/src/loader/src/Router.js +15 -1
- package/src/loader/src/SearchScreen.js +1 -0
- package/src/loader/src/SearchTable.js +10 -4
- package/src/main.js +3 -3
- package/src/utils/Enum.js +778 -756
- package/src/utils/mixins.js +61 -12
- package/src/utils/validate.js +1 -0
|
@@ -239,7 +239,7 @@ function FormListModel(source, master,actionRouters) {
|
|
|
239
239
|
row['delete'] = rows[i].delete
|
|
240
240
|
row['fontColor'] = rows[i].fontColor
|
|
241
241
|
this._tableData.push(row);
|
|
242
|
-
if (this.flagRepeat) {
|
|
242
|
+
if (this.flagRepeat||this.flagTemplate) {
|
|
243
243
|
allhiddenHandle(row, rows[i].$sourceIndex, rtn)
|
|
244
244
|
}
|
|
245
245
|
}
|
|
@@ -302,6 +302,29 @@ function FormListModel(source, master,actionRouters) {
|
|
|
302
302
|
});
|
|
303
303
|
return rtnObj;
|
|
304
304
|
},
|
|
305
|
+
get relationParentFormFields() {
|
|
306
|
+
return source.relationParentFormFields;
|
|
307
|
+
},
|
|
308
|
+
getRelationParentFormFields(){
|
|
309
|
+
let relfields=[];
|
|
310
|
+
if(this.relationParentFormFields){
|
|
311
|
+
if(this.form && this.form.fieldsDic){
|
|
312
|
+
let form=this.form;
|
|
313
|
+
(this.relationParentFormFields.split(',')).forEach(function(f){
|
|
314
|
+
if(form.fieldsDic[f]){
|
|
315
|
+
let newField={...form.fieldsDic[f]};
|
|
316
|
+
newField.is='ct-label';
|
|
317
|
+
newField.type=Enum.ControlType.Label;
|
|
318
|
+
newField.colspan=24;
|
|
319
|
+
newField.required=false;
|
|
320
|
+
newField.labelClass='';
|
|
321
|
+
relfields.push(newField);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return relfields;
|
|
327
|
+
}
|
|
305
328
|
};
|
|
306
329
|
return rtn;
|
|
307
330
|
}
|
|
@@ -464,6 +487,7 @@ function addRow(model) {
|
|
|
464
487
|
actionRouters: model.actionRouters,
|
|
465
488
|
},
|
|
466
489
|
parentModelForm: model.parentModel,
|
|
490
|
+
relationParentFormFields:model.getRelationParentFormFields(),
|
|
467
491
|
onSubmit: (ev) => {
|
|
468
492
|
var row = JSON.parse(JSON.stringify(model.source.rows[0]));
|
|
469
493
|
for (let findex = 0; findex < row.columns.length; findex++) {
|
|
@@ -471,6 +495,8 @@ function addRow(model) {
|
|
|
471
495
|
field.code1 = ev.formData.source.fields[findex].code1;
|
|
472
496
|
field.name1 = ev.formData.source.fields[findex].name1;
|
|
473
497
|
field.code2 = ev.formData.source.fields[findex].code2;
|
|
498
|
+
field.locked = ev.formData.source.fields[findex].locked;
|
|
499
|
+
field.required = ev.formData.source.fields[findex].required;
|
|
474
500
|
if(field.controlType==Enum.ControlType.Photo){
|
|
475
501
|
field.code1 =JSON.stringify(ev.formData.fields[findex].fileSource)
|
|
476
502
|
}
|
|
@@ -536,6 +562,7 @@ function editRow(sourceIndex, model) {
|
|
|
536
562
|
actionRouters: model.source.actionRouters,
|
|
537
563
|
},
|
|
538
564
|
parentModelForm: model.parentModel,
|
|
565
|
+
relationParentFormFields:model.getRelationParentFormFields(),
|
|
539
566
|
onSubmit: (ev) => {
|
|
540
567
|
model.rows[model.rows.findIndex(v => v.$sourceIndex === sourceIndex)].edited = true;
|
|
541
568
|
var row = model.source.rows[index].columns;
|
|
@@ -547,11 +574,13 @@ function editRow(sourceIndex, model) {
|
|
|
547
574
|
model.tableData[tableIndex][row[findex]['fieldName1']]['name1'] = ev.formData.source.fields[findex].name1
|
|
548
575
|
model.tableData[tableIndex][row[findex]['fieldName1']]['code2'] = ev.formData.source.fields[findex].code2
|
|
549
576
|
model.tableData[tableIndex][row[findex]['fieldName1']]['locked'] = ev.formData.source.fields[findex].locked
|
|
577
|
+
model.tableData[tableIndex][row[findex]['fieldName1']]['required'] = ev.formData.source.fields[findex].required
|
|
550
578
|
|
|
551
579
|
row[findex]['code1'] = ev.formData.source.fields[findex].code1
|
|
552
580
|
row[findex]['name1'] = ev.formData.source.fields[findex].name1
|
|
553
581
|
row[findex]['code2'] = ev.formData.source.fields[findex].code2
|
|
554
582
|
row[findex]['locked'] = ev.formData.source.fields[findex].locked
|
|
583
|
+
row[findex]['required'] = ev.formData.source.fields[findex].required
|
|
555
584
|
}
|
|
556
585
|
common.closeDialog(dialogOption);
|
|
557
586
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import base from '../index';
|
|
2
|
+
import valid from '../../utils/validate';
|
|
3
|
+
const GroupList = function (source) {
|
|
4
|
+
let rtn = {
|
|
5
|
+
get value() {
|
|
6
|
+
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
};
|
|
10
|
+
rtn = base.copy(source, rtn);
|
|
11
|
+
rtn = base.copy(rtn, valid.Init(rtn));
|
|
12
|
+
return rtn;
|
|
13
|
+
};
|
|
14
|
+
export default GroupList
|
|
@@ -10,6 +10,7 @@ import TextBox from './TextBox';
|
|
|
10
10
|
import DatePicker from './DatePicker';
|
|
11
11
|
import RadioButton from './RadioButton';
|
|
12
12
|
import CheckBoxList from './CheckBoxList';
|
|
13
|
+
import NumberWithPlusAndMinus from './NumberWithPlusAndMinus';
|
|
13
14
|
import NumericRange from './NumericRange';
|
|
14
15
|
import MultiComboBoxWithTextBox from './MultiComboBoxWithTextBox';
|
|
15
16
|
import FormList from './FormList';
|
|
@@ -34,7 +35,8 @@ const LibFunction = {
|
|
|
34
35
|
else if (field.controlType === Enum.ControlType.DateTime) {
|
|
35
36
|
field.width = field.width || 280;
|
|
36
37
|
}
|
|
37
|
-
else if (field.controlType === Enum.ControlType.DateRange
|
|
38
|
+
else if (field.controlType === Enum.ControlType.DateRange
|
|
39
|
+
|| field.controlType === Enum.ControlType.MonthRange) {
|
|
38
40
|
field.width = field.width || 300;
|
|
39
41
|
}
|
|
40
42
|
else if (field.controlType === Enum.ControlType.DateTimeRange) {
|
|
@@ -58,6 +60,9 @@ const LibFunction = {
|
|
|
58
60
|
else if (field.controlType === Enum.ControlType.CheckBox) {
|
|
59
61
|
showLabel = true;
|
|
60
62
|
}
|
|
63
|
+
else if (field.controlType === Enum.ControlType.DateYearMonth) {
|
|
64
|
+
field.width = field.width || 200;
|
|
65
|
+
}
|
|
61
66
|
else {
|
|
62
67
|
showLabel = false;
|
|
63
68
|
field.width = field.width || 200;
|
|
@@ -119,6 +124,7 @@ const LibFunction = {
|
|
|
119
124
|
case Enum.ControlType.DateTime:
|
|
120
125
|
case Enum.ControlType.Date:
|
|
121
126
|
case Enum.ControlType.Time:
|
|
127
|
+
case Enum.ControlType.MonthRange:
|
|
122
128
|
item = DatePicker(item)
|
|
123
129
|
item.is = 'ct-datepicker'
|
|
124
130
|
break;
|
|
@@ -147,7 +153,7 @@ const LibFunction = {
|
|
|
147
153
|
console.error("找不到对应的list:" + field.fieldName1);
|
|
148
154
|
}
|
|
149
155
|
listobj.scripts = source.scripts;
|
|
150
|
-
item = FormList.FormListModel(listobj, field,source.actionRouters);
|
|
156
|
+
item = FormList.FormListModel(listobj, field, source.actionRouters);
|
|
151
157
|
item.is = 'ct-formlist';
|
|
152
158
|
break;
|
|
153
159
|
case Enum.ControlType.RichText: //富文本框
|
|
@@ -191,8 +197,8 @@ const LibFunction = {
|
|
|
191
197
|
var files = [];
|
|
192
198
|
if (Array.isArray(field.code1)) {
|
|
193
199
|
files = field.code1;
|
|
194
|
-
} else {
|
|
195
|
-
files= field.code1 && field.code1 != "[]" ? JSON.parse(field.code1) : [];
|
|
200
|
+
} else {
|
|
201
|
+
files = field.code1 && field.code1 != "[]" ? JSON.parse(field.code1) : [];
|
|
196
202
|
}
|
|
197
203
|
item = Photo.loadFromModel(item, files, router, source.videoPlayIconUrl);
|
|
198
204
|
item.is = 'ct-photo';
|
|
@@ -234,8 +240,15 @@ const LibFunction = {
|
|
|
234
240
|
item.is = 'ct-steps';
|
|
235
241
|
break;
|
|
236
242
|
case Enum.ControlType.Tags:
|
|
237
|
-
|
|
238
|
-
|
|
243
|
+
item = Tags(item)
|
|
244
|
+
item.is = 'ct-tags'
|
|
245
|
+
break;
|
|
246
|
+
case Enum.ControlType.NumberWithPlusAndMinus:
|
|
247
|
+
item = NumberWithPlusAndMinus(item)
|
|
248
|
+
item.is = 'ct-numberwithplusandminus'
|
|
249
|
+
break;
|
|
250
|
+
case Enum.ControlType.VueCustomizedComponent:
|
|
251
|
+
item.is = 'ct-'+item.vueComponentName.toLowerCase();
|
|
239
252
|
break;
|
|
240
253
|
default:
|
|
241
254
|
item = Label(item)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import base from '../../loader/index';
|
|
2
|
+
import valid from '../../utils//validate';
|
|
3
|
+
const NumberWithPlusAndMinus = function (source) {
|
|
4
|
+
let rtn = {
|
|
5
|
+
get value() {
|
|
6
|
+
this._value = [];
|
|
7
|
+
if (source.code1) {
|
|
8
|
+
let val = source.code1
|
|
9
|
+
if (typeof source.code1 === 'string') {
|
|
10
|
+
val = JSON.parse(source.code1)
|
|
11
|
+
}
|
|
12
|
+
this._value = val;
|
|
13
|
+
}
|
|
14
|
+
if (this._value && this._value.length == 0) {
|
|
15
|
+
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
16
|
+
for (let i = 0; i < 4; i++) {
|
|
17
|
+
var item = {};
|
|
18
|
+
item['code'] = str[i];
|
|
19
|
+
|
|
20
|
+
item['name'] = '';
|
|
21
|
+
item['flagDeleted'] = false
|
|
22
|
+
this._value.push(item)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
source.maxValue1 = this._value.length;
|
|
26
|
+
return this._value
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
};
|
|
31
|
+
rtn = base.copy(source, rtn);
|
|
32
|
+
rtn = base.copy(rtn, valid.Init(rtn));
|
|
33
|
+
return rtn;
|
|
34
|
+
};
|
|
35
|
+
export default NumberWithPlusAndMinus
|
package/src/loader/src/Router.js
CHANGED
|
@@ -17,7 +17,7 @@ const Router = function (source) {
|
|
|
17
17
|
return source.action;
|
|
18
18
|
},
|
|
19
19
|
set action(v) {
|
|
20
|
-
return source.action=v;
|
|
20
|
+
return source.action = v;
|
|
21
21
|
},
|
|
22
22
|
// action的url对应的FieldName,如果此处有值,则忽略action
|
|
23
23
|
get actionField() {
|
|
@@ -92,10 +92,24 @@ const Router = function (source) {
|
|
|
92
92
|
source.hidden = !v;
|
|
93
93
|
},
|
|
94
94
|
|
|
95
|
+
//是否显示
|
|
96
|
+
get vueComponentName() {
|
|
97
|
+
return source.vueComponentName;
|
|
98
|
+
},
|
|
99
|
+
set vueComponentName(v) {
|
|
100
|
+
source.vueComponentName = vueComponentName;
|
|
101
|
+
},
|
|
102
|
+
|
|
95
103
|
//Action 对应的页面样式
|
|
96
104
|
get pageStyle() {
|
|
97
105
|
return source.pageStyle;
|
|
98
106
|
},
|
|
107
|
+
get isVueComponentInLayer() {
|
|
108
|
+
return source.pageStyle === Enum.PageStyle.OpenVueComponentInLayer;
|
|
109
|
+
},
|
|
110
|
+
get isVueComponentInTab() {
|
|
111
|
+
return source.pageStyle === Enum.PageStyle.OpenVueComponentInTab;
|
|
112
|
+
},
|
|
99
113
|
get isOpenForm() {
|
|
100
114
|
return source.pageStyle === Enum.PageStyle.FormPageInLayer;
|
|
101
115
|
},
|
|
@@ -57,6 +57,7 @@ function loadSearchScreenModel(source, prevParam) {
|
|
|
57
57
|
}
|
|
58
58
|
if ((source.fields[key].controlType === Enum.ControlType.DateRange
|
|
59
59
|
|| source.fields[key].controlType === Enum.ControlType.Location
|
|
60
|
+
|| source.fields[key].controlType === Enum.ControlType.MonthRange
|
|
60
61
|
|| source.fields[key].controlType === Enum.ControlType.DateTimeRange)
|
|
61
62
|
&& source.fields[key].code2 == undefined) {
|
|
62
63
|
source.fields[key].code2 = '';
|
|
@@ -205,8 +205,8 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
205
205
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
else{
|
|
209
|
-
data=data.replace("总耗时", "").replace("總耗時", "");
|
|
208
|
+
else {
|
|
209
|
+
data = data.replace("总耗时", "").replace("總耗時", "");
|
|
210
210
|
}
|
|
211
211
|
return data;
|
|
212
212
|
}
|
|
@@ -468,6 +468,9 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
468
468
|
styleObj["width"] = col.width + 'px'; //列宽
|
|
469
469
|
styleObj["min-width"] = col.width + 'px'; //列宽
|
|
470
470
|
}
|
|
471
|
+
if (col.paramName == 'drag') {
|
|
472
|
+
styleObj["cursor"] = 'move';
|
|
473
|
+
}
|
|
471
474
|
styleObj["text-align"] = col.align; //水平位置
|
|
472
475
|
|
|
473
476
|
return styleObj;
|
|
@@ -573,12 +576,15 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
573
576
|
//设置行样式
|
|
574
577
|
setStyleRow(rows) {
|
|
575
578
|
rows.forEach((row) => {
|
|
576
|
-
if (!row
|
|
577
|
-
row
|
|
579
|
+
if (!row.rowStyle) {
|
|
580
|
+
row.rowStyle = "";
|
|
578
581
|
}
|
|
579
582
|
if (rtn.rowColorColumn && row[rtn.rowColorColumn]) {
|
|
580
583
|
row.rowStyle = row.rowStyle + "color:" + row[rtn.rowColorColumn] + ";";
|
|
581
584
|
}
|
|
585
|
+
if (row.flagDrag && row.flagDrag=='1') {
|
|
586
|
+
row.rowStyle = row.rowStyle + "cursor:move;";
|
|
587
|
+
}
|
|
582
588
|
});
|
|
583
589
|
},
|
|
584
590
|
_lastRowspan: null,
|
package/src/main.js
CHANGED
|
@@ -26,7 +26,7 @@ app.use(centaline, {
|
|
|
26
26
|
//baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
|
|
27
27
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
28
28
|
flagRouterSelf: true,
|
|
29
|
-
flagApp:
|
|
29
|
+
flagApp: false,//是否app端
|
|
30
30
|
zindex: 999,
|
|
31
31
|
showRequestSuccessMessage: true,
|
|
32
32
|
showRequestErrorMessage: true,
|
|
@@ -63,8 +63,8 @@ app.use(centaline, {
|
|
|
63
63
|
return {
|
|
64
64
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
65
65
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
66
|
-
//authObject: '{token:"
|
|
67
|
-
authObject: '{EmpID:"
|
|
66
|
+
//authObject: '{token:"1-7acf3f06-c2ea-471c-a5fa-07e1c2a81728"}',
|
|
67
|
+
authObject: '{EmpID:"Token_d646226c-ed20-4baa-bac4-6e6dbc101cd4",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_d646226c-ed20-4baa-bac4-6e6dbc101cd4",Platform:"WEB"}',
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
70
|
// 请求完成事件,可判断是否登录过期执行响应操作
|