centaline-data-driven 1.2.24 → 1.2.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/package.json +1 -1
- package/src/centaline/api/index.js +12 -0
- package/src/centaline/common/index.js +3 -0
- package/src/centaline/dynamicComboBoxWithTextBox/src/dynamicComboBoxWithTextBox.vue +10 -1
- package/src/centaline/dynamicDetail/src/dynamicContactList.vue +0 -3
- package/src/centaline/dynamicFile/src/dynamicFile.vue +40 -2
- package/src/centaline/loader/src/ctl/ComboBoxWithTextBox.js +18 -0
- package/src/centaline/loader/src/ctl/ContactList.js +70 -5
- package/src/main.js +3 -1
- package/wwwroot/static/centaline/centaline-data-driven.js +1 -1
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
package/package.json
CHANGED
|
@@ -127,6 +127,10 @@ Axios.defaults.withCredentials = true;//允许带上跨域cookies
|
|
|
127
127
|
|
|
128
128
|
const api = {
|
|
129
129
|
get(url, params, callback) {
|
|
130
|
+
if(common.flagRouterSelf()){
|
|
131
|
+
url=url+params.action;
|
|
132
|
+
params=params.para;
|
|
133
|
+
}
|
|
130
134
|
return Axios.get(url, params, {
|
|
131
135
|
headers: {
|
|
132
136
|
headers: common.getDataDrivenOpts().handler.getRequestHeaders()
|
|
@@ -138,6 +142,10 @@ const api = {
|
|
|
138
142
|
);
|
|
139
143
|
},
|
|
140
144
|
post(url, params, callback) {
|
|
145
|
+
if(common.flagRouterSelf()){
|
|
146
|
+
url=url+params.action;
|
|
147
|
+
params=params.para;
|
|
148
|
+
}
|
|
141
149
|
return Axios.post(url, params, {
|
|
142
150
|
headers: {
|
|
143
151
|
headers: common.getDataDrivenOpts().handler.getRequestHeaders()
|
|
@@ -230,6 +238,10 @@ const api = {
|
|
|
230
238
|
return Promise.resolve(response.data);
|
|
231
239
|
},
|
|
232
240
|
postHandler(url, params, formData) {
|
|
241
|
+
if(common.flagRouterSelf()){
|
|
242
|
+
url=url+params.action;
|
|
243
|
+
params=params.para;
|
|
244
|
+
}
|
|
233
245
|
return Axios.post(url, params, {
|
|
234
246
|
headers: common.getDataDrivenOpts().handler.getRequestHeaders()
|
|
235
247
|
}).then(this.postThenHandler).catch((ex) => {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<el-input v-if="model.id3" v-bind="model.attrs"
|
|
49
49
|
:placeholder="model.placeholder3" v-model="model.value3"
|
|
50
50
|
@input="inputHandler($event)" @change="changeHandler($event)"
|
|
51
|
-
:disabled="model.lock" :maxlength="
|
|
51
|
+
:disabled="model.lock" :maxlength="maxlength4"></el-input>
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
@@ -110,6 +110,15 @@
|
|
|
110
110
|
set: function (v) {
|
|
111
111
|
|
|
112
112
|
}
|
|
113
|
+
},
|
|
114
|
+
maxlength4()
|
|
115
|
+
{
|
|
116
|
+
if(this.model.max4)
|
|
117
|
+
{
|
|
118
|
+
return parseInt(this.model.max4)
|
|
119
|
+
}
|
|
120
|
+
return 99999
|
|
121
|
+
|
|
113
122
|
}
|
|
114
123
|
},
|
|
115
124
|
mounted() {
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
v-if="apiRouter!==null && !flagLook" :is="apiRouter.is" :vmodel="apiRouter"
|
|
8
8
|
@click="lookOwner(apiRouter,$event)"></component>
|
|
9
9
|
<div class="contacts-tips" v-else>
|
|
10
|
-
<!-- <button class="el-button el-button--primary el-button--mini max-btn-add">新增联系人</button>
|
|
11
|
-
<button class="el-button el-button--primary el-button--mini max-btn-add">通话记录</button>
|
|
12
|
-
<button class="el-button el-button--primary el-button--mini max-btn-add">查看历史号码</button> -->
|
|
13
10
|
<component class="el-button el-button--primary el-button--mini max-btn-add"
|
|
14
11
|
v-if="model && model.buttons!==null && model.buttons.length>0"
|
|
15
12
|
v-for="(col, index) in model.buttons" :key="index"
|
|
@@ -248,11 +248,33 @@
|
|
|
248
248
|
return false;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
if(eventName=='valid'&&!this.validFileClass())
|
|
252
|
+
{
|
|
253
|
+
this.validMessage="请选择附件分类";
|
|
254
|
+
this.valid = false;
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
252
257
|
this.valid = true;
|
|
253
258
|
return this.valid;
|
|
254
259
|
},
|
|
255
|
-
|
|
260
|
+
//验证附件分类是否必填
|
|
261
|
+
validFileClass()
|
|
262
|
+
{
|
|
263
|
+
if(this.model.paramName)
|
|
264
|
+
{
|
|
265
|
+
if(this.model.sourceList&&this.model.sourceList.length>0)
|
|
266
|
+
{
|
|
267
|
+
let notClass= this.model.sourceList.filter(item=>{
|
|
268
|
+
return item.mediaLabelID==undefined||item.mediaLabelID=="";
|
|
269
|
+
})
|
|
270
|
+
if(notClass.length>0)
|
|
271
|
+
{
|
|
272
|
+
return false
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return true;
|
|
277
|
+
},
|
|
256
278
|
classifyClickHandle: function () {
|
|
257
279
|
var self = this;
|
|
258
280
|
this.model.getOptions(() => {
|
|
@@ -263,12 +285,28 @@
|
|
|
263
285
|
classify.file.mediaLabelName = classify.option[this.model.optionModel.optionAttrs.label];
|
|
264
286
|
classify.file.mediaLabelID = classify.option[this.model.optionModel.optionAttrs.value];
|
|
265
287
|
this.model.setClassify(classify);
|
|
288
|
+
if(!this.validFileClass())
|
|
289
|
+
{
|
|
290
|
+
this.validMessage="请选择附件分类";
|
|
291
|
+
this.valid = false;
|
|
292
|
+
}else
|
|
293
|
+
{
|
|
294
|
+
this.valid = true;
|
|
295
|
+
}
|
|
266
296
|
},
|
|
267
297
|
classifyFormClickHandle: function (file) {
|
|
268
298
|
var self = this;
|
|
269
299
|
this.model.updateClassify(file, () => {
|
|
270
300
|
//self.$forceUpdate();
|
|
271
301
|
});
|
|
302
|
+
if(!this.validFileClass())
|
|
303
|
+
{
|
|
304
|
+
this.validMessage="请选择附件分类";
|
|
305
|
+
this.valid = false;
|
|
306
|
+
}else
|
|
307
|
+
{
|
|
308
|
+
this.valid = true;
|
|
309
|
+
}
|
|
272
310
|
},
|
|
273
311
|
}
|
|
274
312
|
}
|
|
@@ -32,6 +32,24 @@ const cbwt = function (source) {
|
|
|
32
32
|
set value3(v) {
|
|
33
33
|
source.code4 = v;
|
|
34
34
|
},
|
|
35
|
+
get max2() {
|
|
36
|
+
return source.maxValue2;
|
|
37
|
+
},
|
|
38
|
+
set max2(v) {
|
|
39
|
+
source.maxValue2 = v;
|
|
40
|
+
},
|
|
41
|
+
get max3() {
|
|
42
|
+
return source.maxValue3;
|
|
43
|
+
},
|
|
44
|
+
set max3(v) {
|
|
45
|
+
source.maxValue3 = v;
|
|
46
|
+
},
|
|
47
|
+
get max4() {
|
|
48
|
+
return source.maxValue4;
|
|
49
|
+
},
|
|
50
|
+
set max4(v) {
|
|
51
|
+
source.maxValue4 = v;
|
|
52
|
+
},
|
|
35
53
|
get optionColCount() {
|
|
36
54
|
return parseInt(source.optCount) || 5;
|
|
37
55
|
},
|
|
@@ -16,9 +16,9 @@ const ContactList = function (source,para ,callBack) {
|
|
|
16
16
|
return rtn._buttons;
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
if (
|
|
19
|
+
if (data.content.toolButtons) {
|
|
20
20
|
rtn._buttons = [];
|
|
21
|
-
|
|
21
|
+
data.content.toolButtons.forEach((v) => {
|
|
22
22
|
var button = Router(v);
|
|
23
23
|
button.is = "ct-btn";
|
|
24
24
|
button.attrs = { size: "mini", class: 'max-btn-gray' }
|
|
@@ -34,8 +34,8 @@ const ContactList = function (source,para ,callBack) {
|
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
rtn._actionRouter = [];
|
|
37
|
-
if (
|
|
38
|
-
|
|
37
|
+
if (data.content.actionRouters) {
|
|
38
|
+
data.content.actionRouters.forEach((v) => {
|
|
39
39
|
var router = Router(v);
|
|
40
40
|
//router.is = "ct-btn";
|
|
41
41
|
//router.attrs = { size: "mini" }
|
|
@@ -60,6 +60,71 @@ const ContactList = function (source,para ,callBack) {
|
|
|
60
60
|
}
|
|
61
61
|
return rtn._rowRouter;
|
|
62
62
|
}
|
|
63
|
+
},
|
|
64
|
+
get listData() {
|
|
65
|
+
if (!data.content.rows) {
|
|
66
|
+
data.content.rows = [];
|
|
67
|
+
}
|
|
68
|
+
return data.content.rows;
|
|
69
|
+
},
|
|
70
|
+
set listData(v) {
|
|
71
|
+
data.content.rows = v;
|
|
72
|
+
},
|
|
73
|
+
doAction(response,field) {
|
|
74
|
+
if (response.responseData) {
|
|
75
|
+
response = response.responseData;
|
|
76
|
+
}
|
|
77
|
+
if(field.flagFreshCurrentRow || field.flagAddRowAfterAction){
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
else{
|
|
81
|
+
switch (response.notification) {
|
|
82
|
+
case Enum.ActionType.Delete://删除
|
|
83
|
+
case Enum.ActionType.CloseTabThenDelete://删除
|
|
84
|
+
var deleteRow = response.content.split(',');
|
|
85
|
+
if (deleteRow) {
|
|
86
|
+
deleteRow.forEach((r) => {
|
|
87
|
+
const dataIndex = rtn.listData.indexOf(rtn.dataDictionary[r])
|
|
88
|
+
if (dataIndex !== -1) {
|
|
89
|
+
rtn.listData.splice(dataIndex, 1);
|
|
90
|
+
delete rtn.dataDictionary[r];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case Enum.ActionType.New://新增
|
|
96
|
+
case Enum.ActionType.CloseTabThenNew://新增
|
|
97
|
+
rtn.setStyleRow(response.content);
|
|
98
|
+
response.content.forEach((nr) => {
|
|
99
|
+
rtn.listData.unshift(nr);
|
|
100
|
+
});
|
|
101
|
+
rtn.dataDictionary = response.content;
|
|
102
|
+
rtn.$vue.calculatingRowHeight()
|
|
103
|
+
break;
|
|
104
|
+
case Enum.ActionType.Update://修改
|
|
105
|
+
case Enum.ActionType.CloseTabThenUpdate://修改
|
|
106
|
+
response.content.forEach((row) => {
|
|
107
|
+
for (var vkey in row) {
|
|
108
|
+
rtn.dataDictionary[row[rtn.primaryKey]][vkey] = row[vkey];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
break;
|
|
112
|
+
case Enum.ActionType.Export://导出
|
|
113
|
+
var fileName = response.content.fieldName1;
|
|
114
|
+
var fileContent = window.atob(response.content.code1);
|
|
115
|
+
common.saveFile(fileName, fileContent);
|
|
116
|
+
break;
|
|
117
|
+
case Enum.ActionType.Refersh://刷新
|
|
118
|
+
rtn.$vue.getPage(1);
|
|
119
|
+
break;
|
|
120
|
+
case Enum.ActionType.RefreshParent://刷新父页面
|
|
121
|
+
rtn.$vue.$emit('refreshParent');
|
|
122
|
+
break;
|
|
123
|
+
default:
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
rtn.$vue.$forceUpdate();
|
|
63
128
|
},
|
|
64
129
|
};
|
|
65
130
|
return rtn;
|
|
@@ -68,7 +133,7 @@ const ContactList = function (source,para ,callBack) {
|
|
|
68
133
|
Vue.prototype.$api.postHandler(common.globalUri(), { action: source,para:para}).then(
|
|
69
134
|
function (response) {
|
|
70
135
|
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
71
|
-
var rtn = init(response
|
|
136
|
+
var rtn = init(response);
|
|
72
137
|
if (callBack) {
|
|
73
138
|
callBack(rtn);
|
|
74
139
|
}
|
package/src/main.js
CHANGED
|
@@ -13,7 +13,9 @@ Vue.use(ElementUI, { size: 'mini'});
|
|
|
13
13
|
Vue.config.productionTip = false;
|
|
14
14
|
Vue.use(centaline, {
|
|
15
15
|
baseUrl: "http://10.88.22.46:7070/v1/form/router",
|
|
16
|
-
// baseUrl: "http://tjcptest.centaline.com.cn/v1/form/router",
|
|
16
|
+
// baseUrl: "http://tjcptest.centaline.com.cn/v1/form/router",
|
|
17
|
+
// baseUrl: "http://10.88.22.46:7070/",
|
|
18
|
+
// flagRouterSelf: true,
|
|
17
19
|
zindex: 999,
|
|
18
20
|
showRequestErrorMessage: true,
|
|
19
21
|
handler: {
|