vue中预览docx、xlsx、pptx、pdf

news2024/11/28 6:28:19

前言:其实本来是要做全类型文件预览的,但是一直找不到合适的doc,xlx,ppt预览插件。要是有可以使用的,可以评论推荐给我

我使用的node版本:v18.19.1

参考官网:preview 文件预览 | ran

引入方式:

//安装组件
npm install ranui --save
//在需要的页面引入即可
import 'ranui/button';
import 'ranui/preview';
import 'ranui/style';
//使用方式

<div class="preview-container">
    <div id="showPreview" class="preview"></div>
    <r-preview :src="url" closeable="false"></r-preview>
</div>

我这里多了个showPreview用来处理ppt的预览,因为他原生的ppt预览是增加一个弹窗,我需要当前页面展示,样式不符合要求,我就修改了,\node_modules\ranui\dist\components\preview\index.js  里对应第一个文件

修改如下:

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};
import { n as noop } from "./index-7913ec46.js";
import "./index-7216d6b0.js";
import { m as message } from "./index-0d5b9435.js";
const f7170ee498e0dd32cbdcb63fba8f75cc = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.r-preview-slot{display:block}:host{cursor:pointer}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-loading{position:absolute;top:30vh;left:50vw;transform:translate(-50%);display:flex;flex-flow:column;align-items:center}.r-preview-mask .r-preview-loading-text{color:#fff;font-size:16px}.r-preview-mask .r-preview-options{width:100%;pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;-webkit-user-select:none;user-select:none}.r-preview-mask .r-preview-contain{max-width:calc(100vw - 20px);margin:0 auto;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{margin:0 auto;height:calc(100vh - 68px);display:flex;flex-flow:column nowrap;justify-content:flex-start;align-items:center;overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main{width:100%;height:100%;margin-bottom:10px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet{font-size:13px;line-height:normal;-webkit-user-select:none;user-select:none;-moz-user-select:none;font-family:Lato,Source Sans Pro,Roboto,Helvetica,Arial,sans-serif;box-sizing:content-box;background:#fff;-webkit-font-smoothing:antialiased}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet textarea{font:400 13px Arial,Lato,Source Sans Pro,Roboto,Helvetica,sans-serif}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-sheet{position:relative;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-table{vertical-align:bottom}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-tooltip{font-family:inherit;position:absolute;padding:5px 10px;color:#fff;border-radius:1px;background:#000000;font-size:12px;z-index:201}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-tooltip:before{pointer-events:none;position:absolute;left:calc(50% - 4px);top:-4px;content:"";width:8px;height:8px;background:inherit;-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:1;box-shadow:1px 1px 3px -1px #0000004d}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-color-palette{padding:5px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-color-palette table{margin:0;padding:0;border-collapse:separate;border-spacing:2;background:#fff}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-color-palette table td{margin:0;cursor:pointer;border:1px solid transparent}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-color-palette table td:hover{border-color:#ddd}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-color-palette table td .x-spreadsheet-color-palette-cell{width:16px;height:16px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette{padding:6px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette table{margin:0;padding:0;border-collapse:separate;border-spacing:0;background:#fff;table-layout:fixed}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette table td{margin:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette .x-spreadsheet-border-palette-left{border-right:1px solid #eee;padding-right:6px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell{width:30px;height:30px;cursor:pointer;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell:hover{background-color:#eee}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette .x-spreadsheet-border-palette-right{padding-left:6px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-line-type{position:relative;left:0;top:-3px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown{position:relative}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown .x-spreadsheet-dropdown-content{position:absolute;z-index:200;background:#fff;box-shadow:1px 2px 5px 2px #33333326}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown.bottom-left .x-spreadsheet-dropdown-content{top:calc(100% + 5px);left:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown.bottom-right .x-spreadsheet-dropdown-content{top:calc(100% + 5px);right:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown.top-left .x-spreadsheet-dropdown-content{bottom:calc(100% + 5px);left:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown.top-right .x-spreadsheet-dropdown-content{bottom:calc(100% + 5px);right:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dropdown .x-spreadsheet-dropdown-title{padding:0 5px;display:inline-block}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer{position:absolute;z-index:11}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer .x-spreadsheet-resizer-hover{background-color:#4b89ff40}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer .x-spreadsheet-resizer-line{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer.horizontal{cursor:row-resize}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer.horizontal .x-spreadsheet-resizer-line{border-bottom:2px dashed #4b89ff;left:0;bottom:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer.vertical{cursor:col-resize}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-resizer.vertical .x-spreadsheet-resizer-line{border-right:2px dashed #4b89ff;top:0;right:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-scrollbar{position:absolute;bottom:0;right:0;background-color:#f4f5f8;opacity:.9;z-index:12}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-scrollbar.horizontal{right:15px;overflow-x:scroll;overflow-y:hidden}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-scrollbar.horizontal>div{height:1px;background:#ddd}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-scrollbar.vertical{bottom:15px;overflow-x:hidden;overflow-y:scroll}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-scrollbar.vertical>div{width:1px;background:#ddd}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-overlayer{position:absolute;left:0;top:0;z-index:10}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-overlayer .x-spreadsheet-overlayer-content{position:absolute;overflow:hidden;pointer-events:none;width:100%;height:100%}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-editor,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector{box-sizing:content-box;position:absolute;overflow:hidden;pointer-events:none;top:0;left:0;width:100%;height:100%}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .hide-input{position:absolute;z-index:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .hide-input input{padding:0;width:0;border:none!important}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-area{position:absolute;border:2px solid #4b89ff;background:rgba(75,137,255,.1);z-index:5}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-clipboard,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-autofill{position:absolute;background:transparent;z-index:100}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-clipboard{border:2px dashed #4b89ff}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-autofill{border:1px dashed rgba(0,0,0,.45)}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-selector .x-spreadsheet-selector-corner{pointer-events:auto;position:absolute;cursor:crosshair;font-size:0;height:5px;width:5px;right:-5px;bottom:-5px;border:2px solid #ffffff;background:#4b89ff}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-editor{z-index:20}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-editor .x-spreadsheet-editor-area{position:absolute;text-align:left;border:2px solid #4b89ff;line-height:0;z-index:100;pointer-events:auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-editor .x-spreadsheet-editor-area textarea{box-sizing:content-box;border:none;padding:0 3px;outline:none;resize:none;text-align:start;overflow-y:hidden;font:400 13px Arial,Lato,Source Sans Pro,Roboto,Helvetica,sans-serif;color:inherit;white-space:normal;word-wrap:break-word;line-height:22px;margin:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-editor .x-spreadsheet-editor-area .textline{overflow:hidden;visibility:hidden;position:fixed;top:0;left:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item{-webkit-user-select:none;user-select:none;background:0;border:1px solid transparent;outline:none;height:26px;color:#000000e6;line-height:26px;list-style:none;padding:2px 10px;cursor:default;text-align:left;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.disabled{pointer-events:none;opacity:.5}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item:hover,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.active{background:rgba(0,0,0,.05)}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.divider{height:0;padding:0;margin:5px 0;border:none;border-bottom:1px solid rgba(0,0,0,.1)}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item .label{float:right;opacity:.65;font-size:1em}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.state,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-header.state{padding-left:35px!important;position:relative}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.state:before,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-header.state:before{content:"";position:absolute;width:10px;height:10px;left:12px;top:calc(50% - 5px);background:rgba(0,0,0,.08);border-radius:2px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-item.state.checked:before,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-header.state.checked:before{background:#4b89ff}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-checkbox{position:relative;display:inline-block;backface-visibility:hidden;outline:0;vertical-align:baseline;font-style:normal;font-size:1rem;line-height:1em}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-checkbox>input{position:absolute;top:0;left:0;opacity:0!important;outline:0;z-index:-1}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-suggest,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-contextmenu,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-sort-filter{position:absolute;box-shadow:1px 2px 5px 2px #33333326;background:#fff;z-index:100;width:260px;pointer-events:auto;overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-suggest{width:200px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-filter{border:1px solid #e9e9e9;font-size:12px;margin:10px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-filter .x-spreadsheet-header{padding:.5em .75em;background:#f8f8f9;border-bottom:1px solid #e9e9e9;border-left:1px solid transparent}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-filter .x-spreadsheet-body{height:200px;overflow-y:auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-filter .x-spreadsheet-body .x-spreadsheet-item{height:20px;line-height:20px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-sort-filter .x-spreadsheet-buttons{margin:10px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-bottombar{height:40px;padding:0 30px;text-align:left;background:#f5f6f7;display:flex}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-bottombar{position:relative;border-top:1px solid #e0e2e4}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-bottombar .x-spreadsheet-menu>li{line-height:40px;height:40px;padding-top:0;padding-bottom:0;vertical-align:middle;border-right:1px solid #e8eaed}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-menu{list-style:none;margin:0;padding:0;-webkit-user-select:none;user-select:none}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-menu>li{float:left;line-height:1.25em;padding:.785em 1em;margin:0;vertical-align:middle;text-align:left;font-weight:400;color:#80868b;white-space:nowrap;cursor:pointer;transition:all .3s;font-weight:700}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-menu>li.active{background-color:#fff;color:#000000a6}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-menu>li .x-spreadsheet-dropdown{display:inline-block}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print{position:absolute;left:0;top:0;z-index:100;width:100%;height:100%;display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-bar{background:#424242;height:60px;line-height:60px;padding:0 30px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-bar .-title{color:#fff;font-weight:700;font-size:1.2em;float:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-bar .-right{float:right;margin-top:12px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-content{display:flex;flex:auto;flex-direction:row;background:#d0d0d0;height:calc(100% - 60px)}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-content .-sider{flex:0 0 300px;width:300px;border-left:2px solid #ccc;background:#fff}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-print-content .-content{flex:auto;overflow-x:auto;overflow-y:scroll;height:100%}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-canvas-card-wraper{margin:40px 20px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-canvas-card{background:#fff;margin:auto;page-break-before:auto;page-break-after:always;box-shadow:0 8px 10px 1px #00000024,0 3px 14px 3px #0000001f,0 4px 5px #0003}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar{color:#000000a6;background:#ffffff;-webkit-user-select:none;user-select:none}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-header{font-weight:700;line-height:30px;text-align:center;width:100%;float:left;background:#f9fafb}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-header .calendar-header-left{padding-left:5px;float:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-header .calendar-header-right{float:right}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-header .calendar-header-right a{padding:3px 0;margin-right:2px;border-radius:2px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-header .calendar-header-right a:hover{background:rgba(0,0,0,.08)}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body{border-collapse:collapse;border-spacing:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body th,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body td{width:14.28571429%;min-width:32px;text-align:center;font-weight:700;line-height:30px;padding:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body td>.cell:hover{background:#ecf6fd}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body td>.cell.active,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body td>.cell.active:hover{background:#ecf6fd;color:#2185d0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-calendar .calendar-body td>.cell.disabled{pointer-events:none;opacity:.5}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-datepicker{box-shadow:2px 2px 5px #0003;position:absolute;left:0;top:calc(100% + 5px);z-index:10;width:auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-buttons{display:flex;justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-buttons .x-spreadsheet-button{margin-left:8px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button{display:inline-block;border-radius:3px;line-height:1em;min-height:1em;white-space:nowrap;text-align:center;cursor:pointer;font-size:1em;font-weight:700;padding:.75em 1em;color:#0009;background:#e0e1e2;text-decoration:none;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;outline:none;vertical-align:baseline;zoom:1;-webkit-user-select:none;user-select:none;transition:all .1s linear}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button.active,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button:hover{background-color:#c0c1c2;color:#000c}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button.primary{color:#fff;background-color:#2185d0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button.primary:hover,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-button.primary.active{color:#fff;background-color:#1678c2}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-input{font-size:1em;position:relative;font-weight:400;display:inline-flex;color:#000000de}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-input input{z-index:1;margin:0;max-width:100%;flex:1 0 auto;outline:0;-webkit-tap-highlight-color:rgba(255,255,255,0);text-align:left;line-height:30px;height:30px;padding:0 8px;background:#fff;border:1px solid #e9e9e9;border-radius:3px;transition:box-shadow .1s ease,border-color .1s ease;box-shadow:inset 0 1px 2px #0a0a0a0f}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-input input:focus{border-color:#4b89ff;box-shadow:inset 0 1px 2px #4b89ff33}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-select{position:relative;display:inline-block;background:#fff;border:1px solid #e9e9e9;border-radius:2px;cursor:pointer;color:#000000de;-webkit-user-select:none;user-select:none;box-shadow:inset 0 1px 2px #0a0a0a0f}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-select .input-text{text-overflow:ellipsis;white-space:nowrap;min-width:60px;width:auto;height:30px;line-height:30px;padding:0 8px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-fields{display:flex;flex-direction:row;flex-wrap:wrap}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-fields .x-spreadsheet-form-field{flex:0 1 auto}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-fields .x-spreadsheet-form-field .label{display:inline-block;margin:0 10px 0 0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-field{display:block;vertical-align:middle;margin-left:10px;margin-bottom:10px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-field:first-child{margin-left:0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-field.error .x-spreadsheet-form-select,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-field.error input{border-color:#f04134}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-form-field .tip{color:#f04134;font-size:.9em}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dimmer{display:none;position:absolute;top:0!important;left:0!important;width:100%;height:100%;text-align:center;vertical-align:middle;background-color:#0009;opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;animation-duration:.5s;transition:background-color .5s linear;-webkit-user-select:none;user-select:none;z-index:1000}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-dimmer.active{display:block;opacity:1}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main form fieldset{border:none}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main form fieldset label{display:block;margin-bottom:.5em;font-size:1em;color:#666}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main form fieldset select{font-size:1.1em;width:100%;background-color:#fff;border:none;border-bottom:2px solid #ddd;padding:.5em .85em;border-radius:2px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-modal,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast{font-size:13px;position:fixed;z-index:1001;text-align:left;line-height:1.25em;min-width:360px;color:#000000de;font-family:Lato,Source Sans Pro,Roboto,Helvetica,Arial,sans-serif;border-radius:4px;border:1px solid rgba(0,0,0,.1);background-color:#fff;background-clip:padding-box;box-shadow:#0003 0 2px 8px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast{background-color:#ffffffd9}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-modal-header,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast-header{font-weight:600;background-clip:padding-box;background-color:#ffffffd9;border-bottom:1px solid rgba(0,0,0,.05);border-radius:4px 4px 0 0}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast-header{color:#f2711c}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-modal-header{border-bottom:1px solid #e0e2e4;background:rgba(0,0,0,.08);font-size:1.0785em}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-modal-header,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-modal-content,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast-header,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-toast-content{padding:.75em 1em}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-excel-main .x-spreadsheet-menu li:first-child{display:none}.r-preview-mask .r-preview-contain .r-preview-context .docx-wrapper{background:none}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section table,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section th,.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context .r-preview-pptx-main section svg.drawing{position:absolute;overflow:visible}\n';
const index$2 = "";
const { warning = noop } = message;
const PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
const PDF = "application/pdf";
const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
const XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
const XLS = "application/vnd.ms-excel";
async function Custom() {
  if (typeof document !== "undefined" && !customElements.get("r-preview") && true) {
    const { renderPptx } = await import("./index-7b8840f9.js");
    const { renderDocx } = await import("./docx-c5d02d8c.js");
    const { renderPdf } = await import("./pdf-bdb7818a.js");
    const { renderExcel } = await import("./index-c14450a9.js");
    const requestUrlToBuffer = (src, options) => {
      if (typeof XMLHttpRequest === "undefined") {
        throw new Error("XMLHttpRequest is not defined");
      }
      if (typeof document === "undefined") {
        return Promise.reject("document is not defined");
      }
      return new Promise(function(resolve, reject) {
        const xhr = new XMLHttpRequest();
        xhr.open(options.method || "GET", src, true);
        xhr.responseType = options.responseType || "arraybuffer";
        xhr.onload = function() {
          if (xhr.status === 200) {
            resolve({ success: true, data: xhr.response, message: "" });
          } else {
            reject({
              success: false,
              data: xhr.status,
              message: `The request status is${xhr.status}`
            });
          }
        };
        xhr.onerror = function(e) {
          reject({ success: false, data: e, message: `` });
        };
        xhr.onprogress = (event) => {
          options.onProgress && options.onProgress(event);
        };
        xhr.withCredentials = options.withCredentials || false;
        if (options.headers) {
          Object.keys(options.headers).forEach(function(key) {
            (options == null ? void 0 : options.headers) && xhr.setRequestHeader(key, options.headers[key]);
          });
        }
        xhr.send(options.body);
      });
    };
    const renderPpt = (file, dom) => {
      return new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.readAsArrayBuffer(file);
        reader.onload = () => {
          var _a;
          if (reader.result && dom) {
            const param = {
              pptx: reader.result,
              resultElement: dom
            };
            (_a = renderPptx(param)) == null ? void 0 : _a.then(() => {
              resolve();
            });
          }
        };
        reader.onerror = (error) => {
          reject(error);
        };
        reader.onabort = (abort) => {
          reject(abort);
        };
      });
    };
    const renderWord = (file, dom) => {
      return Promise.resolve().then(
        () => renderDocx({ buffer: file, bodyContainer: dom })
      );
    };
    const renderFileMap = /* @__PURE__ */ new Map([
      [PDF, renderPdf],
      [PPTX, renderPpt],
      [DOCX, renderWord],
      [XLSX, renderExcel],
      [XLS, renderExcel]
    ]);
    class CustomElement extends HTMLElement {
      constructor() {
        super();
        __publicField(this, "_loadingText");
        __publicField(this, "preview");
        __publicField(this, "previewContext");
        __publicField(this, "_slot");
        __publicField(this, "_div");
        __publicField(this, "_loadingElement");
        __publicField(this, "createLoading", () => {
          this._loadingElement = document.createElement("div");
          this._loadingElement.setAttribute("class", "r-preview-loading");
          const icon = document.createElement("r-icon");
          icon.setAttribute("name", "loading");
          icon.setAttribute("size", "100");
          icon.setAttribute("color", "#1E90FF");
          icon.setAttribute("spin", "");
          this._loadingText = document.createElement("div");
          this._loadingElement.appendChild(icon);
          this._loadingText.setAttribute("class", "r-preview-loading-text");
          this._loadingElement.appendChild(this._loadingText);
          return this._loadingElement;
        });
        __publicField(this, "onProgress", (event) => {
          const num = event.loaded / event.total * 100;
          const progress = Math.min(99, num).toFixed(2) + "%";
          if (this._loadingText && this._loadingElement) {
            this._loadingText.innerText = `Loading ${progress}`;
            if (num >= 100) {
              setTimeout(() => {
                var _a;
                (_a = this.preview) == null ? void 0 : _a.removeChild(this._loadingElement);
              }, 300);
            }
          }
        });
        __publicField(this, "handleFile", async (file) => {
          try {
            if (typeof file === "string") {
              const { success, data, message: message2 } = await requestUrlToBuffer(file, {
                onProgress: this.onProgress,
                responseType: "blob"
              });
              if (success && data) {
                file = new File([data], data.name, { type: data.type });
                const { type } = file;
                const handler = renderFileMap.get(type);
                if (handler && this.previewContext) {
                  if (type === XLSX || type === XLS) {
                    this.previewContext.style.setProperty("width", "100%");
                  } else {
                    this.previewContext.style.setProperty("width", "100%");
                  }
                  handler(file, this.previewContext);
                }
              } else {
                warning(message2);
              }
            }
          } catch (error) {
          }
        });
        __publicField(this, "closePreview", () => {
          if (this.preview) {
            document.body.removeChild(this.preview);
            this.preview = void 0;
          }
        });
        __publicField(this, "showPreview", () => {
          var _a;
          if (this.src) {
            if (this.preview) {
              this.preview.style.display = "block";
            } else {
              this.preview = document.createElement("div");
              this.preview.setAttribute("class", "r-preview-mask");
              this.preview.setAttribute("id", "r-preview-mask");
              const previewOption = document.createElement("div");
              previewOption.setAttribute("class", "r-preview-options");
              if (this.closeable !== "false") {
                const previewCloseButton = document.createElement("r-icon");
                previewCloseButton.setAttribute(
                  "class",
                  "r-preview-options-close"
                );
                previewCloseButton.setAttribute("name", "close-circle-fill");
                previewCloseButton.setAttribute("size", "40");
                previewCloseButton.addEventListener("click", this.closePreview);
                previewOption.appendChild(previewCloseButton);
              }
              const previewContain = document.createElement("div");
              previewContain.setAttribute("class", "r-preview-contain");
              this.previewContext = document.createElement("div");
              this.previewContext.setAttribute("class", "r-preview-context");
              previewContain.appendChild(this.previewContext);
              this.preview.appendChild(previewOption);
              (_a = this.preview) == null ? void 0 : _a.appendChild(previewContain);
              this._loadingElement = this.createLoading();
              this.preview.appendChild(this._loadingElement);
              document.getElementById('showPreview').appendChild(this.preview);
              // document.body.appendChild(this.preview);
            }
            this.handleFile(this.src);
          }
        });
        this._div = document.createElement("div");
        this.preview = document.getElementById("r-preview-mask");
        this._slot = document.createElement("slot");
        this._div.appendChild(this._slot);
        this._slot.setAttribute("class", "r-preview-slot");
        this._div.setAttribute("class", "r-preview");
        const shadowRoot = this.attachShadow({ mode: "closed" });
        const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
        F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
        shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
        shadowRoot.appendChild(this._div);
      }
      static get observedAttributes() {
        return ["src", "closeable"];
      }
      get label() {
        return this.getAttribute("label");
      }
      set label(value) {
        if (value)
          this.setAttribute("label", value);
      }
      get src() {
        return this.getAttribute("src");
      }
      set src(value) {
        if (value)
          this.setAttribute("src", value);
      }
      get closeable() {
        return this.getAttribute("closeable");
      }
      set closeable(value) {
        if (value)
          this.setAttribute("closeable", value);
      }
      connectedCallback() {
        this.preview = document.getElementById("r-preview-mask");
        this.addEventListener("click", this.showPreview);
      }
      disconnectedCallback() {
        this.removeEventListener("click", this.showPreview);
      }
      attributeChangedCallback(name, oldValue, newValue) {
        if (newValue !== oldValue) {
          if (name === "src" && newValue) {
            this.setAttribute("src", newValue);
            this.showPreview();
          }
        }
      }
    }
    customElements.define("r-preview", CustomElement);
  }
}
const index = Custom();
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: index
}, Symbol.toStringTag, { value: "Module" }));
export {
  index as a,
  index$1 as i
};

