AI销管
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

180 líneas
5.7 KiB

  1. <template>
  2. <view class="translation">
  3. <view style="display: flex;width: 100%;height: 100rpx;border-bottom: 1px solid #E0E0E0;">
  4. <view style="width: 50%;display: flex;align-items: center;justify-content: center;font-size: 30rpx;">
  5. <view style="line-height: 50rpx;" :class="roleindex == 0 ? 'bosdttom' : ''" @click="tapspagek(0)">画像语义词选择</view>
  6. </view>
  7. <view style="width: 50%;display: flex;align-items: center;justify-content: center;font-size: 30rpx;">
  8. <view style="line-height: 50rpx;" :class="roleindex == 1 ? 'bosdttom' : ''" @click="tapspagek(1)">关键词输入</view>
  9. </view>
  10. </view>
  11. <view v-if='roleindex==0' style="width: 690rpx;height: 64rpx;margin: 0 auto;margin-top: 30rpx;">
  12. <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;">
  13. <view>画像语义词:</view>
  14. <view style="width:70%" @click="oninputtap()">
  15. <text v-if="Semanticword.length==0">请选择</text>
  16. <text v-else>{{Semanticword}}</text>
  17. </view>
  18. <view>
  19. <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png" style="width:12rpx;height:23rpx;margin-left: 16rpx;">
  20. </view>
  21. </view>
  22. </view>
  23. <view v-if='roleindex==1' style="width: 690rpx;height: 64rpx;margin: 0 auto;margin-top: 30rpx;background: #F2F2F2;border-radius: 32rpx;
  24. display: flex;align-items: center;">
  25. <view style="width: 10%;height: 64rpx;display: flex;align-items: center;">
  26. <image style="width: 28rpx;height: 28rpx;margin-left: 30rpx;" src="/static/images/search.png" mode=""></image>
  27. </view>
  28. <view style="width: 90%;height: 64rpx;display: flex;align-items: center;">
  29. <input type="text" @input="searchinfo" v-model="keyword" placeholder="请输入关键字"
  30. style="width: 100%;color: #999999;font-size: 24rpx;"/>
  31. </view>
  32. </view>
  33. <view style="width: 690rpx;margin: 0 auto;margin-top: 10rpx;">
  34. <view style="width: 100%;border-bottom: 1px solid #E0E0E0;display: flex;padding-bottom: 10rpx;margin-top: 40rpx;"
  35. v-for="(item,index) in listarr" :key='index' @click="toaidoinfo(item.Content,item.corpusId,item.index)">
  36. <view style="width: 26rpx;height: 36rpx;margin-top: 4rpx;">
  37. <image style="width: 26rpx;height: 28rpx;" src="/static/images/testimg.png" mode=""></image>
  38. </view>
  39. <view v-html="item.Content.text" style="color: #666666;font-size: 28rpx;line-height: 36rpx;margin-left: 10rpx;width: 80%;"></view>
  40. <view style="font-size: 28rpx;width: 10%;width: 14%;text-align: right;">{{item.Content.time}}</view>
  41. </view>
  42. </view>
  43. <view v-if="Showhiddenunits">
  44. <u-select v-model="Showhiddenunits" mode="single-column" :list="selectlist" @confirm="confirm"></u-select>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. var util = require("../../../../utils/util.js");
  50. var config = require("../../../../config");
  51. export default {
  52. data() {
  53. return {
  54. customerId:'',
  55. listarr:[],
  56. keyword:'',
  57. skpl:'',
  58. roleindex:0,
  59. Showhiddenunits:false,
  60. selectlist:[],
  61. Semanticword:'',
  62. qujian:true
  63. };
  64. },
  65. onLoad: function(options) {
  66. this.customerId = options.customerId;
  67. this.statistical()
  68. },
  69. methods: {
  70. statistical(){
  71. this.$u.get("/matchKeywords/findCARKeywords", {
  72. customerId: this.customerId
  73. }).then(res => {
  74. res.forEach((item,index)=>{
  75. if(item.isInterval==0){
  76. item.label=item.name+item.unit +'-'+ item.endName+item.unit;
  77. item.value=index
  78. }else{
  79. item.label=item.name;
  80. item.value=index
  81. }
  82. })
  83. this.selectlist=res;
  84. })
  85. },
  86. oninputtap(){
  87. this.Showhiddenunits=true;
  88. },
  89. confirm(e) {
  90. let indexs=e[0].value;
  91. this.selectlist.forEach((item,index)=>{
  92. if(indexs==item.value){
  93. this.Semanticword=item.name;
  94. this.keyword=item.matchName;
  95. if(item.isInterval==0){
  96. this.qujian=false;
  97. this.Semanticword=item.name+item.unit+ '-'+ item.endName+item.unit;
  98. }else{
  99. this.qujian=true;
  100. }
  101. }
  102. })
  103. this.searchinfo()
  104. },
  105. tapspagek(i){
  106. this.roleindex=i;
  107. this.keyword="";
  108. this.Semanticword='';
  109. this.qujian=true;
  110. this.listarr=[];
  111. },
  112. formatTime(num) {
  113. //格式化时间格式
  114. num = num.toFixed(0);
  115. let second = num % 60;
  116. if (second < 10) second = '0' + second;
  117. let min = Math.floor(num / 60);
  118. if (min < 10) min = '0' + min;
  119. return min + ":" + second;
  120. },
  121. searchinfo(){
  122. if(this.keyword.length==0){
  123. return
  124. }else{
  125. let parames={
  126. keyword:this.keyword,
  127. customerId:this.customerId
  128. }
  129. this.$u.post("/corpus/keyWordsMatching", parames).then(res => {
  130. res.forEach(item=>{
  131. item.Content=JSON.parse(item.transferContent)
  132. })
  133. res.forEach(cet=>{
  134. cet.Content.time=this.formatTime(cet.Content.bg/1000)
  135. if(this.qujian==false){
  136. cet.Content.text=cet.Content.onebest;
  137. }else{
  138. cet.Content.text=this.brightKeyword(cet.Content.onebest)
  139. }
  140. })
  141. this.listarr=res;
  142. })
  143. }
  144. },
  145. //替换方法
  146. brightKeyword(val) {
  147. if (val.indexOf(this.keyword) !== -1) {
  148. return val.replace(this.keyword, `<font style='color: red'>${this.keyword}</font>`);
  149. } else {
  150. return val;
  151. }
  152. },
  153. //跳转
  154. toaidoinfo(item,id,index){
  155. uni.setStorageSync("entrance", 2); //写入缓存
  156. item.customerId=this.customerId;
  157. item.id=id;
  158. item.index=index;
  159. let pages = getCurrentPages() //获取当前页面栈的信息
  160. let prevPage = pages[pages.length - 2] //获取上一个页面
  161. prevPage.setData({ //把需要回传的值保存到上一个页面
  162. info: item
  163. });
  164. wx.navigateBack({ //然后返回上一个页面
  165. delta: 1
  166. })
  167. }
  168. },
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .bosdttom{
  173. border-bottom: 2px solid #2671E2;
  174. }
  175. </style>