file-manage.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="other-container" style="margin-top: 178px;">
  3. <IHeader :departmentId="department.departmentId"/>
  4. <div class="main">
  5. <div class="main-table">
  6. <div class="main-left">
  7. <el-select v-model="searchDepartment" filterable clearable placeholder="关键字搜索部门" @change="handleChangeDepart">
  8. <el-option
  9. v-for="item in userDepartments"
  10. :key="item.departmentId"
  11. :label="item.department"
  12. :value="item"
  13. >
  14. </el-option>
  15. </el-select>
  16. <el-menu
  17. :default-active="''+department.departmentId"
  18. class="el-menu-vertical-demo"
  19. @select="handleSelectDepart">
  20. <template v-for="item in userDepartments" >
  21. <el-menu-item :index="''+item.departmentId" v-bind:key="item.departmentId">
  22. <el-button v-if="item.departmentId == department.departmentId" type="text">
  23. {{ item.department}}
  24. </el-button>
  25. <el-button v-else type="text" style="color:#000">
  26. {{ item.department}}
  27. </el-button>
  28. </el-menu-item>
  29. </template>
  30. </el-menu>
  31. </div>
  32. <div class="main-right">
  33. <div style="margin: 16px;position:relative;">
  34. <i class="el-icon-location"></i>
  35. <el-breadcrumb separator-class="el-icon-arrow-right">
  36. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  37. <el-breadcrumb-item>帮助中心</el-breadcrumb-item>
  38. <el-breadcrumb-item>文件列表</el-breadcrumb-item>
  39. <el-breadcrumb-item>{{ department.department }}</el-breadcrumb-item>
  40. </el-breadcrumb>
  41. </div>
  42. <IPanel :account="account" :departmentId="department.departmentId"></IPanel>
  43. <!-- <IArtical :department="department" type="laws"
  44. :list="restaurants.laws" @more="handleOpenMore('laws')" @download="downloadFile"></IArtical>
  45. <IArtical :department="department" type="mechanism"
  46. :list="restaurants.mechanism" @more="handleOpenMore('mechanism')" @download="downloadFile"></IArtical>
  47. <IArtical :department="department" type="result"
  48. :list="restaurants.result" @more="handleOpenMore('result')" @download="downloadFile"></IArtical>
  49. <IArtical :department="department" type="other"
  50. :list="restaurants.other" @more="handleOpenMore('other')" @download="downloadFile"></IArtical> -->
  51. </div>
  52. </div>
  53. <el-dialog title="申请材料" center :visible.sync="dialogFormVisible" >
  54. <h3> 【{{form.title}}】非公开,需要向对应科室申请</h3>
  55. <div class="dialog-footer" slot="footer">
  56. <el-button type="warning" size="medium" style="width: 100px; padding: 10px; margin: 20px;" @click="dialogFormVisible=false">取 消</el-button>
  57. <el-button type="primary" size="medium" style="width: 100px; padding: 10px; margin: 20px;" @click="dialogFormVisible=false">确认申请</el-button>
  58. </div>
  59. </el-dialog>
  60. </div>
  61. <IFooter />
  62. </div>
  63. </template>
  64. <script>
  65. import IHeader from "./components/IHeader";
  66. import IPanel from "./components/IPanel";
  67. import IArtical from "./components/IArtical";
  68. import IFooter from "./components/IFooter";
  69. import glIcon from '@/icons/img/2016smyjj_gl_icon.jpg'
  70. import data from '../data/data.js'
  71. import {getDepartmentAccount} from '@/api/user.js'
  72. import { mapActions, mapGetters } from "vuex";
  73. export default {
  74. name: 'application',
  75. components: {
  76. IHeader,
  77. IArtical,
  78. IFooter,
  79. IPanel
  80. },
  81. data() {
  82. return {
  83. categorys:data.categorys,
  84. dialogFormVisible: false,
  85. leaderId:0,
  86. glIcon: glIcon,
  87. searchDepartment: "",
  88. department:{ departmentId:0, department:''},
  89. account: {},
  90. restaurants: {},
  91. form:{},
  92. state3: '',
  93. category:'',
  94. isShowMore: false,
  95. screenWidth: document.body.clientWidth
  96. }
  97. },
  98. computed: {
  99. ...mapGetters("user", ["userDepartments"])
  100. },
  101. beforeMount( ){
  102. let departmentId = localStorage.getItem("@departmentId")||0;
  103. this.department = data.getDepart( departmentId, this.userDepartments );
  104. this.leaderId = data.getLeader( departmentId, this.userDepartments)
  105. this.getDepartmentAccount()
  106. },
  107. filters:{
  108. filterTitle(val){
  109. if( val.length > 35) {
  110. return val.substr(0,32)+"..."
  111. }else{
  112. return val
  113. }
  114. }
  115. },
  116. methods: {
  117. ...mapActions("user", ["setArticals"]),
  118. downloadFile(o){
  119. this.form = o;
  120. this.dialogFormVisible = true
  121. },
  122. getDepartmentAccount(){
  123. let departmentId = +this.department.departmentId;
  124. getDepartmentAccount( {departmentId}).then( res=>{
  125. if( res.code == 200){
  126. let account ={}
  127. for( let i in res.data){
  128. let item = res.data[i]
  129. account[item.category+item.status] = item.count;
  130. }
  131. this.account = account;
  132. }
  133. })
  134. },
  135. initSearch(){
  136. this.setArticals( this.restaurants.laws||[] )
  137. this.setArticals( this.restaurants.mechanism||[] )
  138. this.setArticals( this.restaurants.result||[] )
  139. this.setArticals( this.restaurants.other||[] )
  140. },
  141. handleSelectFile(item) {
  142. console.log("handleSelectFile", item);
  143. },
  144. handleChangeDepart(item){
  145. console.log("handleChangeDepart", item);
  146. this.department = item;
  147. // 切换文件列表
  148. },
  149. handleSelectDepart( departId ) {
  150. localStorage.setItem("@departmentId", departId)
  151. this.department = data.getDepart( departId, this.userDepartments)
  152. console.log("handleSelectDepart", this.department );
  153. this.getDepartmentAccount();
  154. // 切换文件列表
  155. },
  156. querySearch( item ){
  157. console.log( "search item")
  158. },
  159. handleOpenMore(type){
  160. console.log("handleOpenMore", this)
  161. let query = {category:type, departmentId: this.selectDepartId}
  162. let path = '/file-search'
  163. this.$router.push( {path, query})
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .el-breadcrumb{
  170. display: inline-block;
  171. padding-left: 10px;
  172. }
  173. .box-card{
  174. margin-bottom: 20px;
  175. }
  176. .my-autocomplete {
  177. li {
  178. line-height: normal;
  179. padding: 7px;
  180. .name {
  181. text-overflow: ellipsis;
  182. overflow: hidden;
  183. }
  184. .addr {
  185. font-size: 12px;
  186. color: #b4b4b4;
  187. }
  188. .highlighted .addr {
  189. color: #ddd;
  190. }
  191. }
  192. }
  193. </style>