centaline-data-driven-v3 0.0.77 → 0.0.78

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.
@@ -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 loading = ref(true)
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,193 @@
1
1
  <template>
2
- <div ref="refForm" v-loading="loading" :style="{'min-height': minHeight}">
3
- <div v-if="model !== null && !loading" class="ct-form">
4
- <el-affix target=".ct-form" v-if="model.tip" :offset="62">
5
- <div class="ct-form-tip">
6
- <span v-html="model.tip"></span>
7
- </div>
8
- </el-affix>
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
- <!--可根据场景判断显示el-card还是el-main-->
11
- <component :is="model.showTitle ? 'el-main' : 'el-card'">
12
- <!--relationParentFormFields-->
13
- <el-row v-if="relationParentFormFields.length > 0">
14
- <template v-for="(col, index) in relationParentFormFields" :key="index">
15
- <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
16
- <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
17
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
18
- :parameterAction="model.parameterAction" v-bind="col.bindPara" :fileData="getFileData(col)"
19
- @change="changeHandler" @importComplete="importComplete" @popupLocation="popupLocationHandler"
20
- @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
21
- @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
22
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
23
- </component>
24
- </el-col>
25
- </template>
26
- </el-row>
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
- <el-row v-if="model.collapseFields.length > 0">
30
- <template v-for="(col, index) in model.collapseFields[0]" :key="index">
31
- <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
32
- <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
33
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
34
- :parameterAction="model.parameterAction" v-bind="col.bindPara" :fileData="getFileData(col)"
35
- @change="changeHandler" @importComplete="importComplete" @popupLocation="popupLocationHandler"
36
- @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
37
- @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
38
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
39
- </component>
40
- </el-col>
41
- </template>
42
- </el-row>
43
- <!--tabs-->
44
- <el-tabs v-if="model.isHorizontalLayout" v-model="activeName">
45
- <template v-for="(item, index) in model.collapse" :key="index">
46
- <el-tab-pane :label="item.controlLabel" :name="index.toString()" :lazy="item.lazyLoad" v-if="item.show !== false"
47
- :key="index">
48
- <el-row>
49
- <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
50
- <div style="display: flex; flex: 0 0 100%;"
51
- v-if="col.show !== false && col.lineFeed"></div>
52
- <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
53
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
54
- :parameterAction="model.parameterAction" v-bind="col.bindPara" :fileData="getFileData(col)"
55
- @change="changeHandler" @fieldClick="fieldClickHandler" @popupLocation="popupLocationHandler"
56
- @popupSearchList="popupSearchListHandler" @importComplete="importComplete"
57
- @popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
58
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
59
- </component>
60
- </el-col>
61
- </template>
62
- </el-row>
63
- </el-tab-pane>
64
- </template>
65
- </el-tabs>
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
- <el-collapse v-else v-model="model.collapseActiveNames"
69
- :class="model.flagHideSaveLine ? 'el-collapse-saveLine' : ''">
70
- <template v-for="(item, index) in model.collapse" :key="index">
71
- <el-collapse-item v-if="item.show !== false" :title="item.controlLabel" :name="index"
72
- :disabled="item.locked" :class="item.locked ? 'ct-collapse-item-title' : ''">
73
- <template #title>
74
- <i class="sign"></i>
75
- <span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel }}</span>
76
- <span v-html="item.sufLabel1"></span>
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
- <el-row>
80
- <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
81
- <div style="display: flex; flex: 0 0 100%;"
82
- v-if="col.show !== false && col.lineFeed"></div>
83
- <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
84
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
85
- :parameterAction="model.parameterAction" v-bind="col.bindPara" :fileData="getFileData(col)"
86
- @change="changeHandler" @fieldClick="fieldClickHandler" @popupLocation="popupLocationHandler"
87
- @popupSearchList="popupSearchListHandler" @importComplete="importComplete"
88
- @popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
89
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
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>
147
+ </template>
148
+ <template v-if="model.AIattr.showAI&&!showAI">
149
+ <component :is="model.AIRouter.is" :vmodel="model.AIRouter"
150
+ v-if="model.AIRouter.show" @fieldClick="AIToggle"
151
+ :style="{ 'float': model.AIRouter.isCheckbox ? model.AIRouter.alignCss : '' }">
152
+ </component>
92
153
  </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>
154
+ </el-col>
155
+ </el-row>
156
+ <div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1"
157
+ style="height: 34px;">
158
+ </div>
159
+ </component>
160
+ </div>
161
+ </div>
162
+ <template v-if=" model?.AIattr?.showAI ">
163
+ <div :style="{ flex: ' 0 0 ' + model.AIattr.width + 'px', 'box-shadow': '-10px 0 5px -9px rgba(0, 0, 0, 0.3)' }"
164
+ v-show="showAI">
165
+ <div :style="{ position: 'sticky', top: '0', height: dialogHeight + 'px', overflow: 'hidden','border-bottom-right-radius': '4px' }">
166
+ <AIChat :height="dialogHeight"
167
+ :style="{ position: 'sticky', top: '0', height: dialogHeight + 'px' }"
168
+ :vmodel="model.AIModel" :actionRouter="model.actionRouters" :form="model"
169
+ @hideAI="AIToggle" >
117
170
 
