centaline-data-driven 1.1.67 → 1.2.0
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 +4 -1
- package/package.json +4 -2
- package/src/Detail.vue +1 -1
- package/src/Form.vue +3 -2
- package/src/centaline/common/index.js +43 -27
- package/src/centaline/css/common.css +8 -0
- package/src/centaline/css/max.css +1 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +176 -46
- package/src/centaline/dynamicFile/src/dynamicFile.vue +1 -1
- package/src/centaline/dynamicForm/src/dynamicForm.vue +0 -1
- package/src/centaline/dynamicL/src/dynamicL.vue +13 -2
- package/src/centaline/dynamicPhotoSelect/index.js +11 -0
- package/src/centaline/dynamicPhotoSelect/src/dynamicPhotoSelect.vue +237 -0
- package/src/centaline/dynamicPhotoSelectList/index.js +11 -0
- package/src/centaline/dynamicPhotoSelectList/src/dynamicPhotoSelectList.vue +171 -0
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +45 -4
- package/src/centaline/dynamicSensitiveEye/src/dynamicSensitiveEye.vue +1 -1
- package/src/centaline/dynamicViewer/index.js +11 -0
- package/src/centaline/dynamicViewer/src/dynamicViewer.vue +45 -0
- package/src/centaline/loader/src/ctl/Detail.js +62 -5
- package/src/centaline/loader/src/ctl/L.js +28 -6
- package/src/centaline/loader/src/ctl/PhotoSelect.js +68 -0
- package/src/centaline/loader/src/ctl/PhotoSelectList.js +116 -0
- package/src/centaline/loader/src/ctl/SearchTable.js +42 -0
- package/src/centaline/loader/src/ctl/lib/Enum.js +5 -1
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +19 -0
- package/src/centaline/loader/src/ctl.js +2 -0
- package/wwwroot/static/centaline/centaline-data-driven.js +16 -1
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -3,12 +3,34 @@ import Base from './Base';
|
|
|
3
3
|
const T = function (source) {
|
|
4
4
|
var rtn = {
|
|
5
5
|
get labelValue() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var rtn = "";
|
|
7
|
+
var rtn1 = "";
|
|
8
|
+
var rtn2 = "";
|
|
9
|
+
if (source.name1) {
|
|
10
|
+
rtn1 = source.name1;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
if (source.code1) {
|
|
14
|
+
rtn1 = source.code1;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (source.name2) {
|
|
19
|
+
rtn2 = source.name2;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (source.code2) {
|
|
23
|
+
rtn2 = source.code2;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (rtn2.trim()) {
|
|
28
|
+
rtn = rtn1 + " ~ " + rtn2;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
rtn = rtn1;
|
|
32
|
+
}
|
|
33
|
+
return rtn;
|
|
12
34
|
}
|
|
13
35
|
};
|
|
14
36
|
rtn = base.copy(Base(source), rtn);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import base from '../../index';
|
|
2
|
+
import Base from './Base';
|
|
3
|
+
import Enum from './lib/Enum';
|
|
4
|
+
import Vue from 'vue';
|
|
5
|
+
import common from '../../../common';
|
|
6
|
+
import valid from '../../../validate/index';
|
|
7
|
+
//元数据、图片选择元数据、对应router、下拉框数据api
|
|
8
|
+
const PhotoSelect = function (source, fileSourceList, router, optionApi) {
|
|
9
|
+
var self = this;
|
|
10
|
+
var init = function (data) {
|
|
11
|
+
var rtn = {
|
|
12
|
+
get action() {
|
|
13
|
+
return router.action ? router.action : "";
|
|
14
|
+
},
|
|
15
|
+
get router() {
|
|
16
|
+
return router;
|
|
17
|
+
},
|
|
18
|
+
get sourceList() {
|
|
19
|
+
return fileSourceList;
|
|
20
|
+
},
|
|
21
|
+
set action(v) {
|
|
22
|
+
data.action = v;
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
_fileList: [],
|
|
26
|
+
get fileList() {
|
|
27
|
+
if (this._fileList.length !== 0) {
|
|
28
|
+
return rtn._fileList;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
//this._fileList = [];
|
|
32
|
+
fileSourceList.forEach((v, index) => {
|
|
33
|
+
if (v.flagDeleted !== 0) {
|
|
34
|
+
rtn._fileList.push(v);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
return rtn._fileList;
|
|
39
|
+
},
|
|
40
|
+
setFileList(fileList) {
|
|
41
|
+
fileSourceList = fileList;
|
|
42
|
+
rtn.fileList = fileList;
|
|
43
|
+
},
|
|
44
|
+
delete(index) {
|
|
45
|
+
fileSourceList.splice(index, 1);
|
|
46
|
+
rtn.fileList.splice(index, 1);
|
|
47
|
+
},
|
|
48
|
+
getFormObj() {
|
|
49
|
+
var rtnFormObj = {};
|
|
50
|
+
Object.defineProperty(rtnFormObj, source.fieldName1, {
|
|
51
|
+
get: function () {
|
|
52
|
+
return fileSourceList;
|
|
53
|
+
},
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
return rtnFormObj;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
rtn = base.copy(Base(data), rtn);
|
|
61
|
+
rtn = base.copy(rtn, valid.Init(rtn));
|
|
62
|
+
return rtn;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return init(source);
|
|
66
|
+
}
|
|
67
|
+
export default PhotoSelect;
|
|
68
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import common from '../../../common';
|
|
2
|
+
import Router from './Router';
|
|
3
|
+
import Vue from 'vue';
|
|
4
|
+
import Enum from './lib/Enum';
|
|
5
|
+
const PhotoSelectList = function (source, callBack,searchModel, defaultSearchData) {
|
|
6
|
+
var init = function (source) {
|
|
7
|
+
var rtn = {
|
|
8
|
+
searchModel: searchModel,
|
|
9
|
+
defaultSearchData: defaultSearchData,
|
|
10
|
+
$vue: null,
|
|
11
|
+
get source() {
|
|
12
|
+
return source;
|
|
13
|
+
},
|
|
14
|
+
set source(v) {
|
|
15
|
+
source = v;
|
|
16
|
+
},
|
|
17
|
+
_rowSelectRouter: null,
|
|
18
|
+
get rowSelectRouter() {
|
|
19
|
+
if (rtn._rowSelectRouter !== null) {
|
|
20
|
+
return rtn._rowSelectRouter;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
rtn._rowSelectRouter = [];
|
|
24
|
+
if (source.content.rowSelectRouter) {
|
|
25
|
+
var router = Router(source.content.rowSelectRouter);
|
|
26
|
+
rtn._rowSelectRouter = router;
|
|
27
|
+
}
|
|
28
|
+
return rtn._rowSelectRouter;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
_actionRouter: null,
|
|
32
|
+
get actionRouter() {
|
|
33
|
+
if (rtn._actionRouter !== null) {
|
|
34
|
+
return rtn._actionRouter;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
rtn._actionRouter = [];
|
|
38
|
+
if (source.content.actionRouters) {
|
|
39
|
+
source.content.actionRouters.forEach((v) => {
|
|
40
|
+
var router = Router(v);
|
|
41
|
+
//router.is = "ct-btn";
|
|
42
|
+
//router.attrs = { size: "mini" }
|
|
43
|
+
rtn._actionRouter.push(router);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return rtn._actionRouter;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
_rowRouter: null,
|
|
50
|
+
get rowRouter() {
|
|
51
|
+
if (rtn._rowRouter !== null) {
|
|
52
|
+
return rtn._rowRouter;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
rtn._rowRouter = [];
|
|
56
|
+
if (rtn.actionRouter) {
|
|
57
|
+
rtn.actionRouter.forEach((v) => {
|
|
58
|
+
if (v.show) {
|
|
59
|
+
rtn._rowRouter.push(v);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return rtn._rowRouter;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
doAction(api, searchModel, callback) {
|
|
67
|
+
var self = this;
|
|
68
|
+
var para = searchModel ? searchModel : {};
|
|
69
|
+
Vue.prototype.$api.postHandler(common.globalUri(), {
|
|
70
|
+
action: api,
|
|
71
|
+
para: para
|
|
72
|
+
})
|
|
73
|
+
.then(function (response) {
|
|
74
|
+
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
75
|
+
if (typeof callback !== 'undefined') {
|
|
76
|
+
callback(response.content);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
.catch((error) => {
|
|
81
|
+
console.error(error);
|
|
82
|
+
if (typeof callback !== 'undefined') {
|
|
83
|
+
callback();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
return rtn;
|
|
89
|
+
};
|
|
90
|
+
if (typeof source === 'string') {
|
|
91
|
+
var apiData = searchModel ? searchModel.searchData : {};
|
|
92
|
+
Vue.prototype.$api.postHandler(common.globalUri(),
|
|
93
|
+
{
|
|
94
|
+
action: source,
|
|
95
|
+
para:
|
|
96
|
+
{
|
|
97
|
+
searchFields: apiData,
|
|
98
|
+
pageAttribute: { pageIndex: 1 },
|
|
99
|
+
flagSearch: true
|
|
100
|
+
}
|
|
101
|
+
}).then(
|
|
102
|
+
function (response) {
|
|
103
|
+
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
104
|
+
var rtn = init(response);
|
|
105
|
+
if (callBack) {
|
|
106
|
+
callBack(rtn);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
return init(source);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
export default PhotoSelectList;
|
|
@@ -267,6 +267,48 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
|
|
|
267
267
|
return [rtn.listData[rtn.selectIndex]];
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
|
+
setSelectAll() {
|
|
271
|
+
debugger
|
|
272
|
+
if (rtn.listData.length === 0) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (rtn.isMulti) {
|
|
276
|
+
//找出没有被选中的框
|
|
277
|
+
var rtnData = rtn.listData.filter((ro) => {
|
|
278
|
+
return ro.$select === false
|
|
279
|
+
});
|
|
280
|
+
if(!rtnData||rtnData.length>0)
|
|
281
|
+
{
|
|
282
|
+
this.selectAll = 0;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
//1.没选中 2.部分选中 3.全选中
|
|
287
|
+
getSelectAll()
|
|
288
|
+
{
|
|
289
|
+
if (rtn.listData.length === 0) {
|
|
290
|
+
return 1;
|
|
291
|
+
}
|
|
292
|
+
if (rtn.isMulti) {
|
|
293
|
+
//找出没有被选中的框
|
|
294
|
+
var rtnData = rtn.listData.filter((ro) => {
|
|
295
|
+
return (ro.$select === false||ro.$select ===undefined)
|
|
296
|
+
});
|
|
297
|
+
if(rtnData.length<=0)//没有找到未选中的复选框
|
|
298
|
+
{
|
|
299
|
+
return 3;
|
|
300
|
+
}
|
|
301
|
+
if(rtnData.length>0&&rtnData.length<rtn.listData.length)//部分选中
|
|
302
|
+
{
|
|
303
|
+
return 2;
|
|
304
|
+
}
|
|
305
|
+
if(rtnData.length>0&&rtnData.length==rtn.listData.length)//没选中
|
|
306
|
+
{
|
|
307
|
+
return 1;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return 1;
|
|
311
|
+
},
|
|
270
312
|
_buttons: null,
|
|
271
313
|
get buttons() {
|
|
272
314
|
if (rtn._buttons !== null) {
|
|
@@ -30,6 +30,7 @@ import HyperLinkList from '../HyperLinkList';
|
|
|
30
30
|
import PlaceHolder from '../PlaceHolder';
|
|
31
31
|
import SensitiveEye from '../SensitiveEye';
|
|
32
32
|
import Cb from '../Cb';
|
|
33
|
+
import PhotoSelect from '../PhotoSelect';
|
|
33
34
|
|
|
34
35
|
const LibFunction = {
|
|
35
36
|
install(Vue) {
|
|
@@ -264,6 +265,24 @@ const LibFunction = {
|
|
|
264
265
|
item = File(field, files, router, source.parameterAction);
|
|
265
266
|
item.is = 'ct-file';
|
|
266
267
|
break;
|
|
268
|
+
case Enum.ControlType.PhotoSelect://图片选择
|
|
269
|
+
var router = source.actionRouters.find((v1) => {
|
|
270
|
+
return v1.key === field.fieldName1;
|
|
271
|
+
});
|
|
272
|
+
var files = [];
|
|
273
|
+
source.medias.forEach((v, index) => {
|
|
274
|
+
if (v.GroupID) {
|
|
275
|
+
if (v.GroupID == field.fieldName1) {
|
|
276
|
+
files.push(v);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
files.push(v);
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
item = PhotoSelect(field, files, router, source.parameterAction);
|
|
284
|
+
item.is = 'ct-photoselect';
|
|
285
|
+
break;
|
|
267
286
|
case Enum.ControlType.PasswordTextBox://密码
|
|
268
287
|
item = T(field, "text", false, true);
|
|
269
288
|
item.is = 'ct-text';
|
|
@@ -33,6 +33,8 @@ const loader = {
|
|
|
33
33
|
HyperLink: require("./ctl/HyperLink.js").default,
|
|
34
34
|
HyperLinkList: require("./ctl/HyperLinkList.js").default,
|
|
35
35
|
Detail: require("./ctl/Detail.js").default,
|
|
36
|
+
PhotoSelect: require("./ctl/PhotoSelect.js").default,
|
|
37
|
+
PhotoSelectList: require("./ctl/PhotoSelectList.js").default,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
export default loader;
|