You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
5.8 KiB

  1. <template>
  2. <section>
  3. <!-- <div class="module-item" v-for="(item,index) in topModules" :key="index">
  4. <div class="module-text" @click="gotolink(item)" >
  5. <div class="box-icon">
  6. <img :src="item.icon" height="20px" />
  7. </div>
  8. <div class="box-info">{{item.moduleName}}</div>
  9. </div>
  10. </div> -->
  11. <div class="module-item">
  12. <div class="module-text" @click="menuVisible = true" >
  13. <div class="box-info">全部应用</div>
  14. </div>
  15. </div>
  16. <div class="module-item">
  17. <div class="module-text" @click="goToMyWork" >
  18. <div class="box-info">我的工作台</div>
  19. </div>
  20. </div>
  21. <div class="drawer-box">
  22. <all-menus v-model="menuVisible"></all-menus>
  23. <!-- <el-drawer
  24. :visible.sync="drawer"
  25. :modal-append-to-body="false"
  26. :direction="direction">
  27. <div class="drawer">
  28. <div class="drawer-content">
  29. <div class="drawer-content-category" v-for="(item,index) in categorys" :key="index">
  30. <div class="category-name" v-text="item.moduleName"></div>
  31. <div class="category-list">
  32. <div
  33. class="category-item"
  34. v-for="(module,mindex) in item.childrens" :key="index+'_'+mindex"
  35. @click="gotolink(module)"
  36. :class="{highlight : module.isHighlight }"
  37. >
  38. <div class="module-icon">
  39. <img :src="module.icon">
  40. </div>
  41. <div class="module-name" v-text="module.moduleName"></div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </el-drawer> -->
  48. </div>
  49. </section>
  50. </template>
  51. <script>
  52. import NProgress from 'nprogress' // progress bar
  53. const topModulesData = require("./top_modules_"+process.env.CONTEXT+".js")
  54. const allModulesData = require("./all_modules.js")
  55. import allMenus from '../ModulesMenu/allMenus'
  56. export default {
  57. components: {allMenus},
  58. created() {
  59. },
  60. data() {
  61. return {
  62. levelList: null,
  63. drawer: false,
  64. direction: 'rtl',
  65. key:"",
  66. topModules: topModulesData.default,
  67. //模块分类
  68. categorys:allModulesData.default,
  69. menuVisible: false,
  70. }
  71. },
  72. watch: {
  73. key(val){
  74. this.searchModule();
  75. }
  76. },
  77. methods: {
  78. goToMyWork(){
  79. this.$router.push("/my/work/index")
  80. },
  81. //路由跳转
  82. gotolink(module) {
  83. this.drawer = false
  84. this.jumpToOtherSystem(module);
  85. },
  86. //系统跳转
  87. jumpToOtherSystem(module) {
  88. window.open(module.sysLink, module.moduleName,null,true);
  89. NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
  90. },
  91. //搜索
  92. searchModule(){
  93. for(let i =0 ; i <this.categorys.length; i++){
  94. for(let j =0 ; j <this.categorys[i].childrens.length; j++){
  95. let module = this.categorys[i].childrens[j];
  96. this.categorys[i].childrens[j].isHighlight = false;
  97. }
  98. }
  99. if(this.key != ""){
  100. for(let i =0 ; i <this.categorys.length; i++){
  101. for(let j =0 ; j <this.categorys[i].childrens.length; j++){
  102. let module = this.categorys[i].childrens[j];
  103. if(module.moduleName.indexOf(this.key) > -1){
  104. this.categorys[i].childrens[j].isHighlight = true;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. </script>
  113. <style rel="stylesheet/scss" lang="scss" scoped>
  114. .drawer-box{
  115. .drawer{
  116. padding-left: 10px;
  117. padding-right: 10px;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. z-index: 9 !important;
  122. .drawer-content{
  123. width: 900px;
  124. height: 100%;
  125. .drawer-content-input{
  126. display: flex;
  127. justify-content: center;
  128. }
  129. .drawer-content-category{
  130. .category-name{
  131. color: #333333;
  132. font-size: 16px;
  133. }
  134. .category-list{
  135. display: flex;
  136. justify-content: flex-start;
  137. flex-wrap: wrap;
  138. .category-item{
  139. height: 70px;
  140. width: 70px;
  141. margin-right: 20px;
  142. transition: all 0.3s;
  143. .module-icon{
  144. width: 70px;
  145. height: 38px;
  146. text-align: center;
  147. display: flex;
  148. flex-direction: column;
  149. justify-content: center;
  150. align-items: center;
  151. img{
  152. width: 20px;
  153. }
  154. }
  155. .module-name{
  156. height: 32px;
  157. line-height: 32px;
  158. color:#666666;
  159. font-size: 12px;
  160. text-align: center;
  161. }
  162. }
  163. .category-item:hover{
  164. background: rgb(240, 241, 245);
  165. }
  166. }
  167. }
  168. }
  169. }
  170. .highlight{
  171. transform: scale(1.05);
  172. -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  173. border-radius: 50%;
  174. box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  175. }
  176. }
  177. .module-item {
  178. display: inline-block;
  179. cursor: pointer;
  180. fill: #5a5e66;
  181. align-items: center;
  182. text-align: center;
  183. margin-right: 30px;
  184. .module-text{
  185. line-height: 22px;
  186. font-size: 22px;
  187. }
  188. .box-icon {
  189. text-align: center;
  190. }
  191. .box-info {
  192. text-align: center;
  193. font-size: 14px;
  194. color: #7D7D7D;
  195. font-weight: bold;
  196. }
  197. }
  198. </style>
  199. <style rel="stylesheet/scss" lang="scss">
  200. .drawer-box{
  201. .el-drawer{
  202. height: 100% !important;
  203. overflow: auto;
  204. }
  205. }
  206. </style>