初始提交

This commit is contained in:
2026-01-04 11:09:06 +08:00
commit 8fa31df250
1326 changed files with 213907 additions and 0 deletions

View File

@@ -0,0 +1,203 @@
<template>
<u-popup class="jnpf-select" :maskCloseAble="maskCloseAble" mode="bottom" v-model="showPopup"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close">
<view class="u-select">
<view class="u-select__header" @touchmove.stop.prevent="">
<view class="u-select__header__cancel u-select__header__btn" :style="{ color: cancelColor }"
hover-class="u-hover-class" :hover-stay-time="150" @tap="close()"
style="width: 60rpx;text-align: center;">
<text v-if="cancelBtn">{{cancelText}}</text>
</view>
<view class="u-select__header__title" style="flex: 1;text-align: center;">
{{title}}
</view>
<view class="u-select__header__confirm u-select__header__btn" :style="{ color: confirmColor }"
style="width: 60rpx;text-align: center;" hover-class="u-hover-class" :hover-stay-time="150"
@touchmove.stop="" @tap.stop="handleConfirm()">
<text v-if="confirmBtn">{{confirmText}}</text>
</view>
</view>
<view class="u-select__body u-select__body__multiple">
<scroll-view :scroll-y="true" style="height: 100%">
<view class="u-flex u-p-l-20 u-p-r-20" style="height: 100rpx;border-bottom: 1rpx solid #f0f2f6;"
@click="radioGroupChange('add')">
<text class="u-m-r-20 u-font-28 icon-ym icon-ym-add-folder"></text>
<text>新建文件夹</text>
</view>
<view class="u-flex u-p-l-20 u-p-r-20 uploadFileBtn" @click="radioGroupChange('up')">
<JnpfUploadFileComment ref="lsjUpload" height="100rpx" childId="upload" :size="10"
:parentId="parentId" @callback="onCallback">
</JnpfUploadFileComment>
</view>
</scroll-view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
height: {
type: [Number, String],
default: ''
},
cancelBtn: {
type: Boolean,
default: true
},
confirmBtn: {
type: Boolean,
default: true
},
show: {
type: Boolean,
default: false
},
cancelColor: {
type: String,
default: '#606266'
},
confirmColor: {
type: String,
default: '#2979ff'
},
safeAreaInsetBottom: {
type: Boolean,
default: false
},
maskCloseAble: {
type: Boolean,
default: true
},
title: {
type: String,
default: ''
},
parentId: {
type: [String, Number],
default: 0
},
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确认'
}
},
data() {
return {
showPopup: false,
option: {},
id: ''
}
},
watch: {
show: {
handler(val) {
this.showPopup = val
},
immediate: true
}
},
computed: {
baseURL() {
return this.define.baseURL
},
token() {
return uni.getStorageSync('token')
},
},
methods: {
//文件上传
onCallback(e) {
this.$emit('onCallback', e)
},
// 获取默认选中的值
radioGroupChange(e) {
this.$emit('confirm', e)
},
close() {
this.$emit('close');
},
}
}
</script>
<style scoped lang="scss">
.notData-box {
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
margin-top: -50px;
.notData-inner {
width: 286rpx;
height: 222rpx;
align-items: center;
.iconImg {
width: 100% !important;
height: 100% !important;
}
}
.notData-inner-text {
color: #909399;
}
}
.uploadFileBtn {
height: 3.125rem;
}
.jnpf-select {
width: 100%;
.u-select {
&__header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
height: 40px;
padding: 0 20px;
position: relative;
::after {
content: "";
position: absolute;
border-bottom: 0.5px solid #eaeef1;
transform: scaleY(0.5);
bottom: 0;
right: 0;
left: 0;
}
}
&__body {
width: 100%;
overflow: hidden;
background-color: #fff;
&__picker-view {
height: 100%;
box-sizing: border-box;
&__item {
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
padding: 0 8rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,91 @@
<template>
<view class="notice-warp" :style="{height:noticeWarpH + 'px'}">
<view class="search-box" style="background-color: #fff;">
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72" :show-action="false"
@change="search" bg-color="#f0f2f6" shape="square" />
</view>
<CommonTabs class="commonTabs" :list="categoryList" @change="change" :current="current" ref="CommonTabs"
:icon="icon" type="doc" @iconClick="iconClick">
</CommonTabs>
</view>
</template>
<script>
import mixin from "../mixin.js"
import CommonTabs from '@/components/CommonTabs'
export default {
mixins: [mixin],
components: {
CommonTabs
},
data() {
return {
icon: 'icon-ym icon-ym-thumb-mode',
keyword: '',
current: 0,
categoryList: [{
fullName: '我的文档',
}, {
fullName: '我的共享'
}, {
fullName: '共享给我'
}, {
fullName: '回收站'
}],
commonTabs: 0,
noticeWarpH: 0
}
},
mounted() {
this.getContentHeight()
},
methods: {
async getContentHeight() {
const windowHeight = this.$u.sys().windowHeight;
const [commonTabs, searchBox] = await Promise.all([
this.$uGetRect('.search-box'),
this.$uGetRect('.commonTabs')
]);
this.commonTabs = commonTabs.height
this.searchBox = searchBox.height
this.noticeWarpH = this.commonTabs + this.searchBox
// #ifdef MP
this.$emit('mescrollTop', this.commonTabs + 10)
// #endif
// #ifndef MP
this.$emit('mescrollTop', this.noticeWarpH)
// #endif
},
search() {
this.searchTimer && clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.$emit('search', this.keyword)
}, 300);
},
change(e) {
this.current = e;
this.keyword = ''
this.$emit('change', this.current)
},
iconClick(e) {
this.$emit('iconClick')
},
}
}
</script>
<style lang="scss">
.notice-warp {
z-index: 9;
position: fixed;
top: var(--window-top);
left: 0;
width: 100%;
height: 200rpx;
/*对应mescroll-body的top值*/
font-size: 26rpx;
text-align: center;
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,183 @@
<template>
<view class="" v-if="list.length">
<view class="doc-list" v-if="modelValue">
<checkbox-group @change="checkboxChange" @click.stop>
<label class="item-label" v-for="(item,index) in list" :key="index">
<view class="u-flex item-label-left u-line-1" @click.stop="goDetail(item)">
<view class="doc-icon">
<u-image :src="getRecordImg(item.fileExtension)" width="74" height="74" />
</view>
<view class="text">
<p class="u-m-l-10 u-m-b-8 u-font-28 name u-line-1">{{item.fullName}}</p>
<p class="u-m-l-10 u-m-t-8 u-font-24 time">
{{item.time ? jnpf.toDate(item.time, 'yyyy-MM-dd HH:mm:ss') :''}}
</p>
</view>
</view>
<checkbox :value="item.id" :checked="item.checked" activeBackgroundColor="#0177FF" iconColor="#fff"
style="transform:scale(0.7)" />
</label>
</checkbox-group>
</view>
<view class="u-flex u-p-l-20 u-p-r-20 doc-list2 u-p-t-20" v-else>
<checkbox-group @change="checkboxChange" @click.stop class="checkbox-group">
<label class="group-label" v-for="(item,index) in list" :key="index">
<view class="u-flex-col doc-list-inner" @click.stop="goDetail(item)">
<view class="doc-icon u-flex">
<u-image :src="getRecordImg(item.fileExtension)" width="84" height="84" />
</view>
<view class="u-flex doc-name" @click.stop>
<view class="u-line-1 name">{{item.fullName}}</view>
<checkbox :value="item.id" :checked="item.checked" activeBackgroundColor="#0177FF"
iconColor="#fff" style="transform:scale(0.7)" />
</view>
</view>
</label>
</checkbox-group>
</view>
</view>
</template>
<script>
import mixin from "../mixin.js"
export default {
name: 'DocList',
mixins: [mixin],
props: {
modelValue: {
type: Boolean,
default: true
},
documentList: {
type: Array,
default: () => []
}
},
data() {
return {
list: []
}
},
watch: {
documentList: {
handler(val) {
this.list = val
},
immediate: true,
deep: true
}
},
methods: {
goDetail(item) {
this.$emit('goDetail', item)
},
checkboxChange(e) {
this.$emit('checkboxChange', e.detail.value)
}
}
}
</script>
<style lang="scss">
.doc-list {
background-color: #FFFFFF;
position: relative;
width: 100%;
display: flex;
flex-direction: column;
padding: 0 20rpx;
.item-label {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1rpx solid #f0f2f6;
height: 126rpx;
.item-label-left {
flex: 1;
.doc-icon {
width: 74rpx;
height: 74rpx;
img {
width: 100%;
height: 100%;
}
}
.text {
width: 80%;
.name {
color: #303133;
}
.time {
color: #909399;
}
}
}
.uni-checkbox-wrapper {
.uni-checkbox-input {
margin: 0 !important;
}
}
}
}
.doc-list2 {
background-color: #fff;
.doc-list-inner {
width: 100%;
background-color: #f2f3f7;
padding: 12rpx 12rpx 0 12rpx;
margin-bottom: 20rpx;
border-radius: 8rpx;
.doc-icon {
width: 100%;
background-color: #FFFFFF;
border-radius: 8rpx;
height: 160rpx;
justify-content: center;
}
.doc-name {
width: 100%;
height: 73rpx;
.name {
text-align: left;
flex: 1;
}
::v-deep .uni-checkbox-wrapper {
.uni-checkbox-input {
margin: 0;
}
}
}
}
}
.checkbox-group {
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: space-between;
.group-label {
width: 48%;
}
::v-deep .uni-label-pointer {
width: 48%;
display: flex;
text-align: center;
}
}
</style>

View File

@@ -0,0 +1,28 @@
// 导航栏标题
.title {
height: 90rpx;
padding: 0 32rpx;
line-height: 90rpx;
font-size: 30rpx;
background-color: #f5f5f5;
color: #606064;
// 导航栏图标样式
.iconclass {
display: inline-block;
margin: 0 12rpx;
color: #D0D4DB;
font-size: 28rpx;
}
}
// 导航栏项样式
.inline-item {
display: inline-block
}
// 导航栏项-启用状态
.active {
color: #4297ED !important;
}
// 导航栏项-无状态
.none {
color: #666666;
}

View File

@@ -0,0 +1,168 @@
<template>
<view class="title" style="background-color: #fff;margin-top: 20rpx;">
<scroll-view ref="sea" scroll-x style="width: 100%;white-space: nowrap;">
<!-- 全部 -->
<view class="inline-item" @click="clickItem(null,-1)">
<text v-if="!isre && treeStack.length == 0" class="none">全部</text>
<text v-else class="active">全部</text>
</view>
<!-- 全部 -->
<!-- 搜索结果 -->
<view v-if="isre" @click="clickItem(null,-2)"
:class="activeSearch?'active inline-item':' none inline-item'">
<i class="iconfont icon-z043 iconclass" />
搜索结果
</view>
<!-- 搜索结果 -->
<!-- 当前树的层级值 -->
<view v-for="(item,index) in treeStack" class="inline-item" :key="index">
<view class="inline-item" @click="clickItem(item,index)">
<i class="iconfont icon-z043 iconclass" />
<text v-if="index== treeStack.length-1" class="none inline-item">
{{item[slabel]}}
</text>
<text v-else class="active">
{{item[slabel]}}
</text>
</view>
</view>
<!-- 当前树的层级值 -->
</scroll-view>
</view>
</template>
<script>
/**
* 无限级树-面包屑导航
* @description 无限级树的面包屑导航
* @property {String} slabel 显示的label值
* @return {Function} clickItemitem , index 点击导航栏的索引
* @item 表示导航项对应的值
* @index 表示导航项的层级别索引
* @value -1 全部
* @value -2 表示层级
* @value 其他 从最外层开始依次0,1,2,3……
* @return {Object} outF 导航条内部的方法
* @param {Function} isIre 设置是否搜索状态
* @param {Function} setTreeStack 设置导航树的值
* @param {Function} pushTreeStack 为导航树添加项
* @param {Function} clearTreeStack 清空导航树
*/
// scrollLeft : 暂时
export default {
name: "luyj-tree-navigation",
props: {
// 显示的label值
slabel: {
type: String,
default: 'label'
},
},
data() {
return {
isre: false, // 是否进行了搜索(返回是否进行了搜索)
treeStack: [], // 当前搜索值
}
},
computed: {
// 是否可点击搜索结果
activeSearch() {
return this.treeStack.length > 0;
}
},
created() {
// 浅拷贝导航列表的每一个对象为了不改变item值也不复制过多的数据
this.treeStack.forEach(item => {
let tempItem = Object.assign(item);
this.treeStack.push(tempItem);
});
let obj = {
setIsre: this.setIsre,
getIsre: this.getIsre,
setTreeStack: this.setTreeStack,
concatTreeStack: this.concatTreeStack,
pushTreeStack: this.pushTreeStack,
clearTreeStack: this.clearTreeStack,
getTreeStack: this.getTreeStack
};
this.$emit("inF", obj); // 导出的导航栏调用方法
},
methods: {
// ================================== 初始化时导出方法(用于外部调用内部结果) =========================================================
/** 设置isre值(是否搜索)
* @param {Boolean} isre 设置是否搜索
*/
setIsre(isre) {
this.isre = isre;
},
/**
* 获取isr值获取是否搜索中
*/
getIsre() {
return this.isre;
},
/** 设置导航树
* @param {Array} treeStack 导航树
*/
setTreeStack(treeStack) {
this.treeStack = treeStack;
},
/** 拼接导航树
* @param {Object} treeStack 导航树
*/
concatTreeStack(treeStack) {
this.treeStack = this.treeStack.concat(treeStack);
},
/** 为导航树添加项
* @param {Object} item 待添加的对象
*/
pushTreeStack(item) {
this.treeStack.push(item);
},
/**
* 获取当前导航条
*/
getTreeStack() {
return this.treeStack;
},
/**
* 清空导航树
*/
clearTreeStack() {
this.treeStack.splice(0);
},
// ================================== 监听事件 ===========================================================
/** 点击导航栏索引
* @param {Object} item 当前层的值
* @param {Number} index 索引值
*/
clickItem(item, index) {
if (index == -1) {
// 点击全部
this.isre = false;
this.treeStack.splice(0);
} else if (index == -2) {
// 搜索结果
if (this.activeSearch) {
this.isre = true;
this.treeStack.splice(0);
}
} else {
// 点击某一层级树
this.isre = false;
if (this.treeStack.length - 1 > index) {
this.treeStack.splice(index + 1);
}
}
this.$emit("clickItem", item, index);
},
},
// ============================================================================================================
}
</script>
<style lang="scss" scoped>
@import "navigation.scss";
@import "icon.css";
</style>

View File

@@ -0,0 +1,342 @@
@font-face {
font-family: "iconfont"; /* Project id 2009600 */
src: url('https://at.alicdn.com/t/font_2009600_gpzp7pxtnw.woff2?t=1620633089023') format('woff2'),
url('https://at.alicdn.com/t/font_2009600_gpzp7pxtnw.woff?t=1620633089023') format('woff'),
url('https://at.alicdn.com/t/font_2009600_gpzp7pxtnw.ttf?t=1620633089023') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-banxuanzhongshousuo1-shi:before {
content: "\e682";
}
.icon-xuanzhong3:before {
content: "\e6bb";
}
.icon-weixuanzhong2:before {
content: "\e62e";
}
.icon-danxuanxuanzhong:before {
content: "\e631";
}
.icon-xuanzhong4:before {
content: "\e63e";
}
.icon-xuanzhong1:before {
content: "\e62d";
}
.icon-xuanzhong2:before {
content: "\e656";
}
.icon-selected:before {
content: "\e615";
}
.icon-weixuanzhong1:before {
content: "\e614";
}
.icon-xingzhuang6kaobei3-copy-copy:before {
content: "\e613";
}
.icon-radio-checked:before {
content: "\e63f";
}
.icon-huifu:before {
content: "\e619";
}
.icon-dizhi:before {
content: "\e64a";
}
.icon-kuaijiecaidan:before {
content: "\e60a";
}
.icon-z043:before {
content: "\e62f";
}
.icon-guanbi:before {
content: "\e607";
}
.icon-xuanze:before {
content: "\e623";
}
.icon-caidanzhaolinggan:before {
content: "\e616";
}
.icon-xitongshezhi:before {
content: "\e60c";
}
.icon-xitongshezhi1:before {
content: "\e633";
}
.icon-lunbo:before {
content: "\e692";
}
.icon-shuping:before {
content: "\e659";
}
.icon-tongzhi:before {
content: "\e641";
}
.icon-pinglunguanlishezhi:before {
content: "\e6ac";
}
.icon-icon:before {
content: "\e600";
}
.icon-liuyanguanli:before {
content: "\e61d";
}
.icon-xuanzhong:before {
content: "\e669";
}
.icon--:before {
content: "\e622";
}
.icon-tushu:before {
content: "\e604";
}
.icon-huishouzhan:before {
content: "\e61c";
}
.icon-yonghutouxiang:before {
content: "\e617";
}
.icon-liebiao:before {
content: "\e630";
}
.icon-fenlei:before {
content: "\e621";
}
.icon-tushu1:before {
content: "\e605";
}
.icon-tubiao-:before {
content: "\e620";
}
.icon-weixuanze:before {
content: "\e624";
}
.icon-tushujieyue:before {
content: "\e690";
}
.icon-lunbo1:before {
content: "\e6c5";
}
.icon-shanchu:before {
content: "\e67b";
}
.icon-lunbo2:before {
content: "\e61e";
}
.icon-huaban:before {
content: "\e663";
}
.icon-kehuan:before {
content: "\e608";
}
.icon-icon02:before {
content: "\e601";
}
.icon-huishouzhan1:before {
content: "\e612";
}
.icon-huishouzhan2:before {
content: "\e63d";
}
.icon-sousuo:before {
content: "\e62c";
}
.icon-xingzhuang:before {
content: "\e625";
}
.icon-lunbobankuai:before {
content: "\e61f";
}
.icon-shangchuan:before {
content: "\e602";
}
.icon-yonghu:before {
content: "\e761";
}
.icon-tongzhi1:before {
content: "\e603";
}
.icon-jingsong:before {
content: "\e65c";
}
.icon-fenlei1:before {
content: "\e6c6";
}
.icon-xieshupingicon:before {
content: "\e72d";
}
.icon-liuyan:before {
content: "\e626";
}
.icon-weixuanzhong:before {
content: "\e627";
}
.icon-youxiang:before {
content: "\e646";
}
.icon-lunboguanggao:before {
content: "\e6b3";
}
.icon-xuanze1:before {
content: "\e60d";
}
.icon-chushaixuanxiang:before {
content: "\e606";
}
.icon-liuyanguanli1:before {
content: "\e61a";
}
.icon-shanchu1:before {
content: "\e609";
}
.icon-huishouzhan3:before {
content: "\e642";
}
.icon-shangchuan1:before {
content: "\e823";
}
.icon-huishouzhan4:before {
content: "\e61b";
}
.icon-chuangzuo:before {
content: "\e8ad";
}
.icon-dianzan:before {
content: "\e8ae";
}
.icon-paihangbang:before {
content: "\e8b3";
}
.icon-shouye:before {
content: "\e8b9";
}
.icon-shoucang:before {
content: "\e8c6";
}
.icon-addApp:before {
content: "\e60b";
}
.icon-huishouzhan5:before {
content: "\e63a";
}
.icon-add1:before {
content: "\e60e";
}
.icon-shoucang1:before {
content: "\e60f";
}
.icon-canshutongji:before {
content: "\e618";
}
.icon-rizhiguanli:before {
content: "\e628";
}
.icon-shanchu2:before {
content: "\e629";
}
.icon-xinzeng:before {
content: "\e62a";
}
.icon-zhankailiebiao:before {
content: "\e62b";
}
.icon-xiala-copy:before {
content: "\e610";
}
.icon-shangla:before {
content: "\e64e";
}
.icon-xianxingshezhi:before {
content: "\e611";
}

View File

@@ -0,0 +1,309 @@
<template>
<view class="document-v" :style="{'padding-bottom': show ? '88rpx' : '0','overflow':showAddSelect?'hidden':''}">
<view class="u-flex top-btn" :class="slide2" v-show="show && current !== 1">
<view class="button-left" @click.stop="bottomfun('cancel')">
<p class="u-m-t-10 u-font-28">取消</p>
</view>
<view class="button-center" @click.stop="bottomfun('select')">
<p class="u-m-t-10 u-font-28">已选中{{this.selectFiles.length}}文件</p>
</view>
<view class="button-right u-m-t-12" @click.stop="bottomfun('checkAll')">
<p class="icon-ym icon-ym-app-checkAll " :style="{'color':this.checkedAll ? '#0293fc' : '#303133'}">
</p>
</view>
</view>
<NaviGation @inF="navigationInt" @clickItem="backTree" :slabel="props.label" ref="NaviGation"></NaviGation>
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
:up="upOption" :bottombar="false" @init="mescrollInit" top="20">
<DocList v-model="changeStyle" :documentList="documentList" @goDetail="goDetail"
@checkboxChange="checkboxChange"></DocList>
</mescroll-body>
<view class="com-addBtn" @click="addFolder()" v-if="!selectFiles.length && current == 0">
<u-icon name="plus" size="48" color="#fff" />
</view>
<view class="u-flex bottom-btn" :class="slide" v-show="show && current !== 1">
<template v-if="current == 0">
<view class="button-preIcon" @click.stop="bottomfun('down')">
<p class="icon-ym icon-ym-app-download u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">下载</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('share')">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">共享</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('delete')">
<p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">删除</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('move')">
<p class="icon-ym icon-ym-app-move u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">移动到</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('restName')" v-if="this.selectFiles.length === 1">
<p class="icon-ym icon-ym-app-rename u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">重命名</p>
</view>
</template>
<template v-if="current == 2">
<view class="button-preIcon" @click.stop="bottomfun('down')">
<p class="icon-ym icon-ym-app-download u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">下载</p>
</view>
</template>
<template v-if="current == 1">
<view class="button-preIcon" @click.stop="bottomfun('shareCancel')">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">取消共享</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('share')">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">共享</p>
</view>
</template>
<template v-if="current == 3">
<view class="button-preIcon" @click.stop="bottomfun('revert')">
<p class="icon-ym icon-ym-recovery u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">还原</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('delete')">
<p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">删除</p>
</view>
</template>
</view>
<!-- 重命名弹窗 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="modalTitle" v-model="modalValue" placeholder="请输入内容"
before-close @confirm="restName" @close="closeDialog"></uni-popup-dialog>
</uni-popup>
<treeCollapse :show="showApply" v-if="showApply" :treeData="folderTreeList" @change="handelClick" mode="right"
@close="close" width="100%" type="doc">
<view class="u-flex u-p-l-32 u-p-r-32" style="justify-content: space-between;height: 88rpx;">
<text style="color: #2979ff;" @click="close()">取消</text>
<text>移动到</text>
<text style="color: #2979ff;" v-if="selectFiles.length" @click="folderMove">移动到此</text>
</view>
</treeCollapse>
<JnpfUsersSelect ref="JnpfUsersSelect" @change="shareSubmit" v-model="usersSelectValue" :isInput="false" />
<AddFilePopup v-if="showAddFilePopup" :show="showAddSelect" @confirm="addSelect" @close="showAddSelect = false"
title="新建" :confirmBtn="false" @onCallback="onCallback" :parentId="parentId"></AddFilePopup>
</view>
</template>
<script>
import {
getDocumentList,
trash,
shareFolder,
shareTome
} from "@/api/workFlow/document";
import treeCollapse from '@/components/treeCollapse'
import AddFilePopup from './components/AddFilePopup.vue'
import NaviGation from './components/navigation/NaviGation.vue'
import DocList from './components/DocList.vue'
import mixin from "./mixin.js"
export default {
mixins: [mixin],
components: {
NaviGation,
DocList,
treeCollapse,
AddFilePopup,
},
data() {
return {
showAddFilePopup: false,
showModal: false,
show: false,
detailList: [],
keyword: '',
documentList: [],
changeStyle: true,
parentId: 0,
props: {
id: 'id',
label: 'fullName',
children: 'children',
multiple: false,
checkStrictly: false, //不关联
nodes: false, // nodes为false时可以选择任意一级选项nodes为true时只能选择叶子节点
}
}
},
onLoad(e) {
let config = JSON.parse(e.config)
this.config = JSON.parse(JSON.stringify(config))
this.parentId = this.config.id
this.$nextTick(() => {
this.$refs.NaviGation.pushTreeStack(this.config);
})
this.init()
},
watch: {
// 在select弹起的时候重新初始化所有数据
selectFiles: {
handler(val) {
if (!val.length) {
setTimeout(() => {
this.show = false
}, 500)
}
if (val.length === this.documentList.length) {
this.checkedAll = true
} else {
this.checkedAll = false
}
},
immediate: true
},
},
methods: {
init() {
this.isDetail = true
this.current = this.config.current
this.changeStyle = this.config.changeStyle
this.setTitle(this.config.fullName)
this.showAddFilePopup = true
},
navigationInt(e) {
this.pushTreeStack = e.pushTreeStack;
},
backTree(item, index) {
if (index === -1) {
this.isDetail = false
uni.navigateBack()
return
}
if (item.id === this.parentId) return
this.parentId = item.id
this.setTitle(item.fullName)
this.resetList()
},
setTitle(fullName) {
uni.setNavigationBarTitle({
title: fullName
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f0f2f6;
}
.document-v {
padding-bottom: 88rpx;
height: calc(100vh - 288rpx);
::v-deep .mescroll-empty {
padding-top: 400rpx;
}
::v-deep .u-model__title {
padding: 20rpx 0;
}
::v-deep .u-model__footer__button {
border-right: 1rpx solid #e4e7ed;
height: 76rpx;
line-height: 76rpx;
font-size: 28rpx;
}
.top-btn {
height: 80rpx;
position: fixed;
width: 100%;
top: 0;
left: 0;
background-color: #fff;
z-index: 9999;
justify-content: space-between;
padding: 0 20rpx;
.button-left {
color: #0293fc;
}
.button-right {
width: 30rpx;
height: 30rpx;
}
}
.slide-down2 {
animation: slide-down2 0.5s forwards;
opacity: 1;
transform: translateY(0);
}
.slide-up2 {
animation: slide-up2 0.5s forwards;
opacity: 0;
transform: translateY(-100%);
}
.slide-down {
animation: slide-down 0.5s forwards;
opacity: 1;
transform: translateY(0);
}
.slide-up {
animation: slide-up 0.5s forwards;
opacity: 0;
transform: translateY(100%);
}
.bottom-btn {
height: 100rpx;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
background-color: #0293fc;
z-index: 9;
justify-content: space-around;
.button-preIcon {
color: #fff;
text-align: center;
width: 20%;
}
}
@keyframes slide-up {
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-down {
to {
transform: translateY(100%);
opacity: 0;
}
}
@keyframes slide-up2 {
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-down2 {
to {
transform: translateY(-100%);
opacity: 0;
}
}
.com-addBtn {
bottom: 320rpx;
right: 66rpx;
}
}
</style>

View File

@@ -0,0 +1,298 @@
<template>
<view class="document-v" :style="{'padding-bottom': show ? '88rpx' : '0','overflow':showAddSelect?'hidden':''}">
<view class="u-flex top-btn" :class="slide2" v-show="show">
<view class="button-left" @click.stop="bottomfun('cancel')">
<p class="u-m-t-10 u-font-28">取消</p>
</view>
<view class="button-center" @click.stop="bottomfun('select')">
<p class="u-m-t-10 u-font-28">已选中{{this.selectFiles.length}}文件</p>
</view>
<view class="button-right u-m-t-12" @click.stop="bottomfun('checkAll')">
<p class="icon-ym icon-ym-app-checkAll " :style="{'color':this.checkedAll ? '#0293fc' : '#303133'}">
</p>
</view>
</view>
<DocHead @search="search" @change="change" @iconClick="iconClick" @mescrollTop="mescrollTop">
</DocHead>
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
:up="upOption" :bottombar="false" @init="mescrollInit" :top="top">
<DocList :modelValue="changeStyle" :documentList="documentList" @goDetail="goDetail"
@checkboxChange="checkboxChange"></DocList>
</mescroll-body>
<view class="com-addBtn" @click="addFolder()" v-if="!selectFiles.length && current == 0">
<u-icon name="plus" size="48" color="#fff" />
</view>
<view class="u-flex bottom-btn" :class="slide" v-show="show">
<template v-if="current == 0">
<!-- #ifdef H5 -->
<view class="button-preIcon" @click.stop="bottomfun('down')">
<p class="icon-ym icon-ym-app-download u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">下载</p>
</view>
<!-- #endif -->
<view class="button-preIcon" @click.stop="bottomfun('share')">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">共享</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('delete')">
<p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">删除</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('move')">
<p class="icon-ym icon-ym-app-move u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">移动到</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('restName')" v-if="this.selectFiles.length === 1">
<p class="icon-ym icon-ym-app-rename u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">重命名</p>
</view>
</template>
<!-- #ifdef H5 -->
<template v-if="current == 2">
<view class="button-preIcon" @click.stop="bottomfun('down')">
<p class="icon-ym icon-ym-app-download u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">下载</p>
</view>
</template>
<!-- #endif -->
<template v-if="current == 1">
<view class="button-preIcon" @click.stop="bottomfun('shareCancel')">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">取消共享</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('share')" v-if="this.selectFiles.length === 1">
<p class="icon-ym icon-ym-app-share u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">共享</p>
</view>
</template>
<template v-if="current == 3">
<view class="button-preIcon" @click.stop="bottomfun('revert')">
<p class="icon-ym icon-ym-recovery u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">还原</p>
</view>
<view class="button-preIcon" @click.stop="bottomfun('delete')">
<p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
<p class="u-m-t-10 u-font-24">删除</p>
</view>
</template>
</view>
<!-- 重命名弹窗 -->
<uni-popup ref="inputDialog" type="dialog" class="diyPopup">
<uni-popup-dialog ref="inputClose" mode="input" :title="modalTitle" placeholder="请输入内容" before-close
@confirm="restName" @close="closeDialog" class="popup-dialog">
<u-input v-model="modalValue" placeholder="请输入" :auto-height="false" maxlength="99999" height="150"
:clearable="true" :border="true" />
</uni-popup-dialog>
</uni-popup>
<treeCollapse :show="showApply" v-if="showApply" :treeData="folderTreeList" @change="handelClick" mode="right"
@close="close" width="100%" type="doc">
<view class="u-flex u-p-l-32 u-p-r-32" style="justify-content: space-between;height: 88rpx;">
<text style="color: #2979ff;" @click="close()">取消</text>
<text>移动到</text>
<text style="color: #2979ff;" v-if="selectFiles.length" @click="folderMove">移动到此</text>
</view>
</treeCollapse>
<JnpfUsersSelect ref="JnpfUsersSelect" @change="shareSubmit" :isInput="false" v-model="usersSelectValue" />
<AddFilePopup :show="showAddSelect" @confirm="addSelect" @close="showAddSelect = false" title="新建"
:confirmBtn="false" @onCallback="onCallback" :parentId="parentId"></AddFilePopup>
</view>
</template>
<script>
import treeCollapse from '@/components/treeCollapse'
import DocHead from './components/DocHead.vue'
import DocList from './components/DocList.vue'
import AddFilePopup from './components/AddFilePopup.vue'
import mixin from "./mixin.js"
export default {
mixins: [mixin],
components: {
DocHead,
DocList,
AddFilePopup,
treeCollapse
},
data() {
return {
documentList: [],
top: 0
}
},
onLoad(e) {
this.selectFiles = []
this.parentId = e.parentId ? e.parentId : 0
this.current = e.current ? Number(e.current) : 0
},
watch: {
// 在select弹起的时候重新初始化所有数据
selectFiles: {
handler(val) {
if (!val.length) {
setTimeout(() => {
this.show = false
}, 500)
}
if (val.length === this.documentList.length) {
this.checkedAll = true
} else {
this.checkedAll = false
}
},
immediate: true
}
},
methods: {
search(e) {
this.keyword = e
this.documentList = [];
this.mescroll.resetUpScroll();
},
mescrollTop(e) {
this.top = e + 10
}
}
}
</script>
<style lang="scss">
page {
background-color: #f0f2f6;
}
.document-v {
padding-bottom: 88rpx;
height: calc(100vh - 288rpx);
::v-deep .mescroll-empty {
padding-top: 400rpx;
}
::v-deep .u-model__title {
padding: 20rpx 0;
}
::v-deep .u-model__footer__button {
border-right: 1rpx solid #e4e7ed;
height: 76rpx;
line-height: 76rpx;
font-size: 28rpx;
}
.top-btn {
height: 80rpx;
position: fixed;
width: 100%;
top: 0;
left: 0;
background-color: #fff;
/* #ifdef MP-WEIXIN */
z-index: 99;
/* #endif */
/* #ifndef MP-WEIXIN */
z-index: 999;
/* #endif */
justify-content: space-between;
padding: 0 20rpx;
.button-left {
color: #0293fc;
}
.button-right {
width: 30rpx;
height: 30rpx;
}
}
.slide-down2 {
animation: slide-down2 0.5s forwards;
opacity: 1;
transform: translateY(0);
}
.slide-up2 {
animation: slide-up2 0.5s forwards;
opacity: 0;
transform: translateY(-100%);
}
.slide-down {
animation: slide-down 0.5s forwards;
opacity: 1;
transform: translateY(0);
}
.slide-up {
animation: slide-up 0.5s forwards;
opacity: 0;
transform: translateY(100%);
}
.bottom-btn {
height: 100rpx;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
background-color: #0293fc;
z-index: 9;
justify-content: space-around;
.button-preIcon {
color: #fff;
text-align: center;
width: 20%;
}
}
.diyPopup {
.popup-dialog {
.uni-dialog-title {
justify-content: center
}
.uni-dialog-content {
height: 160rpx;
.u-input {
height: 80rpx;
}
}
}
}
@keyframes slide-up {
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-down {
to {
transform: translateY(100%);
opacity: 0;
}
}
@keyframes slide-up2 {
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-down2 {
to {
transform: translateY(-100%);
opacity: 0;
}
}
.com-addBtn {
bottom: 320rpx;
right: 66rpx;
}
}
</style>

View File

@@ -0,0 +1,541 @@
import {
getDocumentList,
packDownload,
resetFileName,
batchDelete,
trash,
recovery,
trashDelete,
folderTree,
folderMove,
addFolder,
shareFolder,
shareFolderList,
shareTome,
shareUser,
shareAdjustment,
cancelShare,
fileDetail
} from "@/api/workFlow/document";
import resources from "@/libs/resources.js";
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import jnpf from '@/utils/jnpf'
const wordTypeList = ['doc', 'docx'];
const excelTypeList = ['xls', 'xlsx'];
const pptTypeList = ['ppt', 'pptx'];
const pdfTypeList = ['pdf'];
const zipTypeList = ['rar', 'zip', 'arj', 'z', '7z'];
const txtTypeList = ['txt', 'log'];
const codeTypeList = ['html', 'cs', 'xml'];
const imgTypeList = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
const videoTypeList = ['avi', 'wmv', 'mpg', 'mpeg', 'mov', 'rm', 'ram', 'swf', 'flv', 'mp4', 'mp3', 'wma', 'avi', 'rm',
'rmvb', 'flv', 'mpg', 'mkv'
];
const previewTypeList = [...wordTypeList, ...excelTypeList, ...pptTypeList, ...pdfTypeList];
export default {
mixins: [MescrollMixin],
data() {
return {
usersSelectValue: '',
isDetail: true,
showApply: false,
folderTreeList: [],
modalValue: '',
keyword: '',
current: 0,
show: false,
slide: '',
slide2: '',
changeStyle: true,
checkedAll: false,
parentId: 0,
wordImg: resources.document.wordImg,
excelImg: resources.document.excelImg,
pptImg: resources.document.pptImg,
pdfImg: resources.document.pdfImg,
rarImg: resources.document.rarImg,
txtImg: resources.document.txtImg,
codeImg: resources.document.codeImg,
imageImg: resources.document.imageImg,
audioImg: resources.document.audioImg,
blankImg: resources.document.blankImg,
folderImg: resources.document.folderImg,
downOption: {
use: true,
auto: true,
},
upOption: {
page: {
num: 0,
size: 50,
time: null,
},
empty: {
use: true,
icon: resources.message.nodata,
tip: this.$t('common.noData'),
fixed: false,
top: "560rpx",
},
textNoMore: this.$t('app.apply.noMoreData'),
toTop: {
bottom: 200,
right: 80
}
},
selectFolder: {},
moveId: '',
selectFiles: [],
modalType: 'restName',
showAddSelect: false,
selector: [{
fullName: '新建文件夹',
id: 1,
icon: 'icon-ym icon-ym-add-folder'
},
{
fullName: '上传文件',
id: 2,
icon: 'icon-ym icon-ym-generator-menu'
}
],
isDetail: false
}
},
computed: {
baseURL() {
return this.define.baseURL
},
modalTitle() {
return this.modalType === 'restName' ? '重命名文件' : '新建文件夹'
}
},
methods: {
onCallback(e) {
this.$u.toast(e.msg)
setTimeout(() => {
this.showAddSelect = false
this.resetList()
}, 1000)
},
addSelect(item) {
if (item == 'add') {
this.showAddSelect = false
this.$refs.inputDialog.open('center')
this.modalType = 'addFolder'
}
},
addFolder() {
this.modalValue = ''
this.showAddSelect = true
},
shareSubmit(e) {
let method = this.current === 1 ? shareAdjustment : shareFolder;
let data = {
ids: this.selectFiles,
userIds: e
}
method(data).then(res => {
this.resetList()
})
},
upCallback(page) {
let method;
switch (this.current) {
case 1:
method = shareFolderList
break;
case 3:
method = trash
break;
case 2:
method = shareTome
break;
default:
method = getDocumentList
break;
}
let query = {
keyword: this.keyword,
parentId: this.parentId
};
method(query).then(res => {
this.documentList = [];
this.selectFiles = []
const timeMap = ['creatorTime', 'shareTime', 'shareTime', 'deleteTime'];
const useTime = timeMap[this.current] ?? 'creatorTime'; // 添加默认值
const list = res.data.list.map(o => ({
...o,
time: o[useTime]
}));
this.documentList = this.documentList.concat(list);
this.mescroll.endSuccess(list.length);
})
},
downLoad(id) {
let data = {
ids: id ? id : this.selectFiles
}
packDownload(JSON.stringify(data)).then(res => {
// #ifdef H5
const fileUrl = this.baseURL + res.data.url + '&name=' + encodeURI(res.data.name);
window.location.href = fileUrl;
// #endif
// #ifdef MP-WEIXIN
this.previewFile(res.data)
// #endif
// #ifndef H5 || MP
this.downloadFile(res.data);
// #endif
})
},
handelClick(item) {
this.moveId = item.id == '-1' ? 0 : item.id
},
downloadFile(data) {
const {
url,
name
} = data;
const fileExt = name.split('.').pop().toLowerCase();
const handleDownload = () => {
uni.downloadFile({
url: `${this.baseURL}${url}&name=${name}`,
success: (res) => {
if (res.statusCode !== 200) return this.$u.toast('文件下载失败');
// #ifdef APP-HARMONY
openDocument(res.tempFilePath)
// #endif
// #ifndef APP-HARMONY
if (plus.os.name == 'iOS') {
openDocument(res.tempFilePath)
return
}
/* 安卓 */
uni.saveFile({
tempFilePath: res.tempFilePath,
success: red => {
uni.showToast({
icon: 'none',
mask: true,
title: '文件已保存:' + red.savedFilePath, //保存路径
duration: 3000,
});
},
fail(err) {
console.log(err, 547);
}
});
// #endif
},
fail: (err) => {
this.$u.toast('文件下载失败');
}
})
}
const openDocument = (filePath) => {
uni.openDocument({
filePath,
showMenu: true,
success: () => {},
fail: (err) => {
console.error('打开文档失败:', err);
this.$u.toast('文件打开失败');
}
});
}
handleDownload();
},
previewFile(item) {
let fileTypes = ['doc', 'xls', 'ppt', 'pdf', 'docx', 'xlsx', 'pptx', 'txt']
let fileType = item.name.split('.')[1]
if (fileTypes.includes(fileType)) {
uni.downloadFile({
url: `${this.baseURL}${ item.url}&name=${item.name}`,
success: (res) => {
let filePath = res.tempFilePath;
uni.openDocument({
filePath,
showMenu: true,
success: (res) => {}
});
}
});
} else {
this.$u.toast('该文件类型无法打开')
}
},
checkboxChange(e) {
if (e.length) {
this.slide = 'slide-up'
this.slide2 = 'slide-up2'
const {
platform
} = uni.getSystemInfoSync()
if (platform === 'ios' && this.current == 2) return this.show = false
this.show = true
} else {
this.slide = 'slide-down'
this.slide2 = 'slide-down2'
}
this.selectOperation(e)
},
change(e) {
this.current = e
this.parentId = 0
this.resetList()
},
bottomfun(type) {
if (type === 'down') this.downLoad()
if (type === 'restName') {
fileDetail(this.selectFiles[0]).then(res => {
this.modalValue = res?.data?.fullName || ''
this.modalType = 'restName'
this.$refs.inputDialog.open()
})
}
if (type === 'checkAll') this.checkedAllFun()
if (type === 'revert') this.recoveryOrDelete(type)
if (type === 'delete') this.recoveryOrDelete(type)
if (type === 'share') {
if (this.current == 1) return this.shareUser()
this.usersSelectValue = ''
this.$nextTick(() => {
this.$refs.JnpfUsersSelect.openSelect()
})
}
if (type === 'shareCancel') return this.cancelShare()
if (type === 'move') this.getFolderTree()
if (type === 'cancel') {
this.selectFiles = []
this.selectOperation(this.selectFiles)
}
},
cancelShare() {
uni.showModal({
title: '提示',
content: '您确定要取消共享, 是否继续?',
success: (res) => {
if (res.confirm) {
cancelShare({
ids: this.selectFiles
}).then(res => {
this.$u.toast(res.msg)
this.resetList()
})
}
}
});
},
shareUser() {
shareUser(this.selectFiles[0]).then(res => {
let list = res.data.list || []
const ids = list.map(item => item.shareUserId);
this.usersSelectValue = ids
this.$nextTick(() => {
this.$refs.JnpfUsersSelect.openSelect()
})
})
},
folderMove() {
let data = {
ids: this.selectFiles,
id: this.moveId
}
folderMove(data).then(res => {
this.selectFiles = []
this.close()
this.resetList()
})
},
iconClick() {
if (this.documentList.length) this.changeStyle = !this.changeStyle
},
close() {
this.showApply = false
},
checkedAllFun() {
this.checkedAll = !this.checkedAll
this.selectFiles = [];
this.documentList.forEach(o => {
if (this.checkedAll) {
this.$set(o, 'checked', true)
this.selectFiles.push(o.id);
} else {
this.$set(o, 'checked', false)
this.selectFiles = [];
}
})
},
goDetail(e) {
if (e.type == 0 && this.current != 3) {
if (!this.isDetail) {
let item = {
current: this.current,
changeStyle: this.changeStyle,
...e
}
this.selectFiles = []
this.selectOperation()
uni.navigateTo({
url: './detail?config=' + JSON.stringify(item),
});
} else {
this.parentId = e.id
this.setTitle(e.fullName)
this.pushTreeStack(e);
this.resetList()
}
} else {
if (imgTypeList.includes(e.fileExtension)) {
const images = jnpf.getAuthImgUrl(e.uploaderUrl, false);
uni.previewImage({
urls: [images],
success: (res) => {},
fail: (err) => {
uni.showToast({
title: '预览图片失败',
icon: 'none'
});
}
});
return
}
if (this.current !== 3) this.downLoad([e.id])
}
},
selectOperation(value) {
let items = this.documentList;
this.selectFiles = value || [];
for (let i = 0, lenI = items.length; i < lenI; ++i) {
const item = items[i]
if (this.selectFiles.includes(item.id)) {
this.$set(item, 'checked', true)
} else {
this.$set(item, 'checked', false)
}
}
},
getRecordImg(ext) {
if (!ext) return this.folderImg;
if (ext) ext = ext.replace('.', '');
if (wordTypeList.includes(ext)) return this.wordImg;
if (excelTypeList.includes(ext)) return this.excelImg;
if (pptTypeList.includes(ext)) return this.pptImg;
if (pdfTypeList.includes(ext)) return this.pdfImg;
if (zipTypeList.includes(ext)) return this.rarImg;
if (txtTypeList.includes(ext)) return this.txtImg;
if (codeTypeList.includes(ext)) return this.codeImg;
if (imgTypeList.includes(ext)) return this.imageImg;
if (videoTypeList.includes(ext)) return this.audioImg;
return this.blankImg;
},
getFolderTree() {
let data = {
ids: this.selectFiles
}
folderTree(data).then(res => {
this.showApply = true
this.folderTreeList = JSON.parse(JSON.stringify(res.data.list)) || []
const loop = (list, parent) => {
list.forEach(o => {
o.icon = 'icon-ym icon-ym-folder';
if (o && o.children && Array.isArray(o.children)) {
loop(o.children, o)
}
})
}
loop(this.folderTreeList)
})
},
recoveryOrDelete(type) {
let data = {
ids: this.selectFiles
}
let content = '确定要还原选中的文件吗'
let method = recovery
if (type !== 'revert') {
content = '删除后,放入回收站!'
method = batchDelete
if (type === 'delete' && this.current == 3) {
content = '删除后数据无法恢复'
method = trashDelete
}
}
uni.showModal({
title: '提示',
content,
success: (res) => {
if (res.confirm) {
this.$nextTick(() => {
method(JSON.stringify(data)).then(res => {
this.$u.toast(res.msg)
setTimeout(() => {
this.$nextTick(() => {
this.documentList = [];
this.selectFiles = []
this.mescroll.resetUpScroll();
})
}, 1000)
})
})
}
}
});
},
/* 新建文件 */
handleAddFolder() {
let item = {
id: '',
parentId: this.parentId,
type: 0,
fullName: this.modalValue
}
addFolder(item).then(res => {
this.modalType = 'restName'
this.closeDialog()
this.resetList()
})
},
/* 重命名 */
closeDialog() {
this.$refs.inputDialog.close()
},
restName(e) {
let txt = this.modalType === 'addFolder' ? '文件夹名称不能为空' : '文件名不能为空'
if (!this.modalValue) return this.$u.toast(txt)
if (this.modalType === 'addFolder') return this.handleAddFolder()
if (this.modalType === 'restName') return this.handleRestName()
},
handleRestName() {
let item = {}
this.documentList.forEach(o => {
if (o.id === this.selectFiles[0]) item = {
id: o.id,
parentId: this.parentId,
type: o.type,
fullName: this.modalValue
}
})
resetFileName(item).then(res => {
this.selectFiles = []
this.closeDialog()
this.resetList()
})
},
resetList() {
this.$nextTick(() => {
this.selectFiles = []
this.documentList = [];
this.mescroll.resetUpScroll();
})
},
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB