index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <div class="ch_box" ref="ch_box">
  3. <div class="ch_content_box" v-if="type == 1">
  4. <searchArea v-show="itemType == 1" />
  5. <taskArea v-show="itemType == 2" />
  6. <dialogArea v-show="itemType == 3" />
  7. </div>
  8. <div class="ch_nav_box">
  9. <div class="ch_nav_box_top">
  10. <div @click="$emit('backPage')">
  11. <el-tooltip class="item" effect="dark" content="返回" placement="top">
  12. <img :src="require('../../assets/icon/course/return.png')" alt="" />
  13. </el-tooltip>
  14. </div>
  15. <div @click="$emit('refresh')">
  16. <el-tooltip class="item" effect="dark" content="刷新" placement="top">
  17. <img
  18. :src="require('../../assets/icon/course/refresh.png')"
  19. alt=""
  20. />
  21. </el-tooltip>
  22. </div>
  23. <div @click="$emit('authority')">
  24. <el-tooltip class="item" effect="dark" content="权限" placement="top">
  25. <img
  26. :src="require('../../assets/icon/course/setting.png')"
  27. alt=""
  28. />
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. <div class="ch_nav_box_middle">
  33. <div
  34. :class="[
  35. 'ch_nav_box_middle_item',
  36. itemType == 1 ? 'ch_nav_box_middle_item_active' : ''
  37. ]"
  38. @click.stop="changeItemType(1)"
  39. >
  40. <img
  41. v-if="itemType == 1"
  42. :src="require('../../assets/icon/course/up_active.png')"
  43. />
  44. <img
  45. v-if="itemType != 1"
  46. :src="require('../../assets/icon/course/up.png')"
  47. />
  48. <!-- <span :style="`background:url(${itemType==1?require('../../assets/icon/course/up_active.png'):require('../../assets/icon/course/up.png')});`"></span> -->
  49. <div>搜索</div>
  50. </div>
  51. <div
  52. :class="[
  53. 'ch_nav_box_middle_item',
  54. itemType == 2 ? 'ch_nav_box_middle_item_active' : ''
  55. ]"
  56. @click.stop="changeItemType(2)"
  57. >
  58. <img
  59. v-if="itemType == 2"
  60. :src="require('../../assets/icon/course/task_active.png')"
  61. />
  62. <img
  63. v-if="itemType != 2"
  64. :src="require('../../assets/icon/course/task.png')"
  65. />
  66. <!-- <span :style="`background:url(${itemType==2?require('../../assets/icon/course/task_active.png'):require('../../assets/icon/course/task.png')});`"></span> -->
  67. <div>任务</div>
  68. </div>
  69. <div
  70. :class="[
  71. 'ch_nav_box_middle_item',
  72. itemType == 3 ? 'ch_nav_box_middle_item_active' : ''
  73. ]"
  74. @click.stop="changeItemType(3)"
  75. >
  76. <img
  77. v-if="itemType == 3"
  78. :src="require('../../assets/icon/course/dialog_active.png')"
  79. />
  80. <img
  81. v-if="itemType != 3"
  82. :src="require('../../assets/icon/course/dialog.png')"
  83. />
  84. <!-- <span :style="`background:url(${itemType==3?require('../../assets/icon/course/dialog_active.png'):require('../../assets/icon/course/dialog.png')});`"></span> -->
  85. <div>对话</div>
  86. </div>
  87. </div>
  88. <div class="ch_nav_box_bottom">
  89. <div @click.stop="$emit('goStep', 0)">
  90. <el-tooltip
  91. class="item"
  92. effect="dark"
  93. content="上一步"
  94. placement="top"
  95. >
  96. <img :src="require('../../assets/icon/course/last.png')" />
  97. </el-tooltip>
  98. </div>
  99. <div @click.stop="$emit('goStep', 1)">
  100. <el-tooltip
  101. class="item"
  102. effect="dark"
  103. content="下一步"
  104. placement="top"
  105. >
  106. <img :src="require('../../assets/icon/course/next.png')" />
  107. </el-tooltip>
  108. </div>
  109. <div @click="openSetting">
  110. <el-tooltip
  111. class="item"
  112. effect="dark"
  113. :content="type == 0 ? '展开' : '折叠'"
  114. placement="top"
  115. >
  116. <img :src="require('../../assets/icon/course/menu.png')" />
  117. </el-tooltip>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. <script>
  124. import searchArea from "./component/searchArea.vue";
  125. import taskArea from "./component/taskArea.vue";
  126. import dialogArea from "./component/dialogArea.vue";
  127. export default {
  128. emits: ["refresh", "goStep", "backPage","authority"],
  129. components: {
  130. searchArea,
  131. taskArea,
  132. dialogArea
  133. },
  134. data() {
  135. return {
  136. type: 0,
  137. itemType: 0 //0--无 1-搜索 2-任务 3-对话
  138. };
  139. },
  140. mounted() {
  141. this.setWidth();
  142. },
  143. methods: {
  144. setWidth() {
  145. let w = this.$refs.ch_box;
  146. let w2 = w.offsetWidth + 30 + "px";
  147. this.$emit("setWidth", w2);
  148. },
  149. openSetting() {
  150. this.type = this.type == 1 ? 0 : 1;
  151. this.$nextTick(() => {
  152. this.setWidth();
  153. });
  154. },
  155. changeItemType(type) {
  156. this.type = 0;
  157. this.openSetting();
  158. this.itemType = type;
  159. }
  160. }
  161. };
  162. </script>
  163. <style scoped>
  164. .ch_box {
  165. width: auto;
  166. background: rgb(255, 255, 255);
  167. position: fixed;
  168. height: calc(100% - 40px);
  169. border-radius: 10px;
  170. box-sizing: border-box;
  171. right: 20px;
  172. overflow: hidden;
  173. display: flex;
  174. }
  175. .ch_nav_box {
  176. height: 100%;
  177. width: 65px;
  178. display: flex;
  179. flex-direction: column;
  180. justify-content: flex-end;
  181. align-items: center;
  182. }
  183. .ch_content_box {
  184. width: 400px;
  185. height: 100%;
  186. border-right: 2px solid #e7e7e7;
  187. }
  188. .ch_nav_box_bottom {
  189. width: 100%;
  190. height: auto;
  191. box-sizing: border-box;
  192. border-top: solid 1px #eaeaea;
  193. display: flex;
  194. flex-direction: column;
  195. justify-content: flex-end;
  196. }
  197. .ch_nav_box_middle {
  198. width: 100%;
  199. height: auto;
  200. display: flex;
  201. box-sizing: border-box;
  202. border-top: solid 1px #eaeaea;
  203. flex-direction: column;
  204. justify-content: space-between;
  205. }
  206. .ch_nav_box_middle_item {
  207. width: 100%;
  208. height: 80px;
  209. display: flex;
  210. flex-direction: column;
  211. justify-content: center;
  212. align-items: center;
  213. cursor: pointer;
  214. transition: 0.3s;
  215. font-size: 14px;
  216. }
  217. /* .ch_nav_box_middle_item:hover{
  218. background-color: rgb(195, 215, 247);
  219. } */
  220. .ch_nav_box_middle_item_active {
  221. background-color: #3681fc;
  222. color: white;
  223. }
  224. .ch_nav_box_middle_item > img {
  225. width: 24px;
  226. height: 24px;
  227. margin-bottom: 5px;
  228. }
  229. /* .ch_nav_box_middle_item>span{
  230. width: 24px;
  231. height: 24px;
  232. background-size: 100% 100%;
  233. background-repeat: no-repeat;
  234. background-position: center;
  235. } */
  236. .ch_nav_box_bottom > div {
  237. width: 100%;
  238. height: 65px;
  239. display: flex;
  240. flex-direction: column;
  241. justify-content: center;
  242. align-items: center;
  243. cursor: pointer;
  244. }
  245. .ch_nav_box_bottom > div > img {
  246. width: 24px;
  247. height: 24px;
  248. }
  249. .ch_nav_box_top {
  250. width: 100%;
  251. height: auto;
  252. }
  253. .ch_nav_box_top > div {
  254. width: 100%;
  255. height: 65px;
  256. display: flex;
  257. justify-content: center;
  258. align-items: center;
  259. cursor: pointer;
  260. }
  261. .ch_nav_box_top > div > img {
  262. width: 24px;
  263. height: 24px;
  264. }
  265. </style>