好像是pdf在预览时样式很奇怪:所以pdf我是通过ifream进行预览

 <iframe :src="url" class="pdfBox"></iframe>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1587065.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Flask快速搭建文件上传服务与接口

说明&#xff1a;仅供学习使用&#xff0c;请勿用于非法用途&#xff0c;若有侵权&#xff0c;请联系博主删除 作者&#xff1a;zhu6201976 一、需求背景 前端通过浏览器&#xff0c;访问后端服务器地址&#xff0c;将目标文件进行上传。 访问地址&#xff1a;http://127.0.0…

✔ ★Java项目——设计一个消息队列(二)

Java项目——设计一个消息队列 四. 项⽬创建五. 创建核⼼类创建 Exchange&#xff08;名字、类型、持久化&#xff09;创建 MSGQueue&#xff08;名字、持久化、独占标识&#xff09;创建 Binding&#xff08;交换机名字、队列名字、bindingKey用于与routingKey匹配&#xff09…

前端docker jenkins nginx CI/CD持续集成持续部署-实战

最近用go react ts开发了一个todolist后端基本开发完了,前端采用CI/CD方式去部署。 步骤总结 先安装docker 和 docker-compose。安装jenkins镜像,跑容器的时候要配好数据卷。配置gitee或github(我这里使用gitee)在服务器上一定要创建好dokcer的数据卷,以便持久保存jenkin…

