centaline-data-driven-v3 0.1.24 → 0.1.26
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 +76 -76
- package/package.json +1 -1
- package/src/components/web/Field.vue +2 -2
- package/src/components/web/Label.vue +12 -1
- package/src/components/web/SearchList/SearchTable.vue +14 -5
- package/src/components/web/SearchList/Tablecurrency.vue +4 -3
- package/src/loader/src/SearchTable.js +9 -2
- package/src/main.js +3 -3
- package/src/utils/mixins.js +40 -54
- package/src/views/SearchList.vue +3 -3
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<slot name="PreLabel">
|
|
21
|
-
<div v-if="model.preLabel1" class="preLabel">
|
|
21
|
+
<div v-if="model.preLabel1" class="preLabel" :style="model.isList ? 'white-space: nowrap' : ''">
|
|
22
22
|
<span v-html="model.preLabel1"></span>
|
|
23
23
|
</div>
|
|
24
24
|
</slot>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<slot name="PreLabel">
|
|
40
|
-
<div v-if="model.preLabel1" class="preLabel">
|
|
40
|
+
<div v-if="model.preLabel1" class="preLabel" :style="model.isList ? 'white-space: nowrap' : ''">
|
|
41
41
|
<span v-html="model.preLabel1"></span>
|
|
42
42
|
</div>
|
|
43
43
|
</slot>
|
|
@@ -71,7 +71,18 @@ function clickHandle() {
|
|
|
71
71
|
emit('change', model);
|
|
72
72
|
}
|
|
73
73
|
function HtmlReplace(v) {
|
|
74
|
-
|
|
74
|
+
return v.replace(
|
|
75
|
+
/(?:<[^>]*>)|([^<]+)/g, // 匹配所有标签,或标签外的文本
|
|
76
|
+
(match, text) => {
|
|
77
|
+
if (text) {
|
|
78
|
+
// 若匹配到文本部分,替换其中的空格(例如替换为 或保留连续空格)
|
|
79
|
+
return text.replace(/ /g, ' '); // 仅替换文本中的空格
|
|
80
|
+
} else {
|
|
81
|
+
// 若匹配到标签(含属性),不做处理,直接返回原标签
|
|
82
|
+
return match;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
)
|
|
75
86
|
}
|
|
76
87
|
defineExpose({
|
|
77
88
|
model
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
v-if="!router.rightField || row[router.rightField] == 1"
|
|
141
141
|
:key="rowRouterIndex" :rowData="row"
|
|
142
142
|
:rowindex="rowindex" :isOperationalColumn="true"
|
|
143
|
-
:router="router" :colValue="router.
|
|
143
|
+
:router="router" :colValue="router.controlLabel"
|
|
144
144
|
:isShowImg="false" @click="rolRouterClickHandler">
|
|
145
145
|
</Tablecurrency>
|
|
146
146
|
</template>
|
|
@@ -183,7 +183,8 @@
|
|
|
183
183
|
<Tablecurrency v-else :rowindex="rowindex" :align="column.attrs.align"
|
|
184
184
|
:class="column.autoRowHeight ? 'lineFeedCell' : 'cell'"
|
|
185
185
|
:columnName="column.id" :router="column.router"
|
|
186
|
-
:
|
|
186
|
+
:columnGroupId="column.groupId"
|
|
187
|
+
:colValue="getValueCaseInsensitive(row,column.id)" :rowData="row"
|
|
187
188
|
:eventTriggerType="column.eventTriggerType"
|
|
188
189
|
@click="rolRouterClickHandler"
|
|
189
190
|
@mouseenter="rolRouterMouseenterHandler">
|
|
@@ -726,7 +727,7 @@ function rowLayoutClickHandle(index) {
|
|
|
726
727
|
}
|
|
727
728
|
|
|
728
729
|
//表单列表操作
|
|
729
|
-
function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, callBack, flagMouseenter) {
|
|
730
|
+
function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, columnGroupId,callBack, flagMouseenter) {
|
|
730
731
|
field.rowindex = rowindex;
|
|
731
732
|
if (refRowsPopover.value[rowindex]) {
|
|
732
733
|
refRowsPopover.value[rowindex].hide();
|
|
@@ -752,6 +753,9 @@ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, ca
|
|
|
752
753
|
if (columnName) {
|
|
753
754
|
submitData.columnName = columnName;
|
|
754
755
|
}
|
|
756
|
+
if (columnGroupId) {
|
|
757
|
+
submitData.columnGroupId = columnGroupId;
|
|
758
|
+
}
|
|
755
759
|
|
|
756
760
|
let action = field.action;
|
|
757
761
|
if (field.actionField) {
|
|
@@ -761,8 +765,8 @@ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, ca
|
|
|
761
765
|
RouterClickHandler(field, submitData, action, model.value, 'table', callBack, flagMouseenter)
|
|
762
766
|
}
|
|
763
767
|
//表单列表操作
|
|
764
|
-
function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName, callBack, flagMouseenter) {
|
|
765
|
-
rolRouterClickHandler(field, rowData, rowindex, visible, columnName, callBack, true)
|
|
768
|
+
function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName,columnGroupId, callBack, flagMouseenter) {
|
|
769
|
+
rolRouterClickHandler(field, rowData, rowindex, visible, columnName,columnGroupId, callBack, true)
|
|
766
770
|
}
|
|
767
771
|
function popupClickHandler() {
|
|
768
772
|
var tempListData = model.value.getSelectRowData({ isMulti: model.value.isMulti });
|
|
@@ -1604,6 +1608,11 @@ function addClass(el, className) {
|
|
|
1604
1608
|
newClassName.push(className);
|
|
1605
1609
|
el.className = newClassName.join(" ");
|
|
1606
1610
|
}
|
|
1611
|
+
function getValueCaseInsensitive(obj, key) {
|
|
1612
|
+
const searchKey = key.toLowerCase();
|
|
1613
|
+
const foundKey = Object.keys(obj).find(k => k.toLowerCase() === searchKey);
|
|
1614
|
+
return foundKey ? obj[foundKey] : undefined;
|
|
1615
|
+
}
|
|
1607
1616
|
|
|
1608
1617
|
defineExpose({
|
|
1609
1618
|
model,
|
|
@@ -77,6 +77,7 @@ const props = defineProps({
|
|
|
77
77
|
colValue: String,
|
|
78
78
|
rowindex: Number,
|
|
79
79
|
columnName: String,
|
|
80
|
+
columnGroupId: String,
|
|
80
81
|
isOperationalColumn: {
|
|
81
82
|
type: Boolean,
|
|
82
83
|
default: false
|
|
@@ -141,10 +142,10 @@ function clickHandler(ev) {
|
|
|
141
142
|
video.value.pause();
|
|
142
143
|
}
|
|
143
144
|
visible.value = !visible.value;
|
|
144
|
-
emit('click', props.router, props.rowData, props.rowindex, visible.value, props.columnName);
|
|
145
|
+
emit('click', props.router, props.rowData, props.rowindex, visible.value, props.columnName,props.columnGroupId);
|
|
145
146
|
}
|
|
146
147
|
else {
|
|
147
|
-
emit('click', props.router, props.rowData, props.rowindex, null, props.columnName);
|
|
148
|
+
emit('click', props.router, props.rowData, props.rowindex, null, props.columnName, props.columnGroupId);
|
|
148
149
|
}
|
|
149
150
|
labelColor.value = 'mazarine'
|
|
150
151
|
|
|
@@ -172,7 +173,7 @@ function voiceEndedHandler() {
|
|
|
172
173
|
listenSeconds.value = -1;
|
|
173
174
|
}
|
|
174
175
|
function onShow() {
|
|
175
|
-
emit('mouseenter', props.router, props.rowData, props.rowindex, null, props.columnName, function (data) {
|
|
176
|
+
emit('mouseenter', props.router, props.rowData, props.rowindex, null, props.columnName, props.columnGroupId,function (data) {
|
|
176
177
|
if (data.height) {
|
|
177
178
|
data.height = (parseInt(data.height.replace('px', '')) + 50) + 'px';
|
|
178
179
|
}
|
|
@@ -64,6 +64,7 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
64
64
|
toolbarKey: 0,
|
|
65
65
|
downloadUrl: '',
|
|
66
66
|
_scripts: null,
|
|
67
|
+
OriginalColumns:source.content.columns?JSON.parse(JSON.stringify(source.content.columns)):[],
|
|
67
68
|
get scripts() {
|
|
68
69
|
if (rtn._scripts !== null) {
|
|
69
70
|
return rtn._scripts;
|
|
@@ -449,6 +450,9 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
|
|
|
449
450
|
get rowspan() {
|
|
450
451
|
return v.rowSpan || 1;
|
|
451
452
|
},
|
|
453
|
+
get groupId() {
|
|
454
|
+
return v.groupId;
|
|
455
|
+
},
|
|
452
456
|
get colspan() {
|
|
453
457
|
return v.colSpan || 1;
|
|
454
458
|
},
|
|
@@ -794,7 +798,8 @@ function apiData(model, callback) {
|
|
|
794
798
|
if (typeof response.page.flagMoreData !== 'undefined') {
|
|
795
799
|
model.flagMoreData = response.page.flagMoreData;
|
|
796
800
|
}
|
|
797
|
-
if (response.content.updateTableColumns && response.page.pageIndex <= 1
|
|
801
|
+
if (response.content.updateTableColumns && response.page.pageIndex <= 1
|
|
802
|
+
&&JSON.stringify(model.OriginalColumns) !== JSON.stringify(response.content.columns)) {
|
|
798
803
|
model.columns = response.content.columns;
|
|
799
804
|
if (model.template) {
|
|
800
805
|
// var tempLoader = template.loader(model.template).default;
|
|
@@ -1031,7 +1036,9 @@ function getCurrentRowApiData(model, callback, rtnData, router) {
|
|
|
1031
1036
|
if (typeof response.content.bottomText !== 'undefined') {
|
|
1032
1037
|
model.listFooter = response.content.bottomText;
|
|
1033
1038
|
}
|
|
1034
|
-
if (response.content.updateTableColumns && response.page.pageIndex <= 1
|
|
1039
|
+
if (response.content.updateTableColumns && response.page.pageIndex <= 1
|
|
1040
|
+
&&JSON.stringify(model.OriginalColumns) !== JSON.stringify(response.content.columns)
|
|
1041
|
+
) {
|
|
1035
1042
|
model.columns = response.content.columns;
|
|
1036
1043
|
if (model.template) {
|
|
1037
1044
|
// var tempLoader = template.loader(model.template).default;
|
package/src/main.js
CHANGED
|
@@ -25,7 +25,7 @@ app.use(centaline, {
|
|
|
25
25
|
//baseUrl:"http://10.88.22.13:7070/onecard-api/",
|
|
26
26
|
//baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
|
|
27
27
|
//baseUrl: "http://10.88.22.13:6060/onecard-api/",
|
|
28
|
-
//baseUrl: "http://10.88.22.66
|
|
28
|
+
//baseUrl: "http://10.88.22.66/IBS.Mvc/api/",
|
|
29
29
|
//baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
|
|
30
30
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
31
31
|
|
|
@@ -65,10 +65,10 @@ app.use(centaline, {
|
|
|
65
65
|
//获取请求头
|
|
66
66
|
getRequestHeaders: function () {
|
|
67
67
|
return {
|
|
68
|
-
authobject: '{token:"wufw-
|
|
68
|
+
authobject: '{token:"wufw-1980431367841927168",platform:"WEB"}',
|
|
69
69
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
70
70
|
//authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
|
|
71
|
-
//authObject: '{
|
|
71
|
+
//authObject: '{EmpID:"Token_4e09499b-4b76-46df-9ce5-5498d48ed062",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_4e09499b-4b76-46df-9ce5-5498d48ed062",Platform:"WEB"}',
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
getToken() {
|
package/src/utils/mixins.js
CHANGED
|
@@ -662,68 +662,54 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
else {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
else {
|
|
670
|
-
if (field.action.indexOf("?") > -1) {
|
|
671
|
-
model.$vue.downloadUrl = field.action + "&" + Math.random();
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
model.$vue.downloadUrl = field.action + "?" + Math.random();
|
|
675
|
-
}
|
|
676
|
-
}
|
|
665
|
+
|
|
666
|
+
field.loading = true;
|
|
667
|
+
if (!field.flagAlert && field.content) {
|
|
668
|
+
common.message(field.content, 'info', 1500, true)
|
|
677
669
|
}
|
|
678
|
-
|
|
679
|
-
field.loading =
|
|
680
|
-
if (
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
window.location.href = encodeURI(data.action);
|
|
670
|
+
field.doBlobAction(submitData, (data, headers) => {
|
|
671
|
+
field.loading = false;
|
|
672
|
+
if (data.type == "application/json") {
|
|
673
|
+
const reader = new FileReader();
|
|
674
|
+
reader.readAsText(data, 'utf-8');
|
|
675
|
+
reader.onload = function () {
|
|
676
|
+
data = JSON.parse(reader.result);
|
|
677
|
+
if (data.content) {
|
|
678
|
+
if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
|
|
679
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
680
|
+
window.location.href = encodeURI(data.action);
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
if (data.content.indexOf("?") > -1) {
|
|
684
|
+
model.$vue.downloadUrl = data.content + "&" + Math.random();
|
|
694
685
|
}
|
|
695
686
|
else {
|
|
696
|
-
|
|
697
|
-
model.$vue.downloadUrl = data.content + "&" + Math.random();
|
|
698
|
-
}
|
|
699
|
-
else {
|
|
700
|
-
model.$vue.downloadUrl = data.content + "?" + Math.random();
|
|
701
|
-
}
|
|
687
|
+
model.$vue.downloadUrl = data.content + "?" + Math.random();
|
|
702
688
|
}
|
|
703
689
|
}
|
|
704
|
-
else {
|
|
705
|
-
}
|
|
706
690
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
else {
|
|
710
|
-
if (!headers['content-disposition']) {
|
|
711
|
-
common.message('返回结果headers必须包含Access-Control-Expose-Headers和Content-Disposition!', 'error')
|
|
712
|
-
return false;
|
|
691
|
+
else {
|
|
692
|
+
}
|
|
713
693
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
link.setAttribute('download', fileName);
|
|
721
|
-
document.body.appendChild(link);
|
|
722
|
-
link.click();
|
|
723
|
-
document.body.removeChild(link);
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
if (!headers['content-disposition']) {
|
|
698
|
+
common.message('返回结果headers必须包含Access-Control-Expose-Headers和Content-Disposition!', 'error')
|
|
699
|
+
return false;
|
|
724
700
|
}
|
|
725
|
-
|
|
726
|
-
|
|
701
|
+
|
|
702
|
+
let blob = new Blob([data], { type: "application/octet-stream;" })
|
|
703
|
+
const url = window.URL.createObjectURL(blob);
|
|
704
|
+
const link = document.createElement('a');
|
|
705
|
+
let fileName = decodeURIComponent(escape(headers['content-disposition'].split('filename=')[1]));
|
|
706
|
+
link.href = url;
|
|
707
|
+
link.setAttribute('download', fileName);
|
|
708
|
+
document.body.appendChild(link);
|
|
709
|
+
link.click();
|
|
710
|
+
document.body.removeChild(link);
|
|
711
|
+
}
|
|
712
|
+
});
|
|
727
713
|
}
|
|
728
714
|
}
|
|
729
715
|
else if (field.isOpenForm) {
|
package/src/views/SearchList.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app-search" style="width:100%;height:100%;position: fixed;">
|
|
3
|
-
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/
|
|
4
|
-
:searchDataApi="'/
|
|
3
|
+
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/ReportPersonAttendanceList/getLayoutOfSearch'"
|
|
4
|
+
:searchDataApi="'ReportPersonAttendanceList/getListOfSearchModel'"></ct-searchlist>
|
|
5
5
|
|
|
6
6
|
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
|
|
7
7
|
:searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
<script lang="ts" setup>
|
|
17
17
|
import { ref, nextTick } from 'vue'
|
|
18
|
-
const apiParam = {
|
|
18
|
+
const apiParam = {}
|
|
19
19
|
|
|
20
20
|
</script>
|