centaline-data-driven-v3 0.1.40 → 0.1.41
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
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
:style="{ width: pageWidth ? pageWidth + 'px' : '100%', margin: 'auto', 'min-height': minHeight }">
|
|
4
4
|
<div style="display: flex; width: 100%;">
|
|
5
5
|
<div style="flex: 1; min-width: 0;">
|
|
6
|
-
<div v-if="model !== null && !loading" class="ct-form"
|
|
7
|
-
|
|
6
|
+
<div v-if="model !== null && !loading" class="ct-form"
|
|
7
|
+
:style="{ margin: openType != 'tree' ? '10px' : '0px' }">
|
|
8
|
+
<el-affix target=".ct-form" v-if="model.tip" :offset="tipTopHight">
|
|
8
9
|
<div class="ct-form-tip" ref="refTip">
|
|
9
10
|
<span v-html="model.tip"></span>
|
|
10
11
|
</div>
|
|
@@ -57,7 +58,8 @@
|
|
|
57
58
|
<template v-if="model.isHorizontalLayout">
|
|
58
59
|
<component :is="model.flagFixedTabOnHorizontalLayout ? 'el-affix' : 'div'"
|
|
59
60
|
v-bind="model.flagFixedTabOnHorizontalLayout ? { offset: tabTopHight, target: '.ct-form' } : {}">
|
|
60
|
-
<el-tabs v-model="activeName" @tab-click="tabClick" style="background: #fff;"
|
|
61
|
+
<el-tabs v-model="activeName" @tab-click="tabClick" style="background: #fff;"
|
|
62
|
+
ref="refTabs">
|
|
61
63
|
<template v-for="(item, index) in model.collapse" :key="index">
|
|
62
64
|
<el-tab-pane :name="index.toString()" :lazy="item.lazyLoad"
|
|
63
65
|
v-if="item.show !== false" :key="index">
|
|
@@ -100,7 +102,7 @@
|
|
|
100
102
|
<template #title>
|
|
101
103
|
<i class="sign"></i>
|
|
102
104
|
<span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel
|
|
103
|
-
|
|
105
|
+
}}</span>
|
|
104
106
|
<span v-html="item.sufLabel1"></span>
|
|
105
107
|
</template>
|
|
106
108
|
|
|
@@ -110,10 +112,11 @@
|
|
|
110
112
|
v-if="col.show !== false && col.lineFeed"></div>
|
|
111
113
|
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
|
|
112
114
|
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
113
|
-
<component ref="Fields" :is="col.is" :vmodel="col"
|
|
114
|
-
:
|
|
115
|
-
v-bind="col.bindPara"
|
|
116
|
-
|
|
115
|
+
<component ref="Fields" :is="col.is" :vmodel="col"
|
|
116
|
+
:key="col.fieldItemKey" :listHeight="listHeight"
|
|
117
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
118
|
+
:fileData="getFileData(col)" @change="changeHandler"
|
|
119
|
+
@fieldClick="fieldClickHandler"
|
|
117
120
|
@popupLocation="popupLocationHandler"
|
|
118
121
|
@popupSearchList="popupSearchListHandler"
|
|
119
122
|
@importComplete="importComplete"
|
|
@@ -272,7 +275,6 @@ const props = defineProps({
|
|
|
272
275
|
dialoWidth: Number,
|
|
273
276
|
listHeight: Number,
|
|
274
277
|
})
|
|
275
|
-
|
|
276
278
|
const itemKey = ref(1)
|
|
277
279
|
const router = useRouter()
|
|
278
280
|
const loading = ref(true)
|
|
@@ -288,7 +290,9 @@ const showAI = ref(false);
|
|
|
288
290
|
const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
|
|
289
291
|
const tabActiveNameKey = ref('')
|
|
290
292
|
const refTip = ref()
|
|
291
|
-
const
|
|
293
|
+
const tipTopHight = ref(0)
|
|
294
|
+
const tabTopHight = ref(0)
|
|
295
|
+
const refTabs = ref()
|
|
292
296
|
|
|
293
297
|
const qrtimer1 = ref(null)
|
|
294
298
|
const qrtimer2 = ref(null)
|
|
@@ -322,6 +326,17 @@ onDeactivated(() => {
|
|
|
322
326
|
})
|
|
323
327
|
onMounted(() => {
|
|
324
328
|
setCss();
|
|
329
|
+
if (refForm.value) {
|
|
330
|
+
const rect = refForm.value.getBoundingClientRect()
|
|
331
|
+
const distanceFromTop = rect.top + window.scrollY
|
|
332
|
+
tipTopHight.value = distanceFromTop;
|
|
333
|
+
if (refTip.value) {
|
|
334
|
+
tabTopHight.value = tabTopHight.value + refTip.value.clientHeight + 10
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
tabTopHight.value = tipTopHight.value;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
325
340
|
})
|
|
326
341
|
init()
|
|
327
342
|
//初始化数据
|
|
@@ -379,11 +394,6 @@ function load(data) {
|
|
|
379
394
|
|
|
380
395
|
}
|
|
381
396
|
}
|
|
382
|
-
nextTick(() => {
|
|
383
|
-
if (refTip.value) {
|
|
384
|
-
tabTopHight.value = tabTopHight.value + refTip.value.clientHeight + 10
|
|
385
|
-
}
|
|
386
|
-
})
|
|
387
397
|
//通知父组件加载完成
|
|
388
398
|
emit('loaded', model.value);
|
|
389
399
|
}
|
|
@@ -703,11 +713,29 @@ function setCss() {
|
|
|
703
713
|
if (props.topHeight > -1) {
|
|
704
714
|
minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
|
|
705
715
|
}
|
|
706
|
-
else if(props.dialogHeight){
|
|
716
|
+
else if (props.dialogHeight) {
|
|
707
717
|
minHeight.value = (props.dialogHeight) + 'px';
|
|
708
718
|
}
|
|
709
|
-
else{
|
|
710
|
-
|
|
719
|
+
else if (props.openType == 'tree') {
|
|
720
|
+
if (refForm.value) {
|
|
721
|
+
let parentDom = refForm.value.parentElement;
|
|
722
|
+
minHeight.value = parentDom.clientHeight + 'px';
|
|
723
|
+
refForm.value.style.height = minHeight.value
|
|
724
|
+
refForm.value.style.overflowY = 'auto'
|
|
725
|
+
refForm.value.style.paddingBottom = '45px'
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
else if (props.openType == 'detail') {
|
|
729
|
+
if (refForm.value) {
|
|
730
|
+
let parentDom = refForm.value.parentElement;
|
|
731
|
+
minHeight.value = parentDom.clientHeight + 'px';
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
if (refForm.value) {
|
|
736
|
+
let parentDom = refForm.value.parentElement;
|
|
737
|
+
minHeight.value = parentDom.clientHeight + 'px';
|
|
738
|
+
}
|
|
711
739
|
}
|
|
712
740
|
}
|
|
713
741
|
|
|
@@ -726,18 +754,93 @@ function buttonsWidth() {
|
|
|
726
754
|
rtn = props.dialoWidth - model.value.aiAttr.width - 4 + 'px';
|
|
727
755
|
}
|
|
728
756
|
else if (props.pageWidth) {
|
|
729
|
-
rtn = props.pageWidth
|
|
757
|
+
rtn = props.pageWidth + 'px';
|
|
730
758
|
|
|
731
759
|
}
|
|
760
|
+
|
|
732
761
|
return rtn;
|
|
733
762
|
}
|
|
734
763
|
|
|
735
|
-
|
|
764
|
+
|
|
765
|
+
// 点击后让激活 Tab 居中
|
|
766
|
+
async function tabClick(pane: TabsPaneContext) {
|
|
736
767
|
if (props.openType == 'detail') {
|
|
737
768
|
window.localStorage.setItem(tabActiveNameKey.value, model.value.collapse[event.index].fieldName1);//存储
|
|
738
769
|
}
|
|
770
|
+
// await nextTick() // 等 DOM 更新完再取节点
|
|
771
|
+
// debugger
|
|
772
|
+
// const navWrapScroll = document.querySelector('.el-tabs__nav-scroll') as HTMLElement
|
|
773
|
+
// const firstTab = document.querySelector('.el-tabs__item') as HTMLElement
|
|
774
|
+
// if (!navWrapScroll || !firstTab) return
|
|
775
|
+
|
|
776
|
+
// // 第一个 tab 的“右边”到容器左边的距离
|
|
777
|
+
// const firstRight = firstTab.getBoundingClientRect().right
|
|
778
|
+
// const wrapLeft = navWrapScroll.getBoundingClientRect().left
|
|
779
|
+
|
|
780
|
+
// // 只要右边还在容器左边之外,就说明还没进来
|
|
781
|
+
// const firstVisible = firstRight >= wrapLeft
|
|
782
|
+
// const visibleCount = getVisibleTabCount();
|
|
783
|
+
// if (pane.index < visibleCount / 2 && firstVisible) {
|
|
784
|
+
// return;
|
|
785
|
+
// }
|
|
786
|
+
|
|
787
|
+
// const navWrap = document.querySelector('.el-tabs__nav') as HTMLElement
|
|
788
|
+
// const activeBtn = document.querySelector(
|
|
789
|
+
// `.el-tabs__item#tab-${pane.paneName}`
|
|
790
|
+
// ) as HTMLElement
|
|
791
|
+
|
|
792
|
+
// if (!navWrapScroll || !navWrap || !activeBtn) return
|
|
793
|
+
|
|
794
|
+
// const wrapWidth = navWrapScroll.clientWidth
|
|
795
|
+
// const btnLeft = activeBtn.offsetLeft
|
|
796
|
+
// const btnWidth = activeBtn.offsetWidth
|
|
797
|
+
|
|
798
|
+
// /* 想让 activeBtn 居中,需要整个 navWrap 向左移动的距离 */
|
|
799
|
+
// const dx = (wrapWidth - btnWidth) / 2 - btnLeft
|
|
800
|
+
|
|
801
|
+
// setTimeout(() => {
|
|
802
|
+
// navWrap.style.transition = 'transform .3s ease-out'
|
|
803
|
+
// navWrap.style.transform = `translateX(${dx}px)`
|
|
804
|
+
// }, 50);
|
|
805
|
+
|
|
806
|
+
// const navWrapScroll = document.querySelector('.el-tabs__nav-scroll') as HTMLElement
|
|
807
|
+
// const navWrap = document.querySelector('.el-tabs__nav') as HTMLElement
|
|
808
|
+
// const activeBtn = document.querySelector(
|
|
809
|
+
// `.el-tabs__item#tab-${pane.paneName}`
|
|
810
|
+
// ) as HTMLElement
|
|
811
|
+
// if (!navWrapScroll || !activeBtn) return
|
|
812
|
+
|
|
813
|
+
// const wrapWidth = navWrapScroll.clientWidth
|
|
814
|
+
// const btnLeft = activeBtn.offsetLeft
|
|
815
|
+
// const btnWidth = activeBtn.offsetWidth
|
|
816
|
+
|
|
817
|
+
// // 滚动到“元素中心 - 容器半宽”的位置,就能居中
|
|
818
|
+
// navWrapScroll.scrollTo({
|
|
819
|
+
// left: btnLeft - (wrapWidth - btnWidth) / 2,
|
|
820
|
+
// behavior: 'smooth'
|
|
821
|
+
// })
|
|
822
|
+
|
|
823
|
+
}
|
|
824
|
+
/** 返回当前屏幕完全可见的 tab 个数 */
|
|
825
|
+
function getVisibleTabCount(): number {
|
|
826
|
+
const navWrapScroll = document.querySelector('.el-tabs__nav-scroll') as HTMLElement
|
|
827
|
+
const navWrap = document.querySelector('.el-tabs__nav') as HTMLElement
|
|
828
|
+
if (!navWrapScroll || !navWrap) return 0
|
|
829
|
+
|
|
830
|
+
const wrapWidth = navWrapScroll.clientWidth // 容器可视宽
|
|
831
|
+
const allTabs = Array.from(navWrap.querySelectorAll('.el-tabs__item')) as HTMLElement[]
|
|
832
|
+
if (!allTabs.length) return 0
|
|
833
|
+
|
|
834
|
+
// ① 如果所有 tab 总宽度 ≤ 容器宽,全部可见
|
|
835
|
+
const totalWidth = allTabs.reduce((sum, tab) => sum + tab.offsetWidth, 0)
|
|
836
|
+
if (totalWidth <= wrapWidth) return allTabs.length
|
|
837
|
+
|
|
838
|
+
// ② 否则按“平均宽度”向下取整
|
|
839
|
+
const avgWidth = totalWidth / allTabs.length
|
|
840
|
+
return Math.floor(wrapWidth / avgWidth)
|
|
739
841
|
}
|
|
740
842
|
|
|
843
|
+
|
|
741
844
|
</script>
|
|
742
845
|
|
|
743
846
|
<style scoped>
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<template v-if="pageType == 'form'">
|
|
17
17
|
<div style="height: 100%;">
|
|
18
18
|
<div class="ct-form"
|
|
19
|
-
:style="{ 'width': (width ? width + 'px' : 'auto'), 'height': (height ? height + 'px' : '
|
|
20
|
-
<ct-form :api="formApi" :api-param="apiParam1" :
|
|
19
|
+
:style="{ 'width': (width ? width + 'px' : 'auto'), 'height': (height ? height + 'px' : '100%') ,margin: '0px','position': 'relative','background-color': '#FFFFFF','border-radius': '6px'}">
|
|
20
|
+
<ct-form :api="formApi" :api-param="apiParam1" :pageWidth="width" :pageHeight="height" :openType="'tree'"></ct-form>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
package/src/main.js
CHANGED
|
@@ -21,8 +21,8 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
app.use(centaline, {
|
|
24
|
-
baseUrl: "http://10.88.22.
|
|
25
|
-
//baseUrl:"http://10.88.22.
|
|
24
|
+
baseUrl: "http://10.88.22.66:7080/ibs-api/",
|
|
25
|
+
//baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
|
|
26
26
|
//baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
|
|
27
27
|
//baseUrl: "http://10.88.22.13:6060/onecard-api/",
|
|
28
28
|
//baseUrl: "http://10.88.22.66/IBS.Mvc/api/",
|
|
@@ -66,8 +66,9 @@ app.use(centaline, {
|
|
|
66
66
|
getRequestHeaders: function () {
|
|
67
67
|
return {
|
|
68
68
|
|
|
69
|
-
AuthorizationCode:'Bearer eyJhbGciOiJIUzUxMiJ9.
|
|
70
|
-
authobject: '{
|
|
69
|
+
//AuthorizationCode:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQxZTM1MGE1LWFiMGMtNDY2Mi05MTQ5LTAwYTQ4NTljMDkyYSJ9.3ci0CpgcmIqm-ORf9efFnvB6sgAWVSGv6ptrWMe3ZSs3fQ8PvlZv3BizhcBJjk0l7csA2Ihw9oodq2N81ELUoQ',
|
|
70
|
+
authobject: '{token:"T5067-2003269852298657792",platform:"WEB"}',
|
|
71
|
+
//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
72
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
72
73
|
//authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
|
|
73
74
|
//authObject: '{EmpID:"Token_4e09499b-4b76-46df-9ce5-5498d48ed062",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_4e09499b-4b76-46df-9ce5-5498d48ed062",Platform:"WEB"}',
|
package/src/views/SearchList.vue
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app-search" style="width:100%;height:100%;position: fixed;">
|
|
3
|
-
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/
|
|
3
|
+
<ct-searchlist :apiParam="apiParam" :searchConditionApi="'/RoleList/getLayoutOfSearch'"
|
|
4
4
|
|
|
5
|
-
:searchDataApi="'/
|
|
5
|
+
:searchDataApi="'/RoleList/getListOfSearchModel'"></ct-searchlist>
|
|
6
6
|
|
|
7
|
+
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
|
|
8
|
+
|
|
9
|
+
:searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist> -->
|
|
7
10
|
<!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
|
|
8
11
|
:searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->
|
|
9
12
|
|
package/src/views/Tree.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div id="app-Tree" style="height:100%;position: fixed;width:100%;padding: 10px;">
|
|
3
3
|
<ct-treelist :flagsearch="true" :apiParam="apiParam" :leftWidth="'280'"
|
|
4
|
-
:searchConditionApi="'/SystemParameterCatalogList/getLayoutOfSearch'"
|
|
4
|
+
:searchConditionApi="'/SystemParameterCatalogList/getLayoutOfSearch'"
|
|
5
|
+
:searchDataApi="'/SystemParameterCatalogList/getListOfSearchModel'"
|
|
5
6
|
@loaded="loaded"></ct-treelist>
|
|
6
7
|
<!-- <ct-textbox :source="source"></ct-textbox> -->
|
|
7
8
|
<ct-dialoglist></ct-dialoglist>
|
|
@@ -14,4 +15,9 @@ const apiParam = {
|
|
|
14
15
|
function loaded() {
|
|
15
16
|
|
|
16
17
|
}
|
|
17
|
-
</script>
|
|
18
|
+
</script>
|
|
19
|
+
<style>
|
|
20
|
+
body{
|
|
21
|
+
background-color: #ddd;
|
|
22
|
+
}
|
|
23
|
+
</style>
|