【MySQL】锁篇

SueWakeup 个人主页&#xff1a;SueWakeup 系列专栏&#xff1a;学习技术栈 个性签名&#xff1a;保留赤子之心也许是种幸运吧 本文封面由 凯楠&#x1f4f8;友情提供 目录 本系列专栏 1. MySQ 中的锁 2. 表锁和行锁 表锁 行锁 3. InnoDB 存储引擎的三种行级锁 4. 悲观锁…

怎么开发一个预约小程序_一键预约新体验

预约小程序&#xff0c;让生活更便捷——轻松掌握未来&#xff0c;一键预约新体验 在快节奏的现代生活中&#xff0c;我们总是在不断地奔波&#xff0c;为了工作、为了生活&#xff0c;不停地忙碌着。然而&#xff0c;在这繁忙的生活中&#xff0c;我们是否曾想过如何更加高效…

探探各个微前端框架

本文作者为 360 奇舞团前端开发工程师 微前端架构是为了在解决单体应用在一个相对长的时间跨度下&#xff0c;由于参与的人员、团队的增多、变迁&#xff0c;从一个普通应用演变成一个巨石应用(Frontend Monolith)后&#xff0c;随之而来的应用不可维护的问题。这类问题在企业级…

点击按钮(文字)调起elementUI大图预览

