ai_career_interview.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <div class="ai_career_interview">
  3. <head-component :headinfo=headinfo></head-component>
  4. <div class="page-content">
  5. <div class="page-box">
  6. <div>
  7. <div class="two-page">
  8. <div class="two-page-search">
  9. <el-input
  10. v-model="form.name"
  11. style="width: 1484px;height: 84px"
  12. placeholder="请输入你要访谈的职业"
  13. @input="byKeyword"
  14. >
  15. <template #suffix>
  16. <span style="font-size: 38px;color: #444040;margin-left: 37px;">
  17. X
  18. </span>
  19. </template>
  20. </el-input>
  21. <div @click="byKeyword">
  22. 开始查询
  23. </div>
  24. </div>
  25. </div>
  26. <div style="overflow: auto;height: 720px;margin-top: 16px">
  27. <div style="display: flex; flex-direction: column; align-items: center;">
  28. <div class="result-box" v-if="occupationList.length>0">
  29. <div class="two-page-result">
  30. <div v-for="(item,index) in occupationList"
  31. :class="[item.selected?'item-result-box-active':'item-result-box']"
  32. @click="toDetail(item)">
  33. <div v-html="item.name"></div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="hot-search">
  39. <div class="title">热门搜索:</div>
  40. <div style="display: flex;flex-wrap:wrap;
  41. margin-top: 11px;margin-left: 119px;margin-right: 91px">
  42. <div class="search-item">计算机软件工程技术人员</div>
  43. <div class="search-item">教师</div>
  44. <div class="search-item">心理咨询师</div>
  45. <div class="search-item">实施运维工程师</div>
  46. <div class="search-item">计算机软件工程技术人员</div>
  47. <div class="search-item">计算机软件工程技术人员</div>
  48. <div class="search-item">计算机软件工程技术人员</div>
  49. <div class="search-item">计算机软件工程技术人员</div>
  50. <div class="search-item">计算机软件工程技术人员</div>
  51. <div class="search-item">教师</div>
  52. <div class="search-item">心理咨询师</div>
  53. <div class="search-item">实施运维工程师</div>
  54. <div class="search-item">计算机软件工程技术人员</div>
  55. <div class="search-item">计算机软件工程技术人员</div>
  56. <div class="search-item">计算机软件工程技术人员</div>
  57. <div class="search-item">计算机软件工程技术人员</div>
  58. </div>
  59. </div>
  60. <div class="hot-search">
  61. <div class="title">历史查询:</div>
  62. <div style="display: flex;flex-wrap:wrap;
  63. margin-top: 11px;margin-left: 119px;margin-right: 91px">
  64. <div class="search-item">计算机软件工程技术人员</div>
  65. <div class="search-item">教师</div>
  66. <div class="search-item">心理咨询师</div>
  67. <div class="search-item">实施运维工程师</div>
  68. <div class="search-item">计算机软件工程技术人员</div>
  69. <div class="search-item">计算机软件工程技术人员</div>
  70. <div class="search-item">计算机软件工程技术人员</div>
  71. <div class="search-item">计算机软件工程技术人员</div>
  72. <div class="search-item">教师</div>
  73. <div class="search-item">心理咨询师</div>
  74. <div class="search-item">实施运维工程师</div>
  75. <div class="search-item">计算机软件工程技术人员</div>
  76. <div class="search-item">计算机软件工程技术人员</div>
  77. <div class="search-item">计算机软件工程技术人员</div>
  78. <div class="search-item">计算机软件工程技术人员</div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <drag_component></drag_component>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script setup>
  89. import {onMounted, ref} from "vue";
  90. import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
  91. import Drag_component from "@/views/xjc-integratedmachine/components/drag_component.vue";
  92. const headinfo = ref({})
  93. import {getOccupationByKeyword} from "@/api/xjc-integratedmachine/environment/occupation.js";
  94. const router = useRouter()
  95. const form = ref({
  96. name: null
  97. })
  98. // 职业列表
  99. const occupationList = ref([])
  100. function setHeadinfo(){
  101. headinfo.value = {
  102. title: 'AI生涯访谈',
  103. user: {
  104. avatar: '头像路径',
  105. nickName: '张三'
  106. },
  107. backUrl : '/xjc-integratedmachine/environment/index'
  108. }
  109. }
  110. // 定义一个函数,用于将关键词变为红色
  111. function highlightKeywords(text, keywords) {
  112. // 遍历关键词列表
  113. keywords.forEach(keyword => {
  114. // 使用正则表达式匹配关键词,并替换为带有红色样式的HTML标签
  115. // 这里使用全局匹配标志'g',以确保替换所有出现的关键词
  116. // console.log("keywords", keywords)
  117. let regex = new RegExp(keyword, 'g');
  118. text = text.replace(regex, `<span style="color: #0DE6A1;">${keyword}</span>`);
  119. // console.log("text", text)
  120. });
  121. return text;
  122. }
  123. function byKeyword() {
  124. if(form.value.name){
  125. getOccupationByKeyword(form.value).then(resp => {
  126. resp.list.map(item => {
  127. item.selected = false;
  128. let keyWord = form.value.name
  129. item.name = highlightKeywords(item.name, [keyWord]);
  130. })
  131. occupationList.value = resp.list
  132. })
  133. }else{
  134. occupationList.value = []
  135. }
  136. }
  137. function toDetail(row) {
  138. router.push({
  139. path: '/xjc-integratedmachine/environment/ai_career_interview_chat',
  140. query: {
  141. id: row.id
  142. }
  143. })
  144. }
  145. onMounted(() => {
  146. setHeadinfo()
  147. })
  148. </script>
  149. <style scoped lang="scss">
  150. p{
  151. margin: 0;
  152. padding: 0;
  153. }
  154. .ai_career_interview{
  155. background: url('@/assets/images/login/login-home-background.png') no-repeat;
  156. background-size: 1920px 1080px;
  157. z-index:10;
  158. width: 100%;
  159. height: 1080px;
  160. .page-content {
  161. width: 100%;
  162. height: 980px;
  163. position: absolute;
  164. top: 100px;
  165. bottom: 0;
  166. }
  167. .page-box{
  168. width: 1832px;
  169. height: 910px;
  170. background: #FFFFFF;
  171. border-radius: 35px 35px 35px 35px;
  172. margin: 13px auto 0;
  173. padding-top: 25px;
  174. position: relative;
  175. }
  176. }
  177. .two-page {
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. .two-page-search {
  182. display: flex;
  183. margin-top: 57px;
  184. ::v-deep .el-input__inner {
  185. font-size: 24px;
  186. margin-left: 34px;
  187. }
  188. ::v-deep .el-input__suffix {
  189. font-size: 100px;
  190. width: 100px;
  191. height: 100px;
  192. }
  193. ::v-deep .el-input__wrapper {
  194. background: #E2E2E2;
  195. box-shadow: none;
  196. height: 84px;
  197. width: 1484px;
  198. }
  199. div{
  200. width: 170px;
  201. height: 84px;
  202. background: linear-gradient( 180deg, #73EE71 0%, #0ACB63 100%);
  203. border-radius: 0px 5px 5px 0px;
  204. font-weight: 400;
  205. font-size: 24px;
  206. color: #FFFFFF;
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. }
  211. }
  212. }
  213. .result-box {
  214. width: 1484px;
  215. /*height: 750px;*/
  216. /*overflow: auto;*/
  217. .two-page-result {
  218. display: flex;
  219. flex-wrap: wrap;
  220. /*justify-content: space-between;*/
  221. align-items: center;
  222. .item-result-box-active {
  223. min-width: 320px;
  224. height: 92px;
  225. background: linear-gradient(180deg, #B6FFEF 0%, #C5EEFF 100%);
  226. box-shadow: inset 0px -2px 7px 0px #1E410E;
  227. border-radius: 5px 5px 5px 5px;
  228. border: 1px solid #A2F57F;
  229. font-weight: 400;
  230. font-size: 30px;
  231. color: #0DE6A1;
  232. line-height: 90px;
  233. text-align: center;
  234. margin-left: 50px;
  235. margin-right: 50px;
  236. margin-top: 32px;
  237. padding-left: 20px;
  238. padding-right: 20px;
  239. }
  240. .item-result-box {
  241. min-width: 320px;
  242. height: 92px;
  243. background: #E0EEF4;
  244. border-radius: 5px 5px 5px 5px;
  245. font-weight: 400;
  246. font-size: 30px;
  247. color: #000000;
  248. line-height: 90px;
  249. text-align: center;
  250. margin-left: 50px;
  251. margin-right: 50px;
  252. margin-top: 32px;
  253. padding-left: 20px;
  254. padding-right: 20px;
  255. }
  256. .item-result-box:hover {
  257. min-width: 320px;
  258. height: 92px;
  259. background: linear-gradient(180deg, #B6FFEF 0%, #C5EEFF 100%);
  260. box-shadow: inset 0px -2px 7px 0px #1E410E;
  261. border-radius: 5px 5px 5px 5px;
  262. border: 1px solid #A2F57F;
  263. font-weight: 400;
  264. font-size: 30px;
  265. color: #000000;
  266. line-height: 90px;
  267. text-align: center;
  268. margin-left: 50px;
  269. margin-top: 32px;
  270. padding-left: 20px;
  271. padding-right: 20px;
  272. }
  273. }
  274. }
  275. .hot-search {
  276. .title{
  277. height: 52px;
  278. /*margin-top: 16px;*/
  279. margin-left: 123px;
  280. font-weight: bold;
  281. font-size: 24px;
  282. color: #333333;
  283. line-height: 52px;
  284. letter-spacing: 3px;
  285. text-align: left;
  286. font-style: normal;
  287. text-transform: none;
  288. }
  289. }
  290. .search-item{
  291. height: 80px;
  292. border-radius: 5px;
  293. border: 1px solid #B3B3B3;
  294. margin-right: 26px;
  295. margin-bottom: 26px;
  296. padding: 0 44px;
  297. font-weight: 400;
  298. font-size: 24px;
  299. color: #333333;
  300. display: flex;
  301. align-items: center;
  302. letter-spacing: 3px;
  303. text-align: left;
  304. font-style: normal;
  305. text-transform: none;
  306. }
  307. </style>