118
- </el-col>
119
- </el-row>
120
- <el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1"
121
- :class="isScroll ? 'button-absolute' : 'button-initial'"
122
- :style="[pageWidth ? 'max-width:' + (pageWidth - 20) + 'px' : 'max-width:100%', isWebScroll ? 'position: fixed;' : '']">
123
- <el-col :span="24"
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;">
171
+ </AIChat>
133
172
  </div>
134
- </component>
173
+ </div>
174
+ </template>
175
+
135
176
  </div>
136
177
  <div style="min-height:200px" v-if="loading"></div>
137
178
  <iframe :src="downloadUrl" style="height:0px;width:0px;border-width: 0px;display: none;"> </iframe>
138
179
  </div>
139
180
  </template>
140
181
  <script lang="ts" setup>
141
- import { ref, nextTick, onUpdated,onDeactivated , onMounted } from 'vue'
182
+ import { ref, nextTick, onUpdated, onDeactivated, onMounted } from 'vue'
142
183
  import { RouterClickHandler } from '../../utils/mixins';
143
184
  import common from '../../utils/common'
144
185
  import Form from '../../loader/src/Form'
145
186
  import { ElMessage } from 'element-plus'
146
187
  import { useRouter } from 'vue-router';
147
188
  import Enum from '../../utils/Enum';
148
- const emit = defineEmits(['loaded', 'failLoad', 'submit'])
189
+ import AIChat from '../web/AIChat.vue';
190
+ const emit = defineEmits(['loaded', 'failLoad', 'submit', 'AIToggle'])
149
191
  const props = defineProps({
150
192
  api: String,
151
193
  vmodel: Object,
@@ -183,15 +225,17 @@ const props = defineProps({
183
225
  default: '',
184
226
  },
185
227
  isIframe: {
186
- Boolean,
187
- default: false,
228
+ Boolean,
229
+ default: false,
188
230
  },
189
231
  relationParentFormFields: {
190
- Array,
191
- default: function () {
192
- return [];
193
- },
232
+ Array,
233
+ default: function () {
234
+ return [];
235
+ },
194
236
  },
237
+ dialogHeight: String,
238
+ dialoWidth: String,
195
239
  })
196
240
 
197
241
  const itemKey = ref(1)
@@ -212,10 +256,10 @@ onUpdated(() => {
212
256
  });
213
257
  })
214
258
  onDeactivated(() => {
215
- downloadUrl.value=''
259
+ downloadUrl.value = ''
216
260
  })
217
261
  onMounted(() => {
218
- setCss();
262
+ setCss();
219
263
  })
220
264
  init()
221
265
  //初始化数据
@@ -242,7 +286,7 @@ function init() {
242
286
  function load(data) {
243
287
  model.value = data
244
288
  model.value.parentModelForm = props.parentModelForm
245
- model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey,downloadUrl,doAction };
289
+ model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey, downloadUrl, doAction };
246
290
  model.value.$vue.openType = props.openType
247
291
  model.value.isIframe = props.isIframe