时隔一年&#xff0c;我又回来了 ~ 最近在做后台&#xff0c;遇到一个需求&#xff0c;就是点击“查看详情”按钮&#xff0c;调起elementUI的大图预览功能&#xff0c;预览多张图片&#xff0c;如下图&#xff1a; 首先想到的是使用element-ui的el-image组件&#xff0c;但它是…

Towards Geolocation of Millions of IP Addresses(2012年)

下载地址: Towards geolocation of millions of IP addresses | Proceedings of the 2012 Internet Measurement Conference 被引用次数:70 Hu Z, Heidemann J, Pradkin Y. Towards geolocation of millions of IP addresses[C]//Proceedings of the 2012 Internet Measure…

利用Python实现可视化交互界面:Dash

Dash是一个低代码数据框架&#xff0c;用Python实现可视化交互界面&#xff0c;不用写Javascript&#xff0c;开源&#xff0c;支持回调、HTML组件等功能。 安装 pip install dash使用 # Import packages from dash import Dash, html, dash_table, dcc, callback, Output, …

[BT]BUUCTF刷题第14天(4.10)

第14天&#xff08;共5题&#xff09; Web [BJDCTF2020]ZJCTF&#xff0c;不过如此 打开网站直接显示源代码&#xff1a; <?php error_reporting(0); //关闭报错 $text $_GET["text"]; $file $_GET["file"]; if(isset($text)&&(file…

