centaline-data-driven-v3 0.0.78 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
Binary file
@@ -298,7 +298,7 @@ const fetchAIResponse = async (params) => {
298
298
  function read() {
299
299
  if (isStopped) {
300
300
  // 如果停止标志为 true,直接返回
301
- outtext.value += "用户停止"
301
+ outtext.value += "\n\n用户停止"
302
302
  startTypingEffect(outtext.value);
303
303
  outtext.value = '';
304
304
  resolve();
@@ -336,6 +336,8 @@ const fetchAIResponse = async (params) => {
336
336
  });
337
337
  }).then(() => {
338
338
  // 在所有行处理完毕后执行 startTypingEffect
339
+
340
+
339
341
  startTypingEffect(outtext.value);
340
342
  outtext.value = '';
341
343
  }).catch(error => {
@@ -418,6 +420,11 @@ const handleStreamEvent = (eventData: StreamEventData) => {
418
420
  }
419
421
  }
420
422
 
423
+ const getTemplateType= (fullText)=>{
424
+
425
+
426
+
427
+ }
421
428
 
422
429
 
423
430
  function startTypingEffect(fullText) {
@@ -83,7 +83,7 @@
83
83
  <template #title>
84
84
  <i class="sign"></i>
85
85
  <span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel
86
- }}</span>
86
+ }}</span>
87
87
  <span v-html="item.sufLabel1"></span>
88
88
  </template>
89
89
 
@@ -137,7 +137,7 @@
137
137
  </el-row>
138
138
  <el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1"
139
139
  :class="isScroll ? 'button-absolute' : 'button-initial'"
140
- :style="[ 'max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
140
+ :style="['max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
141
141
  <el-col :span="24"
142
142
  style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
143
143
  class="btnPadBom">
@@ -145,12 +145,7 @@
145
145
  <component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler"
146
146
  :style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }"></component>
147
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>
153
- </template>
148
+
154
149
  </el-col>
155
150
  </el-row>
156
151
  <div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1"
@@ -158,24 +153,40 @@
158
153
  </div>
159
154
  </component>
160
155
  </div>
156
+
157
+
161
158
  </div>
162
- <template v-if=" model?.AIattr?.showAI ">
159
+ <template v-if="model?.AIattr?.showAI">
163
160
  <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" >
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">
170
168
 
171
- </AIChat>
169
+ </AIChat>
170
+ </div>
172
171
  </div>
173
- </div>
174
172
  </template>
175
-
173
+
176
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>
177
187
  <div style="min-height:200px" v-if="loading"></div>
178
188
  <iframe :src="downloadUrl" style="height:0px;width:0px;border-width: 0px;display: none;"> </iframe>
189
+
179
190
  </div>
180
191
  </template>
181
192
  <script lang="ts" setup>
@@ -185,6 +196,7 @@ import common from '../../utils/common'
185
196
  import Form from '../../loader/src/Form'
186
197
  import { ElMessage } from 'element-plus'
187
198
  import { useRouter } from 'vue-router';
199
+ import util from '../../utils/pub-use'
188
200
  import Enum from '../../utils/Enum';
189
201
  import AIChat from '../web/AIChat.vue';
190
202
  const emit = defineEmits(['loaded', 'failLoad', 'submit', 'AIToggle'])
@@ -313,21 +325,20 @@ const showAI = ref(false);
313
325
  const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
314
326
 
315
327
  function AIToggle() {
316
- showAI.value =!showAI.value;
328
+ showAI.value = !showAI.value;
317
329
  let width = model.value.AIattr.width;
318
330
  dialogHeight.value = (props.dialogHeight || (window.innerHeight - 60));
319
331
  emit('AIToggle', (showAI.value ? width : -width));
320
332
  }
321
333
 
322
-
334
+
323
335
  function buttonsWidth() {
324
336
  let rtn = '100%';
325
337
  if (showAI.value) {
326
- rtn = props.dialoWidth -model.value.AIattr.width-4+ 'px';
338
+ rtn = props.dialoWidth - model.value.AIattr.width - 4 + 'px';
327
339
  }
328
- else if(props.pageWidth)
329
- {
330
- rtn = props.pageWidth - 20+ 'px';
340
+ else if (props.pageWidth) {
341
+ rtn = props.pageWidth - 20 + 'px';
331
342
 
332
343
  }
333
344
  return rtn;
@@ -638,4 +649,41 @@ function setCss() {
638
649
  minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
639
650
  }
640
651
  }
641
- </script>
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
+ }
688
+ }
689
+ </style>