Browse Source

AI参谋跳转接口调试

zhujindu 1 year ago
parent
commit
68d7b5cad8

BIN
src/assets/pauseVoice.gif


BIN
src/assets/playVoice.png


+ 69 - 0
src/views/intelligence/audioPlayer.vue

@@ -0,0 +1,69 @@
+<template>
+  <div class="audioBox">
+    <audio controls ref="audioRef" style="display: none">
+      <source :src="fileurl" type="audio/wav" />
+    </audio>
+    <div @click="playAudio" class="audio-righr">
+      <p class="voice" :style="{ width: duration * 10 + 'px' }">
+        <span>{{ duration }}''</span>
+        <img src="@/assets/playVoice.png" alt="" v-if="audioStatus == 'play'" />
+        <img src="@/assets/pauseVoice.gif" alt="" v-else />
+      </p>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    // 文件路径
+    fileurl: {
+      type: String,
+      default: '',
+    },
+    // 总时长
+    duration: {
+      type: Number,
+      default: 3,
+    },
+  },
+  data() {
+    return {
+      audioStatus: 'play', //音频播放状态 play:等待播放;pause:正在播放
+    }
+  },
+  // directives:{
+
+  // }
+  methods: {
+    // 播放暂停控制
+    playAudio() {
+      let recordAudio = this.$refs.audioRef // 获取audio元素
+      if (recordAudio.paused) {
+        recordAudio.play()
+        this.audioStatus = 'pause'
+      } else {
+        recordAudio.pause()
+        this.audioStatus = 'play'
+      }
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+.audioBox {
+  .audio-righr {
+    min-height: 44px;
+    padding: 5px 15px 5px 10px;
+    .voice {
+      display: flex;
+      align-items: center;
+      img {
+        // transform: rotate(180deg);
+        width: 20px;
+        margin-left: 5px;
+      }
+    }
+  }
+}
+</style>

+ 0 - 412
src/views/intelligence/audioRecord.vue

@@ -1,412 +0,0 @@
-<template>
-  <div class="audioRecord">
-    <div class="audioBox">
-      <div
-        class="boxItem"
-        :class="recordStatus == 'begin' || recordStatus == 'resume' ? 'active' : ''"
-        @click="startRecorder('begin')">
-        <div class="item_icon iconfonts iconrecord-circle-line"></div>
-        <div class="item_desc">开始录制</div>
-      </div>
-      <div class="boxItem" v-show="recordStatus !== 'pause'" @click="pauseRecorder('pause')">
-        <div class="item_icon iconfonts iconzanting1"></div>
-        <div class="item_desc">暂停录制</div>
-      </div>
-      <div class="boxItem" v-show="recordStatus == 'pause'" @click="resumeRecorder('resume')">
-        <div class="item_icon iconfonts iconicon_play"></div>
-        <div class="item_desc">继续录制</div>
-      </div>
-      <div class="boxItem" @click="stopRecorder('stop')">
-        <div class="item_icon iconfonts iconstop-full"></div>
-        <div class="item_desc">停止录制</div>
-      </div>
-      <div class="boxItem">
-        <div class="item_dura">{{ formatNum(rm) }}:{{ formatNum(rs) }}</div>
-        <div class="item_desc">录音时长</div>
-      </div>
-    </div>
-    <div class="audioBox playBox">
-      <div class="boxItem" @click="playRecorder('play')">
-        <div class="item_icon iconfonts iconicon_play"></div>
-        <div class="item_desc">录音播放</div>
-      </div>
-      <div class="boxItem" @click="resumePlayRecorder('resume_play')">
-        <div class="item_icon iconfonts iconicon_play"></div>
-        <div class="item_desc">恢复播放</div>
-      </div>
-      <div class="boxItem" @click="pausePlayRecorder('pause_play')">
-        <div class="item_icon iconfonts iconzanting1"></div>
-        <div class="item_desc">暂停播放</div>
-      </div>
-      <div class="boxItem">
-        <div class="item_dura">
-          {{ formatNum(ym) }}:{{ formatNum(ys) }}/{{ formatNum(rm) }}:{{ formatNum(rs) }}
-        </div>
-        <div class="item_desc">播放时长/录音时长</div>
-      </div>
-      <div class="boxItem" @click="resetRecorder('reset')">
-        <div class="item_icon iconfonts iconzhongzhi"></div>
-        <div class="item_desc">重新录制</div>
-      </div>
-      <div class="boxItem" @click="getRecorder">
-        <div class="item_icon iconfonts iconbaocun01"></div>
-        <div class="item_desc">保存</div>
-      </div>
-    </div>
-  </div>
-</template>
-<script>
-// lamejs  版本号为  1.2.0  最新版本会报错 属性找不到
-import Recorder from 'js-audio-recorder';
-const lamejs = require('lamejs');
-var recorder = new Recorder({
-  sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
-  sampleRate: 48000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
-  numChannels: 1, // 声道,支持 1 或 2, 默认是1
-  // compiling: false,(0.x版本中生效,1.x增加中)  // 是否边录边转换,默认是false
-});
-
-export default {
-  name: 'audioRecord',
-  props: {
-    audioUrl: {
-      type: String,
-      default: '',
-    },
-  },
-  data() {
-    return {
-      //波浪图-录音
-      drawRecordId: null,
-      oCanvas: null,
-      ctx: null,
-      //波浪图-播放
-      drawPlayId: null,
-      pCanvas: null,
-      pCtx: null,
-      recordStatus: null,
-      rm: 0, // 录音时长 分
-      rs: 0, // 录音时长 秒
-      ym: 0, // 播放时长 分
-      ys: 0, // 播放时长 秒
-    };
-  },
-  watch: {
-    audioUrl: {
-      handler() {
-        debugger;
-        this.getMp3Data();
-      },
-    },
-  },
-  created() {
-    // 绑定事件-打印的是当前录音数据
-    recorder.onprogress = function (params) {
-      // console.log('--------------START---------------')
-      console.log('录音时长(秒)', params.duration);
-      // console.log('录音大小(字节)', params.fileSize);
-      // console.log('录音音量百分比(%)', params.vol);
-      // console.log('当前录音的总数据([DataView, DataView...])', params.data);
-      // console.log('--------------END---------------')
-    };
-  },
-  mounted() {
-    // this.startCanvas();
-  },
-  methods: {
-    formatNum(val) {
-      return val < 10 ? '0' + val : val;
-    },
-    // 将秒数 转为 时间
-    secondsTotime(seconds) {
-      var hours = Math.floor(seconds / 3600);
-      var minutes = Math.floor((seconds - hours * 3600) / 60);
-      var second = seconds - hours * 3600 - minutes * 60;
-      second = Math.round(seconds * 100) / 100;
-      var result =
-        (minutes < 10 ? '0' + minutes : minutes) + ':' + (second < 10 ? '0' + second : second);
-      return result;
-    },
-    /**
-     * 波浪图配置
-     * */
-    startCanvas() {
-      //录音波浪
-      this.oCanvas = document.getElementById('canvas');
-      this.ctx = this.oCanvas.getContext('2d');
-      //播放波浪
-      this.pCanvas = document.getElementById('playChart');
-      this.pCtx = this.pCanvas.getContext('2d');
-    },
-    /**
-     *  录音的具体操作功能
-     * */
-    // 开始录音
-    startRecorder(val) {
-      this.recordStatus = val;
-      let that = this;
-      // 获取麦克风权限
-      Recorder.getPermission().then(
-        () => {
-          console.log('获取权限成功,开始录音');
-          recorder.start();
-        },
-        (error) => {
-          console.log('请先允许该网页使用麦克风');
-          // console.log(`${error.name} : ${error.message}`);
-        }
-      );
-      // recorder.start().then(() => {
-      //   this.drawRecord();//开始绘制图片
-      // }, (error) => {
-      //   // 出错了
-      //   console.log(`${error.name} : ${error.message}`);
-      // });
-    },
-    // 继续录音
-    resumeRecorder(val) {
-      this.recordStatus = val;
-      recorder.resume();
-    },
-    // 暂停录音
-    pauseRecorder(val) {
-      this.recordStatus = val;
-      recorder.pause();
-      // this.drawRecordId && cancelAnimationFrame(this.drawRecordId);
-      // this.drawRecordId = null;
-    },
-    // 结束录音
-    stopRecorder(val) {
-      this.recordStatus = val;
-      recorder.stop();
-      // this.drawRecordId && cancelAnimationFrame(this.drawRecordId);
-      // this.drawRecordId = null;
-    },
-    // 录音播放
-    playRecorder(val) {
-      this.recordStatus = val;
-      recorder.play();
-      // this.drawPlay();//绘制波浪图
-    },
-    // 暂停录音播放
-    pausePlayRecorder(val) {
-      this.recordStatus = val;
-      recorder.pausePlay();
-    },
-    // 恢复录音播放
-    resumePlayRecorder(val) {
-      this.recordStatus = val;
-      recorder.resumePlay();
-      // this.drawPlay();//绘制波浪图
-    },
-    // 停止录音播放
-    stopPlayRecorder(val) {
-      this.recordStatus = val;
-      recorder.stopPlay();
-    },
-    // 重新录制
-    resetRecorder(val) {
-      this.recordStatus = val;
-    },
-    // 销毁录音
-    destroyRecorder(val) {
-      this.recordStatus = val;
-      let that = this;
-      recorder.destroy().then(function () {
-        // recorder = null;
-        that.drawRecordId && cancelAnimationFrame(that.drawRecordId);
-        that.drawRecordId = null;
-      });
-    },
-    /**
-     *  获取录音文件
-     * */
-    getRecorder() {
-      let toltime = recorder.duration; //录音总时长
-      let fileSize = recorder.fileSize; //录音总大小
-      //录音结束,获取取录音数据
-      let PCMBlob = recorder.getPCMBlob(); //获取 PCM 数据
-      let wav = recorder.getWAVBlob(); //获取 WAV 数据
-      let channel = recorder.getChannelData(); //获取左声道和右声道音频数据
-    },
-    /**
-     *  下载录音文件
-     * */
-    //下载pcm
-    downPCM() {
-      //这里传参进去的时文件名
-      recorder.downloadPCM('新文件');
-    },
-    //下载wav
-    downWAV() {
-      //这里传参进去的时文件名
-      recorder.downloadWAV('新文件');
-    },
-    /**
-     *  获取麦克风权限
-     * */
-    getPermission() {
-      Recorder.getPermission().then(
-        () => {
-          console.log('获取权限成功');
-        },
-        (error) => {
-          console.log(`${error.name} : ${error.message}`);
-        }
-      );
-    },
-    /**
-     * 文件格式转换 wav-map3
-     * */
-    getMp3Data() {
-      debugger;
-      let url = this.audioUrl;
-      var xhr = new XMLHttpRequest();
-      xhr.open('GET', url, true);
-      xhr.responseType = 'arraybuffer';
-      xhr.onload = function () {
-        var samples = new Int16Array(xhr.response);
-        const mp3Blob = this.convertToMp3(samples);
-        recorder.download(mp3Blob, 'recorder', 'mp3');
-      };
-      xhr.send();
-    },
-    convertToMp3(wavDataView) {
-      // 获取wav头信息
-      const wav = lamejs.WavHeader.readHeader(wavDataView); // 此处其实可以不用去读wav头信息,毕竟有对应的config配置
-      const { channels, sampleRate } = wav;
-      const mp3enc = new lamejs.Mp3Encoder(channels, sampleRate, 128);
-      // 获取左右通道数据
-      const result = recorder.getChannelData();
-      const buffer = [];
-      const leftData =
-        result.left && new Int16Array(result.left.buffer, 0, result.left.byteLength / 2);
-      const rightData =
-        result.right && new Int16Array(result.right.buffer, 0, result.right.byteLength / 2);
-      const remaining = leftData.length + (rightData ? rightData.length : 0);
-      const maxSamples = 1152;
-      for (let i = 0; i < remaining; i += maxSamples) {
-        const left = leftData.subarray(i, i + maxSamples);
-        let right = null;
-        let mp3buf = null;
-        if (channels === 2) {
-          right = rightData.subarray(i, i + maxSamples);
-          mp3buf = mp3enc.encodeBuffer(left, right);
-        } else {
-          mp3buf = mp3enc.encodeBuffer(left);
-        }
-        if (mp3buf.length > 0) {
-          buffer.push(mp3buf);
-        }
-      }
-      const enc = mp3enc.flush();
-      if (enc.length > 0) {
-        buffer.push(enc);
-      }
-      return new Blob(buffer, { type: 'audio/mp3' });
-    },
-    /**
-     * 绘制波浪图-录音
-     * */
-    drawRecord() {
-      // 用requestAnimationFrame稳定60fps绘制
-      this.drawRecordId = requestAnimationFrame(this.drawRecord);
-      // 实时获取音频大小数据
-      let dataArray = recorder.getRecordAnalyseData(),
-        bufferLength = dataArray.length;
-      // 填充背景色
-      this.ctx.fillStyle = 'rgb(200, 200, 200)';
-      this.ctx.fillRect(0, 0, this.oCanvas.width, this.oCanvas.height);
-      // 设定波形绘制颜色
-      this.ctx.lineWidth = 2;
-      this.ctx.strokeStyle = 'rgb(0, 0, 0)';
-      this.ctx.beginPath();
-      var sliceWidth = (this.oCanvas.width * 1.0) / bufferLength, // 一个点占多少位置,共有bufferLength个点要绘制
-        x = 0; // 绘制点的x轴位置
-      for (var i = 0; i < bufferLength; i++) {
-        var v = dataArray[i] / 128.0;
-        var y = (v * this.oCanvas.height) / 2;
-        if (i === 0) {
-          // 第一个点
-          this.ctx.moveTo(x, y);
-        } else {
-          // 剩余的点
-          this.ctx.lineTo(x, y);
-        }
-        // 依次平移,绘制所有点
-        x += sliceWidth;
-      }
-      this.ctx.lineTo(this.oCanvas.width, this.oCanvas.height / 2);
-      this.ctx.stroke();
-    },
-    /**
-     * 绘制波浪图-播放
-     * */
-    drawPlay() {
-      // 用requestAnimationFrame稳定60fps绘制
-      this.drawPlayId = requestAnimationFrame(this.drawPlay);
-      // 实时获取音频大小数据
-      let dataArray = recorder.getPlayAnalyseData(),
-        bufferLength = dataArray.length;
-      // 填充背景色
-      this.pCtx.fillStyle = 'rgb(200, 200, 200)';
-      this.pCtx.fillRect(0, 0, this.pCanvas.width, this.pCanvas.height);
-      // 设定波形绘制颜色
-      this.pCtx.lineWidth = 2;
-      this.pCtx.strokeStyle = 'rgb(0, 0, 0)';
-      this.pCtx.beginPath();
-      var sliceWidth = (this.pCanvas.width * 1.0) / bufferLength, // 一个点占多少位置,共有bufferLength个点要绘制
-        x = 0; // 绘制点的x轴位置
-      for (var i = 0; i < bufferLength; i++) {
-        var v = dataArray[i] / 128.0;
-        var y = (v * this.pCanvas.height) / 2;
-        if (i === 0) {
-          // 第一个点
-          this.pCtx.moveTo(x, y);
-        } else {
-          // 剩余的点
-          this.pCtx.lineTo(x, y);
-        }
-        // 依次平移,绘制所有点
-        x += sliceWidth;
-      }
-      this.pCtx.lineTo(this.pCanvas.width, this.pCanvas.height / 2);
-      this.pCtx.stroke();
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.audioRecord {
-  background: #fff;
-  position: fixed;
-  bottom: 120px;
-  width: 100%;
-}
-.audioBox {
-  color: #bec0e0;
-  // width: 6.48rem;
-  // height: 1.3rem;
-  display: flex;
-  justify-content: space-around;
-  align-items: center;
-  font-size: 14px;
-  .boxItem {
-    cursor: pointer;
-    text-align: center;
-    margin: 0 5px;
-    .item_icon {
-      font-size: 14px !important;
-    }
-    .item_desc {
-      margin-top: 0.1rem;
-    }
-    &.active {
-      color: #49f66c;
-    }
-    &:hover {
-      color: #49f66c;
-    }
-  }
-}
-</style>

+ 185 - 198
src/views/intelligence/index.vue

@@ -78,38 +78,20 @@
               <van-col span="16">
               <van-col span="16">
                 <div
                 <div
                   style="
                   style="
+                    border-radius: 6px;
                     text-align: left;
                     text-align: left;
                     background-color: #a0e75a;
                     background-color: #a0e75a;
-                    min-height: 44px;
                     margin: 0 10px;
                     margin: 0 10px;
-                    padding: 10px;
-                    border-radius: 6px;
                     display: inline-block;
                     display: inline-block;
                     float: right;
                     float: right;
                   ">
                   ">
                   <template v-if="item.chatRecordFile">
                   <template v-if="item.chatRecordFile">
-                    <p @click="audioPlay(item.chatRecordFile)">播放</p>
-                    <p
-                      class="voice"
-                      @click="audioPlay(item.chatRecordFile)"
-                      :style="{ width: 3 * 10 + 'px' }">
-                      <img
-                        src="https://adm-ms.icolor.com.cn/application/1/assets/voice.png"
-                        alt="" />
-                      <span>{{ 3 }}''</span>
-                    </p>
-                    <audio controls>
-                      <source :src="sample3s" type="audio/mpeg" />
-                      <p>
-                        Your browser doesn't support HTML5 audio. Here is a
-                        <a href="myAudio.mp4">link to download the audio</a> instead.
-                      </p>
-                    </audio>
+                    <audioPlayer :fileurl="item.chatRecordFile"></audioPlayer>
                   </template>
                   </template>
                   <template v-else>
                   <template v-else>
-                    <p style="word-break: break-all">
+                    <div class="myContent">
                       {{ item.chatRecordText }}
                       {{ item.chatRecordText }}
-                    </p>
+                    </div>
                   </template>
                   </template>
                 </div>
                 </div>
               </van-col>
               </van-col>
@@ -431,25 +413,24 @@
         </div>
         </div>
       </div>
       </div>
     </van-overlay>
     </van-overlay>
-    <audioRecord :audioUrl="audioUrl"></audioRecord>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import avatar from '@/assets/avatar2.png';
-import yy from '@/assets/Icon/yy.png';
-import yt from '@/assets/Icon/yt.png';
-import aiselect from '@/assets/Icon/avatar1.png';
-import tabBar from '@/components/tabBar';
-import { getReportInfo } from '@/api';
-import { aiDialogue } from '@/api/inventory';
-import { getPosition, getTicketFun } from '@/utils/TXApiFun';
-import BenzAMRRecorder from 'benz-amr-recorder';
-import sample3s from '@/assets/mp3/sample-3s.mp3';
-import audioRecord from './audioRecord.vue';
+import avatar from '@/assets/avatar2.png'
+import yy from '@/assets/Icon/yy.png'
+import yt from '@/assets/Icon/yt.png'
+import aiselect from '@/assets/Icon/avatar1.png'
+import tabBar from '@/components/tabBar'
+import { getReportInfo } from '@/api'
+import { aiDialogue } from '@/api/inventory'
+import { getPosition, getTicketFun } from '@/utils/TXApiFun'
+import BenzAMRRecorder from 'benz-amr-recorder'
+import sample3s from '@/assets/mp3/sample-3s.mp3'
+import audioPlayer from './audioPlayer.vue'
 export default {
 export default {
   name: 'ai',
   name: 'ai',
-  components: { tabBar, audioRecord },
+  components: { tabBar, audioPlayer },
   data() {
   data() {
     return {
     return {
       sample3s: sample3s,
       sample3s: sample3s,
@@ -495,7 +476,7 @@ export default {
       successText: '加载成功', //上拉刷新提示语
       successText: '加载成功', //上拉刷新提示语
       tips: '按住 说话',
       tips: '按住 说话',
       audioUrl: '',
       audioUrl: '',
-    };
+    }
   },
   },
   // watch: {
   // watch: {
   //   $route(to, from) {
   //   $route(to, from) {
@@ -505,62 +486,63 @@ export default {
   //   },
   //   },
   // },
   // },
   activated() {
   activated() {
-    this.pageNum = 0;
-    this.isNoData = false;
-    this.onLoad();
+    this.pageNum = 0
+    this.isNoData = false
+    this.onLoad()
     // 授权
     // 授权
-    getTicketFun(['getLocation', 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'uploadVoice']);
+    getTicketFun(['getLocation', 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'uploadVoice'])
     this.audioUrl =
     this.audioUrl =
-      'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D';
+      // 'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D'
+      'https://cdn-svs-test.nipponpaint.com.cn/%E6%9C%B1%E9%87%91%E5%98%9F-20240918160200.wav?Expires=2042179320&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=kcsEr4BE11XpV6TAW6lLJWU0rXI%3D'
   },
   },
   methods: {
   methods: {
     audioPlay(chatRecordFile) {
     audioPlay(chatRecordFile) {
       if (chatRecordFile) {
       if (chatRecordFile) {
-        const url = chatRecordFile;
-        this.amr = new BenzAMRRecorder();
+        const url = chatRecordFile
+        this.amr = new BenzAMRRecorder()
         this.amr.initWithUrl(url).then(() => {
         this.amr.initWithUrl(url).then(() => {
-          this.amr.play();
+          this.amr.play()
           // data.amrTime = Math.ceil(amr.getDuration());    //获取音频总时长
           // data.amrTime = Math.ceil(amr.getDuration());    //获取音频总时长
-        });
+        })
         this.amr.onEnded(() => {
         this.amr.onEnded(() => {
           // 播放结束重置状态
           // 播放结束重置状态
-        });
+        })
       } else {
       } else {
-        this.amr.stop();
+        this.amr.stop()
       }
       }
     },
     },
     garbageManager() {
     garbageManager() {
       this.$nextTick(() => {
       this.$nextTick(() => {
-        this.$refs.snb.scrollTop = this.$refs.snb.scrollHeight;
-      });
+        this.$refs.snb.scrollTop = this.$refs.snb.scrollHeight
+      })
     },
     },
     onLoad() {
     onLoad() {
       if (this.isNoData) {
       if (this.isNoData) {
-        this.successText = '以下所有内容!';
-        this.$toast('已经加载所有内容!');
-        this.loading = false;
-        return;
+        this.successText = '以下所有内容!'
+        this.$toast('已经加载所有内容!')
+        this.loading = false
+        return
       }
       }
-      this.pageNum++;
-      this.aiDialogueGgreet();
+      this.pageNum++
+      this.aiDialogueGgreet()
     },
     },
     choiceSelct(val, val2) {
     choiceSelct(val, val2) {
       if (val.type == 'AI_WIRING_SCENE') {
       if (val.type == 'AI_WIRING_SCENE') {
-        localStorage.setItem(val.type, val.content);
+        localStorage.setItem(val.type, val.content)
         // 跳转高销额列表
         // 跳转高销额列表
         this.$router.push({
         this.$router.push({
           path: '/topStore',
           path: '/topStore',
           query: {
           query: {
             AItype: val.type,
             AItype: val.type,
           },
           },
-        });
-        return;
+        })
+        return
       } else {
       } else {
         let loading1 = this.$toast.loading({
         let loading1 = this.$toast.loading({
           duration: 0,
           duration: 0,
           message: '发送中...',
           message: '发送中...',
           forbidClick: true,
           forbidClick: true,
-        });
+        })
         aiDialogue({
         aiDialogue({
           type: 4,
           type: 4,
           content: val.radioName,
           content: val.radioName,
@@ -570,13 +552,13 @@ export default {
           radioValue: val.radioValue,
           radioValue: val.radioValue,
           radioName: val.radioName,
           radioName: val.radioName,
         }).then((response) => {
         }).then((response) => {
-          loading1.clear();
+          loading1.clear()
           if (response.code == 200) {
           if (response.code == 200) {
-            this.pageNum = 1;
-            this.Ggreet = [];
-            this.aiDialogueGgreet();
+            this.pageNum = 1
+            this.Ggreet = []
+            this.aiDialogueGgreet()
           }
           }
-        });
+        })
       }
       }
     },
     },
     aiDialogueGgreet() {
     aiDialogueGgreet() {
@@ -584,25 +566,25 @@ export default {
         duration: 0,
         duration: 0,
         message: '发送中...',
         message: '发送中...',
         forbidClick: true,
         forbidClick: true,
-      });
+      })
       this.aiDialogueCommon({ type: 3, pageNum: this.pageNum, pageSize: 10 })
       this.aiDialogueCommon({ type: 3, pageNum: this.pageNum, pageSize: 10 })
         .then((response) => {
         .then((response) => {
-          this.Ggreet = response.rows.concat(this.Ggreet);
+          this.Ggreet = response.rows.concat(this.Ggreet)
           if (this.Ggreet.length >= response.total) {
           if (this.Ggreet.length >= response.total) {
-            this.isNoData = true;
+            this.isNoData = true
           } else {
           } else {
-            this.isNoData = false;
+            this.isNoData = false
           }
           }
           if (this.pageNum == 1) {
           if (this.pageNum == 1) {
-            this.garbageManager();
+            this.garbageManager()
           }
           }
-          loading1.clear();
-          this.loading = false;
+          loading1.clear()
+          this.loading = false
         })
         })
         .catch(() => {
         .catch(() => {
-          loading1.clear();
-          this.loading = false;
-        });
+          loading1.clear()
+          this.loading = false
+        })
       // aiDialogue({ type: 3, pageNum: this.pageNum, pageSize: 10 }).then((response) => {
       // aiDialogue({ type: 3, pageNum: this.pageNum, pageSize: 10 }).then((response) => {
       //   loading1.clear();
       //   loading1.clear();
       //   this.loading = false;
       //   this.loading = false;
@@ -621,62 +603,62 @@ export default {
     },
     },
     Submit() {
     Submit() {
       if (this.content.trim() == '') {
       if (this.content.trim() == '') {
-        this.$toast('请输入内容!');
+        this.$toast('请输入内容!')
       }
       }
       let loading1 = this.$toast.loading({
       let loading1 = this.$toast.loading({
         duration: 0,
         duration: 0,
         message: '发送中...',
         message: '发送中...',
         forbidClick: true,
         forbidClick: true,
-      });
-      this.btnclik = false;
+      })
+      this.btnclik = false
       // 发送的文本内容添加到对象,减少重新获取接口
       // 发送的文本内容添加到对象,减少重新获取接口
       this.Ggreet.push({
       this.Ggreet.push({
         chatRecordText: this.content,
         chatRecordText: this.content,
         chatRecordFrom: 1,
         chatRecordFrom: 1,
-      });
+      })
       aiDialogue({ type: 1, content: this.content }).then((response) => {
       aiDialogue({ type: 1, content: this.content }).then((response) => {
-        loading1.clear();
-        this.btnclik = true;
+        loading1.clear()
+        this.btnclik = true
         if (response.code == 200) {
         if (response.code == 200) {
-          this.content = '';
+          this.content = ''
           // this.pageNum = 1;
           // this.pageNum = 1;
           // this.Ggreet = [];
           // this.Ggreet = [];
-          this.Ggreet.push(...response.rows);
+          this.Ggreet.push(...response.rows)
           // this.aiDialogueGgreet();
           // this.aiDialogueGgreet();
-          this.garbageManager();
+          this.garbageManager()
         }
         }
-      });
+      })
     },
     },
     startRecord() {
     startRecord() {
-      this.tips = '松开 发送';
-      this.wx.startRecord();
-      this.shows = true;
+      this.tips = '松开 发送'
+      this.wx.startRecord()
+      this.shows = true
       this.wx.onVoiceRecordEnd({
       this.wx.onVoiceRecordEnd({
         // 录音时间超过一分钟没有停止的时候会执行 complete 回调
         // 录音时间超过一分钟没有停止的时候会执行 complete 回调
         complete: (res) => {
         complete: (res) => {
-          var localId = res.localId;
-          this.shows = false;
+          var localId = res.localId
+          this.shows = false
           this.wx.uploadVoice({
           this.wx.uploadVoice({
             localId: localId,
             localId: localId,
             isShowProgressTips: 1, // 默认为1,显示进度提示
             isShowProgressTips: 1, // 默认为1,显示进度提示
             success: (res) => {
             success: (res) => {
-              this.shows = false;
-              this.show = false;
+              this.shows = false
+              this.show = false
               this.aiDialogueCommon({ type: 2, content: res.serverId }).then((response) => {
               this.aiDialogueCommon({ type: 2, content: res.serverId }).then((response) => {
                 this.Ggreet.push({
                 this.Ggreet.push({
                   chatRecordFile:
                   chatRecordFile:
                     'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D',
                     'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D',
                   chatRecordFrom: 1,
                   chatRecordFrom: 1,
-                });
+                })
                 // 音频内容需要接口传唤格式后添加到对象
                 // 音频内容需要接口传唤格式后添加到对象
                 // this.Ggreet.push(...response.rows);
                 // this.Ggreet.push(...response.rows);
                 // this.Ggreet.push(...response.rows);
                 // this.Ggreet.push(...response.rows);
-                this.garbageManager();
-              });
+                this.garbageManager()
+              })
             },
             },
-          });
+          })
         },
         },
-      });
+      })
       //     });
       //     });
       //   }
       //   }
       // });
       // });
@@ -684,26 +666,26 @@ export default {
     stopRecord() {
     stopRecord() {
       this.wx.stopRecord({
       this.wx.stopRecord({
         success: (res) => {
         success: (res) => {
-          var localId = res.localId;
+          var localId = res.localId
           this.wx.uploadVoice({
           this.wx.uploadVoice({
             localId: localId,
             localId: localId,
             isShowProgressTips: 1, // 默认为1,显示进度提示
             isShowProgressTips: 1, // 默认为1,显示进度提示
             success: (res) => {
             success: (res) => {
-              console.log(res);
-              this.shows = false;
-              this.show = false;
+              console.log(res)
+              this.shows = false
+              this.show = false
               this.aiDialogueCommon({ type: 2, content: res.serverId })
               this.aiDialogueCommon({ type: 2, content: res.serverId })
                 .then((response) => {
                 .then((response) => {
-                  this.Ggreet.push(...response.rows);
-                  this.garbageManager();
+                  this.Ggreet.push(...response.rows)
+                  this.garbageManager()
                 })
                 })
                 .catch(() => {
                 .catch(() => {
                   this.Ggreet.push({
                   this.Ggreet.push({
                     chatRecordFile:
                     chatRecordFile:
                       'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D',
                       'https://cdn-svs-test.nipponpaint.com.cn/%E5%90%B4%E5%BA%B7-20240918152244.amr?Expires=2042176973&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=BvwZFdxp69wRNy7oOPfqG6lxTww%3D',
                     chatRecordFrom: 1,
                     chatRecordFrom: 1,
-                  });
-                });
+                  })
+                })
               // aiDialogue({ type: 2, content: res.serverId }).then((response) => {
               // aiDialogue({ type: 2, content: res.serverId }).then((response) => {
               //   if (response.code == 200) {
               //   if (response.code == 200) {
               //     this.Ggreet.push(...response.rows);
               //     this.Ggreet.push(...response.rows);
@@ -713,9 +695,9 @@ export default {
               //   this.show = false;
               //   this.show = false;
               // });
               // });
             },
             },
-          });
+          })
         },
         },
-      });
+      })
     },
     },
     //AI对话接口
     //AI对话接口
     // type:类型:1-用户文本对话 2-用户语音对话 3-欢迎语/查询历史 4-点击AI回答进行匹配结果
     // type:类型:1-用户文本对话 2-用户语音对话 3-欢迎语/查询历史 4-点击AI回答进行匹配结果
@@ -724,158 +706,158 @@ export default {
         aiDialogue({ ...arguments[0] })
         aiDialogue({ ...arguments[0] })
           .then((response) => {
           .then((response) => {
             if (response.code == 200) {
             if (response.code == 200) {
-              resolve(response);
+              resolve(response)
             } else {
             } else {
-              console.log(response.msg);
-              rejectt(response);
+              console.log(response.msg)
+              rejectt(response)
             }
             }
           })
           })
           .catch((err) => {
           .catch((err) => {
-            console.log(err);
-            rejectt('aiDialogue接口失败');
-          });
-      });
+            console.log(err)
+            rejectt('aiDialogue接口失败')
+          })
+      })
     },
     },
     typw(val) {
     typw(val) {
       if (val == 1) {
       if (val == 1) {
-        this.one14 = true;
+        this.one14 = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one15 = true;
-        }, 1000);
+          this.one15 = true
+        }, 1000)
       }
       }
       if (val == 2) {
       if (val == 2) {
-        this.one16 = true;
+        this.one16 = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one17 = true;
-        }, 1000);
+          this.one17 = true
+        }, 1000)
       }
       }
       if (val == 3) {
       if (val == 3) {
-        this.one18 = true;
+        this.one18 = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one19 = true;
-        }, 1000);
+          this.one19 = true
+        }, 1000)
       }
       }
     },
     },
     send() {
     send() {
-      this.one = false;
-      this.two = false;
-      this.one1 = false;
-      this.one9 = false;
-      this.one10 = false;
-      this.one11 = false;
-      this.one12 = false;
-      this.one14 = false;
-      this.one15 = false;
-      this.one16 = false;
-      this.one17 = false;
-      this.one18 = false;
-      this.one19 = false;
-      this.two1 = false;
+      this.one = false
+      this.two = false
+      this.one1 = false
+      this.one9 = false
+      this.one10 = false
+      this.one11 = false
+      this.one12 = false
+      this.one14 = false
+      this.one15 = false
+      this.one16 = false
+      this.one17 = false
+      this.one18 = false
+      this.one19 = false
+      this.two1 = false
       if (this.message.indexOf('销量') != -1 || this.num == 1) {
       if (this.message.indexOf('销量') != -1 || this.num == 1) {
-        this.one = true;
+        this.one = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one1 = true;
-        }, 1000);
+          this.one1 = true
+        }, 1000)
       }
       }
       if (this.message.indexOf('专业时时丽') != -1 || this.num == 2) {
       if (this.message.indexOf('专业时时丽') != -1 || this.num == 2) {
-        this.one11 = true;
+        this.one11 = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one12 = true;
-        }, 1000);
+          this.one12 = true
+        }, 1000)
       }
       }
       if (this.message.indexOf('碰瓷专案') != -1 || this.num == 3) {
       if (this.message.indexOf('碰瓷专案') != -1 || this.num == 3) {
-        this.one9 = true;
+        this.one9 = true
         setTimeout(() => {
         setTimeout(() => {
-          this.one10 = true;
-        }, 1000);
+          this.one10 = true
+        }, 1000)
       }
       }
