【fix bug】bug完善

This commit is contained in:
dujie
2023-04-11 15:09:26 +08:00
parent 889c8abdbc
commit 6de4cf368f
2 changed files with 18 additions and 6 deletions
+17 -5
View File
@@ -24,7 +24,12 @@
</div> </div>
</div> </div>
</a-upload> </a-upload>
<j-image-preview-modal ref="JImagePreviewModal"></j-image-preview-modal> <div id="images">
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl">
</div>
</div>
<!-- <j-image-preview-modal ref="JImagePreviewModal"></j-image-preview-modal>-->
</div> </div>
</template> </template>
@@ -32,7 +37,7 @@
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage' import { getFileAccessHttpUrl } from '@/api/manage'
import JImagePreviewModal from './modal/JImagePreviewModal' // import JImagePreviewModal from './modal/JImagePreviewModal'
// const Base64 = require('js-base64').Base64 // const Base64 = require('js-base64').Base64
const uidGenerator = () => { const uidGenerator = () => {
@@ -40,16 +45,18 @@ const uidGenerator = () => {
} }
export default { export default {
name: 'JImageUpload', name: 'JImageUpload',
components: { JImagePreviewModal }, // components: { JImagePreviewModal },
data () { data () {
return { return {
uploadAction: window._CONFIG.domianURL + '/sys/common/upload', uploadAction: window._CONFIG.domianURL + '/sys/common/upload',
uploadLoading: false, uploadLoading: false,
image: false,
picUrl: false, picUrl: false,
headers: {}, headers: {},
fileList: [], fileList: [],
accept: 'image/png, image/jpeg', accept: 'image/png, image/jpeg',
previewImage: '' previewImage: '',
imageUrl: null
} }
}, },
props: { props: {
@@ -184,7 +191,12 @@ export default {
// const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/${file.url}` // const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/${file.url}`
// const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` // const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// window.open(url) // window.open(url)
this.$refs.JImagePreviewModal.open(file) // this.$refs.JImagePreviewModal.open(file)
this.imageUrl = getFileAccessHttpUrl(file.name)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
} }
}, },
getAvatarView () { getAvatarView () {
+1 -1
View File
@@ -36,7 +36,7 @@
<a-avatar class="avatar" size="small" :src="getAvatar()"/> <a-avatar class="avatar" size="small" :src="getAvatar()"/>
</span> </span>
<a-dropdown> <a-dropdown>
<span class="action action-full ant-dropdown-link user-dropdown-menu"> <span class="action">
<span v-if="isDesktop()">欢迎您,{{ nickname() }}</span> <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>
</span> </span>
<a-menu slot="overlay" class="user-dropdown-menu-wrapper"> <a-menu slot="overlay" class="user-dropdown-menu-wrapper">