待办文本显示修改

master
wujingling0908 5 days ago
parent e4483030f5
commit bf6b316d0d
  1. 10
      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,11 +54,21 @@ const businessHandle = (userId) => {
) { ) {
return Post("notify/info", { userInfoId: userId }) return Post("notify/info", { userInfoId: userId })
.then((res) => { .then((res) => {
if (import.meta.env.VITE_USER_NODE_ENV === 'development') {
businessHandleInfo.value = {
contents: [
{
name: '测试待办'
}
]
}
} else {
if (res.data?.contents?.length > 0) { if (res.data?.contents?.length > 0) {
businessHandleInfo.value = res.data businessHandleInfo.value = res.data
} else { } else {
businessHandleInfo.value = {} businessHandleInfo.value = {}
} }
}
store?.setBusinessHandleInfo?.(businessHandleInfo.value) store?.setBusinessHandleInfo?.(businessHandleInfo.value)
}) })
.catch((error) => { .catch((error) => {

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

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

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

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

Loading…
Cancel
Save