home copy.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <template>
  2. <div class="page page-home" id="pageContainer">
  3. <div class="home-top">
  4. <div class="header">
  5. <home-header @login="emits('login')" sub-title="自然资源大模型" />
  6. </div>
  7. <div class="container">
  8. <div class="tool">
  9. <ul>
  10. <li class="active">
  11. <span class="iconfont icon-a-zu11199"></span>
  12. <span class="title">AI问答</span>
  13. </li>
  14. <li>
  15. <span class="iconfont icon-a-lujing11029"></span>
  16. <span class="title">智能选址</span>
  17. </li>
  18. <li>
  19. <span class="iconfont icon-66zhishikuguanli"></span>
  20. <span class="title">知识库</span>
  21. </li>
  22. </ul>
  23. </div>
  24. <div class="top-content">
  25. <div class="title">
  26. <div class="logo"></div>
  27. <div class="title-main"></div>
  28. </div>
  29. <div class="search-panel">
  30. <div class="type-box">
  31. <div class="scope-type-box">
  32. <div
  33. class="item"
  34. v-for="(item, index) in scopeTypes"
  35. :key="index"
  36. @click="toggleType(item, index)"
  37. :class="{ checked: activeTypeIndex == index }"
  38. >
  39. {{ item.name }}
  40. </div>
  41. </div>
  42. </div>
  43. <div class="search-input">
  44. <input
  45. type="text"
  46. v-model="question"
  47. @keydown.enter.native="search"
  48. :placeholder="placeholder"
  49. />
  50. <div class="input-tool">
  51. <div class="tool-box">
  52. <a-select v-model:value="scope.name" class="select">
  53. <a-select-option value="knowledge">知识库</a-select-option>
  54. <a-select-option value="paper">学术</a-select-option>
  55. <a-select-option value="net">全网</a-select-option>
  56. </a-select>
  57. <div class="ds-box">
  58. <div @click="dsChange('1')" :class="{active: isDeepSeek === '1'}">
  59. <i class="iconfont icon-deepsee"></i>
  60. </div>
  61. <div @click="dsChange('0')" :class="{active: isDeepSeek === '0'}">
  62. <i class="iconfont icon-tongyi"></i>
  63. </div>
  64. </div>
  65. </div>
  66. <button class="search-btn" @click="search" v-login-required>
  67. <span class="iconfont icon-a-zu11168"></span>
  68. </button>
  69. </div>
  70. </div>
  71. <div class="scopes">
  72. <div class="questions" v-if="typeIndex == 0">
  73. <slider-card-up-down @ask="jumpToSearch" />
  74. </div>
  75. </div>
  76. </div>
  77. <div class="ai_tool_box">
  78. <h4>AI工具</h4>
  79. <ul>
  80. <li @click="toToolPage('./#/policy/interpret')">
  81. <div>
  82. <div class="icon_box icon_box1">
  83. <span class="iconfont icon-a-lujing8796"></span>
  84. </div>
  85. <div>
  86. <p class="name">政策解读</p>
  87. <p>导入一个政策文件,AI快速总结政策要点</p>
  88. </div>
  89. </div>
  90. </li>
  91. <li @click="toToolPage('./#/policy/smart')">
  92. <div>
  93. <div class="icon_box icon_box2">
  94. <span class="iconfont icon-a-lujing8794"></span>
  95. </div>
  96. <div>
  97. <p class="name">政策比对</p>
  98. <p>导入两个政策文件,AI快速比对两个文件的区别</p>
  99. </div>
  100. </div>
  101. </li>
  102. </ul>
  103. </div>
  104. </div>
  105. <compare-policy />
  106. </div>
  107. </div>
  108. </div>
  109. </template>
  110. <script setup>
  111. import HomeHeader from '@/views/home/components/HomeHeader.vue';
  112. import { isEmptyStr } from '@/utils/common';
  113. import SliderCardUpDown from '@/components/NewSliderCardUpDown.vue';
  114. import ComparePolicy from './components/ComparePolicy.vue';
  115. const emits = defineEmits(['login']);
  116. const question = ref('');
  117. const activeTypeIndex = ref(0);
  118. const placeholder = ref('请输入您的问题,如“临时用地的审批流程”');
  119. const scopeTypes = ref([
  120. {
  121. name: '简洁',
  122. value: '0'
  123. },
  124. {
  125. name: '深入',
  126. value: '1'
  127. },
  128. {
  129. name: '研究',
  130. value: '2'
  131. }
  132. ]);
  133. const types = ref([
  134. {
  135. name: '简洁',
  136. key: '0'
  137. }, {
  138. name: '深入',
  139. key: '1'
  140. }, {
  141. name: '研究',
  142. key: '2'
  143. }
  144. ])
  145. const typeIndex = ref(0);
  146. const scope = ref({
  147. name: 'knowledge',
  148. type: '0'
  149. });
  150. const scopeQt = ref({
  151. name: 'title',
  152. type: '0'
  153. });
  154. const search = () => {
  155. if (typeIndex.value == 0) {
  156. if (!isEmptyStr(question.value)) {
  157. jumpToSearch(question.value);
  158. }
  159. } else if (typeIndex.value == 1) {
  160. var url =
  161. window.AppGlobalConfig.links[types.value[typeIndex.value].key] + '?keyword=' + question.value;
  162. window.open(url, '_blank');
  163. } else {
  164. var key = question.value;
  165. if (!key) {
  166. key = '=';
  167. }
  168. var url = window.AppGlobalConfig.links[types.value[typeIndex.value].key] + '?keyword=' + key;
  169. window.open(url, '_blank');
  170. }
  171. };
  172. const toggleType = (item, index) => {
  173. if (typeIndex.value == 0) {
  174. scope.value.type = item.value;
  175. } else {
  176. scopeQt.value.type = item.value;
  177. }
  178. activeTypeIndex.value = index;
  179. };
  180. const jumpToSearch = (q) => {
  181. const { name, type } = scope.value;
  182. window.open(`./#/ai-search?q=${encodeURIComponent(q)}&scope=${name}&type=${type}&ds=${isDeepSeek.value}`, '_blank');
  183. };
  184. const isDeepSeek = ref((localStorage.getItem("_isDeepSeek") || '1'))
  185. const dsChange = (type) => {
  186. isDeepSeek.value = type;
  187. localStorage.setItem("_isDeepSeek", type);
  188. }
  189. const toToolPage = (path) => {
  190. window.open(path, '_blank')
  191. }
  192. </script>
  193. <style scoped lang="scss">
  194. $selectHeight: 36px;
  195. .page-home {
  196. position: relative;
  197. .home-top {
  198. width: 100%;
  199. height: 100%;
  200. position: relative;
  201. background: url("/images/home/home_bg.jpg") no-repeat;
  202. background-size: 100% 100%;
  203. >.header {
  204. width: 100%;
  205. height: 60px;
  206. }
  207. >.container {
  208. display: flex;
  209. height: calc(100% - 60px);
  210. position: relative;
  211. >.tool {
  212. width: 96px;
  213. height: 100%;
  214. display: flex;
  215. align-items: center;
  216. background: #F4F7FD;
  217. box-shadow: 0px 4px 15px 1px rgba(0,54,116,0.15);
  218. >ul {
  219. width: 100%;
  220. text-align: center;
  221. padding: 8px;
  222. box-sizing: border-box;
  223. transform: translateY(-30%);
  224. >li {
  225. padding: 10px 0px;
  226. text-align: center;
  227. margin: 10px auto;
  228. cursor: pointer;
  229. >.iconfont {
  230. display: block;
  231. font-size: 28px;
  232. margin: auto;
  233. margin-bottom: 3px;
  234. color: #222222;
  235. }
  236. >.title {
  237. font-size: 14px;
  238. color: #373C45;
  239. white-space: nowrap;
  240. }
  241. &:hover, &.active {
  242. background: #E0EAFA;
  243. border-radius: 12px;
  244. >.iconfont {
  245. color: #507FFF;
  246. }
  247. }
  248. }
  249. }
  250. }
  251. >.top-content {
  252. width: calc(100% - 96px);
  253. padding-top: 100px;
  254. box-sizing: border-box;
  255. display: flex;
  256. flex-direction: column;
  257. align-items: center;
  258. .title {
  259. display: flex;
  260. flex-direction: column;
  261. justify-content: center;
  262. align-items: center;
  263. margin-bottom: 45px;
  264. >.logo {
  265. width: 66px;
  266. height: 66px;
  267. background: url('@/assets/images/home/logo.png') no-repeat;
  268. background-size: 100% 100%;
  269. }
  270. &-main {
  271. width: 480px;
  272. height: 66px;
  273. background: url('@/assets/images/home/icon-title-main.png') no-repeat;
  274. background-size: 100% 100%;
  275. margin-bottom: 11px;
  276. }
  277. &-sub {
  278. font-family: PingFang SC, PingFang SC;
  279. font-weight: 500;
  280. font-size: 20px;
  281. color: #4B525F;
  282. letter-spacing: 10px;
  283. text-align: left;
  284. font-style: normal;
  285. text-transform: none;
  286. }
  287. }
  288. .search-panel {
  289. width: 960px;
  290. .type-box {
  291. display: flex;
  292. margin-bottom: 10px;
  293. justify-content: space-between;
  294. >.scope-type-box {
  295. display: flex;
  296. background: #FFFFFF;
  297. border-radius: 7px;
  298. border: 1px solid #E3E4E4;;
  299. padding: 2px;
  300. >.item {
  301. color: #4A4F55;
  302. border-radius: 7px;
  303. padding: 6px 18px;
  304. flex: 1;
  305. display: flex;
  306. align-items: center;
  307. cursor: pointer;
  308. font-size: 14px;
  309. &.checked {
  310. background: #0E83F8;
  311. color: #FFF;
  312. }
  313. }
  314. }
  315. }
  316. .search-input {
  317. width: 960px;
  318. position: relative;
  319. margin-bottom: 19px;
  320. background: #FFFFFF;
  321. box-shadow: 0px 8px 16px 1px rgba(11,53,103,0.1);
  322. border-radius: 12px;
  323. border: 1px solid #E5E6EA;
  324. padding: 10px 20px;
  325. >input {
  326. width: 100%;
  327. padding: 15px 0px;
  328. background: #ffffff;
  329. font-family: PingFang SC, PingFang SC;
  330. border: 0px;
  331. border-bottom: 1px solid rgba(228, 231, 234, 0.6);
  332. &:hover,
  333. &:focus,
  334. &:focus-visible {
  335. border-bottom: 1px solid #0e83f8;
  336. outline: none;
  337. }
  338. &::placeholder {
  339. color: #858C93;
  340. font-size: 18px;
  341. }
  342. }
  343. >.input-tool {
  344. margin-top: 10px;
  345. display: flex;
  346. justify-content: space-between;
  347. >.tool-box {
  348. display: flex;
  349. align-items: center;
  350. .select {
  351. height: $selectHeight;
  352. left: 2px;
  353. border-radius: 5px;
  354. margin-right: 10px;
  355. border: 1px solid #E3E4E4;
  356. overflow: hidden;
  357. :deep(.ant-select-selector) {
  358. border: none;
  359. height: $selectHeight;
  360. line-height: $selectHeight;
  361. box-shadow: none;
  362. }
  363. :deep(.ant-select-selection-item) {
  364. line-height: $selectHeight;
  365. font-family: PingFang SC, PingFang SC;
  366. font-size: 15px;
  367. color: #34383C;
  368. text-align: center;
  369. margin-right: 4px;
  370. }
  371. :deep(.ant-select-arrow) {
  372. margin-top: -4px;
  373. }
  374. }
  375. .ds-box {
  376. display: flex;
  377. height: 36px;
  378. align-items: center;
  379. border: 1px solid #E3E4E4;
  380. background: #fff;
  381. border-radius: 5px;
  382. overflow: hidden;
  383. >div {
  384. height: 100%;
  385. display: flex;
  386. align-items: center;
  387. justify-content: center;
  388. width: 108px;
  389. cursor: pointer;
  390. padding: 10px 0px;
  391. &.active {
  392. background: #f2f5fe;
  393. border: 1px solid #0E83F8;
  394. &:nth-child(1) {
  395. border-top-left-radius: 5px;
  396. border-bottom-left-radius: 5px;
  397. .iconfont {
  398. color: #4f6bfe;
  399. }
  400. }
  401. &:nth-child(2) {
  402. border-top-right-radius: 5px;
  403. border-bottom-right-radius: 5px;
  404. .iconfont {
  405. color: #605BEC;
  406. }
  407. }
  408. }
  409. .iconfont {
  410. color: #34383C;
  411. margin-top: 2px;
  412. }
  413. &:nth-child(1) {
  414. .iconfont {
  415. font-size: 16px;
  416. }
  417. }
  418. &:nth-child(2) {
  419. .iconfont {
  420. font-size: 22px;
  421. }
  422. }
  423. }
  424. .sw {
  425. :deep(.ant-switch) {
  426. background-color: #eaeaea;
  427. }
  428. :deep(.ant-switch-handle::before) {
  429. background-color: #fff;
  430. }
  431. }
  432. }
  433. }
  434. .search-btn {
  435. border-radius: 6px;
  436. cursor: pointer;
  437. border: none;
  438. padding: 10px;
  439. background: linear-gradient( 124deg, #505DFF 0%, #418CFF 100%);
  440. >.iconfont {
  441. display: block;
  442. width: 30px;
  443. height: 30px;
  444. font-size: 26px;
  445. color: #fff;
  446. }
  447. }
  448. }
  449. }
  450. .scopes {
  451. display: flex;
  452. margin-bottom: 20px;
  453. font-weight: 400;
  454. font-size: 14px;
  455. text-align: left;
  456. height: 32px;
  457. font-style: normal;
  458. text-transform: none;
  459. color: #fff;
  460. .scope {
  461. flex: 1;
  462. display: flex;
  463. align-items: center;
  464. &-type {
  465. justify-content: flex-start;
  466. }
  467. :deep(.ant-radio-wrapper) {
  468. color: #fff;
  469. }
  470. }
  471. .questions {
  472. flex: 1;
  473. }
  474. }
  475. }
  476. .ai_tool_box {
  477. width: 960px;
  478. >h4 {
  479. color: #353745;
  480. font-size: 20px;
  481. }
  482. >ul {
  483. >li {
  484. cursor: pointer;
  485. border: 1px solid #E5E6EA;
  486. background: #fff;
  487. padding: 20px 15px;
  488. border-radius: 5px;
  489. display: inline-block;
  490. box-sizing: border-box;
  491. box-shadow: 0px 4px 8px 1px rgba(33,50,70,0.06);
  492. width: calc(50% - 15px);
  493. &:nth-child(2n+1) {
  494. margin-right: 15px;
  495. }
  496. &:nth-child(2n+2) {
  497. margin-left: 15px;
  498. }
  499. >div {
  500. height: 100%;
  501. display: flex;
  502. align-items: center;
  503. >.icon_box {
  504. width: 40px;
  505. height: 40px;
  506. line-height: 40px;
  507. border-radius: 4px;
  508. text-align: center;
  509. margin-right: 10px;
  510. >.iconfont {
  511. font-size: 22px;
  512. display: inline-block;
  513. }
  514. &.icon_box1 {
  515. background: #D4F3F7;
  516. >.iconfont {
  517. color: #29BECD;
  518. }
  519. }
  520. &.icon_box2 {
  521. background: #E5EFFC;
  522. >.iconfont {
  523. color: #4F7FFF;
  524. }
  525. }
  526. }
  527. >div {
  528. >p {
  529. margin: 5px 0px;
  530. color: #76808E;
  531. font-size: 15px;
  532. &.name {
  533. font-size: 18px;
  534. font-weight: bold;
  535. color: #414355;
  536. }
  537. }
  538. }
  539. }
  540. }
  541. }
  542. }
  543. }
  544. }
  545. }
  546. }
  547. </style>