检测文档更新
This commit is contained in:
parent
cdd6ca0354
commit
b1bbe479ec
@ -2,6 +2,7 @@
|
||||
|
||||
<template>
|
||||
<view class="content">
|
||||
<u-loading-page :loading="isLoading"></u-loading-page>
|
||||
<view class="top-heder">
|
||||
<view class="t-left" @click="getback()">
|
||||
<uni-icons type="left" size="18"></uni-icons>
|
||||
@ -49,6 +50,7 @@
|
||||
<view class="bsd-dis">
|
||||
<view class="bianji" v-if="item.type == '2'" @click="viewFile(item.filePath)">预览</view>
|
||||
<view class="bianji" @click="editFile(item.id)">编辑</view>
|
||||
<view class="bianji" @click="showHistory(item.id)">历史版本</view>
|
||||
<view class="sanchu" @click="delFile(item.id)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -59,12 +61,38 @@
|
||||
</view>
|
||||
|
||||
|
||||
<u-popup :show="isShow" mode="bottom" @close="isShow = false">
|
||||
<view>
|
||||
<!-- 弹出层 -->
|
||||
<view v-if="isShow" class="popup">
|
||||
<view class="popup-content">
|
||||
<view class="popup-title">修改记录</view>
|
||||
|
||||
<!-- 步骤条 -->
|
||||
<view class="steps">
|
||||
<view v-for="(item, index) in drawerData" :key="index" class="step">
|
||||
<view class="step-index">{{ index + 1 }}</view>
|
||||
<view class="step-content">
|
||||
<text class="step-file-name">📄 文件名称:{{ item.fileName }}</text>
|
||||
<text class="step-time">🕒 修改时间:{{ formatDate(item.createTime) }}</text>
|
||||
<text class="step-time">🕒 提醒时间:{{ item.warnTime != null ? formatDate(item.warnTime) : '' }}</text>
|
||||
<text class="step-download" @click="viewFile(item.filePath)" v-if="item.type == '2'">📂 预览文件</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <button class="close-btn" @click="isShow = false">关闭</button>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import request from '../../utils/request';
|
||||
import {formatDate} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -75,7 +103,10 @@
|
||||
pageSize: 20,//一页多少张
|
||||
totalPages: 0,//总数
|
||||
nowFile: {},
|
||||
fileName: null
|
||||
fileName: null,
|
||||
isShow: false,
|
||||
drawerData: [],
|
||||
isLoading:false
|
||||
}
|
||||
},
|
||||
|
||||
@ -99,6 +130,7 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate,
|
||||
async getlist() {
|
||||
let res = await request({
|
||||
url: '/inspectionFile/inspectionFile/list',
|
||||
@ -111,14 +143,26 @@
|
||||
}
|
||||
})
|
||||
if (this.pageNum != 1) {
|
||||
this.arrlist = this.arrlist.concat(res.rows)
|
||||
this.arrlist = this.arrlist.concat(res.data)
|
||||
} else {
|
||||
this.arrlist = res.rows
|
||||
this.arrlist = res.data
|
||||
}
|
||||
let total = res.total
|
||||
this.totalPages = Math.ceil(total / this.pageSize);
|
||||
this.getCountByDirectory()
|
||||
},
|
||||
showHistory(id) {
|
||||
this.isShow = true
|
||||
this.isShow = true
|
||||
request({
|
||||
url: '/system/fileRecord/get/' + id,
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
if (res && res.data) {
|
||||
this.drawerData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getCountByDirectory() {
|
||||
if (this.arrlist && this.arrlist.length > 0) {
|
||||
const ids = this.arrlist.filter(item => (item.type === '1' && !item.count)).map(item => item.id)
|
||||
@ -167,16 +211,29 @@
|
||||
this.getlist()
|
||||
},
|
||||
viewFile(filePath) {
|
||||
this.isLoading = true;
|
||||
|
||||
uni.downloadFile({
|
||||
url: this.$baseImageUrl + '/' + filePath,
|
||||
success: function (res) {
|
||||
success: (res) => { // 使用箭头函数
|
||||
var filePath = res.tempFilePath;
|
||||
console.log('看看执行了吗');
|
||||
this.isLoading = false;
|
||||
console.log('目前的loading', this.isLoading); // this 现在指向 Vue 实例
|
||||
|
||||
uni.openDocument({
|
||||
filePath: filePath,
|
||||
showMenu: true,
|
||||
success: function (res) {
|
||||
success: (res) => {
|
||||
console.log("文件打开成功");
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error("文件打开失败", err);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error("文件下载失败", err);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -234,9 +291,11 @@
|
||||
box-sizing: border-box;
|
||||
// padding-top: 45px;
|
||||
}
|
||||
|
||||
.top-icon {
|
||||
margin-bottom: 45px;
|
||||
}
|
||||
|
||||
.q-fab {
|
||||
position: fixed;
|
||||
bottom: 50px;
|
||||
@ -245,11 +304,13 @@
|
||||
height: 55px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.fab-z1 {
|
||||
position: fixed;
|
||||
bottom: 115px;
|
||||
@ -258,11 +319,13 @@
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.fab-z2 {
|
||||
position: fixed;
|
||||
bottom: 50px;
|
||||
@ -271,11 +334,13 @@
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.c-tap {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
@ -285,15 +350,18 @@
|
||||
background-color: white;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.c-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.c-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.cont {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
@ -302,6 +370,7 @@
|
||||
background-color: #F6F6F6;
|
||||
|
||||
}
|
||||
|
||||
.hongdian {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
@ -313,6 +382,7 @@
|
||||
right: 5px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.c-box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -325,33 +395,39 @@
|
||||
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
|
||||
image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.c-b-top {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.t-left {
|
||||
width: 40%;
|
||||
height: 100px;
|
||||
border-radius: 7px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.t-right {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.t-tilte {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
@ -361,6 +437,7 @@
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.tw-tilte {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
@ -372,6 +449,7 @@
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.t-zi {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
@ -383,16 +461,19 @@
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
}
|
||||
|
||||
.bjimg {
|
||||
width: 255px;
|
||||
height: 236px;
|
||||
margin: 0px auto;
|
||||
margin-top: 100px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.c-b-bom {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -400,15 +481,18 @@
|
||||
align-items: center;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.b-left {
|
||||
color: #0D2E8D;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.b-right {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.z-lv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -416,6 +500,7 @@
|
||||
font-size: 15px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.y-hong {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -423,28 +508,35 @@
|
||||
font-size: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.z-img {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.tap-box {
|
||||
width: 30%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.gang {
|
||||
height: 4px;
|
||||
background: #0D2E8D;
|
||||
width: 80%;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.lan {
|
||||
color: #0D2E8D;
|
||||
}
|
||||
|
||||
.top-heder {
|
||||
width: 100%;
|
||||
height: 68px;
|
||||
@ -456,19 +548,23 @@
|
||||
padding: 5px 15px;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.t-title {
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.t-left {
|
||||
width: 20%;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.t-you {
|
||||
width: 20%;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.wrap-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -476,6 +572,7 @@
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.w-box {
|
||||
width: 48%;
|
||||
background-color: white;
|
||||
@ -486,14 +583,17 @@
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.wimg {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.bsd-dis {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@ -501,6 +601,7 @@
|
||||
justify-content: space-around;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.bianji {
|
||||
width: 50px;
|
||||
height: 24px;
|
||||
@ -511,6 +612,7 @@
|
||||
justify-content: center;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.sanchu {
|
||||
width: 50px;
|
||||
height: 24px;
|
||||
@ -545,4 +647,99 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 弹出层背景 */
|
||||
.popup {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
/* 弹出层内容 */
|
||||
.popup-content {
|
||||
width: 90%;
|
||||
background: #fff;
|
||||
border-radius: 10px 10px 0 0;
|
||||
padding: 20px;
|
||||
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 标题 */
|
||||
.popup-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* 步骤条 */
|
||||
.steps {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 单个步骤 */
|
||||
.step {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* 序号样式 */
|
||||
.step-index {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
background: #007aff;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* 步骤内容 */
|
||||
.step-content {
|
||||
flex: 1;
|
||||
background: #f8f8f8;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* 文字样式 */
|
||||
.step-file-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.step-time {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.step-download {
|
||||
font-size: 14px;
|
||||
color: #007aff;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 关闭按钮 */
|
||||
.close-btn {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background: #007aff;
|
||||
color: white;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user