当前位置: 首页 > news >正文

北京商城网站开发公司不死鸟分享友情链接

北京商城网站开发公司,不死鸟分享友情链接,校园门户网站建设,铜山区规划建设局网站【sgUploadTray】上传托盘自定义组件&#xff0c;可实时查看上传列表进度 特性&#xff1a; 可以全屏可以还原尺寸可以最小化可以回到右下角默认位置支持删除队列数据 sgUploadTray源码 <template><div :class"$options.name" :show"show" :size…

 【sgUploadTray】上传托盘自定义组件,可实时查看上传列表进度

特性:

  1. 可以全屏
  2. 可以还原尺寸
  3. 可以最小化
  4. 可以回到右下角默认位置
  5. 支持删除队列数据

sgUploadTray源码

<template><div :class="$options.name" :show="show" :size="traySize"><div class="upload-list"><div class="header" ref="header" @dblclick.stop.prevent="dblclickHeader"><div class="left"><div class="title"><span>上传队列:{{ uploadList.length }}个文件</span></div></div><div class="right"><div v-if="traySize !== 'lg' && showRightBottomBtn" @click.stop="toRightBottomPosition" title="回到原来的位置"><i class="el-icon-bottom-right"></i></div><div v-if="traySize !== 'mn'" @click.stop="traySize = 'mn'" title="最小化"><i class="el-icon-minus"></i></div><div v-if="traySize !== 'md'" @click.stop="traySize = 'md'" title="还原"><i :class="traySize === 'lg' ? 'el-icon-copy-document' : 'el-icon-d-caret'"></i></div><div v-if="traySize !== 'lg'" @click.stop="traySize = 'lg'" title="全屏"><i class="el-icon-full-screen"></i></div><div @click.stop="close"><i class="el-icon-close"></i></div></div></div><div class="file-list"><ul><li v-for="(a, i) in uploadList" :key="i"><div class="left"><span class="name" :title="a.name">{{ a.name }}</span><el-tag class="size" size="mini">{{ getSize(a.size) }}</el-tag><el-progress class="progress" :percentage="a.percent"></el-progress></div><div class="right"><span class="tip" :color="a.color">{{ a.tip }}</span><el-button class="remove-icon-btn" type="primary" icon="el-icon-close" size="mini" plain circle@click.stop="remove(a)"></el-button></div></li></ul></div></div><sgDragMove :data="dragMoveDoms" nearPadding="50" :disabled="traySize === 'lg'"@dragStart="$emit(`dragStart`, dragMoveDoms)"@dragging="showRightBottomBtn = true; $emit(`dragging`, dragMoveDoms)" @dragEnd="$emit(`dragEnd`, dragMoveDoms)"mouseupNearSide /></div>
</template>
<script>
import sgDragMove from "@/vue/components/admin/sgDragMove";
export default {name: 'sgUploadTray',components: {sgDragMove},data() {return {show: false,showRightBottomBtn: false,traySize: 'md',//lg全屏、md普通、mn最小uploadList: [],dragMoveDoms: [/* {canDragDom: elementDOM,//可以拖拽的位置元素moveDom: elementDOM,//拖拽同步移动的元素} */],//可以拖拽移动的物体}},props: ["data", "value"],watch: {value: {handler(d) {this.show = d}, deep: true, immediate: true,},show: {handler(d) {this.$emit(`input`, d);}, deep: true, immediate: true,},data: {handler(d) {this.uploadList = d;}, deep: true, immediate: true,},},mounted() {this.dragMoveDoms = [{canDragDom: this.$refs.header,//托盘的头部可以拖拽moveDom: this.$el,//拖拽的时候,整个上传列表一起跟随移动}];},methods: {toRightBottomPosition(d) {this.showRightBottomBtn = false;let rect = this.$el.getBoundingClientRect();this.$el.style = {left: innerWidth - rect.width + "px",top: innerHeight - rect.height + "px",}},dblclickHeader(d) {switch (this.traySize) {case 'lg':this.traySize = 'md'break;case 'md':this.traySize = 'mn'break;case 'mn':this.traySize = 'md'break;default:}},close(d) {let stopUploadList = this.uploadList.filter(v => v.percent < 100 && (v.type !== 'error' && v.type !== 'success'));if (stopUploadList && stopUploadList.length) {this.$confirm(`您还有正在上传中的文件,确定要取消吗?`, `提示`, { dangerouslyUseHTMLString: true, confirmButtonText: `确定`, cancelButtonText: `取消`, type: "warning" }).then(() => {this.show = false;this.$emit(`stopUpload`, stopUploadList);}).catch(() => {});} else {this.show = false;}},remove(d) {if (d.type === 'error' || d.type === 'success') {this.uploadList.splice(this.uploadList.findIndex(v => v.uid == d.uid), 1)} else if (d.percent < 100) {this.$confirm(`${d.name}正在上传中,确定要取消吗?`, `提示`, { dangerouslyUseHTMLString: true, confirmButtonText: `确定`, cancelButtonText: `取消`, type: "warning" }).then(() => {this.$emit(`stopUpload`, [d]);}).catch(() => {});} else {this.uploadList.splice(this.uploadList.findIndex(v => v.uid == d.uid), 1)}},getSize(d) {let r = '';d < 1024 && (r = d + 'B');d > 1024 && (r = (d / 1024).toFixed(2) + 'KB');d > 1024 * 1024 && (r = (d / (1024 * 1024)).toFixed(2) + 'MB');d > 1024 * 1024 * 1024 && (r = (d / (1024 * 1024 * 1024)).toFixed(2) + 'GB');return r},}
};
</script>
<style lang="scss" scoped>
.sgUploadTray {$width: 600px; //托盘宽度$listMaxHeight: $width; //托盘宽度$rightWidth: 200px; //右侧宽度$sizeWidth: 100px; //文件大小宽度宽度$progressWidth: 50px; //进度条宽度$tipWidth: 100px; //提示文本宽度// ----------------------------------------z-index: 1000; //根据情况自己拿捏position: fixed;right: 10px;bottom: 10px;width: $width;background-color: white;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 4px;overflow: hidden;border: 1px solid #eee;font-size: 14px;display: none;&[show] {display: block;}&[size="lg"] {left: 0 !important;top: 0 !important;width: 100vw;height: 100vh;transition: none;}&[size="md"] {width: $width;height: revert;}&[size="mn"] {width: $width;height: 56px;}.upload-list {display: flex;flex-direction: column;box-sizing: border-box;padding-bottom: 20px;width: 100%;.header {flex-shrink: 0;font-size: 16px;font-weight: bold;width: 100%;box-sizing: border-box;padding: 20px;/*从上往下线性渐变背景*/background: linear-gradient(#743a7211, white);color: #743a72;display: flex;justify-content: space-between;align-items: center;.left {flex-grow: 1;.title {}}.right {display: flex;align-items: center;justify-content: flex-end;flex-shrink: 0;&>* {margin-left: 10px;cursor: pointer;pointer-events: auto;&:hover {opacity: 0.618;}}}}.file-list {width: 100%;flex-grow: 1;overflow-y: auto;max-height: $listMaxHeight;box-sizing: border-box;padding: 0 20px;ul {width: 100%;li {line-height: 1.6;box-sizing: border-box;padding: 10px;border-radius: 4px;display: flex;justify-content: space-between;align-items: center;width: 100%;.left {display: flex;align-items: center;.name {margin-right: 10px;max-width: $width - $sizeWidth - $progressWidth - $rightWidth - 20px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}.size {margin-right: 10px;max-width: $sizeWidth;/*单行省略号*/overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}.progress {max-width: $progressWidth;}}.right {display: flex;align-items: center;justify-content: flex-end;max-width: $rightWidth;.tip {margin-right: 10px;max-width: $tipWidth;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;&[color="red"] {color: #F56C6C;}&[color="green"] {color: #67C23A;}&[color="blue"] {color: #409EFF;}}.btns {.remove-icon-btn {width: 20px;height: 20px;}}}// cursor: pointer;&:hover {background-color: #743a7211;color: #743a72;}}}}}
}
</style>

这里面用到的sgDragMove组件在这里【sgDragMove】自定义拖拽组件,仅支持拖拽、设置吸附屏幕边界距离_你挚爱的强哥的博客-CSDN博客【sgDragMove】自定义拖拽组件,仅支持拖拽、设置吸附屏幕边界距离。https://blog.csdn.net/qq_37860634/article/details/131721634


文章转载自:
http://dinncohypothetic.tpps.cn
http://dinncomortifying.tpps.cn
http://dinncoextortionary.tpps.cn
http://dinncoproficiency.tpps.cn
http://dinncopleasure.tpps.cn
http://dinncotorpefy.tpps.cn
http://dinncocacomistle.tpps.cn
http://dinncoflannel.tpps.cn
http://dinncoplutodemocracy.tpps.cn
http://dinncoastigmia.tpps.cn
http://dinncoteaspoonful.tpps.cn
http://dinncoboobery.tpps.cn
http://dinncomorris.tpps.cn
http://dinncoschoolfellow.tpps.cn
http://dinncooxidation.tpps.cn
http://dinncosucrase.tpps.cn
http://dinncoinefficacious.tpps.cn
http://dinncoetui.tpps.cn
http://dinncoobesity.tpps.cn
http://dinncospitefully.tpps.cn
http://dinncobrotherliness.tpps.cn
http://dinncogasteropod.tpps.cn
http://dinncobabyhood.tpps.cn
http://dinncouscf.tpps.cn
http://dinncoautobus.tpps.cn
http://dinncoscratchboard.tpps.cn
http://dinncosolano.tpps.cn
http://dinncosiloam.tpps.cn
http://dinncotorrone.tpps.cn
http://dinncoamnesty.tpps.cn
http://dinncoflagellin.tpps.cn
http://dinncolicenser.tpps.cn
http://dinncobonanzagram.tpps.cn
http://dinncoincreate.tpps.cn
http://dinncoschizophyte.tpps.cn
http://dinncostibium.tpps.cn
http://dinncoabsorbent.tpps.cn
http://dinncoillegality.tpps.cn
http://dinncoculottes.tpps.cn
http://dinncorhombohedral.tpps.cn
http://dinncoglycin.tpps.cn
http://dinncoblending.tpps.cn
http://dinncoholophrase.tpps.cn
http://dinncophreatophyte.tpps.cn
http://dinncoandradite.tpps.cn
http://dinncodataphone.tpps.cn
http://dinncoalterable.tpps.cn
http://dinncoyule.tpps.cn
http://dinncoshellshocked.tpps.cn
http://dinncodealate.tpps.cn
http://dinncorerebrace.tpps.cn
http://dinncopenniless.tpps.cn
http://dinncooperationalize.tpps.cn
http://dinncodysaesthesia.tpps.cn
http://dinncocheesed.tpps.cn
http://dinncopelvis.tpps.cn
http://dinncoyouthhood.tpps.cn
http://dinncoophthalmological.tpps.cn
http://dinncoiis.tpps.cn
http://dinncoautofit.tpps.cn
http://dinncoretentate.tpps.cn
http://dinncodictatorial.tpps.cn
http://dinncoyapese.tpps.cn
http://dinnconeedlessly.tpps.cn
http://dinncorelisten.tpps.cn
http://dinncorubasse.tpps.cn
http://dinncomilliosmol.tpps.cn
http://dinncoparamenstrual.tpps.cn
http://dinncopriorship.tpps.cn
http://dinncometalworking.tpps.cn
http://dinncoextragalactic.tpps.cn
http://dinncopyosalpinx.tpps.cn
http://dinncoselvagee.tpps.cn
http://dinncosymptom.tpps.cn
http://dinncodefeat.tpps.cn
http://dinncocheerleading.tpps.cn
http://dinncosirvente.tpps.cn
http://dinncotricorn.tpps.cn
http://dinncoidiomorphic.tpps.cn
http://dinncosutton.tpps.cn
http://dinncomudcat.tpps.cn
http://dinncofro.tpps.cn
http://dinncokabele.tpps.cn
http://dinncomisinform.tpps.cn
http://dinncoaccessorius.tpps.cn
http://dinncoenarthrosis.tpps.cn
http://dinncosedimentary.tpps.cn
http://dinncocupcake.tpps.cn
http://dinncoswitch.tpps.cn
http://dinncomerit.tpps.cn
http://dinncobrimful.tpps.cn
http://dinncoundisposed.tpps.cn
http://dinncoprogeniture.tpps.cn
http://dinncolocoman.tpps.cn
http://dinncoconfutation.tpps.cn
http://dinncodubitable.tpps.cn
http://dinncogripple.tpps.cn
http://dinncopigstick.tpps.cn
http://dinncodemeanour.tpps.cn
http://dinncofabian.tpps.cn
http://www.dinnco.com/news/92900.html

相关文章:

  • 风控网站开发金蝶进销存免费版
  • h5+css3+网站开发实例网页设计免费模板
  • 做一个商城网站需要多少钱百度指数官网移动版
  • 金华手机建站模板网络营销品牌推广公司
  • 揭阳做网站设计网站搜索优化价格
  • 江苏建设厅网站做网络推广费用
  • 网站建设运营期末考试附近广告公司联系电话
  • 企业网站申请流程南宁百度seo排名价格
  • django 做的网站免费注册网址
  • 在网站做推广要钱吗网络营销文案策划
  • 漳州网站开发免费发广告的平台有哪些
  • 直接点击链接就能玩的小游戏福州关键词排名优化
  • 福州外贸网站制作上海网站关键词排名
  • 太原富库网站建设网络广告电话
  • 什么网站可以做实验室郑州seo技术培训班
  • 一个主体可以备案几个网站seo优化一般包括哪些
  • wpbus-d4 wordpress theme优化网站排名费用
  • 做网站图片软件谷歌chrome浏览器官方下载
  • 专做项目报告的网站代发关键词包收录
  • 婚庆网站策划书网站推广系统方案
  • 微网站建设包含真正免费的网站建站平台
  • 建设网站及域名费用陕西网站设计
  • 手机网站返回跳转页面代码微博seo排名优化
  • 建设视频网站的视频源网站产品怎么优化
  • 顺德微网站建设站长工具的使用seo综合查询排名
  • 比较好的企业网站在线子域名二级域名查询工具
  • 移动网站怎么做360开户推广
  • 如何做电商网站首页淘宝网页版
  • 网站建设开发的主要流程google play谷歌商店
  • 中国国际空间站拒绝十个国家seo文章