1.修改水印 2.修改三册在线预览
This commit is contained in:
parent
23ff8c1d65
commit
88962d4dbd
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<view :class="['pageLayout', { 'gray': appStore.isGray == 1 }]">
|
||||
<wd-watermark :content="userStore.userInfo.realname + ' '+ userStore.userInfo.username"
|
||||
:width="200" :height="200" :opacity="0.2"></wd-watermark>
|
||||
<wd-watermark :content="content1" :width="200" :height="200" :opacity="0.3" :size="16" ></wd-watermark>
|
||||
<view v-if="navbarShow" :class="{ pageNav: true, transparent: navBgTransparent, fixed: navFixed }"
|
||||
:style="{ height: `${statusBarHeight + navHeight}px` }">
|
||||
<view class="statusBar" :style="{ height: `${statusBarHeight}px` }"></view>
|
||||
@ -29,6 +28,7 @@
|
||||
import { useParamsStore } from '@/store/page-params'
|
||||
import { useAppStore } from '@/store'
|
||||
import { useUserStore } from '@/store/user'
|
||||
import dayjs from 'dayjs';
|
||||
defineOptions({
|
||||
name: 'pageLayout',
|
||||
options: {
|
||||
@ -41,6 +41,7 @@
|
||||
const userStore = useUserStore()
|
||||
const paramsStore = useParamsStore()
|
||||
const router = useRouter()
|
||||
const content1 = userStore.userInfo.realname + ' ' + userStore.userInfo.workNo + ' ' + dayjs().format('YYYY-MM-DD')
|
||||
const props = defineProps({
|
||||
backRouteName: {
|
||||
type: String,
|
||||
|
@ -56,10 +56,6 @@
|
||||
const type = ref('') //绑定查询文件种类
|
||||
var ifH5 = false;
|
||||
|
||||
const handleClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const getList = (e) => {
|
||||
loading = true;
|
||||
const handlers = {
|
||||
@ -69,7 +65,6 @@
|
||||
'厂级制度': getFactorySystemList,
|
||||
'法律法规': getRegulationsList
|
||||
};
|
||||
|
||||
if (e === 1) {
|
||||
handlers[type.value]?.();
|
||||
} else if (type.value == '厂级制度') {
|
||||
@ -183,7 +178,6 @@
|
||||
}
|
||||
|
||||
const onlinePreView = (e) => {
|
||||
console.log(e)
|
||||
uni.navigateTo({
|
||||
url: `/pages/onlinePreview/detail?data=${e}`
|
||||
});
|
||||
|
@ -12,33 +12,30 @@
|
||||
<wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange"
|
||||
@confirm="handleConfirm" :display-format="displayFormat"></wd-col-picker>
|
||||
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" v-if="fileUrl" />
|
||||
<view v-else @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2" style="padding: 15px 0 0 0">
|
||||
<view v-else class="bdIframe" @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2" style="padding: 15px 0 0 0">
|
||||
<wd-card :title="item.name"></wd-card>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
useUserStore
|
||||
} from '@/store/user';
|
||||
} from '@/store/user'
|
||||
import {
|
||||
getListApi,
|
||||
getJobDesIdByDepAndName,
|
||||
getPathByInsflagQuote,
|
||||
queryByIdApi
|
||||
} from '@/api/pages/sc';
|
||||
import Base64 from '@/utils/code';
|
||||
} from '@/api/pages/sc'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import base64 from '@/utils/code';
|
||||
import {
|
||||
getEnvBaseUrl
|
||||
} from '@/utils/index'
|
||||
|
||||
const baseUrl = 'https://10.75.166.6/jeecg-boot/sys/common/static/';
|
||||
const data = ref([])
|
||||
const dataSource = ref([])
|
||||
const selectedValue = ref([]);
|
||||
@ -70,14 +67,18 @@
|
||||
const handleConfirm = ({
|
||||
value
|
||||
}) => {
|
||||
let base64 = new Base64();
|
||||
queryByIdApi(value[value.length - 1]).then(res => {
|
||||
let url = res.result.path
|
||||
let quote = res.result.quote
|
||||
let insFlag = res.result.insFlag
|
||||
if (url) {
|
||||
fileUrl.value = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64
|
||||
.encode(getEnvBaseUrl() + '/sys/common/static/' + url))
|
||||
if (isH5()) {
|
||||
fileUrl.value = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(
|
||||
Base64.encode(baseUrl + url))
|
||||
} else {
|
||||
fileUrl.value = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(
|
||||
new base64().encode(baseUrl + url))
|
||||
}
|
||||
} else if (/^-?\d+$/.test(quote) && !insFlag) {
|
||||
getJobDesIdByDepAndName({
|
||||
jobname: quote,
|
||||
@ -122,7 +123,7 @@
|
||||
|
||||
const onlinePreview = (e) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/onlinePreview/${path}?data=${e}`
|
||||
url: `/pages/onlinePreview/detail?data=${e}`
|
||||
});
|
||||
};
|
||||
|
||||
@ -160,10 +161,11 @@
|
||||
</script>
|
||||
<style lang="scss">
|
||||
#bdIframe {
|
||||
position: absolute;
|
||||
top: 10;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: calc(100vh - 230rpx);
|
||||
/* 使用视口高度减去顶部固定高度 */
|
||||
border: none;
|
||||
/* 移除absolute定位,改用普通文档流 */
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
@ -53,7 +53,6 @@
|
||||
|
||||
const captureText = (text) => { //截取字符串显示
|
||||
const match = text.match(/\/([^_]+)(?=_)/);
|
||||
console.log(match)
|
||||
return match ? match[1] : '';
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import Base64 from '@/utils/code';
|
||||
import base64 from '@/utils/code';
|
||||
import {
|
||||
getEnvBaseUrl
|
||||
} from '@/utils/index'
|
||||
@ -25,9 +25,9 @@
|
||||
var fileUrl = "";
|
||||
|
||||
onLoad((options) => {
|
||||
let base64 = new Base64();
|
||||
let Base64 = new base64();
|
||||
var url = baseUrl + JSON.parse(options.data);
|
||||
fileUrl = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64.encode(url))
|
||||
fileUrl = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
const baseUrl = 'https://10.75.166.6/jeecg-boot/sys/common/static/';
|
||||
|
||||
onLoad((options) => {
|
||||
console.log(options)
|
||||
let url = JSON.parse(options.data)
|
||||
url = baseUrl + url;
|
||||
fileUrl = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default class Base64 {
|
||||
export default class base64 {
|
||||
// 私钥
|
||||
private readonly _keyStr: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
|
@ -216,7 +216,10 @@ export function formatDate(value, fmt) {
|
||||
export const hasNewVersion = (version, isWgt = false) => {
|
||||
// #ifdef APP_PLUS
|
||||
return new Promise((resolve) => {
|
||||
const transfer = (str) => str.replace(/\./g, '')
|
||||
const transfer = (str) => {
|
||||
const parts = str.split('.').map(part => part.padStart(4, '0'))
|
||||
return parts.join('')
|
||||
}
|
||||
if (isWgt) {
|
||||
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
|
||||
const currentVersion = widgetInfo.version
|
||||
@ -433,13 +436,13 @@ export const imgUrl = (url : string) => {
|
||||
* @param subStr
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getFileAccessHttpUrl(avatar,subStr) {
|
||||
if(!subStr) subStr = 'http'
|
||||
if(avatar && avatar.startsWith(subStr)){
|
||||
export function getFileAccessHttpUrl(avatar, subStr) {
|
||||
if (!subStr) subStr = 'http'
|
||||
if (avatar && avatar.startsWith(subStr)) {
|
||||
return avatar;
|
||||
}else{
|
||||
if(avatar && avatar.length>0 && avatar.indexOf('[')==-1){
|
||||
return getEnvBaseUrl()+ "/sys/common/static/" + avatar;
|
||||
} else {
|
||||
if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
|
||||
return getEnvBaseUrl() + "/sys/common/static/" + avatar;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user