待办文本显示修改

master
wujingling0908 5 days ago
parent e4483030f5
commit bf6b316d0d
  1. 16
      src/components/abstract.vue
  2. 19
      src/components/business-handle.vue
  3. 6
      src/components/footer-bar-input.vue
  4. 16
      src/store/app.js
  5. 2
      src/utils/utils.js

@ -54,10 +54,20 @@ const businessHandle = (userId) => {
) {
return Post("notify/info", { userInfoId: userId })
.then((res) => {
if (res.data?.contents?.length > 0) {
businessHandleInfo.value = res.data
if (import.meta.env.VITE_USER_NODE_ENV === 'development') {
businessHandleInfo.value = {
contents: [
{
name: '测试待办'
}
]
}
} else {
businessHandleInfo.value = {}
if (res.data?.contents?.length > 0) {
businessHandleInfo.value = res.data
} else {
businessHandleInfo.value = {}
}
}
store?.setBusinessHandleInfo?.(businessHandleInfo.value)
})

@ -46,18 +46,18 @@
</template>
<script setup>
import { ref, inject, computed, watch } from 'vue'
import { ref, computed, watch } from 'vue'
import { storeToRefs } from 'pinia'
import { Icon, Swipe, SwipeItem, Popup } from 'vant'
import { useAppStore } from '@/store/app.js'
const props = defineProps({
businessHandleInfo: { type: Object, default: () => ({}) },
autoOpen: { type: Boolean, default: true },
})
const store = inject('appStore', null)
const userId = inject('userId', ref(''))
const mescrollContent = inject('mescrollContent', ref(null))
const manualService = inject('manualService', ref('1'))
const store = useAppStore()
const { userId, mescrollContent, manualService, businessHandleInfo: storeBusinessHandleInfo } = storeToRefs(store)
const Popupshow = ref(false)
const isBtnsubmit = ref(true)
@ -66,7 +66,7 @@ const hasAutoOpened = ref(false)
const displayInfo = computed(() => {
const fromProp = props.businessHandleInfo
if (fromProp && Array.isArray(fromProp.contents) && fromProp.contents.length) return fromProp
return store?.businessHandleInfo || {}
return storeBusinessHandleInfo.value || {}
})
function getIconUrl(icon) {
@ -92,7 +92,7 @@ function richCallAnswer(item) {
serialNumber,
clickTime: new Date().getTime()
}
store?.dispatch?.('updateClickTime', mdParmas).catch(err => {
Promise.resolve(store.updateClickTime?.(mdParmas)).catch(err => {
console.error(err)
})
@ -102,14 +102,15 @@ function richCallAnswer(item) {
msgText: '&' + text + '&',
intentId: '',
msgSource: manualService.value,
questionType: 6
realText: text,
questionType: 6,
}
if (isBtnsubmit.value) {
isBtnsubmit.value = false
Popupshow.value = false
scrollTopBody()
const sending = store?.sendingRobot?.(sendParmas) || store?.dispatch?.('sendingRobot', sendParmas)
const sending = store.sendingRobot(sendParmas)
Promise.resolve(sending).then(() => {
isBtnsubmit.value = true
}).catch(err => {

@ -8,7 +8,7 @@
v-for="(item, index) in wordList" :key="index" @click.stop="lenovoQuery(item.name)"
v-show="doesMatchMessage(item.name)">
<div class="word-cell__bd word-cell_primary">
<p v-html="brightenKeyword(item.name)"></p>
<span v-html="brightenKeyword(item.name)"></span>
</div>
<span class="word-cell__ft"></span>
</a>
@ -1074,7 +1074,7 @@ textarea:-ms-input-placeholder {
height: 47rem;
text-align: left;
font-family: SourceHanSansCN-Regular;
font-size: 15rem;
font-size: 14rem;
color: #717985;
line-height: 47rem;
overflow: hidden;
@ -1090,6 +1090,8 @@ textarea:-ms-input-placeholder {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 8rem;
color: #2c3562;
}
.word-cell__ft {

@ -369,13 +369,15 @@ export const useAppStore = defineStore('app', () => {
function getConversationMessageText(payload) {
if (typeof payload === 'string' || typeof payload === 'number') return String(payload)
// 展示优先 realText(如待办发送的可读文案),接口仍用 msgText(如 &xxx&)
return (
payload?.msgText ??
payload?.answer ??
payload?.answerText ??
payload?.content ??
payload?.text ??
payload?.message?.[0]?.options?.label ??
payload?.realText ||
payload?.msgText ||
payload?.answer ||
payload?.answerText ||
payload?.content ||
payload?.text ||
payload?.message?.[0]?.options?.label ||
''
)
}
@ -719,6 +721,7 @@ export const useAppStore = defineStore('app', () => {
reqAndResType: payload.reqAndResType, // 1文本 2图片 3问提评价
msgType: payload.msgType || '',
msgText: payload.msgText,
realText: payload.realText || '',
file: payload.file || '',
filename: payload.filename || '',
formData: payload.formData || '',
@ -1040,6 +1043,7 @@ export const useAppStore = defineStore('app', () => {
reqAndResType: payload.reqAndResType,
msgType: payload.msgType || '',
msgText: payload.msgText,
realText: payload.realText || '',
intentId: payload.intentId || '',
source: source.value,
timestamp: payload.timestamp || Date.now(),

@ -921,7 +921,7 @@ export default {
normalizeMessage: function (item) {
if (!item || typeof item !== 'object') return item;
let msgText = item.msgText || '';
let msgText = item.realText || item.msgText || '';
// 保单时效性类型的答案,直接返回
if(!!item.cmd && (item.cmd == 'yhzzsx' ||
item.cmd == 'fhzzsx' ||

Loading…
Cancel
Save