|
|
@@ -1,59 +1,62 @@
|
|
|
<template>
|
|
|
- <view class="mainBox">
|
|
|
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="选择" @clickLeft="back">
|
|
|
- <!--右菜单-->
|
|
|
- <template slot="right">
|
|
|
- <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
|
|
|
- text="文件夹"></u-button>
|
|
|
- </template>
|
|
|
- </uni-nav-bar>
|
|
|
-
|
|
|
- <view class="wrapper">
|
|
|
- <u-list class="listContent">
|
|
|
- <checkbox-group v-for="(item, index) in listData" :key="index" @change="e => selectVal(e, item, index)">
|
|
|
- <label>
|
|
|
- <view class="listBox">
|
|
|
- <view class="listBox-sel">
|
|
|
- <checkbox :value="item.code" color="#fff" :disabled="item.disabled"
|
|
|
- :checked="item.checked" />
|
|
|
- </view>
|
|
|
- <view class="listBox-con">
|
|
|
- <view class="listBox-top">
|
|
|
- <view class="listBox-name">
|
|
|
- {{ item.name }}
|
|
|
- </view>
|
|
|
- <view class="listBox-code">
|
|
|
- {{ item.code }}
|
|
|
- </view>
|
|
|
+ <u-popup :show="show" @close="cancel" :closeable="false">
|
|
|
+ <view class="mainBox">
|
|
|
+ <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="选择" @clickLeft="cancel">
|
|
|
+ <!--右菜单-->
|
|
|
+ <template slot="right">
|
|
|
+ <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
|
|
|
+ text="文件夹"></u-button>
|
|
|
+ </template>
|
|
|
+ </uni-nav-bar>
|
|
|
+
|
|
|
+ <view class="wrapper">
|
|
|
+ <u-list class="listContent">
|
|
|
+ <checkbox-group v-for="(item, index) in listData" :key="index"
|
|
|
+ @change="e => selectVal(e, item, index)">
|
|
|
+ <label>
|
|
|
+ <view class="listBox">
|
|
|
+ <view class="listBox-sel">
|
|
|
+ <checkbox :value="item.code" color="#fff" :disabled="item.disabled"
|
|
|
+ :checked="item.checked" />
|
|
|
</view>
|
|
|
- <view class="listBox-bottom">
|
|
|
- <view>文件名称:{{ item.storagePath[0].name }}</view>
|
|
|
- <view>版本:{{ item.version }}</view>
|
|
|
- <view>创建人:{{ item.createUserName }}</view>
|
|
|
- <view>创建时间:{{ item.createTime }}</view>
|
|
|
+ <view class="listBox-con">
|
|
|
+ <view class="listBox-top">
|
|
|
+ <view class="listBox-name">
|
|
|
+ {{ item.name }}
|
|
|
+ </view>
|
|
|
+ <view class="listBox-code">
|
|
|
+ {{ item.code }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="listBox-bottom">
|
|
|
+ <view>文件名称:{{ item.storagePath[0].name }}</view>
|
|
|
+ <view>版本:{{ item.version }}</view>
|
|
|
+ <view>创建人:{{ item.createUserName }}</view>
|
|
|
+ <view>创建时间:{{ item.createTime }}</view>
|
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </label>
|
|
|
- </checkbox-group>
|
|
|
- <u-empty class="noDate" style="margin-top: 20vh" v-if="!listData.length"></u-empty>
|
|
|
- </u-list>
|
|
|
- </view>
|
|
|
+ </label>
|
|
|
+ </checkbox-group>
|
|
|
+ <u-empty class="noDate" style="margin-top: 20vh" v-if="!listData.length"></u-empty>
|
|
|
+ </u-list>
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="footer">
|
|
|
- <view class="bottom" v-if="this.isAll==1">
|
|
|
- <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
|
|
|
- <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
|
|
|
- </checkbox>
|
|
|
+ <view class="footer">
|
|
|
+ <view class="bottom" v-if="this.isAll==1">
|
|
|
+ <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
|
|
|
+ <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
|
|
|
+ </checkbox>
|
|
|
+ </view>
|
|
|
+ <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
|
|
|
+ <view class="selBtn">选择( {{ checkListLen }} )</view>
|
|
|
+ </u-button>
|
|
|
</view>
|
|
|
- <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
|
|
|
- <view class="selBtn">选择( {{ checkListLen }} )</view>
|
|
|
- </u-button>
|
|
|
+ <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择文件夹"
|
|
|
+ :localdata="classificationList" valueKey="id" textKey="name" childrenKey='sonDirectoryList' />
|
|
|
</view>
|
|
|
- <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择文件夹"
|
|
|
- :localdata="classificationList" valueKey="id" textKey="name" childrenKey='sonDirectoryList' />
|
|
|
- </view>
|
|
|
+ </u-popup>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -80,7 +83,8 @@
|
|
|
classificationList: [], //分类数据
|
|
|
seletedAll: false, //全选状态,
|
|
|
isAll: '',
|
|
|
- fileId:[]
|
|
|
+ fileId: [],
|
|
|
+ show: false
|
|
|
|
|
|
}
|
|
|
},
|
|
|
@@ -93,17 +97,22 @@
|
|
|
},
|
|
|
|
|
|
},
|
|
|
- onLoad({
|
|
|
- isAll,fileId
|
|
|
- }) {
|
|
|
- this.isAll = isAll //1多选 2单选
|
|
|
- this.fileId=JSON.parse(fileId)
|
|
|
- this.userInfo = uni.getStorageSync('userInfo')
|
|
|
- this.getClassify()
|
|
|
- },
|
|
|
+
|
|
|
onShow() {},
|
|
|
methods: {
|
|
|
-
|
|
|
+ open(isAll, fileId) {
|
|
|
+ this.isAll = isAll //1多选 2单选
|
|
|
+ this.fileId = fileId
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo')
|
|
|
+ this.getClassify()
|
|
|
+ this.show = true
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.fileId = []
|
|
|
+ this.userInfo = ''
|
|
|
+ this.listData = []
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
//列表数据
|
|
|
async getList() {
|
|
|
this._getClassifyList()
|
|
|
@@ -120,9 +129,9 @@
|
|
|
filePageAPI(params).then(res => {
|
|
|
uni.hideLoading()
|
|
|
|
|
|
- this.listData = res.list.map(item=>{
|
|
|
- if(this.fileId.includes(item.id)){
|
|
|
- item['disabled']=true
|
|
|
+ this.listData = res.list.map(item => {
|
|
|
+ if (this.fileId.includes(item.id)) {
|
|
|
+ item['disabled'] = true
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
|
@@ -139,13 +148,14 @@
|
|
|
currentUserId: this.userInfo.userId
|
|
|
}).then(res => {
|
|
|
this.classificationList = res
|
|
|
- this.categoryLevelId=res[0].id
|
|
|
- console.log(this.classificationList, 'this.classificationList')
|
|
|
+ this.categoryLevelId = res[0].id
|
|
|
+
|
|
|
|
|
|
this.getList()
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+
|
|
|
//勾选
|
|
|
selectVal(e, val, index) {
|
|
|
|
|
|
@@ -177,19 +187,16 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //跳转回添加页面
|
|
|
+
|
|
|
jumpAdd() {
|
|
|
- uni.$emit(
|
|
|
- 'setDocList',
|
|
|
- this.listData.filter(item => item.checked).map(item=>item.id)
|
|
|
+ this.$emit(
|
|
|
+ 'success',
|
|
|
+ this.listData.filter(item => item.checked).map(item => item.id)
|
|
|
)
|
|
|
|
|
|
- uni.navigateBack()
|
|
|
+ this.cancel()
|
|
|
},
|
|
|
- //返回添加页
|
|
|
- backAdd() {
|
|
|
- uni.navigateBack()
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|