list.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <div class="contentDataMain">
  3. <div class="userTop">
  4. <div class="userMidle">
  5. <p class="userMidleName">{{ dataDetail.title }}</p>
  6. <p class="userMidleNum"><span>上传文件数量</span><span>{{ dataDetail.contentTotal }}</span></p>
  7. </div>
  8. </div>
  9. <div class="tabBoxContent" style="display: none;">
  10. <div v-for="(item, index) in dataDetail.routes" :key="index" @click="changeAction(index)">
  11. <span>{{item.name.length>5?item.name.substr(0,5)+'...':item.name}}{{ item.state==0?'(未完成)':'(已完成)' }}</span>
  12. <img v-if="tapAction==index" src="../../../../image/tabAction.png"/>
  13. </div>
  14. </div>
  15. <a-tabs default-active-key="1" @change="changeAction" class="tabBoxContent">
  16. <a-tab-pane :key="index" :tab="item.state==0?item.name+'(未完成)':item.name+'(已完成)'" v-for="(item, index) in dataDetail.routes"></a-tab-pane>
  17. </a-tabs>
  18. <div class="searchBoxContent">
  19. <div class="noDataBox" v-if="dataList.length==0">
  20. <img src="../../../../image/noDataNew.png" class="noData"/>
  21. <p class="noDataText">暂无搜索结果</p>
  22. </div>
  23. <div v-else class="DataBoxContent">
  24. <div class="listBox">
  25. <div class="listBoxItemContent listItemClass" v-for="(item, index) in dataList" :key="index">
  26. <pageList :item="item" type="list0" :showHeader="true" @refresh="refresh"></pageList>
  27. <a-divider class="bottomBorder" v-if="(index!=dataList.length-1)"/>
  28. </div>
  29. </div>
  30. <pageBar ref="pageBarref" @pageChange="pageChange" :total="total" :pageSize="pageSize" class="pageBar"></pageBar>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import pageBar from '../components/pageBar'
  37. import pageList from '../components/pageListMap'
  38. import {mapState} from "vuex";
  39. import map from '@/api/knowledge/map'
  40. export default {
  41. name: 'contentData',
  42. components: {
  43. pageBar,
  44. pageList
  45. },
  46. computed: {
  47. ...mapState({
  48. user: (state) => state.appSetting.user,
  49. })
  50. },
  51. data() {
  52. return {
  53. dataDetail:{},
  54. tapArr:['','我的审批','我的上传'],
  55. tapAction:0,
  56. categoryName:'请选择分类',
  57. pageNum:1,
  58. total:10,
  59. pageSize:10,
  60. dataList:[
  61. ],
  62. detailPkId:''
  63. }
  64. },
  65. mounted() {
  66. let that = this
  67. this.detailPkId = this.$route.query.pkId
  68. let getData={'pkId':this.detailPkId}
  69. map.info(getData).then((res) => {
  70. if(res.code == 200) {
  71. this.dataDetail = res.data
  72. this.dataDetail.routes[0].contents.forEach(element => {
  73. if(element.type==2){
  74. element.viewNum = element.views
  75. element.uploadTime = element.createTime
  76. element.categoryArr = element.category.split(' ')
  77. this.getType(element)
  78. }
  79. });
  80. this.changeAction(0)
  81. }
  82. })
  83. },
  84. methods: {
  85. refresh(){
  86. let getData={'pkId':this.detailPkId}
  87. map.info(getData).then((res) => {
  88. if(res.code == 200) {
  89. this.dataDetail = res.data
  90. }
  91. })
  92. },
  93. categoryData(data){
  94. data.forEach(element => {
  95. element.label=element.name
  96. element.value=element.pkId
  97. if(element.children!=null&&element.children.length!=0){
  98. this.categoryData(element.children)
  99. }
  100. })
  101. },
  102. getType(item){
  103. item.documentType = 5
  104. let typeName = item.attachmentType
  105. if(typeName==null){
  106. return false
  107. }
  108. if(typeName.indexOf("pdf")>-1){
  109. item.documentType = 1
  110. }else if(typeName.indexOf("doc")>-1){
  111. item.documentType = 2
  112. }else if(typeName.indexOf("xls")>-1){
  113. item.documentType = 3
  114. }else if(typeName.indexOf("ppt")>-1){
  115. item.documentType = 4
  116. }else{
  117. item.documentType = 5
  118. }
  119. },
  120. getCategory(arr,data){
  121. arr.unshift(data.name)
  122. if(data.parents!=null){
  123. this.getCategory(arr,data.parents)
  124. }
  125. },
  126. pageChange(num){
  127. this.pageNum = num
  128. this.dataList = this.dataDetail.routes[this.tapAction].contents.slice((this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
  129. },
  130. changeAction(num){
  131. let that = this
  132. this.tapAction = num
  133. this.dataDetail.routes[this.tapAction].contents.forEach(element => {
  134. if(element.type==2){
  135. element.viewNum = element.views
  136. element.uploadTime = element.createTime
  137. element.categoryArr = element.category.split(' ')
  138. this.getType(element)
  139. }
  140. });
  141. this.pageNum = 1
  142. this.dataList = this.dataDetail.routes[this.tapAction].contents.slice((this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
  143. setTimeout(function(){
  144. that.$refs.pageBarref.setTotal(that.dataDetail.routes[that.tapAction].contents.length)
  145. },200)
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="less" scoped>
  151. .contentDataMain{
  152. position: absolute;
  153. background: #FAFAFA;
  154. height: 100%;
  155. overflow: scroll;
  156. }
  157. .searchHead{
  158. background: #fff;
  159. display: inline-grid;
  160. width: 100%;
  161. }
  162. .searchBoxContent{
  163. margin: 0px 10.94vw;
  164. border-bottom-left-radius: 10px;
  165. border-bottom-right-radius: 10px;
  166. }
  167. .searchBoxTop{
  168. margin: 0px 10.94vw;
  169. background: #fff;
  170. padding: 1.5625vw;
  171. margin-top: 1.25vw;
  172. border-radius: 10px;
  173. }
  174. .noDataBox{
  175. width: 100%;
  176. text-align: center;
  177. padding: 1.71875vw 0px 3.91vw 0px;
  178. }
  179. .noData{
  180. width:35.2vw;
  181. margin-top: 4.68vw;
  182. }
  183. .DataBoxContent{
  184. width:100%;
  185. }
  186. .noDataText{
  187. color:#C0C0C0;
  188. font-size:1.14vw;
  189. }
  190. .tabBoxContent{
  191. display: flex;
  192. width: 78.12vw;
  193. margin: 0px 10.94vw;
  194. background: #fff;
  195. margin-top: 1.25vw;
  196. border-top-left-radius: 10px;
  197. border-top-right-radius: 10px;
  198. height: 4.6875vw;
  199. }
  200. .tabBoxContent /deep/.ant-tabs-nav-wrap{
  201. height: 4.6875vw;
  202. }
  203. .tabBoxContent /deep/.ant-tabs-tab{
  204. color: #202124;
  205. font-size: 0.9375vw;
  206. padding-top: 1.5625vw;
  207. padding-bottom: 1.8vw;
  208. font-weight: 500;
  209. }
  210. .tabBoxContent /deep/.ant-tabs-content{
  211. display: none;
  212. }
  213. .tabBoxContent /deep/.ant-tabs-tab-prev-icon-target{
  214. font-size: 1.2vw;
  215. }
  216. .tabBoxContent /deep/.ant-tabs-tab-next-icon-target{
  217. font-size: 1.2vw;
  218. }
  219. .tabBoxContent /deep/.ant-tabs-tab-active{
  220. border: none;
  221. }
  222. .tabBoxContent /deep/.ant-tabs-ink-bar{
  223. background: url(../../../../image/tabAction.png);
  224. background-size:4.6vw;
  225. background-repeat: no-repeat;
  226. height: 0.442vw;
  227. background-position:center center
  228. }
  229. .tabBoxContent div{
  230. width: 9.8vw;
  231. text-align: center;
  232. float:left;
  233. }
  234. .tabBoxContent span{
  235. padding-top: 1.5625vw;
  236. width: 100%;
  237. color: #202124;
  238. font-size: 0.9375vw;
  239. cursor: pointer;
  240. display: inline-block;
  241. }
  242. .tabBoxContent img{
  243. margin-top: 0.9375vw;
  244. width:4.64vw;
  245. }
  246. ::-webkit-scrollbar{
  247. display:none;
  248. }
  249. .btnSmall:hover{
  250. opacity: 0.73;
  251. }
  252. .listBoxItemContent{
  253. padding: 1.5625vw;
  254. padding-bottom: 0px;
  255. }
  256. .listItemClass{
  257. background: #fff;
  258. }
  259. .pageBar{
  260. background: #FAFAFA;
  261. margin-top: 2.76vw;
  262. }
  263. .btnAddData{
  264. -moz-user-select: none;
  265. -khtml-user-select: none;
  266. user-select: none;
  267. width: 5.625vw!important;
  268. height: 2.552vw;
  269. line-height: 2.552vw;
  270. text-align: center;
  271. color: #fff;
  272. background: #406CC4;
  273. border-radius: 6px 6px 6px 6px;
  274. font-size: 0.9375vw;
  275. margin-left: 0.5738vw;
  276. margin-top: 0.93vw;
  277. cursor: pointer;
  278. float: right!important;
  279. margin-right: 1.5625vw;
  280. }
  281. .btnAddData:hover{
  282. background: #385FAD;
  283. }
  284. .bottomBorder{
  285. background: #EEEEEE;
  286. margin-bottom: 0px;
  287. }
  288. .userTop{
  289. margin: 0px 10.94vw;
  290. background: #fff;
  291. padding: 1.5625vw;
  292. margin-top: 1.5104vw;
  293. display: flex;
  294. border-radius: 10px;
  295. }
  296. .userHead{
  297. margin-right: 1.09375vw;
  298. float: left;
  299. }
  300. .userHead img{
  301. width: 6vw;
  302. height: 6vw;
  303. border-radius: 6vw;
  304. }
  305. .userMidle{
  306. }
  307. .userMidleName{
  308. color: #202124;
  309. font-size: 1.25vw;
  310. text-align: left;
  311. font-weight: 550;
  312. }
  313. .userMidleNum{
  314. margin-top: 0.7vw;
  315. color: #C0C0C0;
  316. font-size: 0.83333vw;
  317. text-align: left;
  318. }
  319. .userMidleNum span:first-child{
  320. float: left;
  321. padding-top:0.22vw;
  322. }
  323. .userMidleNum span:last-child{
  324. float: left;
  325. color: #202124;
  326. font-size: 1.04166vw;
  327. margin-left: 0.4166vw;
  328. }
  329. .userEnd{
  330. margin-left: auto;
  331. }
  332. .cascaderBox{
  333. width: 20.625vw;
  334. height: 1.875vw;
  335. margin-top: 2.083vw;
  336. }
  337. .cascaderBox /deep/input{
  338. height: 1.875vw;
  339. }
  340. .listBox{
  341. padding-bottom: 1.5625vw;
  342. background: #fff;
  343. }
  344. </style>