-      this.message = '';
+      this.message = ''
     },
     },
     showFn() {
     showFn() {
-      this.tips = '按住 说话';
-      this.shows = false;
-      this.show = true;
+      this.tips = '按住 说话'
+      this.shows = false
+      this.show = true
     },
     },
     mousedownFN() {
     mousedownFN() {
-      this.shows = true;
+      this.shows = true
     },
     },
     clears() {
     clears() {
-      this.show = false;
+      this.show = false
       // this.two=true
       // this.two=true
       //
       //
       // setTimeout(()=>{
       // setTimeout(()=>{
       //   this.two1=true
       //   this.two1=true
       // },1000)
       // },1000)
-      this.one = false;
-      this.two = false;
-      this.one1 = false;
-      this.one9 = false;
-      this.one10 = false;
-      this.one11 = false;
-      this.one12 = false;
-      this.one14 = false;
-      this.one15 = false;
-      this.one16 = false;
-      this.one17 = false;
-      this.one18 = false;
-      this.one19 = false;
-      this.two1 = false;
+      this.one = false
+      this.two = false
+      this.one1 = false
+      this.one9 = false
+      this.one10 = false
+      this.one11 = false
+      this.one12 = false
+      this.one14 = false
+      this.one15 = false
+      this.one16 = false
+      this.one17 = false
+      this.one18 = false
+      this.one19 = false
+      this.two1 = false
     },
     },
     mouseupfN() {
     mouseupfN() {
-      this.show = false;
+      this.show = false
       // this.two=true
       // this.two=true
       //
       //
       // setTimeout(()=>{
       // setTimeout(()=>{
       //   this.two1=true
       //   this.two1=true
       // },1000)
       // },1000)
-      this.one = false;
-      this.two = false;
-      this.one1 = false;
-      this.one9 = false;
-      this.one10 = false;
-      this.one11 = false;
-      this.one12 = false;
-      this.one14 = false;
-      this.one15 = false;
-      this.one16 = false;
-      this.one17 = false;
-      this.one18 = false;
-      this.one19 = false;
-      this.two1 = false;
+      this.one = false
+      this.two = false
+      this.one1 = false
+      this.one9 = false
+      this.one10 = false
+      this.one11 = false
+      this.one12 = false
+      this.one14 = false
+      this.one15 = false
+      this.one16 = false
+      this.one17 = false
+      this.one18 = false
+      this.one19 = false
+      this.two1 = false
       if (this.num > 2) {
       if (this.num > 2) {
-        this.num = 0;
+        this.num = 0
       }
       }
-      this.num = this.num + 1;
-      this.send();
+      this.num = this.num + 1
+      this.send()
     },
     },
     goFn(row) {
     goFn(row) {
       this.$router.push({
       this.$router.push({
         path: '/aipage',
         path: '/aipage',
         query: { type: row },
         query: { type: row },
-      });
+      })
     },
     },
     getReportInfo() {
     getReportInfo() {
-      this.deptLevel = localStorage.getItem('deptLevel');
+      this.deptLevel = localStorage.getItem('deptLevel')
       let loading1 = this.$toast.loading({
       let loading1 = this.$toast.loading({
         duration: 0,
         duration: 0,
         message: '加载中...',
         message: '加载中...',
         forbidClick: true,
         forbidClick: true,
-      });
+      })
       getReportInfo({ isContent: false }).then((res) => {
       getReportInfo({ isContent: false }).then((res) => {
-        loading1.clear();
-        this.list = res.data.summaryTasks;
-        this.historyButton = res.data.historyButton;
-        localStorage.setItem('powerGrade', res.data.positionId);
-        this.existReject = res.data.existReject;
-        this.powerGrade = res.data.positionId;
-        this.showButton = res.data.showButton;
-        this.deptLevel = res.data.deptLevel;
-        this.reportTargetAll = res.data.reportTargetAll;
-        this.updataTime = res.data.reportTargetAll.updateTime;
-      });
+        loading1.clear()
+        this.list = res.data.summaryTasks
+        this.historyButton = res.data.historyButton
+        localStorage.setItem('powerGrade', res.data.positionId)
+        this.existReject = res.data.existReject
+        this.powerGrade = res.data.positionId
+        this.showButton = res.data.showButton
+        this.deptLevel = res.data.deptLevel
+        this.reportTargetAll = res.data.reportTargetAll
+        this.updataTime = res.data.reportTargetAll.updateTime
+      })
     },
     },
   },
   },
-};
+}
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 p {
 p {
@@ -981,4 +963,9 @@ p {
     }
     }
   }
   }
 }
 }
+.myContent {
+  min-height: 44px;
+  word-break: break-all;
+  padding: 5px 10px;
+}
 </style>
 </style>