C#如何用NPOI创建、读取、更新Excel文件

一.获取引用NPOI VS2017&#xff0c;通过Nuget工具包下载NPOI到指定的项目中&#xff0c;如下 二.添加如下命名空间,其中HSSF是操作*.xls文件&#xff0c;XSSF操作*.xlsx文件. using NPOI; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using NPOI.HSSF.UserModel; …

Debian 安装 Docker

Debian 安装 Docker。 这是官方安装文档 Install Docker Engine on Debian | Docker DocsLearn how to install Docker Engine on Debian. These instructions cover the different installation methods, how to uninstall, and next steps.https://docs.docker.com/engine/i…

如何将普通maven项目转为maven-web项目

文件-项目结构&#xff08;File-->Project Structure &#xff09; 模块-->learn&#xff08;moudle-->learn&#xff09; 选中需要添加web的moudle&#xff0c;点击加号&#xff0c;我得是learn&#xff0c;单击选中后进行下如图操作&#xff1a; 编辑路径 结果如下…

【网站项目】英语学习激励系统小程序

&#x1f64a;作者简介&#xff1a;拥有多年开发工作经验&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。&#x1f339;赠送计算机毕业设计600个选题excel文件&#xff0c;帮助大学选题。赠送开题报告模板&#xff…

神经网络背后的数学原理

