centaline-data-driven-v3 0.1.38 → 0.1.40
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 +259 -259
- package/package.json +2 -1
- package/src/assets/commonWeb.css +4 -1
- package/src/components/web/ComboBox.vue +8 -1
- package/src/components/web/ContainerControl.vue +6 -6
- package/src/components/web/Cron.vue +194 -0
- package/src/components/web/DatePicker.vue +2 -2
- package/src/components/web/Form.vue +69 -46
- package/src/components/web/JsonViewer.vue +48 -27
- package/src/components/web/SearchScreen.vue +4 -2
- package/src/components/web/dialog.vue +9 -1
- package/src/loader/src/Cron.js +11 -0
- package/src/loader/src/DatePicker.js +3 -7
- package/src/loader/src/Form.js +11 -0
- package/src/loader/src/LibFunction.js +6 -1
- package/src/loader/src/SliceUpload.js +9 -1
- package/src/main.js +4 -2
- package/src/utils/Enum.js +6 -1
- package/src/utils/common.js +5 -4
- package/src/utils/distance-utils.js +84 -0
- package/src/utils/mixins.js +74 -4
- package/src/utils/request.js +3 -3
- package/src/utils/validate.js +4 -1
- package/src/views/Form.vue +1 -1
- package/src/views/SearchList.vue +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "centaline-data-driven-v3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "centaline-data-driven-v3",
|
|
6
6
|
"main": "dist/centaline-data-driven-v3.umd.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"vue-cropper": "^1.1.1",
|
|
26
26
|
"vue-router": "^4.2.5",
|
|
27
27
|
"vue-ueditor-wrap": "^3.0.8",
|
|
28
|
+
"vue3-cron-plus-picker": "^1.0.2",
|
|
28
29
|
"vue3-json-viewer": "^2.4.1",
|
|
29
30
|
"vue3-pdf-app": "^1.0.3",
|
|
30
31
|
"vuedraggable": "^4.1.0"
|
package/src/assets/commonWeb.css
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<template #tag>
|
|
22
22
|
<template v-for="(v, i) in model.labelValue" :key="i">
|
|
23
23
|
<el-tag class="ml-2" type="info" disable-transitions :closable="!v.locked && !model.locked"
|
|
24
|
-
|
|
24
|
+
:style="{ marginRight: i + 1 == model.labelValue.length ? '20px' : '' }"
|
|
25
25
|
@close="closeTag(v.code)">
|
|
26
26
|
{{ v.name }}</el-tag>
|
|
27
27
|
</template>
|
|
@@ -62,6 +62,7 @@ const refselect = ref()
|
|
|
62
62
|
const open = ref(false)
|
|
63
63
|
const isComposing = ref(false);
|
|
64
64
|
const nodatatext = ref(' ')
|
|
65
|
+
const popperWidth = ref(null)
|
|
65
66
|
model.value.itemKey = Math.random();
|
|
66
67
|
let cancelTokenSource = null; // 用于存储取消令牌
|
|
67
68
|
|
|
@@ -77,6 +78,7 @@ onBeforeUnmount(() => {
|
|
|
77
78
|
|
|
78
79
|
//下拉框出现/隐藏时触发
|
|
79
80
|
function visibleChange(visible) {
|
|
81
|
+
|
|
80
82
|
//是否有更多选择路由
|
|
81
83
|
if (model.value.moreActionRouter) {
|
|
82
84
|
refselect.value.popperRef.hidden = true
|
|
@@ -84,6 +86,9 @@ function visibleChange(visible) {
|
|
|
84
86
|
else {
|
|
85
87
|
//出现获取数据
|
|
86
88
|
if (visible) {
|
|
89
|
+
if (refselect.value && popperWidth.value) {
|
|
90
|
+
refselect.value.popperSize = popperWidth.value;
|
|
91
|
+
}
|
|
87
92
|
open.value = true;
|
|
88
93
|
nodatatext.value = common.LocalizedString('加载中', '加載中');
|
|
89
94
|
if (!model.value.filterable) {
|
|
@@ -256,9 +261,11 @@ function setminWidth() {
|
|
|
256
261
|
|
|
257
262
|
if ((span.getBoundingClientRect().width + 40) <= refselect.value.selectRef.offsetWidth) {
|
|
258
263
|
refselect.value.popperSize = refselect.value.selectRef.offsetWidth;
|
|
264
|
+
popperWidth.value = refselect.value.selectRef.offsetWidth;
|
|
259
265
|
}
|
|
260
266
|
else {
|
|
261
267
|
refselect.value.popperSize = span.getBoundingClientRect().width + 40;
|
|
268
|
+
popperWidth.value = span.getBoundingClientRect().width + 40;
|
|
262
269
|
}
|
|
263
270
|
|
|
264
271
|
document.body.removeChild(span);
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
|
|
13
13
|
<div v-if="col.show !== false"
|
|
14
14
|
:class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
|
|
15
|
-
:style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : ''), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '') }">
|
|
15
|
+
:style="{ 'width': (col.width && col.width > 0 ? col.width + 'px' : ''), 'flex': (col.width && col.width > 0 ? '0 0 ' + col.width + 'px' : '') }">
|
|
16
16
|
<component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
|
|
17
|
-
v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
|
|
18
|
-
@popupSearchList="popupSearchListHandler"></component>
|
|
17
|
+
:key="col.fieldItemKey" v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
|
|
18
|
+
@change="change(col)" @popupSearchList="popupSearchListHandler"></component>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
</template>
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
|
|
29
29
|
<el-col v-if="col.show !== false"
|
|
30
30
|
:class="[index > 0 && (col.controlLabel == '' || col.is == 'ct-btn') ? 'complex-left-10' : '', 'containerCol']"
|
|
31
|
-
:style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0 ? '0 0 ' + col.width + 'px' : '100%') }">
|
|
31
|
+
:style="{ 'width': (col.width && col.width > 0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width > 0 ? '0 0 ' + col.width + 'px' : '100%') }">
|
|
32
32
|
<component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
|
|
33
|
-
v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
|
|
34
|
-
@popupSearchList="popupSearchListHandler">
|
|
33
|
+
:key="col.fieldItemKey" v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
|
|
34
|
+
@change="change(col)" @popupSearchList="popupSearchListHandler">
|
|
35
35
|
</component>
|
|
36
36
|
</el-col>
|
|
37
37
|
</template>
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ct-field :vmodel="model" v-if="model">
|
|
3
|
+
<template #Control>
|
|
4
|
+
<el-input v-model="model.code1" :placeholder="点击选择" @click="showCron = true" />
|
|
5
|
+
<el-dialog v-model="showCron" title="" width="700px" append-to-body>
|
|
6
|
+
<Vue3CronPlusPicker :expression="model.code1" class="cron-plus-picker" :teleported="true"
|
|
7
|
+
@fill="val => { model.code1 = val; showCron = false }" @hide="showCron = false" />
|
|
8
|
+
</el-dialog>
|
|
9
|
+
</template>
|
|
10
|
+
</ct-field>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { Vue3CronPlusPicker } from 'vue3-cron-plus-picker'
|
|
15
|
+
import 'vue3-cron-plus-picker/style.css'
|
|
16
|
+
import { nextTick, ref, onMounted } from "vue";
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
api: String,
|
|
19
|
+
vmodel: Object,
|
|
20
|
+
actionRouter: Array,
|
|
21
|
+
listHeight: Number,
|
|
22
|
+
})
|
|
23
|
+
const model = ref(null);
|
|
24
|
+
|
|
25
|
+
const showCron = ref(false)
|
|
26
|
+
|
|
27
|
+
init()
|
|
28
|
+
//初始化数据
|
|
29
|
+
function init() {
|
|
30
|
+
nextTick(function () {
|
|
31
|
+
if (props.vmodel) {
|
|
32
|
+
load(props.vmodel);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function load(data) {
|
|
37
|
+
model.value = data;
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
<style scoped>
|
|
41
|
+
.cron-plus-picker :deep(.el-input__wrapper) {
|
|
42
|
+
align-items: center;
|
|
43
|
+
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
44
|
+
background-image: none;
|
|
45
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
46
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
47
|
+
cursor: text;
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
flex-grow: 1;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
padding: 1px 11px;
|
|
52
|
+
transform: translateZ(0);
|
|
53
|
+
transition: var(--el-transition-box-shadow);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.cron-plus-picker :deep(.el-input--small) {
|
|
57
|
+
--el-input-inner-height: calc(var(--el-input-height, 24px) - 2px);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.cron-plus-picker :deep(.el-input--small),
|
|
61
|
+
.cron-plus-picker :deep(.el-input) {
|
|
62
|
+
--el-input-height: var(--el-component-size-small);
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 使用更精确的选择器,避免全局覆盖 */
|
|
67
|
+
.cron-plus-picker :deep(.el-input .el-input__wrapper) {
|
|
68
|
+
align-items: center;
|
|
69
|
+
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
70
|
+
background-image: none;
|
|
71
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
72
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
73
|
+
cursor: text;
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
flex-grow: 1;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
padding: 1px 11px;
|
|
78
|
+
transform: translateZ(0);
|
|
79
|
+
transition: var(--el-transition-box-shadow);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cron-plus-picker :deep(.el-select__wrapper) {
|
|
83
|
+
|
|
84
|
+
min-height: 24px;
|
|
85
|
+
/* 使用 min-height 而不是 height */
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cron-plus-picker :deep(.el-radio.el-radio--small) {
|
|
89
|
+
height: 24px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cron-plus-picker :deep(.el-select) {
|
|
93
|
+
--el-select-border-color-hover: var(--el-border-color-hover);
|
|
94
|
+
--el-select-disabled-color: var(--el-disabled-text-color);
|
|
95
|
+
--el-select-disabled-border: var(--el-disabled-border-color);
|
|
96
|
+
--el-select-font-size: var(--el-font-size-base);
|
|
97
|
+
--el-select-close-hover-color: var(--el-text-color-secondary);
|
|
98
|
+
--el-select-input-color: var(--el-text-color-placeholder);
|
|
99
|
+
--el-select-multiple-input-color: var(--el-text-color-regular);
|
|
100
|
+
--el-select-input-focus-border-color: var(--el-color-primary);
|
|
101
|
+
--el-select-input-font-size: 14px;
|
|
102
|
+
--el-select-width: 100%;
|
|
103
|
+
display: inline-block;
|
|
104
|
+
position: relative;
|
|
105
|
+
vertical-align: middle;
|
|
106
|
+
width: var(--el-select-width);
|
|
107
|
+
z-index: 100;
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* 修改Cron组件的样式 - 区分焦点和非焦点状态 */
|
|
112
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-input__wrapper),
|
|
113
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-select__wrapper),
|
|
114
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-textarea__inner) {
|
|
115
|
+
box-shadow: 0 0 0 1px var(--el-border-color) inset;
|
|
116
|
+
/* 非焦点状态 */
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-input__wrapper.is-focus),
|
|
120
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-input__wrapper:focus),
|
|
121
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-select__wrapper.is-focus),
|
|
122
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-select__wrapper:focus),
|
|
123
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-textarea__inner.is-focus),
|
|
124
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-textarea__inner:focus) {
|
|
125
|
+
box-shadow: 0 0 0 1px var(--el-color-primary) inset !important;
|
|
126
|
+
/* 焦点状态 - 蓝色 */
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* hover状态保持原来的灰色 */
|
|
130
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-input__wrapper:hover),
|
|
131
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-select__wrapper:hover),
|
|
132
|
+
.cron-plus-picker :deep(.el-form-item.is-error .el-textarea__inner:hover) {
|
|
133
|
+
box-shadow: 0 0 0 1px var(--el-text-color-secondary) inset;
|
|
134
|
+
/* hover时也保持灰色 */
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.cron-plus-picker :deep(.el-radio) {
|
|
138
|
+
--el-radio-font-size: var(--el-font-size-base);
|
|
139
|
+
--el-radio-text-color: var(--el-text-color-regular);
|
|
140
|
+
--el-radio-font-weight: var(--el-font-weight-primary);
|
|
141
|
+
--el-radio-input-height: 12px;
|
|
142
|
+
--el-radio-input-width: 12px;
|
|
143
|
+
--el-radio-input-border-radius: var(--el-border-radius-circle);
|
|
144
|
+
--el-radio-input-bg-color: var(--el-fill-color-blank);
|
|
145
|
+
--el-radio-input-border: var(--el-border);
|
|
146
|
+
--el-radio-input-border-color: var(--el-border-color);
|
|
147
|
+
--el-radio-input-border-color-hover: var(--el-color-primary);
|
|
148
|
+
align-items: center;
|
|
149
|
+
color: var(--el-radio-text-color);
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
font-size: var(--el-font-size-base);
|
|
153
|
+
font-weight: var(--el-radio-font-weight);
|
|
154
|
+
height: 32px;
|
|
155
|
+
margin-right: 30px;
|
|
156
|
+
outline: none;
|
|
157
|
+
position: relative;
|
|
158
|
+
-webkit-user-select: none;
|
|
159
|
+
-moz-user-select: none;
|
|
160
|
+
user-select: none;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.cron-plus-picker :deep(.el-radio:last-child) {
|
|
165
|
+
margin-right: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.cron-plus-picker :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner),
|
|
169
|
+
.cron-plus-picker :deep(.el-radio.el-radio--small .el-radio__inner) {
|
|
170
|
+
width: 12px;
|
|
171
|
+
height: 12px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* 1. 让内部 el-select 继续用 ElementPlus 的公共骨架,我们只覆盖 mini 尺寸变量 */
|
|
175
|
+
.cron-plus-picker :deep(.el-radio--small) {
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.cron-plus-picker :deep(.el-radio--small .el-select__wrapper) {
|
|
180
|
+
height: 24px;
|
|
181
|
+
line-height: 24px;
|
|
182
|
+
padding: 0 7px 0 11px;
|
|
183
|
+
/* 左右各缩 4px,与官网 mini 保持一致 */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.cron-plus-picker :deep(.el-form-item--small) {
|
|
187
|
+
margin-bottom: 18px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.cron-plus-picker :deep(.el-select__placeholder) {
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
</style>
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
</DateTimePicker>
|
|
23
23
|
</template>
|
|
24
24
|
<template v-else>
|
|
25
|
-
<el-date-picker v-model="model.code1" :type="model.dateType" v-bind="model.attrs"
|
|
25
|
+
<el-date-picker v-model="model.code1" :type="model.dateType" v-bind="model.attrs" :format="model.format"
|
|
26
26
|
:disabled="model.locked" :disabled-date="disabledDate" @change="changeHandler(model, emit)"
|
|
27
27
|
class="fieldControl" />
|
|
28
28
|
<span class="range-span" v-if="model.flagrange"> - </span>
|
|
29
|
-
<el-date-picker v-if="model.flagrange" v-model="model.code2" :type="model.dateType"
|
|
29
|
+
<el-date-picker v-if="model.flagrange" v-model="model.code2" :type="model.dateType" :format="model.format"
|
|
30
30
|
v-bind="model.attrs" :disabled="model.locked" :disabled-date="disabledDate"
|
|
31
31
|
@change="changeHandler(model, emit)" class="fieldControl" />
|
|
32
32
|
</template>
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
<div style="flex: 1; min-width: 0;">
|
|
6
6
|
<div v-if="model !== null && !loading" class="ct-form">
|
|
7
7
|
<el-affix target=".ct-form" v-if="model.tip" :offset="62">
|
|
8
|
-
<div class="ct-form-tip">
|
|
8
|
+
<div class="ct-form-tip" ref="refTip">
|
|
9
9
|
<span v-html="model.tip"></span>
|
|
10
10
|
</div>
|
|
11
11
|
</el-affix>
|
|
12
12
|
|
|
13
13
|
<!--可根据场景判断显示el-card还是el-main-->
|
|
14
|
-
<component :is="model.showTitle ? 'el-main' : 'el-card'">
|
|
15
|
-
<div class="ct-from-title" v-if="typeof model.title !== 'undefined' && model.flagShowTitle">
|
|
14
|
+
<component :is="model.showTitle ? 'el-main' : 'el-card'" :key="itemKey">
|
|
15
|
+
<!-- <div class="ct-from-title" v-if="typeof model.title !== 'undefined' && model.flagShowTitle">
|
|
16
16
|
<span style="font-weight:bold">{{ model.title }}</span>
|
|
17
|
-
</div>
|
|
17
|
+
</div> -->
|
|
18
18
|
|
|
19
19
|
<!--relationParentFormFields-->
|
|
20
20
|
<el-row v-if="relationParentFormFields.length > 0">
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px"
|
|
25
25
|
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
26
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :key="
|
|
27
|
-
:
|
|
28
|
-
:fileData="getFileData(col)" @change="changeHandler"
|
|
26
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
|
|
27
|
+
:listHeight="listHeight" :parameterAction="model.parameterAction"
|
|
28
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" @change="changeHandler"
|
|
29
29
|
@importComplete="importComplete" @popupLocation="popupLocationHandler"
|
|
30
30
|
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
31
31
|
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px"
|
|
44
44
|
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
45
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :key="
|
|
46
|
-
:
|
|
47
|
-
:fileData="getFileData(col)" @change="changeHandler"
|
|
45
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
|
|
46
|
+
:listHeight="listHeight" :parameterAction="model.parameterAction"
|
|
47
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" @change="changeHandler"
|
|
48
48
|
@importComplete="importComplete" @popupLocation="popupLocationHandler"
|
|
49
49
|
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
50
50
|
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
@@ -54,37 +54,43 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
</el-row>
|
|
56
56
|
<!--tabs-->
|
|
57
|
-
<
|
|
57
|
+
<template v-if="model.isHorizontalLayout">
|
|
58
|
+
<component :is="model.flagFixedTabOnHorizontalLayout ? 'el-affix' : 'div'"
|
|
59
|
+
v-bind="model.flagFixedTabOnHorizontalLayout ? { offset: tabTopHight, target: '.ct-form' } : {}">
|
|
60
|
+
<el-tabs v-model="activeName" @tab-click="tabClick" style="background: #fff;">
|
|
61
|
+
<template v-for="(item, index) in model.collapse" :key="index">
|
|
62
|
+
<el-tab-pane :name="index.toString()" :lazy="item.lazyLoad"
|
|
63
|
+
v-if="item.show !== false" :key="index">
|
|
64
|
+
<template #label>
|
|
65
|
+
<span v-html="item.controlLabel"></span>
|
|
66
|
+
</template>
|
|
67
|
+
</el-tab-pane>
|
|
68
|
+
</template>
|
|
69
|
+
</el-tabs>
|
|
70
|
+
</component>
|
|
58
71
|
<template v-for="(item, index) in model.collapse" :key="index">
|
|
59
|
-
<el-
|
|
60
|
-
:key="
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
<el-row v-show="activeName === index.toString()">
|
|
73
|
+
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
74
|
+
<div style="display: flex; flex: 0 0 100%;"
|
|
75
|
+
v-if="col.show !== false && col.lineFeed"></div>
|
|
76
|
+
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
|
|
77
|
+
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
78
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
|
|
79
|
+
:listHeight="listHeight" :parameterAction="model.parameterAction"
|
|
80
|
+
v-bind="col.bindPara" :fileData="getFileData(col)"
|
|
81
|
+
@change="changeHandler" @fieldClick="fieldClickHandler"
|
|
82
|
+
@popupLocation="popupLocationHandler"
|
|
83
|
+
@popupSearchList="popupSearchListHandler"
|
|
84
|
+
@importComplete="importComplete" @popupGroupList="popupGroupListHandler"
|
|
85
|
+
@tableButtonClick="clickHandler"
|
|
86
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
87
|
+
</component>
|
|
88
|
+
</el-col>
|
|
63
89
|
</template>
|
|
64
|
-
|
|
65
|
-
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
66
|
-
<div style="display: flex; flex: 0 0 100%;"
|
|
67
|
-
v-if="col.show !== false && col.lineFeed"></div>
|
|
68
|
-
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
|
|
69
|
-
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
70
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey" :listHeight="listHeight"
|
|
71
|
-
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
72
|
-
:fileData="getFileData(col)" @change="changeHandler"
|
|
73
|
-
@fieldClick="fieldClickHandler"
|
|
74
|
-
@popupLocation="popupLocationHandler"
|
|
75
|
-
@popupSearchList="popupSearchListHandler"
|
|
76
|
-
@importComplete="importComplete"
|
|
77
|
-
@popupGroupList="popupGroupListHandler"
|
|
78
|
-
@tableButtonClick="clickHandler"
|
|
79
|
-
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
80
|
-
</component>
|
|
81
|
-
</el-col>
|
|
82
|
-
</template>
|
|
83
|
-
</el-row>
|
|
84
|
-
</el-tab-pane>
|
|
90
|
+
</el-row>
|
|
85
91
|
</template>
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
<div style="height: 34px;"> </div>
|
|
93
|
+
</template>
|
|
88
94
|
<!--分组-->
|
|
89
95
|
<el-collapse v-else v-model="model.collapseActiveNames"
|
|
90
96
|
:class="model.flagHideSaveLine ? 'el-collapse-saveLine' : ''">
|
|
@@ -104,10 +110,10 @@
|
|
|
104
110
|
v-if="col.show !== false && col.lineFeed"></div>
|
|
105
111
|
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
|
|
106
112
|
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
107
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :key="
|
|
108
|
-
:
|
|
109
|
-
:fileData="getFileData(col)"
|
|
110
|
-
@fieldClick="fieldClickHandler"
|
|
113
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
|
|
114
|
+
:listHeight="listHeight" :parameterAction="model.parameterAction"
|
|
115
|
+
v-bind="col.bindPara" :fileData="getFileData(col)"
|
|
116
|
+
@change="changeHandler" @fieldClick="fieldClickHandler"
|
|
111
117
|
@popupLocation="popupLocationHandler"
|
|
112
118
|
@popupSearchList="popupSearchListHandler"
|
|
113
119
|
@importComplete="importComplete"
|
|
@@ -130,7 +136,7 @@
|
|
|
130
136
|
:class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
|
|
131
137
|
<component ref="Fields" :is="col.is" :vmodel="col" :listHeight="listHeight"
|
|
132
138
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
133
|
-
@change="changeHandler" :key="
|
|
139
|
+
@change="changeHandler" :key="col.fieldItemKey" :fileData="getFileData(col)"
|
|
134
140
|
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
135
141
|
@importComplete="importComplete" @tableButtonClick="clickHandler"
|
|
136
142
|
@popupGroupList="popupGroupListHandler" @popupLocation="popupLocationHandler"
|
|
@@ -148,8 +154,7 @@
|
|
|
148
154
|
|
|
149
155
|
</el-col>
|
|
150
156
|
</el-row>
|
|
151
|
-
<el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1"
|
|
152
|
-
:class="isScroll ? 'button-absolute' : 'button-initial'"
|
|
157
|
+
<el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1" class="button-absolute"
|
|
153
158
|
:style="['max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
|
|
154
159
|
<el-col :span="24"
|
|
155
160
|
style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
|
|
@@ -164,6 +169,12 @@
|
|
|
164
169
|
<div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1"
|
|
165
170
|
style="height: 34px;">
|
|
166
171
|
</div>
|
|
172
|
+
<el-affix target=".ct-form" position="bottom" v-if="model.bottomTip"
|
|
173
|
+
:offset="model.buttons.findIndex((v) => { return v.show }) > -1 ? 43 : 0">
|
|
174
|
+
<div class="ct-form-tip">
|
|
175
|
+
<span v-html="model.bottomTip"></span>
|
|
176
|
+
</div>
|
|
177
|
+
</el-affix>
|
|
167
178
|
</component>
|
|
168
179
|
</div>
|
|
169
180
|
|
|
@@ -276,6 +287,8 @@ const minHeight = ref('auto')
|
|
|
276
287
|
const showAI = ref(false);
|
|
277
288
|
const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
|
|
278
289
|
const tabActiveNameKey = ref('')
|
|
290
|
+
const refTip = ref()
|
|
291
|
+
const tabTopHight = ref(52)
|
|
279
292
|
|
|
280
293
|
const qrtimer1 = ref(null)
|
|
281
294
|
const qrtimer2 = ref(null)
|
|
@@ -366,7 +379,11 @@ function load(data) {
|
|
|
366
379
|
|
|
367
380
|
}
|
|
368
381
|
}
|
|
369
|
-
|
|
382
|
+
nextTick(() => {
|
|
383
|
+
if (refTip.value) {
|
|
384
|
+
tabTopHight.value = tabTopHight.value + refTip.value.clientHeight + 10
|
|
385
|
+
}
|
|
386
|
+
})
|
|
370
387
|
//通知父组件加载完成
|
|
371
388
|
emit('loaded', model.value);
|
|
372
389
|
}
|
|
@@ -686,6 +703,12 @@ function setCss() {
|
|
|
686
703
|
if (props.topHeight > -1) {
|
|
687
704
|
minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
|
|
688
705
|
}
|
|
706
|
+
else if(props.dialogHeight){
|
|
707
|
+
minHeight.value = (props.dialogHeight) + 'px';
|
|
708
|
+
}
|
|
709
|
+
else{
|
|
710
|
+
minHeight.value = document.documentElement.clientHeight + 'px';
|
|
711
|
+
}
|
|
689
712
|
}
|
|
690
713
|
|
|
691
714
|
|
|
@@ -1,36 +1,56 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</
|
|
16
|
-
</
|
|
17
|
-
</
|
|
18
|
-
</
|
|
1
|
+
<template>
|
|
2
|
+
<div class="josnViewerBox" ref="jsonContent" tabindex="-1"
|
|
3
|
+
:style="{ height: model.height || 'auto', 'max-height': ('calc(100vh - '+topDistance+'px)') }"
|
|
4
|
+
v-if="isRefresh">
|
|
5
|
+
<JsonViewer :value="model.json" copyable show-array-index show-double-quotes theme="light" :expanded="true"
|
|
6
|
+
:expand-depth="2" @onKeyClick="keyClick">
|
|
7
|
+
<template #copy="{ copied }">
|
|
8
|
+
<div class="btn-iocn"><el-icon title="复原到初始状态" @click.stop="resetJSON">
|
|
9
|
+
<Refresh />
|
|
10
|
+
</el-icon>
|
|
11
|
+
|
|
12
|
+
<!-- 复制按钮 -->
|
|
13
|
+
<el-icon :class="{ 'copied': copied }" title="复制JSON内容">
|
|
14
|
+
<CopyDocument />
|
|
15
|
+
</el-icon>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
</JsonViewer>
|
|
19
|
+
</div>
|
|
19
20
|
</template>
|
|
20
21
|
|
|
21
22
|
<script setup>
|
|
22
23
|
import { JsonViewer } from "vue3-json-viewer"
|
|
23
24
|
import "vue3-json-viewer/dist/vue3-json-viewer.css";
|
|
24
|
-
import {
|
|
25
|
+
import { useDistanceCalculator } from '../../utils/distance-utils.js';
|
|
26
|
+
|
|
27
|
+
import { nextTick, ref, onMounted} from "vue";
|
|
25
28
|
const props = defineProps({
|
|
26
29
|
api: String,
|
|
27
30
|
vmodel: Object,
|
|
28
31
|
actionRouter: Array,
|
|
29
|
-
|
|
32
|
+
listHeight: Number,
|
|
30
33
|
})
|
|
34
|
+
|
|
35
|
+
const jsonContent = ref(null);
|
|
36
|
+
|
|
31
37
|
const model = ref({});
|
|
32
38
|
const isRefresh = ref(true);
|
|
39
|
+
const topDistance = ref(0);
|
|
40
|
+
const { getAllDistances } = useDistanceCalculator(jsonContent);
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// 在组件挂载后或需要时调用
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
nextTick(() => {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
topDistance.value = getAllDistances()?.elementInfo?.top+40;
|
|
50
|
+
}, 100);
|
|
51
|
+
});
|
|
33
52
|
|
|
53
|
+
});
|
|
34
54
|
|
|
35
55
|
init()
|
|
36
56
|
//初始化数据
|
|
@@ -47,12 +67,12 @@ function load(data) {
|
|
|
47
67
|
}
|
|
48
68
|
const resetJSON = () => {
|
|
49
69
|
isRefresh.value = false;
|
|
50
|
-
nextTick(() => {
|
|
70
|
+
nextTick(() => {
|
|
51
71
|
isRefresh.value = true;
|
|
52
72
|
});
|
|
53
73
|
};
|
|
54
74
|
|
|
55
|
-
|
|
75
|
+
|
|
56
76
|
|
|
57
77
|
const keyClick = (keyName) => {
|
|
58
78
|
console.log(keyName, "it was click")
|
|
@@ -72,14 +92,14 @@ const keyClick = (keyName) => {
|
|
|
72
92
|
z-index: 10;
|
|
73
93
|
margin-left: auto;
|
|
74
94
|
/* 辅助:确保靠右 */
|
|
75
|
-
|
|
95
|
+
float: right;
|
|
76
96
|
|
|
77
97
|
}
|
|
78
98
|
|
|
79
|
-
|
|
99
|
+
|
|
80
100
|
|
|
81
101
|
.josnViewerBox {
|
|
82
|
-
overflow: auto;
|
|
102
|
+
overflow: auto;
|
|
83
103
|
width: 100%;
|
|
84
104
|
border: 1px solid #eee;
|
|
85
105
|
border-radius: 4px;
|
|
@@ -89,14 +109,15 @@ const keyClick = (keyName) => {
|
|
|
89
109
|
box-sizing: border-box;
|
|
90
110
|
background-color: #ffffff;
|
|
91
111
|
}
|
|
112
|
+
|
|
92
113
|
.josnViewerBox:focus {
|
|
93
114
|
border: 1px solid #3D5ECC;
|
|
94
115
|
}
|
|
95
116
|
|
|
96
117
|
|
|
97
118
|
.btn-iocn {
|
|
98
|
-
|
|
119
|
+
display: flex;
|
|
99
120
|
gap: 10px;
|
|
100
|
-
|
|
121
|
+
|
|
101
122
|
}
|
|
102
123
|
</style>
|
|
@@ -180,8 +180,10 @@ function searchHandler(field) {
|
|
|
180
180
|
SearchScreen.hiddenHandle(v, model.value);
|
|
181
181
|
SearchScreen.displayHandle(v, model.value);
|
|
182
182
|
})
|
|
183
|
-
if (
|
|
184
|
-
|
|
183
|
+
if (field.autoSearch) {
|
|
184
|
+
if (validExcute()) {
|
|
185
|
+
emit('resetSearch', model.value);
|
|
186
|
+
}
|
|
185
187
|
}
|
|
186
188
|
break;
|
|
187
189
|
default:
|