index.vue 8.1 KB

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