centaline-data-driven-v3 0.1.58 → 0.1.60
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 +118 -118
- package/package.json +1 -1
- package/src/components/app/FormList.vue +194 -9
- package/src/components/web/File.vue +21 -2
- package/src/components/web/Form.vue +236 -8
- package/src/components/web/SearchList/SearchTable.vue +21 -5
- package/src/components/web/SearchList/TableToolbar.vue +9 -5
- package/src/components/web/SearchList.vue +1 -1
- package/src/components/web/ViewerFile/ViewerImage.vue +1 -1
- package/src/components/web/ViewerFile.vue +63 -21
- package/src/components/web/dialog.vue +18 -7
- package/src/loader/src/File.js +38 -22
- package/src/loader/src/Form.js +15 -5
- package/src/loader/src/SearchTable.js +58 -17
- package/src/main.js +2 -2
- package/src/utils/useDraggable.js +100 -0
- package/src/views/Form.vue +2 -2
- package/src/views/SearchList.vue +3 -9
|
@@ -7,7 +7,7 @@ function loadSearchTableApi(action, callBack, searchModel, flagSearch, defaultSe
|
|
|
7
7
|
var apiData = searchModel?.searchData ? searchModel.searchData : {};
|
|
8
8
|
|
|
9
9
|
request.postHandler(common.globalUri(), {
|
|
10
|
-
action: (appRootUrl||'') + action,
|
|
10
|
+
action: (appRootUrl || '') + action,
|
|
11
11
|
para: {
|
|
12
12
|
searchFields: apiData,
|
|
13
13
|
pageAttribute: {
|
|
@@ -49,7 +49,7 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
49
49
|
},
|
|
50
50
|
|
|
51
51
|
},
|
|
52
|
-
appRootUrl: appRootUrl||'',
|
|
52
|
+
appRootUrl: appRootUrl || '',
|
|
53
53
|
selectAll: false,//全选是否选中
|
|
54
54
|
selectIndex: 0,//选中行的索引
|
|
55
55
|
pageIndex: 1,//当前显示页数
|
|
@@ -280,7 +280,7 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
280
280
|
},
|
|
281
281
|
//取参数值的 Action名称
|
|
282
282
|
get parameterAction() {
|
|
283
|
-
return (appRootUrl||'') + source.content.parameterAction;
|
|
283
|
+
return (appRootUrl || '') + source.content.parameterAction;
|
|
284
284
|
},
|
|
285
285
|
get multiRowSpan() {
|
|
286
286
|
if (this.isMergeTitle) {
|
|
@@ -316,7 +316,10 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
316
316
|
if (source.content.toolButtons) {
|
|
317
317
|
|
|
318
318
|
source.content.toolButtons.forEach((v) => {
|
|
319
|
-
|
|
319
|
+
if (v.action) {
|
|
320
|
+
v.action = (appRootUrl || '') + v.action;
|
|
321
|
+
}
|
|
322
|
+
|
|
320
323
|
var button = Router(v);
|
|
321
324
|
button.is = "ct-button";
|
|
322
325
|
button.attrs = {
|
|
@@ -339,7 +342,9 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
339
342
|
rtn._actionRouter = [];
|
|
340
343
|
if (source.content.actionRouters) {
|
|
341
344
|
source.content.actionRouters.forEach((v) => {
|
|
342
|
-
v.action
|
|
345
|
+
if (v.action) {
|
|
346
|
+
v.action = (appRootUrl || '') + v.action;
|
|
347
|
+
}
|
|
343
348
|
var router = Router(v);
|
|
344
349
|
router.is = "ct-button";
|
|
345
350
|
rtn._actionRouter.push(router);
|
|
@@ -743,7 +748,9 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
743
748
|
},
|
|
744
749
|
//初始化button路由
|
|
745
750
|
getRtnRouter(v) {
|
|
746
|
-
v.action
|
|
751
|
+
if (v.action) {
|
|
752
|
+
v.action = (appRootUrl || '') + v.action;
|
|
753
|
+
}
|
|
747
754
|
var button = Router(v);
|
|
748
755
|
button.is = "ct-btn";
|
|
749
756
|
return button;
|
|
@@ -755,15 +762,15 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
755
762
|
}
|
|
756
763
|
//加载指定页数数据
|
|
757
764
|
function getPage(index, model, callback) {
|
|
758
|
-
|
|
765
|
+
var selectListData = []
|
|
766
|
+
if (model.isRetain) {
|
|
767
|
+
model.listData = model.getSelectRowData({ isMulti: model.isMulti })
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
model.listData.splice(0, model.listData.length);
|
|
771
|
+
}
|
|
759
772
|
model.pageIndex = index;
|
|
760
773
|
apiData(model, callback);
|
|
761
|
-
model.selectIndex = 0;
|
|
762
|
-
model._lastRowspan = null;
|
|
763
|
-
if (index === 1) {
|
|
764
|
-
setButtonsDisabled(model);
|
|
765
|
-
model.selectAll = false;
|
|
766
|
-
}
|
|
767
774
|
}
|
|
768
775
|
//加载下一页数据
|
|
769
776
|
function nextPage(model, callback) {
|
|
@@ -784,8 +791,17 @@ function apiData(model, callback) {
|
|
|
784
791
|
}
|
|
785
792
|
model.isLoading = true;
|
|
786
793
|
var newSearchModel = model.getSearchData();
|
|
794
|
+
if (model.isRetain && model.listData && model.listData.length > 0) {
|
|
795
|
+
newSearchModel.fields.push({
|
|
796
|
+
fieldName1: model.primaryFieldMappingDBName ? model.primaryFieldMappingDBName : model.primaryFieldName,
|
|
797
|
+
groupName: model.primaryFieldName,
|
|
798
|
+
operation: Enum.SearchOperation.None,
|
|
799
|
+
searchDataType: Enum.SearchDataType.None,
|
|
800
|
+
searchValue1: JSON.stringify(getSelectValue(model.listData)),
|
|
801
|
+
});
|
|
802
|
+
}
|
|
787
803
|
request.postHandler(common.globalUri(), {
|
|
788
|
-
action: model.appRootUrl + model.searchAction,
|
|
804
|
+
action: model.searchAction ? model.appRootUrl + model.searchAction : model.searchAction,
|
|
789
805
|
para: {
|
|
790
806
|
searchFields: newSearchModel ? newSearchModel : {},
|
|
791
807
|
pageAttribute: model.pageData,
|
|
@@ -845,13 +861,18 @@ function apiData(model, callback) {
|
|
|
845
861
|
model._buttons = [];
|
|
846
862
|
model._actions = [];
|
|
847
863
|
response.content.toolButtons.forEach((v) => {
|
|
848
|
-
v.action
|
|
864
|
+
if (v.action) {
|
|
865
|
+
v.action = model.appRootUrl + v.action;
|
|
866
|
+
}
|
|
849
867
|
var button = Router(v);
|
|
850
868
|
button.is = "ct-button";
|
|
851
869
|
button.attrs = {
|
|
852
870
|
size: "small",
|
|
853
871
|
class: 'btn-gray'
|
|
854
872
|
}
|
|
873
|
+
if (model.isRetain && button.key.toLowerCase() == 'Retain'.toLowerCase()) {
|
|
874
|
+
button.code1 = true
|
|
875
|
+
}
|
|
855
876
|
model._buttons.push(button);
|
|
856
877
|
});
|
|
857
878
|
model._buttons.forEach((v) => {
|
|
@@ -1013,7 +1034,7 @@ function getCurrentRowApiData(model, callback, rtnData, router) {
|
|
|
1013
1034
|
});
|
|
1014
1035
|
}
|
|
1015
1036
|
request.postHandler(common.globalUri(), {
|
|
1016
|
-
action: model.appRootUrl+model.searchAction,
|
|
1037
|
+
action: model.searchAction ? model.appRootUrl + model.searchAction : model.searchAction,
|
|
1017
1038
|
para: {
|
|
1018
1039
|
searchFields: searchFields,
|
|
1019
1040
|
pageAttribute: {
|
|
@@ -1075,7 +1096,9 @@ function getCurrentRowApiData(model, callback, rtnData, router) {
|
|
|
1075
1096
|
if (response.content.toolButtons) {
|
|
1076
1097
|
model._buttons = [];
|
|
1077
1098
|
response.content.toolButtons.forEach((v) => {
|
|
1078
|
-
v.action
|
|
1099
|
+
if (v.action) {
|
|
1100
|
+
v.action = model.appRootUrl + v.action;
|
|
1101
|
+
}
|
|
1079
1102
|
var button = Router(v);
|
|
1080
1103
|
button.is = "ct-button";
|
|
1081
1104
|
button.attrs = {
|
|
@@ -1246,6 +1269,24 @@ function checkCloseTabThen(notification) {
|
|
|
1246
1269
|
}
|
|
1247
1270
|
return rtn;
|
|
1248
1271
|
}
|
|
1272
|
+
function getSelectValue(model) {
|
|
1273
|
+
let submitData = {};
|
|
1274
|
+
let jsonData = [];
|
|
1275
|
+
if (model.listData != null) {
|
|
1276
|
+
var submitArr = [];
|
|
1277
|
+
model.primaryFieldName.split(',').forEach(v => {
|
|
1278
|
+
submitArr.push(common.initialsToLowerCase(v));
|
|
1279
|
+
})
|
|
1280
|
+
model.listData.forEach((row) => {
|
|
1281
|
+
let jsonModel = {};
|
|
1282
|
+
submitArr.forEach((k) => {
|
|
1283
|
+
jsonModel[common.initialsToLowerCase(k)] = common.getDataOfUpperLower(row, k);
|
|
1284
|
+
});
|
|
1285
|
+
jsonData.push(jsonModel);
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
return jsonData
|
|
1289
|
+
}
|
|
1249
1290
|
const SearchTable = {
|
|
1250
1291
|
loadSearchTableApi,
|
|
1251
1292
|
loadSearchTableModel,
|
package/src/main.js
CHANGED
|
@@ -21,7 +21,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
app.use(centaline, {
|
|
24
|
-
baseUrl: "
|
|
24
|
+
baseUrl: "http://10.88.22.66:7080/ibs-api/",
|
|
25
25
|
//baseUrl:"http://10.88.22.66:7080/ibs-api/",
|
|
26
26
|
//baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
|
|
27
27
|
//baseUrl: "http://10.88.22.13:6060/onecard-api/",
|
|
@@ -66,7 +66,7 @@ app.use(centaline, {
|
|
|
66
66
|
return {
|
|
67
67
|
|
|
68
68
|
//AuthorizationCode:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyaWQiOiIyNTEyMTUxNzQyMTg5QzI4MTgwRDkxRTk0MDhEOTA0QSIsImxvZ2luX3VzZXJfa2V5IjoiN2MzYzNjNjAtNWVjMy00MzdkLWExMDYtOWYxZTMwYjU0Mjg2In0.daG9mS98Gg8KmHSUjYHktMcO2Jk7SVtCcqm2sRB0I8Y2N0TuonIrVUDcHdNdDiuD3v6qO_f010tQWlBsAQ1dqg',
|
|
69
|
-
authobject: '{token:"
|
|
69
|
+
authobject: '{token:"T5067-2066339039585452032",platform:"WEB"}',
|
|
70
70
|
//authobject: '{EmpID:"Token_946d56e1-7972-4382-9d10-4a72496aab39",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_946d56e1-7972-4382-9d10-4a72496aab39",Platform:"WEB"}',
|
|
71
71
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
72
72
|
//authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// utils/useDraggable.js
|
|
2
|
+
import { ref, reactive, computed, onBeforeUnmount } from 'vue'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 对话框拖动组合式函数
|
|
6
|
+
* @param {string} selector - 要拖动的容器选择器(默认 '.ct-dialog_draggable')
|
|
7
|
+
* @param {Object} initialPosition - 初始位置 { left, top }
|
|
8
|
+
* @returns {Object} { containerStyle, startDrag, hasDragged }
|
|
9
|
+
*/
|
|
10
|
+
export function useDraggable(selector = '.ct-dialog_draggable', initialPosition = { left: 0, top: 0 }) {
|
|
11
|
+
const isDragging = ref(false)
|
|
12
|
+
const position = reactive({ ...initialPosition })
|
|
13
|
+
const hasDragged = ref(false)
|
|
14
|
+
const offset = reactive({ x: 0, y: 0 })
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 鼠标按下开始拖动
|
|
18
|
+
* @param {MouseEvent} e
|
|
19
|
+
*/
|
|
20
|
+
function startDrag(e) {
|
|
21
|
+
// 过滤按钮、关闭图标等元素,避免误触发
|
|
22
|
+
if (e.target.closest('button, .el-icon-close, [role="button"]')) return
|
|
23
|
+
|
|
24
|
+
// 查找真正要移动的对话框容器
|
|
25
|
+
const targetEl = e.currentTarget.closest(selector)
|
|
26
|
+
if (!targetEl) return
|
|
27
|
+
|
|
28
|
+
// 记录鼠标与容器左上角的偏移
|
|
29
|
+
const rect = targetEl.getBoundingClientRect()
|
|
30
|
+
offset.x = e.clientX - rect.left
|
|
31
|
+
offset.y = e.clientY - rect.top
|
|
32
|
+
|
|
33
|
+
// 首次拖动时记录当前位置,并切换为固定定位模式
|
|
34
|
+
if (!hasDragged.value) {
|
|
35
|
+
position.left = rect.left
|
|
36
|
+
position.top = rect.top
|
|
37
|
+
hasDragged.value = true
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
isDragging.value = true
|
|
41
|
+
|
|
42
|
+
// 绑定全局移动和释放事件
|
|
43
|
+
document.addEventListener('mousemove', onDrag)
|
|
44
|
+
document.addEventListener('mouseup', stopDrag)
|
|
45
|
+
|
|
46
|
+
// 阻止默认行为和文本选择
|
|
47
|
+
e.preventDefault()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 拖动过程中更新位置
|
|
52
|
+
* @param {MouseEvent} e
|
|
53
|
+
*/
|
|
54
|
+
function onDrag(e) {
|
|
55
|
+
if (!isDragging.value) return
|
|
56
|
+
position.left = e.clientX - offset.x
|
|
57
|
+
position.top = e.clientY - offset.y
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 停止拖动
|
|
62
|
+
*/
|
|
63
|
+
function stopDrag() {
|
|
64
|
+
isDragging.value = false
|
|
65
|
+
document.removeEventListener('mousemove', onDrag)
|
|
66
|
+
document.removeEventListener('mouseup', stopDrag)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 组件卸载时清理事件
|
|
70
|
+
onBeforeUnmount(() => {
|
|
71
|
+
document.removeEventListener('mousemove', onDrag)
|
|
72
|
+
document.removeEventListener('mouseup', stopDrag)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 对话框容器动态样式
|
|
77
|
+
* - 未拖动前:margin: auto; position: relative; (保持居中)
|
|
78
|
+
* - 拖动后:position: fixed; left/top 由拖动位置控制
|
|
79
|
+
*/
|
|
80
|
+
const containerStyle = computed(() => {
|
|
81
|
+
if (hasDragged.value) {
|
|
82
|
+
return {
|
|
83
|
+
position: 'fixed',
|
|
84
|
+
left: position.left + 'px',
|
|
85
|
+
top: position.top + 'px',
|
|
86
|
+
margin: '0'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
margin: 'auto',
|
|
91
|
+
position: 'relative'
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
containerStyle,
|
|
97
|
+
startDrag,
|
|
98
|
+
hasDragged
|
|
99
|
+
}
|
|
100
|
+
}
|
package/src/views/Form.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="form-app" class="data-driven" style="width:100%;height:100%;overflow:auto">
|
|
3
3
|
<!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
|
|
4
|
-
<ct-form :api="'/
|
|
4
|
+
<ct-form :api="'/PropertyTender/readDetail'" :apiParam="apiParam"></ct-form>
|
|
5
5
|
<ct-dialoglist></ct-dialoglist>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
<script lang="ts" setup>
|
|
9
|
-
const apiParam={"
|
|
9
|
+
const apiParam={"tenderID":"2013190230941741056","actionType":3}
|
|
10
10
|
</script>
|
package/src/views/SearchList.vue
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app-search" style="width:100%;height:100%;position: fixed;">
|
|
3
|
-
<span @click="clickHandle">aa</span>
|
|
4
3
|
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/ccesmanage/AppUseSummaryList/getLayoutOfSearch'"
|
|
5
4
|
|
|
6
5
|
:searchDataApi="'/ccesmanage/AppUseSummaryList/getList'"></ct-searchlist> -->
|
|
@@ -8,9 +7,10 @@
|
|
|
8
7
|
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
|
|
9
8
|
|
|
10
9
|
:searchDataApi="'/propertyPublishList/getListOfSearchModel'" :searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist> -->
|
|
11
|
-
<ct-searchlist :apiParam="apiParam"
|
|
12
|
-
:searchDataApi="'/
|
|
10
|
+
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/PropertyComprehensiveQueryList/getLayoutOfSearch'"
|
|
11
|
+
:searchDataApi="'/PropertyComprehensiveQueryList/getListOfSearchModel'"></ct-searchlist>
|
|
13
12
|
|
|
13
|
+
|
|
14
14
|
<ct-dialoglist ref="dialogList"></ct-dialoglist>
|
|
15
15
|
|
|
16
16
|
</div>
|
|
@@ -18,12 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
<script lang="ts" setup>
|
|
20
20
|
import { ref, nextTick } from 'vue'
|
|
21
|
-
|
|
22
21
|
const apiParam = {}
|
|
23
|
-
const reflist=ref()
|
|
24
|
-
function clickHandle(){
|
|
25
|
-
reflist.value.refScreen.model.formData.setValueByFieldName('b_date','code1','2026-05-20')
|
|
26
|
-
reflist.value.search()
|
|
27
|
-
}
|
|
28
22
|
|
|
29
23
|
</script>
|