原文地址&#xff1a;The Math Behind Neural Networks 2024 年 3 月 29 日 深入研究现代人工智能的支柱——神经网络&#xff0c;了解其数学原理&#xff0c;从头开始实现它&#xff0c;并探索其应用。 神经网络是人工智能 &#xff08;AI&#xff09; 的核心&#xff0c;为…

性能优化“万金油”:缓存Cache

1、首次请求数据时,先从缓存中获取,如果没有,则继续向数据库中获取。获取到数据后,将数据保存到缓存中。再次请求数据,一样先从缓存中获取,成功获取,“缓存命中”。多次请求中,命中次数占全部请求次数的比例,叫“命中率”。如果数据源的数据发生变化,而缓存中的数据没…

【RV1106的ISP使用记录之一】基础环境搭建

公司缺少ISP工程师&#xff0c;做为图像算法工程师的我这就不就给顶上来了么&#xff0c;也没给发两份工资&#xff0c;唉~ 先写个标题&#xff0c;占一个新坑&#xff0c;记录RK平台的传统ISP工作。 一、基础环境的硬件包括三部分&#xff1a; 1、相机环境&#xff0c;用于采…

3D开发工具HOOPS:推动汽车行业CAD可视化发展

在最近的行业对话中&#xff0c;Tech Soft 3D&#xff08;HOOPS厂商&#xff09;的Jonathan Girroir和Actify的Peter West探讨了CAD可视化在当代企业中的重要性和挑战。作为CAD可视化领域的佼佼者&#xff0c;Actify通过其广受欢迎的Spinfire应用&#xff0c;赋能了全球40多个国…

单链表总结提升

这篇博客讲解数据结构中的单链表&#xff0c;包括单链表的基础知识和我对链表实现的总结理解&#xff0c;希望可以帮助到正在学习的小伙伴&#xff0c;也希望得到小伙伴们的关注和支持哦~ 目录 1.单链表的概念 1.2顺序表和链表的对比 顺序表&#xff1a; 链表&#xff1a;…

【牛客SQL快速入门】SQL基础(三)

一、条件函数 IF 条件函数 IF函数是最常用到的条件函数&#xff0c;写法为 if(xn,a,b)&#xff0c;xn代表判断条件&#xff0c;如果xn时&#xff0c;那么结果返回a&#xff0c;否则返回b。 -- 把非北京大学的用户统一归为其他大学 Select device_id,if(university ‘北京大…