123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <template>
- <div class="ch_box" ref="ch_box">
- <div class="ch_content_box" v-if="type == 1">
- <searchArea
- :courseDetail="courseDetail"
- ref="searchAreaRef"
- :navList="navList"
- :tcid="tcid"
- v-if="itemType == 1"
- />
- <taskArea
- :courseDetail="courseDetail"
- ref="taskAreaRef"
- v-if="itemType == 2"
- />
- <dialogArea
- :courseDetail="courseDetail"
- ref="dialogAreaRef"
- v-if="itemType == 3"
- />
- </div>
- <div class="ch_nav_box">
- <div class="ch_nav_box_top">
- <div @click="$emit('backPage')">
- <el-tooltip class="item" effect="dark" content="返回" placement="top">
- <img :src="require('../../assets/icon/course/return.png')" alt="" />
- </el-tooltip>
- </div>
- <div @click="$emit('refresh')">
- <el-tooltip class="item" effect="dark" content="刷新" placement="top">
- <img
- :src="require('../../assets/icon/course/refresh.png')"
- alt=""
- />
- </el-tooltip>
- </div>
- <div @click="$emit('review')" v-if="tType==1">
- <el-tooltip class="item" effect="dark" content="评论" placement="top">
- <img
- :src="require('../../assets/icon/course/comment.png')"
- alt=""
- style="width: 22px;height: 22px;"
- />
- </el-tooltip>
- </div>
- <div @click="$emit('authority')" v-if="(tType==1 || tType == 4)"><!-- -->
- <el-tooltip class="item" effect="dark" content="权限" placement="top">
- <img
- :src="require('../../assets/icon/course/setting.png')"
- alt=""
- />
- </el-tooltip>
- </div>
- </div>
- <div class="ch_nav_box_middle">
- <div
- :class="[
- 'ch_nav_box_middle_item',
- itemType == 1 ? 'ch_nav_box_middle_item_active' : ''
- ]"
- @click.stop="changeItemType(1)"
- >
- <img
- v-if="itemType == 1"
- :src="require('../../assets/icon/course/up_active.png')"
- />
- <img
- v-if="itemType != 1"
- :src="require('../../assets/icon/course/up.png')"
- />
- <!-- <span :style="`background:url(${itemType==1?require('../../assets/icon/course/up_active.png'):require('../../assets/icon/course/up.png')});`"></span> -->
- <div>对话</div>
- </div>
- <div
- :class="[
- 'ch_nav_box_middle_item',
- itemType == 2 ? 'ch_nav_box_middle_item_active' : ''
- ]"
- @click.stop="changeItemType(2)"
- >
- <img
- v-if="itemType == 2"
- :src="require('../../assets/icon/course/task_active.png')"
- />
- <img
- v-if="itemType != 2"
- :src="require('../../assets/icon/course/task.png')"
- />
- <!-- <span :style="`background:url(${itemType==2?require('../../assets/icon/course/task_active.png'):require('../../assets/icon/course/task.png')});`"></span> -->
- <div>任务</div>
- </div>
- <div
- :class="[
- 'ch_nav_box_middle_item',
- itemType == 3 ? 'ch_nav_box_middle_item_active' : ''
- ]"
- @click.stop="changeItemType(3)"
- >
- <img
- v-if="itemType == 3"
- :src="require('../../assets/icon/course/dialog_active.png')"
- />
- <img
- v-if="itemType != 3"
- :src="require('../../assets/icon/course/dialog.png')"
- />
- <!-- <span :style="`background:url(${itemType==3?require('../../assets/icon/course/dialog_active.png'):require('../../assets/icon/course/dialog.png')});`"></span> -->
- <div>智能体</div>
- </div>
- </div>
- <div class="ch_nav_box_bottom">
- <div @click.stop="$emit('goStep', 0)">
- <el-tooltip
- class="item"
- effect="dark"
- content="上一步"
- placement="top"
- >
- <img :src="require('../../assets/icon/course/last.png')" />
- </el-tooltip>
- </div>
- <div @click.stop="$emit('goStep', 1)">
- <el-tooltip
- class="item"
- effect="dark"
- content="下一步"
- placement="top"
- >
- <img :src="require('../../assets/icon/course/next.png')" />
- </el-tooltip>
- </div>
- <div @click="openSetting">
- <el-tooltip
- class="item"
- effect="dark"
- :content="type == 0 ? '展开' : '折叠'"
- placement="top"
- >
- <img :src="require('../../assets/icon/course/menu.png')" />
- </el-tooltip>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import searchArea from "./component/searchArea.vue";
- import taskArea from "./component/taskArea.vue";
- import dialogArea from "./component/dialogArea.vue";
- export default {
- emits: ["refresh", "goStep", "backPage", "authority", "review"],
- components: {
- searchArea,
- taskArea,
- dialogArea
- },
- props: {
- courseDetail: {
- type: Object,
- default: () => {}
- },
- tType:{
- type:Number,
- default:0,
- },
- navList:{
- type:Array,
- default:()=>[]
- },
- tcid:{
- type:String,
- default:""
- },
- },
- data() {
- return {
- type: 0,
- itemType: 0 //0--无 1-搜索 2-任务 3-对话
- };
- },
- mounted() {
- this.setWidth();
- },
- methods: {
- setWidth() {
- let w = this.$refs.ch_box;
- let w2 = w.offsetWidth + 30 + "px";
- this.$emit("setWidth", w2);
- },
- openSetting() {
- this.type = this.type == 1 ? 0 : 1;
- this.$nextTick(() => {
- this.setWidth();
- });
- },
- changeItemType(type) {
- this.type = 0;
- this.openSetting();
- this.$nextTick(() => {
- if (this.itemType == 1 && type != 1) {
- this.$refs.searchAreaRef.scrollBottom();
- this.$refs.searchAreaRef.getWantSearch();
- } else if (this.itemType == 2) {
- this.$refs.taskAreaRef.scrollBottom();
- } else if (this.itemType == 3) {
- this.$refs.dialogAreaRef.scrollBottom();
- }
- this.itemType = type;
- });
- }
- }
- };
- </script>
- <style scoped>
- .ch_box {
- width: auto;
- background: rgb(255, 255, 255);
- position: fixed;
- height: calc(100% - 40px);
- border-radius: 10px;
- box-sizing: border-box;
- right: 20px;
- overflow: hidden;
- display: flex;
- top: 20px;
- }
- .ch_nav_box {
- height: 100%;
- width: 65px;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- align-items: center;
- }
- .ch_content_box {
- width: 400px;
- height: 100%;
- border-right: 2px solid #e7e7e7;
- }
- .ch_nav_box_bottom {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- border-top: solid 1px #eaeaea;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- }
- .ch_nav_box_middle {
- width: 100%;
- height: auto;
- display: flex;
- box-sizing: border-box;
- border-top: solid 1px #eaeaea;
- flex-direction: column;
- justify-content: space-between;
- }
- .ch_nav_box_middle_item {
- width: 100%;
- height: 80px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- transition: 0.3s;
- font-size: 14px;
- }
- /* .ch_nav_box_middle_item:hover{
- background-color: rgb(195, 215, 247);
- } */
- .ch_nav_box_middle_item_active {
- background-color: #3681fc;
- color: white;
- }
- .ch_nav_box_middle_item > img {
- width: 24px;
- height: 24px;
- margin-bottom: 5px;
- }
- /* .ch_nav_box_middle_item>span{
- width: 24px;
- height: 24px;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- background-position: center;
- } */
- .ch_nav_box_bottom > div {
- width: 100%;
- height: 65px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- }
- .ch_nav_box_bottom > div > img {
- width: 24px;
- height: 24px;
- }
- .ch_nav_box_top {
- width: 100%;
- height: auto;
- }
- .ch_nav_box_top > div {
- width: 100%;
- height: 65px;
- display: flex;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- }
- .ch_nav_box_top > div > img {
- width: 24px;
- height: 24px;
- }
- </style>
|