centaline-data-driven-v3 0.0.77 → 0.0.79
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 +251 -192
- package/package.json +3 -1
- package/src/assets/commonWeb.css +1 -1
- package/src/assets/images/AIChat.png +0 -0
- package/src/components/web/AIChat.vue +760 -0
- package/src/components/web/ComboBox.vue +10 -3
- package/src/components/web/Form.vue +274 -158
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ct-field :vmodel="model">
|
|
3
3
|
<template #Control>
|
|
4
|
-
<el-select-v2 ref="refselect" :key="model.itemKey" v-model="model.value" :options="model.options"
|
|
4
|
+
<el-select-v2 ref="refselect" :key="model.itemKey" v-model="model.value" :options="model.options" :no-data-text="nodatatext"
|
|
5
5
|
:props="model.optionAttrs" v-bind="model.attrs" :disabled="model.locked" clearable @change="change"
|
|
6
6
|
:placeholder="model.placeholder" @visible-change="visibleChange" @clear="clear"
|
|
7
7
|
:filterable="model.filterable" :multiple="model.multiple" class="fieldControl" :height="300"
|
|
@@ -59,7 +59,7 @@ const model = initData(props, ComboBox)
|
|
|
59
59
|
const refselect = ref()
|
|
60
60
|
const open = ref(false)
|
|
61
61
|
const isComposing = ref(false);
|
|
62
|
-
const
|
|
62
|
+
const nodatatext = ref(' ')
|
|
63
63
|
model.value.itemKey=Math.random();
|
|
64
64
|
let cancelTokenSource = null; // 用于存储取消令牌
|
|
65
65
|
|
|
@@ -73,6 +73,7 @@ function visibleChange(visible) {
|
|
|
73
73
|
//出现获取数据
|
|
74
74
|
if (visible) {
|
|
75
75
|
open.value = true;
|
|
76
|
+
nodatatext.value = '加载中';
|
|
76
77
|
if (!model.value.filterable) {
|
|
77
78
|
getOptions('')
|
|
78
79
|
}
|
|
@@ -93,7 +94,6 @@ function getOptions(key) {
|
|
|
93
94
|
cancelTokenSource = Axios.CancelToken.source();
|
|
94
95
|
if (!isComposing.value &&!model.value.moreActionRouter) {
|
|
95
96
|
model.value.getOptions(props.parameterAction, key,cancelTokenSource, function (data) {
|
|
96
|
-
loading.value=false;
|
|
97
97
|
if(data){
|
|
98
98
|
data.forEach((v) => {
|
|
99
99
|
let item = model.value.globalOptions.find((v1) => {
|
|
@@ -124,10 +124,17 @@ function getOptions(key) {
|
|
|
124
124
|
model.value.options = data;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
if(data.length==0){
|
|
128
|
+
nodatatext.value = '无数据';
|
|
129
|
+
}
|
|
130
|
+
|
|
127
131
|
nextTick(function () {
|
|
128
132
|
setminWidth()
|
|
129
133
|
});
|
|
130
134
|
}
|
|
135
|
+
else{
|
|
136
|
+
nodatatext.value = '无数据';
|
|
137
|
+
}
|
|
131
138
|
})
|
|
132
139
|
}
|
|
133
140
|
|
|
@@ -1,151 +1,205 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="refForm" v-loading="loading" :style="{'min-height': minHeight}">
|
|
3
|
-
<div
|
|
4
|
-
<
|
|
5
|
-
<div class="ct-form
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div ref="refForm" v-loading="loading" :style="{ 'min-height': minHeight }">
|
|
3
|
+
<div style="display: flex; width: 100%;">
|
|
4
|
+
<div style="flex: 1; min-width: 0;">
|
|
5
|
+
<div v-if="model !== null && !loading" class="ct-form">
|
|
6
|
+
<el-affix target=".ct-form" v-if="model.tip" :offset="62">
|
|
7
|
+
<div class="ct-form-tip">
|
|
8
|
+
<span v-html="model.tip"></span>
|
|
9
|
+
</div>
|
|
10
|
+
</el-affix>
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
<!--可根据场景判断显示el-card还是el-main-->
|
|
13
|
+
<component :is="model.showTitle ? 'el-main' : 'el-card'">
|
|
14
|
+
<!--relationParentFormFields-->
|
|
15
|
+
<el-row v-if="relationParentFormFields.length > 0">
|
|
16
|
+
<template v-for="(col, index) in relationParentFormFields" :key="index">
|
|
17
|
+
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
18
|
+
</div>
|
|
19
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
20
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
21
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
22
|
+
:fileData="getFileData(col)" @change="changeHandler"
|
|
23
|
+
@importComplete="importComplete" @popupLocation="popupLocationHandler"
|
|
24
|
+
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
25
|
+
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
26
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
27
|
+
</component>
|
|
28
|
+
</el-col>
|
|
29
|
+
</template>
|
|
30
|
+
</el-row>
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<el-
|
|
47
|
-
:key="index">
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
v-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
32
|
+
<!--头部元素-->
|
|
33
|
+
<el-row v-if="model.collapseFields.length > 0">
|
|
34
|
+
<template v-for="(col, index) in model.collapseFields[0]" :key="index">
|
|
35
|
+
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
36
|
+
</div>
|
|
37
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
38
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
39
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
40
|
+
:fileData="getFileData(col)" @change="changeHandler"
|
|
41
|
+
@importComplete="importComplete" @popupLocation="popupLocationHandler"
|
|
42
|
+
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
43
|
+
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
44
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
45
|
+
</component>
|
|
46
|
+
</el-col>
|
|
47
|
+
</template>
|
|
48
|
+
</el-row>
|
|
49
|
+
<!--tabs-->
|
|
50
|
+
<el-tabs v-if="model.isHorizontalLayout" v-model="activeName">
|
|
51
|
+
<template v-for="(item, index) in model.collapse" :key="index">
|
|
52
|
+
<el-tab-pane :label="item.controlLabel" :name="index.toString()" :lazy="item.lazyLoad"
|
|
53
|
+
v-if="item.show !== false" :key="index">
|
|
54
|
+
<el-row>
|
|
55
|
+
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
56
|
+
<div style="display: flex; flex: 0 0 100%;"
|
|
57
|
+
v-if="col.show !== false && col.lineFeed"></div>
|
|
58
|
+
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
59
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
60
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
61
|
+
:fileData="getFileData(col)" @change="changeHandler"
|
|
62
|
+
@fieldClick="fieldClickHandler"
|
|
63
|
+
@popupLocation="popupLocationHandler"
|
|
64
|
+
@popupSearchList="popupSearchListHandler"
|
|
65
|
+
@importComplete="importComplete"
|
|
66
|
+
@popupGroupList="popupGroupListHandler"
|
|
67
|
+
@tableButtonClick="clickHandler"
|
|
68
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
69
|
+
</component>
|
|
70
|
+
</el-col>
|
|
71
|
+
</template>
|
|
72
|
+
</el-row>
|
|
73
|
+
</el-tab-pane>
|
|
74
|
+
</template>
|
|
75
|
+
</el-tabs>
|
|
76
|
+
|
|
77
|
+
<!--分组-->
|
|
78
|
+
<el-collapse v-else v-model="model.collapseActiveNames"
|
|
79
|
+
:class="model.flagHideSaveLine ? 'el-collapse-saveLine' : ''">
|
|
80
|
+
<template v-for="(item, index) in model.collapse" :key="index">
|
|
81
|
+
<el-collapse-item v-if="item.show !== false" :title="item.controlLabel" :name="index"
|
|
82
|
+
:disabled="item.locked" :class="item.locked ? 'ct-collapse-item-title' : ''">
|
|
83
|
+
<template #title>
|
|
84
|
+
<i class="sign"></i>
|
|
85
|
+
<span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel
|
|
86
|
+
}}</span>
|
|
87
|
+
<span v-html="item.sufLabel1"></span>
|
|
88
|
+
</template>
|
|
66
89
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
90
|
+
<el-row>
|
|
91
|
+
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
92
|
+
<div style="display: flex; flex: 0 0 100%;"
|
|
93
|
+
v-if="col.show !== false && col.lineFeed"></div>
|
|
94
|
+
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
95
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
96
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
97
|
+
:fileData="getFileData(col)" @change="changeHandler"
|
|
98
|
+
@fieldClick="fieldClickHandler"
|
|
99
|
+
@popupLocation="popupLocationHandler"
|
|
100
|
+
@popupSearchList="popupSearchListHandler"
|
|
101
|
+
@importComplete="importComplete"
|
|
102
|
+
@popupGroupList="popupGroupListHandler"
|
|
103
|
+
@tableButtonClick="clickHandler"
|
|
104
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
105
|
+
</component>
|
|
106
|
+
</el-col>
|
|
107
|
+
</template>
|
|
108
|
+
</el-row>
|
|
109
|
+
</el-collapse-item>
|
|
77
110
|
</template>
|
|
111
|
+
</el-collapse>
|
|
112
|
+
<!--尾部元素-->
|
|
113
|
+
<el-row v-if="model.independentItem.length > 0" style="margin-top: 20px;">
|
|
114
|
+
<template v-for="(col, index) in model.independentItem" :key="index">
|
|
115
|
+
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
116
|
+
</div>
|
|
117
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
118
|
+
<component ref="Fields" :is="col.is" :vmodel="col"
|
|
119
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
120
|
+
@change="changeHandler" :key="itemKey" :fileData="getFileData(col)"
|
|
121
|
+
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
122
|
+
@importComplete="importComplete" @tableButtonClick="clickHandler"
|
|
123
|
+
@popupGroupList="popupGroupListHandler" @popupLocation="popupLocationHandler"
|
|
124
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
125
|
+
</component>
|
|
126
|
+
</el-col>
|
|
127
|
+
</template>
|
|
128
|
+
</el-row>
|
|
129
|
+
<el-row v-if="model.links.findIndex((v) => { return v.show }) > -1" style="margin-top: 8px;">
|
|
130
|
+
<el-col :span="24" style="text-align:left">
|
|
131
|
+
<template v-for="(btn, index) in model.links" :key="index">
|
|
132
|
+
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler">
|
|
133
|
+
</component>
|
|
134
|
+
</template>
|
|
78
135
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
</component>
|
|
91
|
-
</el-col>
|
|
136
|
+
</el-col>
|
|
137
|
+
</el-row>
|
|
138
|
+
<el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1"
|
|
139
|
+
:class="isScroll ? 'button-absolute' : 'button-initial'"
|
|
140
|
+
:style="['max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
|
|
141
|
+
<el-col :span="24"
|
|
142
|
+
style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
|
|
143
|
+
class="btnPadBom">
|
|
144
|
+
<template v-for="(btn, index) in model.buttons" :key="index">
|
|
145
|
+
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler"
|
|
146
|
+
:style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }"></component>
|
|
92
147
|
</template>
|
|
93
|
-
</el-row>
|
|
94
|
-
</el-collapse-item>
|
|
95
|
-
</template>
|
|
96
|
-
</el-collapse>
|
|
97
|
-
<!--尾部元素-->
|
|
98
|
-
<el-row v-if="model.independentItem.length > 0" style="margin-top: 20px;">
|
|
99
|
-
<template v-for="(col, index) in model.independentItem" :key="index">
|
|
100
|
-
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
|
|
101
|
-
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
102
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="model.parameterAction"
|
|
103
|
-
v-bind="col.bindPara" @change="changeHandler" :key="itemKey" :fileData="getFileData(col)"
|
|
104
|
-
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler" @importComplete="importComplete"
|
|
105
|
-
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler" @popupLocation="popupLocationHandler"
|
|
106
|
-
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
107
|
-
</component>
|
|
108
|
-
</el-col>
|
|
109
|
-
</template>
|
|
110
|
-
</el-row>
|
|
111
|
-
<el-row v-if="model.links.findIndex((v) => { return v.show }) > -1" style="margin-top: 8px;">
|
|
112
|
-
<el-col :span="24" style="text-align:left">
|
|
113
|
-
<template v-for="(btn, index) in model.links" :key="index">
|
|
114
|
-
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler">
|
|
115
|
-
</component>
|
|
116
|
-
</template>
|
|
117
148
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
|
|
125
|
-
class="btnPadBom">
|
|
126
|
-
<template v-for="(btn, index) in model.buttons" :key="index">
|
|
127
|
-
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler"
|
|
128
|
-
:style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }"></component>
|
|
129
|
-
</template>
|
|
130
|
-
</el-col>
|
|
131
|
-
</el-row>
|
|
132
|
-
<div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1" style="height: 34px;">
|
|
149
|
+
</el-col>
|
|
150
|
+
</el-row>
|
|
151
|
+
<div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1"
|
|
152
|
+
style="height: 34px;">
|
|
153
|
+
</div>
|
|
154
|
+
</component>
|
|
133
155
|
</div>
|
|
134
|
-
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</div>
|
|
159
|
+
<template v-if="model?.AIattr?.showAI">
|
|
160
|
+
<div :style="{ flex: ' 0 0 ' + model.AIattr.width + 'px', 'box-shadow': '-10px 0 5px -9px rgba(0, 0, 0, 0.3)' }"
|
|
161
|
+
v-show="showAI">
|
|
162
|
+
<div
|
|
163
|
+
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px', overflow: 'hidden', 'border-bottom-right-radius': '4px' }">
|
|
164
|
+
<AIChat :height="dialogHeight"
|
|
165
|
+
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px' }"
|
|
166
|
+
:vmodel="model.AIModel" :actionRouter="model.actionRouters" :form="model"
|
|
167
|
+
@hideAI="AIToggle">
|
|
168
|
+
|
|
169
|
+
</AIChat>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</template>
|
|
173
|
+
|
|
135
174
|
</div>
|
|
175
|
+
<template v-if="model?.AIattr?.showAI && !showAI">
|
|
176
|
+
<div class="btn-avatar" @click="AIToggle"
|
|
177
|
+
:style="{ 'float': model.AIRouter.isCheckbox ? model.AIRouter.alignCss : '' }">
|
|
178
|
+
<img class="avatar-img" :src="util.getAssetsImage('AIChat.png')" :alt="model?.AIRouter.controlLabel"
|
|
179
|
+
:title="model?.AIRouter.controlLabel">
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<!-- <component :is="model.AIRouter.is" :vmodel="model.AIRouter"
|
|
183
|
+
v-if="model.AIRouter.show" @fieldClick="AIToggle"
|
|
184
|
+
:style="{ 'float': model.AIRouter.isCheckbox ? model.AIRouter.alignCss : '' }">
|
|
185
|
+
</component> -->
|
|
186
|
+
</template>
|
|
136
187
|
<div style="min-height:200px" v-if="loading"></div>
|
|
137
188
|
<iframe :src="downloadUrl" style="height:0px;width:0px;border-width: 0px;display: none;"> </iframe>
|
|
189
|
+
|
|
138
190
|
</div>
|
|
139
191
|
</template>
|
|
140
192
|
<script lang="ts" setup>
|
|
141
|
-
import { ref, nextTick, onUpdated,onDeactivated
|
|
193
|
+
import { ref, nextTick, onUpdated, onDeactivated, onMounted } from 'vue'
|
|
142
194
|
import { RouterClickHandler } from '../../utils/mixins';
|
|
143
195
|
import common from '../../utils/common'
|
|
144
196
|
import Form from '../../loader/src/Form'
|
|
145
197
|
import { ElMessage } from 'element-plus'
|
|
146
198
|
import { useRouter } from 'vue-router';
|
|
199
|
+
import util from '../../utils/pub-use'
|
|
147
200
|
import Enum from '../../utils/Enum';
|
|
148
|
-
|
|
201
|
+
import AIChat from '../web/AIChat.vue';
|
|
202
|
+
const emit = defineEmits(['loaded', 'failLoad', 'submit', 'AIToggle'])
|
|
149
203
|
const props = defineProps({
|
|
150
204
|
api: String,
|
|
151
205
|
vmodel: Object,
|
|
@@ -183,15 +237,17 @@ const props = defineProps({
|
|
|
183
237
|
default: '',
|
|
184
238
|
},
|
|
185
239
|
isIframe: {
|
|
186
|
-
|
|
187
|
-
|
|
240
|
+
Boolean,
|
|
241
|
+
default: false,
|
|
188
242
|
},
|
|
189
243
|
relationParentFormFields: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
244
|
+
Array,
|
|
245
|
+
default: function () {
|
|
246
|
+
return [];
|
|
247
|
+
},
|
|
194
248
|
},
|
|
249
|
+
dialogHeight: String,
|
|
250
|
+
dialoWidth: String,
|
|
195
251
|
})
|
|
196
252
|
|
|
197
253
|
const itemKey = ref(1)
|
|
@@ -212,10 +268,10 @@ onUpdated(() => {
|
|
|
212
268
|
});
|
|
213
269
|
})
|
|
214
270
|
onDeactivated(() => {
|
|
215
|
-
|
|
271
|
+
downloadUrl.value = ''
|
|
216
272
|
})
|
|
217
273
|
onMounted(() => {
|
|
218
|
-
|
|
274
|
+
setCss();
|
|
219
275
|
})
|
|
220
276
|
init()
|
|
221
277
|
//初始化数据
|
|
@@ -242,7 +298,7 @@ function init() {
|
|
|
242
298
|
function load(data) {
|
|
243
299
|
model.value = data
|
|
244
300
|
model.value.parentModelForm = props.parentModelForm
|
|
245
|
-
model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey,downloadUrl,doAction };
|
|
301
|
+
model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey, downloadUrl, doAction };
|
|
246
302
|
model.value.$vue.openType = props.openType
|
|
247
303
|
model.value.isIframe = props.isIframe
|
|
248
304
|
if (model.value.scripts) {
|
|
@@ -265,12 +321,35 @@ function load(data) {
|
|
|
265
321
|
function failLoad() {
|
|
266
322
|
emit('failLoad', model.value);
|
|
267
323
|
}
|
|
324
|
+
const showAI = ref(false);
|
|
325
|
+
const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
|
|
326
|
+
|
|
327
|
+
function AIToggle() {
|
|
328
|
+
showAI.value = !showAI.value;
|
|
329
|
+
let width = model.value.AIattr.width;
|
|
330
|
+
dialogHeight.value = (props.dialogHeight || (window.innerHeight - 60));
|
|
331
|
+
emit('AIToggle', (showAI.value ? width : -width));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
function buttonsWidth() {
|
|
336
|
+
let rtn = '100%';
|
|
337
|
+
if (showAI.value) {
|
|
338
|
+
rtn = props.dialoWidth - model.value.AIattr.width - 4 + 'px';
|
|
339
|
+
}
|
|
340
|
+
else if (props.pageWidth) {
|
|
341
|
+
rtn = props.pageWidth - 20 + 'px';
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
return rtn;
|
|
345
|
+
}
|
|
346
|
+
|
|
268
347
|
//获取关联数据
|
|
269
348
|
function getFileData(field) {
|
|
270
349
|
return Form.getFileData(field, model.value);
|
|
271
350
|
}
|
|
272
351
|
function doAction(data) {
|
|
273
|
-
|
|
352
|
+
Form.doAction(data)
|
|
274
353
|
}
|
|
275
354
|
//判断是否有滚动条
|
|
276
355
|
function getisScroll() {
|
|
@@ -353,8 +432,8 @@ function validExcute() {
|
|
|
353
432
|
}
|
|
354
433
|
else if (f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'ct-dialog_wrapper') {
|
|
355
434
|
total = f.$el.offsetTop;
|
|
356
|
-
if(f.$el.offsetParent){
|
|
357
|
-
total+=f.$el.offsetParent.offsetTop
|
|
435
|
+
if (f.$el.offsetParent) {
|
|
436
|
+
total += f.$el.offsetParent.offsetTop - 46
|
|
358
437
|
}
|
|
359
438
|
document.querySelector(".ct-dialog_body").children[0].scrollTop = total;
|
|
360
439
|
}
|
|
@@ -416,12 +495,12 @@ function importComplete(res, field) {
|
|
|
416
495
|
.catch(() => {
|
|
417
496
|
});
|
|
418
497
|
}
|
|
419
|
-
else if(res && res.rtnCode && res.rtnCode === 200 && res.rtnMsg){
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
498
|
+
else if (res && res.rtnCode && res.rtnCode === 200 && res.rtnMsg) {
|
|
499
|
+
ElMessage({
|
|
500
|
+
message: res.rtnMsg,
|
|
501
|
+
type: 'success',
|
|
502
|
+
showClose: true,
|
|
503
|
+
});
|
|
425
504
|
}
|
|
426
505
|
|
|
427
506
|
if (field.flagAsync) {
|
|
@@ -459,12 +538,12 @@ function importComplete(res, field) {
|
|
|
459
538
|
type: 'success',
|
|
460
539
|
showClose: true,
|
|
461
540
|
});
|
|
462
|
-
}
|
|
541
|
+
}
|
|
463
542
|
if (field && field.callBackFunName) {
|
|
464
|
-
|
|
543
|
+
changeCallBackHandler(field, field.callBackFunName, data.content);
|
|
465
544
|
}
|
|
466
545
|
else {
|
|
467
|
-
|
|
546
|
+
Form.doAction(data);
|
|
468
547
|
}
|
|
469
548
|
},
|
|
470
549
|
onError(data) {
|
|
@@ -518,10 +597,10 @@ function importComplete(res, field) {
|
|
|
518
597
|
});
|
|
519
598
|
}
|
|
520
599
|
if (field && field.callBackFunName) {
|
|
521
|
-
|
|
600
|
+
changeCallBackHandler(field, field.callBackFunName, data.content);
|
|
522
601
|
}
|
|
523
602
|
else {
|
|
524
|
-
|
|
603
|
+
Form.doAction(data);
|
|
525
604
|
}
|
|
526
605
|
},
|
|
527
606
|
onError(data) {
|
|
@@ -541,19 +620,19 @@ function importComplete(res, field) {
|
|
|
541
620
|
}
|
|
542
621
|
else {
|
|
543
622
|
if (field && field.callBackFunName) {
|
|
544
|
-
|
|
623
|
+
changeCallBackHandler(field, field.callBackFunName, res.content);
|
|
545
624
|
}
|
|
546
625
|
else {
|
|
547
|
-
|
|
626
|
+
Form.doAction(res)
|
|
548
627
|
}
|
|
549
628
|
}
|
|
550
629
|
}
|
|
551
630
|
//弹出选择列表
|
|
552
631
|
function popupSearchListHandler(singleSelectio, field, router, callBack) {
|
|
553
|
-
|
|
632
|
+
Form.popupSearchListHandler(singleSelectio, field, router, model.value, Fields.value, props, callBack)
|
|
554
633
|
}
|
|
555
634
|
function popupLocationHandler(field, router, callBack) {
|
|
556
|
-
|
|
635
|
+
Form.popupLocationHandler(field, router, callBack, model.value, props);
|
|
557
636
|
}
|
|
558
637
|
//弹出分组列表
|
|
559
638
|
function popupGroupListHandler(field, router, callBack) {
|
|
@@ -566,8 +645,45 @@ function updateFields(data) {
|
|
|
566
645
|
Form.updateFields(data, model.value)
|
|
567
646
|
}
|
|
568
647
|
function setCss() {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
648
|
+
if (props.topHeight > -1) {
|
|
649
|
+
minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
</script>
|
|
653
|
+
|
|
654
|
+
<style scoped>
|
|
655
|
+
.btn-avatar {
|
|
656
|
+
height: 50px;
|
|
657
|
+
|
|
658
|
+
position: absolute;
|
|
659
|
+
display: inline-flex;
|
|
660
|
+
justify-content: center;
|
|
661
|
+
padding: 0px 5px;
|
|
662
|
+
bottom: 0px;
|
|
663
|
+
right: 0px;
|
|
664
|
+
cursor: pointer;
|
|
665
|
+
z-index: 1000;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.avatar-img {
|
|
669
|
+
height: 50px;
|
|
670
|
+
animation: bounce 0.5s infinite ease-in-out;
|
|
671
|
+
/* 使用ease-in-out让动画更平滑 */
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
@keyframes bounce {
|
|
675
|
+
0% {
|
|
676
|
+
transform: translateY(0);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
50% {
|
|
680
|
+
transform: translateY(-10px);
|
|
681
|
+
/* 中间位置向上移动10像素 */
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
100% {
|
|
685
|
+
transform: translateY(0);
|
|
686
|
+
/* 回到初始位置 */
|
|
687
|
+
}
|
|
572
688
|
}
|
|
573
|
-
</
|
|
689
|
+
</style>
|