248
292
  if (model.value.scripts) {
@@ -265,12 +309,36 @@ function load(data) {
265
309
  function failLoad() {
266
310
  emit('failLoad', model.value);
267
311
  }
312
+ const showAI = ref(false);
313
+ const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
314
+
315
+ function AIToggle() {
316
+ showAI.value =!showAI.value;
317
+ let width = model.value.AIattr.width;
318
+ dialogHeight.value = (props.dialogHeight || (window.innerHeight - 60));
319
+ emit('AIToggle', (showAI.value ? width : -width));
320
+ }
321
+
322
+
323
+ function buttonsWidth() {
324
+ let rtn = '100%';
325
+ if (showAI.value) {
326
+ rtn = props.dialoWidth -model.value.AIattr.width-4+ 'px';
327
+ }
328
+ else if(props.pageWidth)
329
+ {
330
+ rtn = props.pageWidth - 20+ 'px';
331
+
332
+ }
333
+ return rtn;
334
+ }
335
+
268
336
  //获取关联数据
269
337
  function getFileData(field) {
270
338
  return Form.getFileData(field, model.value);
271
339
  }
272
340
  function doAction(data) {
273
- Form.doAction(data)
341
+ Form.doAction(data)
274
342
  }
275
343
  //判断是否有滚动条
276
344
  function getisScroll() {
@@ -353,8 +421,8 @@ function validExcute() {
353
421
  }
354
422
  else if (f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'ct-dialog_wrapper') {
355
423
  total = f.$el.offsetTop;
356
- if(f.$el.offsetParent){
357
- total+=f.$el.offsetParent.offsetTop
424
+ if (f.$el.offsetParent) {
425
+ total += f.$el.offsetParent.offsetTop - 46
358
426
  }
359
427
  document.querySelector(".ct-dialog_body").children[0].scrollTop = total;
360
428
  }
@@ -416,12 +484,12 @@ function importComplete(res, field) {
416
484
  .catch(() => {
417
485
  });
418
486
  }
419
- else if(res && res.rtnCode && res.rtnCode === 200 && res.rtnMsg){
420
- ElMessage({
421
- message: res.rtnMsg,
422
- type: 'success',
423
- showClose: true,
424
- });
487
+ else if (res && res.rtnCode && res.rtnCode === 200 && res.rtnMsg) {
488
+ ElMessage({
489
+ message: res.rtnMsg,
490
+ type: 'success',
491
+ showClose: true,
492
+ });
425
493
  }
426
494
 
427
495
  if (field.flagAsync) {
@@ -459,12 +527,12 @@ function importComplete(res, field) {
459
527
  type: 'success',
460
528
  showClose: true,
461
529
  });
462
- }
530
+ }
463
531
  if (field && field.callBackFunName) {
464
- changeCallBackHandler(field, field.callBackFunName, data.content);
532
+ changeCallBackHandler(field, field.callBackFunName, data.content);
465
533
  }
466
534
  else {
467
- Form.doAction(data);
535
+ Form.doAction(data);
468
536
  }
469
537
  },
470
538
  onError(data) {
@@ -518,10 +586,10 @@ function importComplete(res, field) {
518
586
  });
519
587
  }
520
588
  if (field && field.callBackFunName) {
521
- changeCallBackHandler(field, field.callBackFunName, data.content);
589
+ changeCallBackHandler(field, field.callBackFunName, data.content);
522
590
  }
523
591
  else {
524
- Form.doAction(data);
592
+ Form.doAction(data);
525
593
  }
526
594
  },
527
595
  onError(data) {
@@ -541,19 +609,19 @@ function importComplete(res, field) {
541
609
  }
542
610
  else {
543
611
  if (field && field.callBackFunName) {
544
- changeCallBackHandler(field, field.callBackFunName, res.content);
612
+ changeCallBackHandler(field, field.callBackFunName, res.content);
545
613
  }
546
614
  else {
547
- Form.doAction(res)
615
+ Form.doAction(res)
548
616
  }
549
617
  }
550
618
  }
551
619
  //弹出选择列表
552
620
  function popupSearchListHandler(singleSelectio, field, router, callBack) {
553
- Form.popupSearchListHandler(singleSelectio, field, router, model.value, Fields.value, props, callBack)
621
+ Form.popupSearchListHandler(singleSelectio, field, router, model.value, Fields.value, props, callBack)
554
622
  }
555
623
  function popupLocationHandler(field, router, callBack) {
556
- Form.popupLocationHandler(field, router, callBack,model.value,props);
624
+ Form.popupLocationHandler(field, router, callBack, model.value, props);
557
625
  }
558
626
  //弹出分组列表
559
627
  function popupGroupListHandler(field, router, callBack) {
@@ -566,8 +634,8 @@ function updateFields(data) {
566
634
  Form.updateFields(data, model.value)
567
635
  }
568
636
  function setCss() {
569
- if (props.topHeight > -1) {
570
- minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
571
- }
637
+ if (props.topHeight > -1) {
638
+ minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
639
+ }
572
640
  }
573
641
  </script>
@@ -20,7 +20,7 @@ onActivated(() => {
20
20
  function close() {
21
21
  emit('close', props);
22
22
  if (props.vmodel.content[0].attrs && typeof props.vmodel.content[0].attrs["onCloseDialog"] === "function") {
23
- props.vmodel.content[0].attrs["onCloseDialog"]();
23
+ props.vmodel.content[0].attrs["onCloseDialog"]();
24
24
  }
25
25
  }
26
26
  function scrollHandle(ev) {
@@ -142,6 +142,14 @@ const render = () => {
142
142
  modelSelf.value = model
143
143
  }
144
144
  }
145
+ //AI弹框宽度自适应
146
+ if (!item.attrs.onAIToggle) {
147
+ item.attrs.onAIToggle = (newWidth) => {
148
+
149
+ item.width = parseFloat(item.width) + newWidth + 'px';
150
+ }
151
+ }
152
+
145
153
  //加载失败关闭弹框
146
154
  if (!item.attrs.onFailLoad) {
147
155
  item.attrs.onFailLoad = () => {
@@ -187,6 +195,8 @@ const render = () => {
187
195
  item.documentWidth = (props.vmodel.pane.clientWidth - 20) + 'px';
188
196
  }
189
197
  }
198
+ item.attrs.dialoWidth = parseInt((item.width||0).replace('px', ''));
199
+ item.attrs.dialogHeight = parseInt((item.height||0).replace('px', ''));
190
200
  return h('div', {
191
201
  style: {
192
202
  width: item.width,