修改UAT提出的优化点

This commit is contained in:
范强强
2023-07-10 10:05:15 +08:00
parent eaeb368349
commit 0a90b461d1
7 changed files with 207 additions and 86 deletions
@@ -103,7 +103,7 @@
import { getAction, postAction, downFile } from '@/api/manage'
import { kkFileView } from '@/utils/kkfileView'
import eventBUs from '../../common/event'
import { Toast } from 'vant'
import { Dialog, Toast } from 'vant'
export default {
name: 'phoneDocumentDetails',
@@ -261,8 +261,30 @@
this.getPage()
}
},
isBrowser() {
const userAgent = window.navigator.userAgent.toLowerCase()
return userAgent.includes('lark') || userAgent.includes('feishu')
},
fileClick(item) {
kkFileView(item.fileName, item.id)
if (!this.isBrowser()) {
Dialog.alert({
message: '未授权用户 <br> Unauthorized User',
theme: 'round-button',
}).then(() => {
// on close
});
return
}
let url = kkFileView(item.fileName, item.id)
if (url) {
this.$router.push({
path: '/phoneProblemKnowledgeBaseFile',
query: {
fileName: item.fileName,
fileId: item.id
}
})
}
},
urlClick(item) {
window.open(item.value)
@@ -490,8 +490,30 @@
this.form.deliveryResult.splice(index, 1)
this.form = { ...this.form }
},
isBrowser() {
const userAgent = window.navigator.userAgent.toLowerCase()
return userAgent.includes('lark') || userAgent.includes('feishu')
},
deliverablesResultFileClick(item) {
kkFileView(item.fileName, item.id)
if (!this.isBrowser()) {
Dialog.alert({
message: '未授权用户 <br> Unauthorized User',
theme: 'round-button',
}).then(() => {
// on close
});
return
}
let url = kkFileView(item.fileName, item.id)
if (url) {
this.$router.push({
path: '/phoneProblemKnowledgeBaseFile',
query: {
fileName: item.fileName,
fileId: item.id
}
})
}
},
standardClick(item) {
this.$router.push({
@@ -354,8 +354,30 @@
vanField.focus()
})
},
isBrowser() {
const userAgent = window.navigator.userAgent.toLowerCase()
return userAgent.includes('lark') || userAgent.includes('feishu')
},
fileClick(item) {
kkFileView(item.fileName, item.id)
if (!this.isBrowser()) {
Dialog.alert({
message: '未授权用户 <br> Unauthorized User',
theme: 'round-button',
}).then(() => {
// on close
});
return
}
let url = kkFileView(item.fileName, item.id)
if (url) {
this.$router.push({
path: '/phoneProblemKnowledgeBaseFile',
query: {
fileName: item.fileName,
fileId: item.id
}
})
}
},
messageClick(item) {
this.isDisplay = true
@@ -2,6 +2,7 @@
<div class="box">
<iframe :src="url" frameborder="0" marginwidth="0"
id="iframeEle"
@load="loadFrame"
width="100%" height="100%"></iframe>
</div>
</template>
@@ -17,12 +18,22 @@
}
},
mounted() {
document.title = 'NIO GRP'
// this.url = 'http://10.0.3.22:8012/onlinePreview?url=aHR0cDovL2xvY2FsaG9zdDo4MDEyL2RlbW8vR0JUXzQxNjMwXzIwMjJfQ04ucGRm'
// this.url = 'http://localhost:3000/phoneHome'
this.url = kkFileView(this.$route.query.fileName,this.$route.query.fileId)
},
methods: {}
methods: {
loadFrame() {
const iframe = document.getElementById("iframeEle");
const body = iframe.contentWindow.document;
const head = body.getElementsByTagName('head')
const cssLink = document.createElement("link");
cssLink.href = "/iframe.css";
cssLink.rel = "stylesheet";
cssLink.type = "text/css";
head[0].appendChild(cssLink);
},
}
}
</script>
@@ -215,6 +215,7 @@
import Vue from 'vue'
import { kkFileView } from '@/utils/kkfileView'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { Dialog } from 'vant'
export default {
name: 'phoneProcessManagement',
@@ -264,11 +265,51 @@
},
methods: {
...mapGetters(['userInfo']),
isBrowser() {
const userAgent = window.navigator.userAgent.toLowerCase()
return userAgent.includes('lark') || userAgent.includes('feishu')
},
dataSourceFileClick(item) {
kkFileView(item.fileName, item.id)
if (!this.isBrowser()) {
Dialog.alert({
message: '未授权用户 <br> Unauthorized User',
theme: 'round-button',
}).then(() => {
// on close
});
return
}
let url = kkFileView(item.fileName, item.id)
if (url) {
this.$router.push({
path: '/phoneProblemKnowledgeBaseFile',
query: {
fileName: item.fileName,
fileId: item.id
}
})
}
},
approvalFileClick(item, index) {
kkFileView(item.approvalFileName[index], item.approvalFile[index])
if (!this.isBrowser()) {
Dialog.alert({
message: '未授权用户 <br> Unauthorized User',
theme: 'round-button',
}).then(() => {
// on close
});
return
}
let url = kkFileView(item.approvalFileName[index],item.approvalFile[index])
if (url) {
this.$router.push({
path: '/phoneProblemKnowledgeBaseFile',
query: {
fileName: item.approvalFileName[index],
fileId: item.approvalFile[index]
}
})
}
},
iconClick() {
if (this.$route.query.goRouter) {