centaline-data-driven-v3 0.0.76 → 0.0.78
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 +249 -192
- package/package.json +3 -1
- package/src/assets/commonWeb.css +1 -1
- package/src/components/web/AIChat.vue +753 -0
- package/src/components/web/ComboBox.vue +10 -3
- package/src/components/web/Form.vue +225 -157
- package/src/components/web/dialog.vue +11 -1
- package/src/loader/src/AIChat.js +50 -0
- package/src/loader/src/Form.js +62 -7
- package/src/loader/src/LibFunction.js +20 -0
- package/src/main.js +2 -2
- package/src/utils/Enum.js +5 -1
- package/src/views/SearchList.vue +5 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import base from '../index';
|
|
2
|
+
import valid from '../../utils/validate';
|
|
3
|
+
|
|
4
|
+
function loadFromModel(source, messages, router) {
|
|
5
|
+
|
|
6
|
+
var init = function (data) {
|
|
7
|
+
var rtn = {
|
|
8
|
+
|
|
9
|
+
messages:messages,
|
|
10
|
+
get action() {
|
|
11
|
+
return router && router.action ? router.action : "";//上传完整地址
|
|
12
|
+
},
|
|
13
|
+
set action(v) {
|
|
14
|
+
router.action = v;
|
|
15
|
+
},
|
|
16
|
+
getFormObj() {
|
|
17
|
+
var rtnFormObj = {};
|
|
18
|
+
var that = this;
|
|
19
|
+
Object.defineProperty(rtnFormObj, source.fieldName1, {
|
|
20
|
+
get: function () {
|
|
21
|
+
return that.fileSource;
|
|
22
|
+
},
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true
|
|
25
|
+
});
|
|
26
|
+
return rtnFormObj;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
};
|
|
30
|
+
rtn = base.copy(data, rtn);
|
|
31
|
+
|
|
32
|
+
rtn = base.copy(rtn, valid.Init(rtn));
|
|
33
|
+
return rtn;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return init(source);
|
|
37
|
+
}
|
|
38
|
+
function selfValidExcute(eventName, model) {
|
|
39
|
+
if (model.required) {
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
model.valid = true;
|
|
43
|
+
return model.valid;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const AI = {
|
|
47
|
+
loadFromModel,//获取有效文件数量
|
|
48
|
+
selfValidExcute
|
|
49
|
+
};
|
|
50
|
+
export default AI;
|
package/src/loader/src/Form.js
CHANGED
|
@@ -4,6 +4,8 @@ import Router from './Router';
|
|
|
4
4
|
import Enum from '../../utils/Enum';
|
|
5
5
|
import common from '../../utils/common';
|
|
6
6
|
import request from '../../utils/request';
|
|
7
|
+
import Field from './Field';
|
|
8
|
+
import AIChat from './AIChat';
|
|
7
9
|
|
|
8
10
|
function loadFormApi(api, callBack, apiParam, failCallBack, isFormList) {
|
|
9
11
|
if (api) {
|
|
@@ -47,6 +49,7 @@ function loadFromModel(source, isFormList) {
|
|
|
47
49
|
return rtn1.code1;
|
|
48
50
|
}
|
|
49
51
|
},
|
|
52
|
+
|
|
50
53
|
//获取code2
|
|
51
54
|
getCode2ByField1(id) {
|
|
52
55
|
var rtn1 = this.fieldsDic[id];
|
|
@@ -718,6 +721,57 @@ function loadFromModel(source, isFormList) {
|
|
|
718
721
|
get flagAlertCloseWindowAfterSave() {
|
|
719
722
|
return source.flagAlertCloseWindowAfterSave === true;
|
|
720
723
|
},
|
|
724
|
+
|
|
725
|
+
_AIattr: null,
|
|
726
|
+
get AIattr() {
|
|
727
|
+
if (rtn._AIattr !== null) {
|
|
728
|
+
return rtn._AIattr;
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
let aiattr = { showAI: false, width: 0 };
|
|
732
|
+
if (source.aiChat) {
|
|
733
|
+
aiattr.showAI = true;
|
|
734
|
+
aiattr.width = parseFloat(source.aiChat.width || 300);
|
|
735
|
+
}
|
|
736
|
+
rtn._AIattr = aiattr;
|
|
737
|
+
return rtn._AIattr;
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
_AIRouter: null,
|
|
741
|
+
get AIRouter() {
|
|
742
|
+
if (rtn._AIRouter !== null) {
|
|
743
|
+
return rtn._AIRouter;
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
var router = {};
|
|
747
|
+
if (source.aiChat) {
|
|
748
|
+
let field = source.aiChat;
|
|
749
|
+
router = rtn.actionRouters.find((v1) => {
|
|
750
|
+
return v1.key === field.fieldName1;
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
rtn._AIRouter = router;
|
|
754
|
+
return rtn._AIRouter;
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
get AIModel() {
|
|
758
|
+
let airtn = null
|
|
759
|
+
if (source.aiChat) {
|
|
760
|
+
|
|
761
|
+
let field = source.aiChat;
|
|
762
|
+
let item = Field(field, []);
|
|
763
|
+
|
|
764
|
+
var messages = [];
|
|
765
|
+
if (Array.isArray(field.code1)) {
|
|
766
|
+
messages = field.code1;
|
|
767
|
+
} else {
|
|
768
|
+
messages = field.code1 && field.code1 != "[]" ? JSON.parse(field.code1) : [];
|
|
769
|
+
}
|
|
770
|
+
airtn = AIChat.loadFromModel(item, messages, rtn.AIRouter);
|
|
771
|
+
}
|
|
772
|
+
return airtn;
|
|
773
|
+
|
|
774
|
+
},
|
|
721
775
|
//获取表单数据
|
|
722
776
|
getFormObj() {
|
|
723
777
|
var rtnFormObj = {};
|
|
@@ -760,8 +814,9 @@ function loadFromModel(source, isFormList) {
|
|
|
760
814
|
getRefFieldPara(refFieldNameArr) {
|
|
761
815
|
let submitData = {};
|
|
762
816
|
var tempFormData = rtn.getFormObj();
|
|
817
|
+
|
|
763
818
|
refFieldNameArr.forEach((v) => {
|
|
764
|
-
submitData[v] =
|
|
819
|
+
submitData[v] = common.getDataOfUpperLower(tempFormData,v);
|
|
765
820
|
});
|
|
766
821
|
return submitData;
|
|
767
822
|
},
|
|
@@ -1051,10 +1106,10 @@ function popupSearchListHandler(singleSelectio, field, router, model, Fields, pr
|
|
|
1051
1106
|
}
|
|
1052
1107
|
common.openDialog(dialogOption);
|
|
1053
1108
|
}
|
|
1054
|
-
function popupLocationHandler(field, router, callBack,model,props) {
|
|
1055
|
-
var submitData = Form.getFileData(router,model);
|
|
1056
|
-
submitData.lng=field.code1;
|
|
1057
|
-
submitData.lat=field.code2;
|
|
1109
|
+
function popupLocationHandler(field, router, callBack, model, props) {
|
|
1110
|
+
var submitData = Form.getFileData(router, model);
|
|
1111
|
+
submitData.lng = field.code1;
|
|
1112
|
+
submitData.lat = field.code2;
|
|
1058
1113
|
submitData = router.getActionPara(submitData).para;
|
|
1059
1114
|
|
|
1060
1115
|
var dialogOption = {
|
|
@@ -1069,7 +1124,7 @@ function popupLocationHandler(field, router, callBack,model,props) {
|
|
|
1069
1124
|
attrs: {
|
|
1070
1125
|
field: router,
|
|
1071
1126
|
apiParam: submitData,
|
|
1072
|
-
openType
|
|
1127
|
+
openType: 'Location',
|
|
1073
1128
|
onSubmit(ev) {
|
|
1074
1129
|
if (callBack) {
|
|
1075
1130
|
callBack(ev);
|
|
@@ -1077,7 +1132,7 @@ function popupLocationHandler(field, router, callBack,model,props) {
|
|
|
1077
1132
|
common.closeDialog(dialogOption);
|
|
1078
1133
|
},
|
|
1079
1134
|
onCloseDialog(ev) {
|
|
1080
|
-
common.closeDialog(dialogOption);
|
|
1135
|
+
common.closeDialog(dialogOption);
|
|
1081
1136
|
}
|
|
1082
1137
|
}
|
|
1083
1138
|
}]
|
|
@@ -22,6 +22,7 @@ import Photo from './Photo';
|
|
|
22
22
|
import Steps from './Steps';
|
|
23
23
|
import Tags from './Tags';
|
|
24
24
|
import Location from './Location';
|
|
25
|
+
import AIChat from './AIChat';
|
|
25
26
|
const LibFunction = {
|
|
26
27
|
install(app) {
|
|
27
28
|
},
|
|
@@ -255,6 +256,25 @@ const LibFunction = {
|
|
|
255
256
|
case Enum.ControlType.Image:
|
|
256
257
|
item.is = 'ct-image'
|
|
257
258
|
break;
|
|
259
|
+
|
|
260
|
+
case Enum.ControlType.AIChat: //AI
|
|
261
|
+
var router = {};
|
|
262
|
+
if (source.actionRouters) {
|
|
263
|
+
router = source.actionRouters.find((v1) => {
|
|
264
|
+
return v1.key === field.fieldName1;
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
var messages = [];
|
|
269
|
+
if (Array.isArray(field.code1)) {
|
|
270
|
+
messages = field.code1;
|
|
271
|
+
} else {
|
|
272
|
+
messages = field.code1 && field.code1 != "[]" ? JSON.parse(field.code1) : [];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
item = AIChat.loadFromModel(item, messages, router);
|
|
276
|
+
item.is = 'ct-aichat';
|
|
277
|
+
break;
|
|
258
278
|
default:
|
|
259
279
|
item = Label(item)
|
|
260
280
|
item.is = 'ct-label'
|
package/src/main.js
CHANGED
|
@@ -27,7 +27,7 @@ app.use(centaline, {
|
|
|
27
27
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
28
28
|
|
|
29
29
|
flagRouterSelf: true,
|
|
30
|
-
flagApp:
|
|
30
|
+
flagApp: false,//是否app端
|
|
31
31
|
zindex: 999,
|
|
32
32
|
showRequestSuccessMessage: true,
|
|
33
33
|
showRequestErrorMessage: true,
|
|
@@ -65,7 +65,7 @@ app.use(centaline, {
|
|
|
65
65
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
66
66
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
67
67
|
//authObject: '{token:"1-a7289bb2-9f1e-4a04-9016-1e555bf39188"}',
|
|
68
|
-
authObject: '{EmpID:"Token_43406e81-3337-4d1f-8917-edc5bfec9c9f",MachineCode:"e1f39b75-7069-4c4f-b5d5-c590da2d9aa2",SSO_Token:"SSOToken_43406e81-3337-4d1f-8917-edc5bfec9c9f",Platform:"
|
|
68
|
+
authObject: '{EmpID:"Token_43406e81-3337-4d1f-8917-edc5bfec9c9f",MachineCode:"e1f39b75-7069-4c4f-b5d5-c590da2d9aa2",SSO_Token:"SSOToken_43406e81-3337-4d1f-8917-edc5bfec9c9f",Platform:"web"}',
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
71
|
// 请求完成事件,可判断是否登录过期执行响应操作
|
package/src/utils/Enum.js
CHANGED
|
@@ -304,8 +304,12 @@ const Enum = {
|
|
|
304
304
|
/// <summary>
|
|
305
305
|
/// VUE 前端子定义组件,组件名在 Field.vueComponentName 属性里定义
|
|
306
306
|
/// </summary>
|
|
307
|
-
VueCustomizedComponent: 61
|
|
307
|
+
VueCustomizedComponent: 61,
|
|
308
308
|
|
|
309
|
+
/// <summary>
|
|
310
|
+
/// AI会话控件
|
|
311
|
+
/// </summary>
|
|
312
|
+
AIChat: 62
|
|
309
313
|
},
|
|
310
314
|
|
|
311
315
|
//返回状态码
|
package/src/views/SearchList.vue
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app-search" style="width:100%;height:100%;position: fixed;">
|
|
3
|
-
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
|
|
3
|
+
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
|
|
4
4
|
:searchDataApi="'/propertyPublishList/getListOfSearchModel'"
|
|
5
|
-
:searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist>
|
|
5
|
+
:searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist> -->
|
|
6
|
+
|
|
7
|
+
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
|
|
8
|
+
:searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist>
|
|
6
9
|
<ct-dialoglist ref="dialogList"></ct-dialoglist>
|
|
7
10
|
|
|
8
11
|
</div>
|