detail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="document-v" :style="{'padding-bottom': show ? '88rpx' : '0','overflow':showAddSelect?'hidden':''}">
  3. <view class="u-flex top-btn" :class="slide2" v-show="show && current !== 1">
  4. <view class="button-left" @click.stop="bottomfun('cancel')">
  5. <p class="u-m-t-10 u-font-28">取消</p>
  6. </view>
  7. <view class="button-center" @click.stop="bottomfun('select')">
  8. <p class="u-m-t-10 u-font-28">已选中{{this.selectFiles.length}}文件</p>
  9. </view>
  10. <view class="button-right u-m-t-12" @click.stop="bottomfun('checkAll')">
  11. <p class="icon-ym icon-ym-app-checkAll " :style="{'color':this.checkedAll ? '#0293fc' : '#303133'}">
  12. </p>
  13. </view>
  14. </view>
  15. <NaviGation @inF="navigationInt" @clickItem="backTree" :slabel="props.label" ref="NaviGation"></NaviGation>
  16. <mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
  17. :up="upOption" :bottombar="false" @init="mescrollInit" top="20">
  18. <DocList v-model="changeStyle" :documentList="documentList" @goDetail="goDetail"
  19. @checkboxChange="checkboxChange"></DocList>
  20. </mescroll-body>
  21. <view class="com-addBtn" @click="addFolder()" v-if="!selectFiles.length && current == 0">
  22. <u-icon name="plus" size="48" color="#fff" />
  23. </view>
  24. <view class="u-flex bottom-btn" :class="slide" v-show="show && current !== 1">
  25. <template v-if="current == 0">
  26. <view class="button-preIcon" @click.stop="bottomfun('down')">
  27. <p class="icon-ym icon-ym-app-download u-m-b-8"></p>
  28. <p class="u-m-t-10 u-font-24">下载</p>
  29. </view>
  30. <view class="button-preIcon" @click.stop="bottomfun('share')">
  31. <p class="icon-ym icon-ym-app-share u-m-b-8"></p>
  32. <p class="u-m-t-10 u-font-24">共享</p>
  33. </view>
  34. <view class="button-preIcon" @click.stop="bottomfun('delete')">
  35. <p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
  36. <p class="u-m-t-10 u-font-24">删除</p>
  37. </view>
  38. <view class="button-preIcon" @click.stop="bottomfun('move')">
  39. <p class="icon-ym icon-ym-app-move u-m-b-8"></p>
  40. <p class="u-m-t-10 u-font-24">移动到</p>
  41. </view>
  42. <view class="button-preIcon" @click.stop="bottomfun('restName')" v-if="this.selectFiles.length === 1">
  43. <p class="icon-ym icon-ym-app-rename u-m-b-8"></p>
  44. <p class="u-m-t-10 u-font-24">重命名</p>
  45. </view>
  46. </template>
  47. <template v-if="current == 2">
  48. <view class="button-preIcon" @click.stop="bottomfun('down')">
  49. <p class="icon-ym icon-ym-app-download u-m-b-8"></p>
  50. <p class="u-m-t-10 u-font-24">下载</p>
  51. </view>
  52. </template>
  53. <template v-if="current == 1">
  54. <view class="button-preIcon" @click.stop="bottomfun('shareCancel')">
  55. <p class="icon-ym icon-ym-app-share u-m-b-8"></p>
  56. <p class="u-m-t-10 u-font-24">取消共享</p>
  57. </view>
  58. <view class="button-preIcon" @click.stop="bottomfun('share')">
  59. <p class="icon-ym icon-ym-app-share u-m-b-8"></p>
  60. <p class="u-m-t-10 u-font-24">共享</p>
  61. </view>
  62. </template>
  63. <template v-if="current == 3">
  64. <view class="button-preIcon" @click.stop="bottomfun('revert')">
  65. <p class="icon-ym icon-ym-recovery u-m-b-8"></p>
  66. <p class="u-m-t-10 u-font-24">还原</p>
  67. </view>
  68. <view class="button-preIcon" @click.stop="bottomfun('delete')">
  69. <p class="icon-ym icon-ym-app-delete u-m-b-8"></p>
  70. <p class="u-m-t-10 u-font-24">删除</p>
  71. </view>
  72. </template>
  73. </view>
  74. <!-- 重命名弹窗 -->
  75. <uni-popup ref="inputDialog" type="dialog">
  76. <uni-popup-dialog ref="inputClose" mode="input" :title="modalTitle" v-model="modalValue" placeholder="请输入内容"
  77. before-close @confirm="restName" @close="closeDialog"></uni-popup-dialog>
  78. </uni-popup>
  79. <treeCollapse :show="showApply" v-if="showApply" :treeData="folderTreeList" @change="handelClick" mode="right"
  80. @close="close" width="100%" type="doc">
  81. <view class="u-flex u-p-l-32 u-p-r-32" style="justify-content: space-between;height: 88rpx;">
  82. <text style="color: #2979ff;" @click="close()">取消</text>
  83. <text>移动到</text>
  84. <text style="color: #2979ff;" v-if="selectFiles.length" @click="folderMove">移动到此</text>
  85. </view>
  86. </treeCollapse>
  87. <JnpfUserSelect ref="JnpfUsersSelect" multiple @change="shareSubmit" v-model="usersSelectValue"
  88. :isInput="false" />
  89. <AddFilePopup v-if="showAddFilePopup" :show="showAddSelect" @confirm="addSelect" @close="showAddSelect = false"
  90. title="新建" :confirmBtn="false" @onCallback="onCallback" :parentId="parentId"></AddFilePopup>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. getDocumentList,
  96. trash,
  97. shareFolder,
  98. shareTome
  99. } from "@/api/workFlow/document";
  100. import treeCollapse from '@/components/treeCollapse'
  101. import AddFilePopup from './components/AddFilePopup.vue'
  102. import NaviGation from './components/navigation/NaviGation.vue'
  103. import DocList from './components/DocList.vue'
  104. import mixin from "./mixin.js"
  105. export default {
  106. mixins: [mixin],
  107. components: {
  108. NaviGation,
  109. DocList,
  110. treeCollapse,
  111. AddFilePopup,
  112. },
  113. data() {
  114. return {
  115. showAddFilePopup: false,
  116. showModal: false,
  117. show: false,
  118. detailList: [],
  119. keyword: '',
  120. documentList: [],
  121. changeStyle: true,
  122. parentId: 0,
  123. props: {
  124. id: 'id',
  125. label: 'fullName',
  126. children: 'children',
  127. multiple: false,
  128. checkStrictly: false, //不关联
  129. nodes: false, // nodes为false时,可以选择任意一级选项;nodes为true时只能选择叶子节点
  130. }
  131. }
  132. },
  133. onLoad(e) {
  134. let config = JSON.parse(e.config)
  135. this.config = JSON.parse(JSON.stringify(config))
  136. this.parentId = this.config.id
  137. this.$nextTick(() => {
  138. this.$refs.NaviGation.pushTreeStack(this.config);
  139. })
  140. this.init()
  141. },
  142. watch: {
  143. // 在select弹起的时候,重新初始化所有数据
  144. selectFiles: {
  145. handler(val) {
  146. if (!val.length) {
  147. setTimeout(() => {
  148. this.show = false
  149. }, 500)
  150. }
  151. if (val.length === this.documentList.length) {
  152. this.checkedAll = true
  153. } else {
  154. this.checkedAll = false
  155. }
  156. },
  157. immediate: true
  158. },
  159. },
  160. methods: {
  161. init() {
  162. this.isDetail = true
  163. this.current = this.config.current
  164. this.changeStyle = this.config.changeStyle
  165. this.setTitle(this.config.fullName)
  166. this.showAddFilePopup = true
  167. },
  168. navigationInt(e) {
  169. this.pushTreeStack = e.pushTreeStack;
  170. },
  171. backTree(item, index) {
  172. if (index === -1) {
  173. this.isDetail = false
  174. uni.navigateBack()
  175. return
  176. }
  177. if (item.id === this.parentId) return
  178. this.parentId = item.id
  179. this.setTitle(item.fullName)
  180. this.resetList()
  181. },
  182. setTitle(fullName) {
  183. uni.setNavigationBarTitle({
  184. title: fullName
  185. })
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. page {
  192. background-color: #f0f2f6;
  193. }
  194. .document-v {
  195. padding-bottom: 88rpx;
  196. height: calc(100vh - 288rpx);
  197. ::v-deep .mescroll-empty {
  198. padding-top: 400rpx;
  199. }
  200. ::v-deep .u-model__title {
  201. padding: 20rpx 0;
  202. }
  203. ::v-deep .u-model__footer__button {
  204. border-right: 1rpx solid #e4e7ed;
  205. height: 76rpx;
  206. line-height: 76rpx;
  207. font-size: 28rpx;
  208. }
  209. .top-btn {
  210. height: 80rpx;
  211. position: fixed;
  212. width: 100%;
  213. top: 0;
  214. left: 0;
  215. background-color: #fff;
  216. z-index: 9999;
  217. justify-content: space-between;
  218. padding: 0 20rpx;
  219. .button-left {
  220. color: #0293fc;
  221. }
  222. .button-right {
  223. width: 30rpx;
  224. height: 30rpx;
  225. }
  226. }
  227. .slide-down2 {
  228. animation: slide-down2 0.5s forwards;
  229. opacity: 1;
  230. transform: translateY(0);
  231. }
  232. .slide-up2 {
  233. animation: slide-up2 0.5s forwards;
  234. opacity: 0;
  235. transform: translateY(-100%);
  236. }
  237. .slide-down {
  238. animation: slide-down 0.5s forwards;
  239. opacity: 1;
  240. transform: translateY(0);
  241. }
  242. .slide-up {
  243. animation: slide-up 0.5s forwards;
  244. opacity: 0;
  245. transform: translateY(100%);
  246. }
  247. .bottom-btn {
  248. height: 100rpx;
  249. position: fixed;
  250. width: 100%;
  251. bottom: 0;
  252. left: 0;
  253. background-color: #0293fc;
  254. z-index: 9;
  255. justify-content: space-around;
  256. .button-preIcon {
  257. color: #fff;
  258. text-align: center;
  259. width: 20%;
  260. }
  261. }
  262. @keyframes slide-up {
  263. to {
  264. transform: translateY(0);
  265. opacity: 1;
  266. }
  267. }
  268. @keyframes slide-down {
  269. to {
  270. transform: translateY(100%);
  271. opacity: 0;
  272. }
  273. }
  274. @keyframes slide-up2 {
  275. to {
  276. transform: translateY(0);
  277. opacity: 1;
  278. }
  279. }
  280. @keyframes slide-down2 {
  281. to {
  282. transform: translateY(-100%);
  283. opacity: 0;
  284. }
  285. }
  286. .com-addBtn {
  287. bottom: 320rpx;
  288. right: 66rpx;
  289. }
  290. }
  291. </style>