km-knowledge-home.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296
  1. <template>
  2. <div>
  3. <div :class="$style.banner">
  4. <div :class="$style.headers">
  5. <div :class="$style.logo">
  6. <img src="../../../src_custom/images/logo.png" alt="" />
  7. <span :class="$style.logotitle">知识管理系统</span>
  8. </div>
  9. <div :class="$style.info">
  10. <a href="#" disabled="true">共有 {{ knowledgeInfoCountData.knowledgeCount }} 个知识</a>
  11. <a-divider type="vertical" />
  12. <a href="#" disabled="true">本月新增 {{ knowledgeInfoCountData.newKnowledge }} 份知识</a>
  13. <a-divider type="vertical" />
  14. <a href="#" disabled="true">本月预览 {{ knowledgeInfoCountData.newPreview }}</a>
  15. <a-divider type="vertical" />
  16. <a href="#" disabled="true">本月下载 {{ knowledgeInfoCountData.newDownload }}</a>
  17. <a-divider type="vertical" />
  18. <a href="#" disabled="true">本月评论 {{ knowledgeInfoCountData.newComment }}</a>
  19. </div>
  20. <div :class="$style.userInfo">
  21. <a-dropdown>
  22. <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
  23. <a-avatar
  24. :class="$style.userinfo"
  25. icon="user"
  26. size="small"
  27. :src="`api/mobile/v1/user-manager/userAvatar/${userInfo.account}` | sdResource"
  28. alt="avatar"
  29. />{{ userInfo.name }}<a-icon type="down" />
  30. </a>
  31. <a-menu slot="overlay">
  32. <a-menu-item>
  33. <a
  34. href="javascript:;"
  35. @click="
  36. $router.replace({
  37. path: 'sd-frame/km-my-knowledge',
  38. })
  39. "
  40. >个人中心</a
  41. >
  42. </a-menu-item>
  43. <a-menu-item>
  44. <a href="javascript:;" @click="logout">退出登录</a>
  45. </a-menu-item>
  46. </a-menu>
  47. </a-dropdown>
  48. <a :class="$style.goWork" href="javascript:;" @click="$router.push('/sd-frame')"
  49. >进入工作台</a
  50. >
  51. </div>
  52. </div>
  53. <div :class="$style.search">
  54. <a-input-search :class="$style.searchInput" placeholder="全文检索" @search="onSearch" />
  55. <div :class="$style.hotLabel">
  56. 热门搜索:
  57. <span v-for="(item, index) in hotwordsofday" :key="index" @click="goMoreSearch(item)">{{
  58. item
  59. }}</span>
  60. </div>
  61. </div>
  62. </div>
  63. <div :class="$style.content">
  64. <a-layout-content :class="$style.div">
  65. <a-row :gutter="24">
  66. <a-col :span="6">
  67. <div :class="$style.leftContent">
  68. <!-- 知识分类 -->
  69. <div :class="[$style.divContent, $style.type]">
  70. <h3 :class="$style.tt">
  71. <i :class="$style.icons"></i>
  72. 知识分类
  73. <a href="javascript:;" @click="click(item)">更多 <a-icon type="right"/></a>
  74. </h3>
  75. <div :class="$style.hd">
  76. <a-empty v-if="noTypeData" />
  77. <a-skeleton active :paragraph="{ rows: 5 }" :loading="loading" />
  78. <ul>
  79. <li v-for="(item, index) in knowledgeCategoryData" :key="index">
  80. <p :title="item.knowledgeCategoryName">{{ item.knowledgeCategoryName }}</p>
  81. <span>{{ item.knowledgeCount }}</span>
  82. </li>
  83. </ul>
  84. </div>
  85. </div>
  86. <!-- 个人榜 -->
  87. <div :class="[$style.divContent, $style.listTabs]">
  88. <div :class="$style.tab">
  89. <div :class="$style.tabshd">
  90. <span :class="[num === 0 ? $style.active : '']" @click="num = 0">个人榜</span>
  91. <span :class="[num === 1 ? $style.active : '']" @click="num = 1">投稿榜</span>
  92. </div>
  93. <div :class="$style.tabbd">
  94. <div v-show="num === 0">
  95. <a-skeleton active :loading="loading" />
  96. <a-empty v-if="noPointData" />
  97. <ul>
  98. <li v-for="(item, index) in pointData" :key="index">
  99. <span
  100. :class="[
  101. $style.ranking,
  102. index === 0
  103. ? $style.rankingone
  104. : index === 1
  105. ? $style.rankingtwo
  106. : index === 2
  107. ? $style.rankingthree
  108. : '',
  109. ]"
  110. >{{ index + 1 }}</span
  111. >
  112. <span>{{ item.userName }}</span>
  113. <span :class="$style.num">{{ item.value }} 分</span>
  114. </li>
  115. </ul>
  116. </div>
  117. <div v-show="num === 1">
  118. <a-empty v-if="noContributionData" />
  119. <a-skeleton active :loading="loading" />
  120. <ul>
  121. <li v-for="(item, index) in contributionData" :key="index">
  122. <span
  123. :class="[
  124. $style.ranking,
  125. index === 0
  126. ? $style.rankingone
  127. : index === 1
  128. ? $style.rankingtwo
  129. : index === 2
  130. ? $style.rankingthree
  131. : '',
  132. ]"
  133. >{{ index + 1 }}</span
  134. >
  135. <span>{{ item.userName }}</span>
  136. <span :class="$style.num">{{ item.value }} </span>
  137. </li>
  138. </ul>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <!-- 热搜标签 -->
  144. <div :class="[$style.divContent, $style.hot]">
  145. <h3 :class="$style.tt">
  146. <i :class="$style.icons"></i>
  147. 热搜标签
  148. <a href="javascript:;" @click="moreHotTag">更多 <a-icon type="right"/></a>
  149. </h3>
  150. <div :class="$style.hotbd">
  151. <a-empty v-if="noTagData" />
  152. <a-skeleton active :loading="loading" />
  153. <div id="main" :class="$style.main"></div>
  154. </div>
  155. </div>
  156. <!-- 年度分享达人 -->
  157. <div :class="[$style.divContent, $style.share]">
  158. <h3 :class="$style.tt">
  159. <i :class="$style.icons"></i>
  160. 年度分享达人
  161. </h3>
  162. <div :class="$style.sharebd">
  163. <a-empty v-if="noShareData" />
  164. <a-skeleton active :paragraph="{ rows: 1 }" :loading="loading" />
  165. <ul :class="$style.ullist">
  166. <li v-for="item in topSharerData" :key="item.value">
  167. <i :class="$style.useri"></i>
  168. <a-avatar
  169. :class="$style.userinfo"
  170. icon="user"
  171. :size="43"
  172. :src="
  173. `api/mobile/v1/user-manager/userAvatar/${item.userAccount}` | sdResource
  174. "
  175. alt="avatar"
  176. />
  177. <p>{{ item.userName }}</p>
  178. </li>
  179. </ul>
  180. </div>
  181. </div>
  182. </div>
  183. </a-col>
  184. <a-col :span="13">
  185. <div :class="$style.centerContent">
  186. <!-- 最新知识 -->
  187. <div :class="[$style.divContent, $style.newKnow]">
  188. <h3 :class="$style.tt">
  189. <i :class="$style.icons"></i>
  190. 最新知识
  191. <!-- <a href="#">更多 <a-icon type="right"/></a> -->
  192. </h3>
  193. <div :class="$style.newKonwbd">
  194. <a-empty v-if="noNewData" />
  195. <a-skeleton active :loading="loading" />
  196. <div
  197. v-for="item in latestKnowledgeData.slice(0, 1)"
  198. :key="item.id"
  199. :class="$style.fristNews"
  200. @click="toLook(item)"
  201. >
  202. <p :class="$style.title">{{ item.title }}</p>
  203. <span>{{ item.abstractMessage }}</span>
  204. </div>
  205. <ul :class="$style.ullist">
  206. <li v-for="item in latestKnowledgeData.slice(1)" :key="item.id">
  207. <span @click="toLook(item)">{{ item.title }}</span>
  208. <i>{{ item.creationTime | sdDateFormat('YYYY-MM-DD') }}</i>
  209. </li>
  210. </ul>
  211. </div>
  212. </div>
  213. <!-- 阅读排行 -->
  214. <div :class="[$style.divContent, $style.newKnow, $style.readList]">
  215. <h3 :class="$style.tt">
  216. <i :class="$style.icons"></i>
  217. 阅读排行
  218. <!-- <a href="#">更多 <a-icon type="right"/></a> -->
  219. </h3>
  220. <div :class="$style.newKonwbd">
  221. <a-empty v-if="noreadData" />
  222. <a-skeleton active :loading="loading" />
  223. <div
  224. v-for="item in topReadData.slice(0, 1)"
  225. :key="item.id"
  226. :class="$style.fristNews"
  227. @click="toLook(item)"
  228. >
  229. <p :class="$style.title">{{ item.title }}</p>
  230. <span>{{ item.abstractMessage }}</span>
  231. </div>
  232. <ul :class="$style.ullist">
  233. <li v-for="item in topReadData.slice(1)" :key="item.id">
  234. <span @click="toLook(item)">{{ item.title }}</span>
  235. <i>{{ item.creationTime | sdDateFormat('YYYY-MM-DD') }}</i>
  236. </li>
  237. </ul>
  238. </div>
  239. </div>
  240. <!-- 推荐排行 -->
  241. <div :class="[$style.divContent, $style.recommend]">
  242. <h3 :class="$style.tt">
  243. <i :class="$style.icons"></i>
  244. 推荐排行
  245. <!-- <a href="#">更多 <a-icon type="right"/></a> -->
  246. </h3>
  247. <a-empty v-if="noRecommendData" />
  248. <a-skeleton active :loading="loading" />
  249. <ul :class="$style.ullist">
  250. <li v-for="(item, index) in recommendData" :key="item.knowledgeId">
  251. <i>{{ index + 1 }}.</i>
  252. <span @click="toLook(item)">{{ item.title }}</span>
  253. </li>
  254. </ul>
  255. </div>
  256. </div>
  257. </a-col>
  258. <a-col :span="5">
  259. <div :class="$style.rightContent">
  260. <!-- 登录 -->
  261. <div :class="[$style.divContent, $style.loginInfo]">
  262. <div :class="$style.guide">
  263. <h1><i></i>我的积分</h1>
  264. </div>
  265. <p :class="$style.num">
  266. <span v-for="(item, index) in strI" :key="index" :class="$style.filesNum">{{
  267. item
  268. }}</span>
  269. 我已贡献<i>{{
  270. myPointData.contribution === null ? 0 : myPointData.contribution
  271. }}</i
  272. >份知识
  273. </p>
  274. <a-button type="primary" block @click="goKnowLedge">
  275. 上传知识
  276. </a-button>
  277. <ul>
  278. <li @click="$router.replace({ path: '/sd-frame/km-mytodolist' })"
  279. ><a-icon type="clock-circle" />待我审的({{
  280. myPointData.todo === null ? 0 : myPointData.todo
  281. }})</li
  282. >
  283. <li @click="$router.replace({ path: '/sd-frame/km-my-knowledge' })"
  284. ><a-icon type="sd-hat" />我的知识({{
  285. myPointData.contribution === null ? 0 : myPointData.contribution
  286. }})</li
  287. >
  288. <li @click="$router.replace({ path: '/sd-frame/km-my-favorites' })"
  289. ><a-icon type="star" />收藏知识({{
  290. myPointData.favorite === null ? 0 : myPointData.favorite
  291. }})</li
  292. >
  293. <li @click="$router.replace({ path: '/sd-frame/km-my-recommend' })"
  294. ><a-icon type="like" />推荐知识({{
  295. myPointData.recommend === null ? 0 : myPointData.recommend
  296. }})</li
  297. >
  298. <li @click="$router.replace({ path: '/sd-frame/km-my-commend' })"
  299. ><a-icon type="edit" />点评知识({{
  300. myPointData.comment === null ? 0 : myPointData.comment
  301. }})</li
  302. >
  303. <li @click="$router.replace({ path: '/sd-frame/km-my-borrow' })"
  304. ><a-icon type="sd-swap2" />借阅知识({{
  305. myPointData.borrow === null ? 0 : myPointData.borrow
  306. }})</li
  307. >
  308. </ul>
  309. </div>
  310. <!-- 知识地图 -->
  311. <div :class="[$style.divContent, $style.map]">
  312. <h3 :class="$style.tt">
  313. <i :class="$style.icons"></i>
  314. 知识地图
  315. <a href="javascript:;" @click="mapMore">更多 <a-icon type="right"/></a>
  316. </h3>
  317. <a-empty v-if="noData" />
  318. <a-skeleton active :loading="loading" />
  319. <ul>
  320. <li
  321. v-for="item in latestKnowledgeMapData"
  322. :key="item.kmapCategoryId"
  323. @click="goMap(item)"
  324. >
  325. <div :class="$style.mapImg">
  326. <img
  327. v-if="item.cover !== null"
  328. :src="
  329. (`api/flow-mobile/v1/task-form-process/download-attachments/` +
  330. item.cover)
  331. | sdResource
  332. "
  333. />
  334. <a-empty v-else :class="$style.noImg" :description="'暂无图片'" />
  335. </div>
  336. <div :class="$style.mapInfo">
  337. <p :class="$style.title">{{ item.kmapName }}</p>
  338. <p :title="item.abstractMessage" :class="$style.message">{{
  339. item.abstractMessage
  340. }}</p>
  341. <p
  342. ><a-icon type="sd-eye" />
  343. {{ item.readTimes === null ? '0' : item.readTimes }}</p
  344. >
  345. </div>
  346. </li>
  347. </ul>
  348. </div>
  349. </div>
  350. </a-col>
  351. </a-row>
  352. </a-layout-content>
  353. </div>
  354. <div :class="$style.footer">
  355. <p>Copyright 2020 DCI.GOA All Rights Reserved</p>
  356. <p>建议使用Firefox49-52 或 IE11浏览器,1920X1080分辨率访问本系统.</p>
  357. </div>
  358. </div>
  359. </template>
  360. <script>
  361. import loginService from '@/login/login-service'
  362. import 'echarts/theme/macarons.js'
  363. import storeMixin from '@/common/store-mixin'
  364. import KmKnowledageService from '../km-knowledage-service'
  365. import components from './_import-components/km-knowledge-home-import'
  366. const echarts = require('echarts/lib/echarts')
  367. require('echarts-wordcloud')
  368. export default {
  369. name: 'KmKnowledgeHome',
  370. metaInfo: {
  371. title: '知识门户',
  372. },
  373. components: {
  374. ...components,
  375. },
  376. mixins: [storeMixin],
  377. data() {
  378. return {
  379. // 热搜词组
  380. hotwordsofday: [],
  381. // 知识统计
  382. knowledgeInfoCountData: {},
  383. // 知识分类
  384. knowledgeCategoryData: [],
  385. // 个人榜
  386. pointData: [],
  387. // 投稿榜
  388. contributionData: [],
  389. // 热门标签
  390. hotTagData: [],
  391. // 分享达人
  392. topSharerData: [],
  393. // 最新知识
  394. latestKnowledgeData: [],
  395. // 阅读排行
  396. topReadData: [],
  397. // 推荐排行
  398. recommendData: [],
  399. // 知识地图
  400. latestKnowledgeMapData: [],
  401. // 我的积分
  402. myPointData: {},
  403. num: 0,
  404. allFiles: 68,
  405. strI: '',
  406. myChart: null,
  407. noData: false,
  408. noreadData: false,
  409. noRecommendData: false,
  410. noNewData: false,
  411. noShareData: false,
  412. noTypeData: false,
  413. noPointData: false,
  414. noContributionData: false,
  415. noTagData: false,
  416. loading: false,
  417. }
  418. },
  419. created() {},
  420. mounted() {
  421. this.loading = true
  422. // 获取热门词组
  423. this.queryHotWords()
  424. // 热搜词
  425. this.queryHotwordsofday()
  426. // 获取知识数量统计
  427. this.queryKnowledgeCount()
  428. // 知识分类列表
  429. this.queryKnowledgeCategory()
  430. // 获取个人榜和投稿榜
  431. this.queryPersonalList()
  432. // 获取热搜标签
  433. this.queryHotTag()
  434. // 获取年度分享达人
  435. this.queryTopSharer()
  436. // 获取最新知识
  437. this.queryLatestKnowledge()
  438. // 获取阅读排行
  439. this.queryTopRead()
  440. // 推荐排行
  441. this.queryRecommend()
  442. // 获取知识地图
  443. this.queryLatestKnowledgeMap()
  444. // 获取我的积分
  445. this.queryMyPoint()
  446. },
  447. methods: {
  448. logout() {
  449. loginService.doLogout()
  450. },
  451. goKnowLedge() {
  452. window.open('#/sd-frame/km-knowledage-base', '_blank')
  453. },
  454. queryHotwordsofday() {
  455. const params = {
  456. days: 7,
  457. }
  458. KmKnowledageService.getHotwordsofday(params).then((res) => {
  459. if (res.data.length > 0) {
  460. this.hotwordsofday = res.data
  461. } else {
  462. this.hotwordsofday = []
  463. }
  464. })
  465. },
  466. goMoreSearch(val) {
  467. window.open(`${this.$router.resolve('/km-knowledge-fullsearch').href}?searchVal=${val}`)
  468. },
  469. moreHotTag() {
  470. window.open(`${this.$router.resolve('/km-knowledge-fullsearch').href}`)
  471. },
  472. click(record) {
  473. const url = `#/sd-frame/km-knowledage-base`
  474. window.open(url)
  475. },
  476. queryHotWords() {
  477. KmKnowledageService.getHotWords().then((res) => {})
  478. },
  479. queryMyPoint() {
  480. KmKnowledageService.getMyPoint().then((res) => {
  481. this.myPointData = res.data
  482. this.strI = this.myPointData.point.toString().replace(/\B(?=(\d{3})+$)/g, ',')
  483. })
  484. },
  485. queryKnowledgeCount() {
  486. KmKnowledageService.getKnowledgeCount().then((res) => {
  487. this.knowledgeInfoCountData = res.data
  488. })
  489. },
  490. queryKnowledgeCategory() {
  491. this.loading = true
  492. KmKnowledageService.getKnowledgeCategory().then((res) => {
  493. this.loading = false
  494. if (res.data.length > 0) {
  495. this.knowledgeCategoryData = res.data
  496. } else {
  497. this.knowledgeCategoryData = []
  498. this.noTypeData = true
  499. }
  500. })
  501. },
  502. queryPersonalList() {
  503. this.loading = true
  504. KmKnowledageService.getPersonalList().then((res) => {
  505. this.loading = false
  506. if (res.data.point.length > 0) {
  507. this.pointData = res.data.point
  508. } else {
  509. this.pointData = []
  510. this.noPointData = true
  511. }
  512. if (res.data.contribution.length > 0) {
  513. this.contributionData = res.data.contribution
  514. } else {
  515. this.contributionData = []
  516. this.noContributionData = true
  517. }
  518. })
  519. },
  520. queryHotTag() {
  521. this.loading = true
  522. KmKnowledageService.getHotTag().then((res) => {
  523. this.loading = false
  524. const hotTagData = res.data
  525. if (hotTagData.length > 0) {
  526. hotTagData.forEach((e) => {
  527. const hotTagObj = {}
  528. hotTagObj.name = e.tagName
  529. hotTagObj.value = e.count
  530. hotTagObj.id = e.tagId
  531. this.hotTagData.push(hotTagObj)
  532. this.hotWord()
  533. })
  534. } else {
  535. this.noTagData = true
  536. }
  537. })
  538. },
  539. queryTopSharer() {
  540. this.loading = true
  541. KmKnowledageService.getTopSharer().then((res) => {
  542. this.loading = false
  543. if (res.data.length > 0) {
  544. this.topSharerData = res.data
  545. } else {
  546. this.topSharerData = []
  547. this.noShareData = true
  548. }
  549. })
  550. },
  551. queryLatestKnowledge() {
  552. this.loading = true
  553. KmKnowledageService.getLatestKnowledge({ size: 7 }).then((res) => {
  554. this.loading = false
  555. if (res.data.length > 0) {
  556. this.latestKnowledgeData = res.data
  557. } else {
  558. this.latestKnowledgeData = []
  559. this.noNewData = true
  560. }
  561. })
  562. },
  563. queryTopRead() {
  564. KmKnowledageService.getTopRead({ size: 6 }).then((res) => {
  565. if (res.data.length > 0) {
  566. this.topReadData = res.data
  567. } else {
  568. this.topReadData = []
  569. this.noreadData = true
  570. }
  571. })
  572. },
  573. queryRecommend() {
  574. KmKnowledageService.getRecommend({ size: 8 }).then((res) => {
  575. if (res.data.length > 0) {
  576. this.recommendData = res.data
  577. } else {
  578. this.recommendData = []
  579. this.noRecommendData = true
  580. }
  581. })
  582. },
  583. queryLatestKnowledgeMap() {
  584. this.loading = true
  585. KmKnowledageService.getLatestKnowledgeMap({ size: 4 }).then((res) => {
  586. this.loading = false
  587. if (res.data.length > 0) {
  588. this.latestKnowledgeMapData = res.data
  589. } else {
  590. this.latestKnowledgeMapData = []
  591. this.noData = true
  592. }
  593. })
  594. },
  595. // 全文检索
  596. onSearch(value) {
  597. window.open(`${this.$router.resolve('/km-knowledge-fullsearch').href}?searchVal=${value}`)
  598. },
  599. // 词云
  600. hotWord() {
  601. var myChart = echarts.init(document.getElementById('main'))
  602. myChart.setOption({
  603. backgroundColor: '#fff',
  604. tooltip: {
  605. show: false,
  606. },
  607. clickable: true,
  608. series: [
  609. {
  610. type: 'wordCloud',
  611. shape: 'circle',
  612. left: 'center',
  613. top: 'center',
  614. width: '100%',
  615. height: '100%',
  616. right: null,
  617. bottom: null,
  618. gridSize: this.hotTagData.length < 10 ? 14 : 12, // 字符之间的间距(int)
  619. sizeRange: [14, 22], // 字符的范围(array)
  620. rotationRange: [0, 0], // 字符倾斜的角度(array)
  621. autoSize: {
  622. enable: true,
  623. minSize: 6,
  624. },
  625. textPadding: 0,
  626. clickable: true,
  627. drawOutOfBound: false,
  628. textStyle: {
  629. normal: {
  630. color: function() {
  631. return (
  632. 'rgb(' +
  633. [
  634. Math.round(Math.random() * 256),
  635. Math.round(Math.random() * 256),
  636. Math.round(Math.random() * 256),
  637. ].join(',') +
  638. ')'
  639. )
  640. },
  641. },
  642. },
  643. data: this.hotTagData,
  644. },
  645. ],
  646. })
  647. // 防止重复触发点击事件
  648. if (myChart._$handlers.click) {
  649. myChart._$handlers.click.length = 0
  650. }
  651. myChart.on('click', function(params) {
  652. window.open(`#/km-knowledge-fullsearch?searchVal=${params.data.name}`)
  653. })
  654. },
  655. toLook(item) {
  656. window.open(`#/km-knowledage-view?id=${item.id}&title=${item.title}`, '_blank')
  657. },
  658. mapMore() {
  659. window.open(`#/sd-frame/km-knowledge-map`, '_blank')
  660. },
  661. goMap(item) {
  662. window.open(`#/km-kmap-pages/${item.id}`, '_blank')
  663. },
  664. },
  665. }
  666. </script>
  667. <style module lang="scss">
  668. @use '@/common/design' as *;
  669. $font-color: #ededed;
  670. $font-size: 14px;
  671. $font-color: #333;
  672. $font-more-color: #999;
  673. $font-color-sm: #666;
  674. $font-yahei: 'PingFangSC-Medium';
  675. $ul-line-height: 43px;
  676. $color-red: #e02121;
  677. $color-blue: #5692f5;
  678. $h-line-height: 56px;
  679. $logotitle-size: 20px;
  680. .banner {
  681. width: 100%;
  682. height: 328px;
  683. background: url(../images/home-banner.png) no-repeat;
  684. background-size: 100% 100%;
  685. .headers {
  686. max-width: 1200px;
  687. padding-top: 10px;
  688. margin: 0 auto;
  689. .logo {
  690. margin-right: 30px;
  691. .logotitle {
  692. position: relative;
  693. top: 2px;
  694. display: inline-block;
  695. margin-left: 30px;
  696. font-size: $logotitle-size;
  697. font-weight: 700;
  698. color: $white;
  699. }
  700. }
  701. .logo,
  702. .info {
  703. float: left;
  704. }
  705. .info {
  706. padding-top: 4px;
  707. a {
  708. font-size: $font-size-sm;
  709. color: $white;
  710. }
  711. }
  712. .user-info {
  713. float: right;
  714. padding-top: 5px;
  715. font-size: $font-size-sm;
  716. a {
  717. color: $white;
  718. .userinfo {
  719. width: 18px;
  720. height: 18px;
  721. margin-right: 4px;
  722. vertical-align: top;
  723. border-radius: 50%;
  724. }
  725. }
  726. .go-work {
  727. padding-left: 22px;
  728. }
  729. }
  730. }
  731. .search {
  732. width: 612px;
  733. margin: 120px auto 0;
  734. .search-input {
  735. width: 612px;
  736. input {
  737. height: 54px;
  738. }
  739. }
  740. .hot-label {
  741. margin-top: 16px;
  742. font-size: $font-size-sm;
  743. color: $white;
  744. span {
  745. padding-right: 13px;
  746. &:hover {
  747. color: $primary-color;
  748. cursor: pointer;
  749. }
  750. }
  751. }
  752. }
  753. }
  754. .content {
  755. ul {
  756. padding: 0;
  757. margin: 0;
  758. li {
  759. list-style: none;
  760. }
  761. }
  762. width: 100%;
  763. padding: 20px 0;
  764. background: #eff3fa;
  765. .div-content {
  766. padding: 14px;
  767. background: $white;
  768. border-radius: $border-radius-base;
  769. h3.tt {
  770. height: 36px;
  771. font-size: $btn-font-size-sm;
  772. color: $font-color;
  773. border-bottom: 1px solid #efe9e9;
  774. i.icons {
  775. display: inline-block;
  776. width: 26px;
  777. height: 26px;
  778. margin-right: 5px;
  779. vertical-align: bottom;
  780. }
  781. a {
  782. float: right;
  783. margin-top: 5px;
  784. font-size: $font-size-sm;
  785. color: $font-more-color;
  786. }
  787. }
  788. }
  789. .div {
  790. max-width: 1200px;
  791. margin: 0 auto 40px;
  792. }
  793. .left-content {
  794. float: left;
  795. width: 286px;
  796. .type {
  797. height: 365px;
  798. h3 {
  799. i.icons {
  800. background: url(../images/home-icon.png) no-repeat 0 0;
  801. }
  802. }
  803. .hd {
  804. ul {
  805. li {
  806. float: left;
  807. width: 50%;
  808. padding-right: 10px;
  809. padding-left: 20px;
  810. border-right: 1px solid #efe9e9;
  811. &:nth-of-type(2n) {
  812. border-right: 0;
  813. }
  814. p {
  815. height: 31px;
  816. padding-top: 10px;
  817. margin-bottom: 0;
  818. overflow: hidden;
  819. font-family: $font-yahei;
  820. font-size: $font-size;
  821. font-weight: 500;
  822. color: $font-color;
  823. text-overflow: ellipsis;
  824. letter-spacing: 2px;
  825. word-break: break-all;
  826. white-space: nowrap;
  827. }
  828. span {
  829. font-size: $font-size-sm;
  830. color: $font-color;
  831. opacity: 0.6;
  832. }
  833. }
  834. }
  835. }
  836. }
  837. .list-tabs {
  838. height: 445px;
  839. margin-top: 20px;
  840. .tabshd {
  841. height: 40px;
  842. margin-bottom: 20px;
  843. border-bottom: 1px solid #efe9e9;
  844. span {
  845. display: inline-block;
  846. width: 50%;
  847. text-align: center;
  848. cursor: pointer;
  849. &.active {
  850. font-weight: 500;
  851. color: $primary-color;
  852. &::after {
  853. display: block;
  854. width: 50px;
  855. height: 2px;
  856. margin: 14px auto 0;
  857. text-align: center;
  858. content: '';
  859. background: $primary-color;
  860. }
  861. }
  862. }
  863. }
  864. ul {
  865. li {
  866. padding-bottom: 12px;
  867. font-size: $font-size-base;
  868. font-weight: 500;
  869. color: $font-color;
  870. .ranking {
  871. display: inline-block;
  872. width: 23px;
  873. margin-right: 15px;
  874. text-align: center;
  875. }
  876. &:first-child {
  877. .rankingone {
  878. width: 23px;
  879. height: 13px;
  880. font-size: 0;
  881. vertical-align: middle;
  882. background: url(../images/home-icon.png) no-repeat 0 -26px;
  883. }
  884. }
  885. &:nth-of-type(2) {
  886. .rankingtwo {
  887. width: 23px;
  888. height: 13px;
  889. font-size: 0;
  890. vertical-align: middle;
  891. background: url(../images/home-icon.png) no-repeat -26px -26px;
  892. }
  893. }
  894. &:nth-of-type(3) {
  895. .rankingthree {
  896. width: 23px;
  897. height: 13px;
  898. font-size: 0;
  899. vertical-align: middle;
  900. background: url(../images/home-icon.png) no-repeat -52px -26px;
  901. }
  902. }
  903. .num {
  904. float: right;
  905. margin-right: 20px;
  906. }
  907. }
  908. }
  909. }
  910. .hot {
  911. height: 238px;
  912. margin-top: 20px;
  913. h3 {
  914. i.icons {
  915. background: url(../images/home-icon.png) no-repeat -130px 0;
  916. }
  917. }
  918. .hotbd {
  919. padding: 10px 0 0 10px;
  920. .main {
  921. width: 100%;
  922. height: 160px;
  923. }
  924. ul {
  925. overflow: hidden;
  926. li {
  927. float: left;
  928. padding: 2px 10px;
  929. margin-right: 15px;
  930. margin-bottom: 15px;
  931. font-size: $font-size;
  932. color: $primary-color;
  933. background: #f2faff;
  934. &:nth-of-type(2n) {
  935. // color: #587dde;
  936. }
  937. }
  938. }
  939. }
  940. }
  941. .share {
  942. height: 162px;
  943. margin-top: 20px;
  944. h3 {
  945. i.icons {
  946. background: url(../images/home-icon.png) no-repeat -182px 0;
  947. }
  948. }
  949. .sharebd {
  950. ul.ullist {
  951. padding-top: 20px;
  952. li {
  953. position: relative;
  954. float: left;
  955. width: 33%;
  956. height: 81px;
  957. text-align: center;
  958. i.useri {
  959. position: absolute;
  960. top: -12px;
  961. right: 12px;
  962. z-index: 9;
  963. display: inline-block;
  964. width: 24px;
  965. height: 28px;
  966. }
  967. .userinfo {
  968. width: 43px;
  969. height: 43px;
  970. border-radius: 50%;
  971. }
  972. &:first-child {
  973. i.useri {
  974. background: url(../images/home-icon.png) no-repeat 0 -39px;
  975. }
  976. }
  977. &:nth-of-type(2) {
  978. i.useri {
  979. background: url(../images/home-icon.png) no-repeat -26px -39px;
  980. }
  981. }
  982. &:nth-of-type(3) {
  983. i.useri {
  984. background: url(../images/home-icon.png) no-repeat -52px -39px;
  985. }
  986. }
  987. }
  988. }
  989. }
  990. }
  991. }
  992. .center-content {
  993. float: left;
  994. width: 622px;
  995. margin-left: 5px;
  996. .new-know {
  997. height: 442px;
  998. h3 {
  999. i.icons {
  1000. background: url(../images/home-icon.png) no-repeat -26px 0;
  1001. }
  1002. }
  1003. .new-konwbd {
  1004. padding-top: 10px;
  1005. .frist-news {
  1006. padding: 0 10px 10px 20px;
  1007. border-bottom: 1px solid #efe9e9;
  1008. .title {
  1009. margin-bottom: 10px;
  1010. overflow: hidden;
  1011. font-size: $btn-circle-size-sm;
  1012. font-weight: bold;
  1013. color: $font-color;
  1014. text-overflow: ellipsis;
  1015. white-space: nowrap;
  1016. &:hover {
  1017. color: $primary-color;
  1018. cursor: pointer;
  1019. }
  1020. }
  1021. span {
  1022. display: inline-block;
  1023. width: 90%;
  1024. height: 18px;
  1025. overflow: hidden;
  1026. font-size: $font-size;
  1027. color: $font-color-sm;
  1028. text-overflow: ellipsis;
  1029. white-space: nowrap;
  1030. }
  1031. }
  1032. ul.ullist {
  1033. li {
  1034. height: 43px;
  1035. padding-left: 20px;
  1036. line-height: $ul-line-height;
  1037. &:hover {
  1038. span {
  1039. color: $primary-color;
  1040. cursor: pointer;
  1041. }
  1042. }
  1043. span {
  1044. display: inline-block;
  1045. width: 80%;
  1046. overflow: hidden;
  1047. font-size: $font-size;
  1048. color: $font-color;
  1049. text-overflow: ellipsis;
  1050. white-space: nowrap;
  1051. }
  1052. span::before {
  1053. display: inline-block;
  1054. width: 5px;
  1055. height: 5px;
  1056. margin-right: 10px;
  1057. vertical-align: middle;
  1058. content: '';
  1059. background: #0164f1;
  1060. border-radius: 50%;
  1061. }
  1062. &:nth-of-type(2n) {
  1063. background: #f9fafa;
  1064. }
  1065. i {
  1066. float: right;
  1067. padding-right: 20px;
  1068. font-size: $tag-font-size;
  1069. font-style: normal;
  1070. }
  1071. }
  1072. }
  1073. }
  1074. }
  1075. .read-list {
  1076. height: 367px;
  1077. margin-top: 20px;
  1078. h3 {
  1079. i.icons {
  1080. background: url(../images/home-icon.png) no-repeat -78px 0;
  1081. }
  1082. }
  1083. }
  1084. .recommend {
  1085. height: 417px;
  1086. margin-top: 20px;
  1087. h3 {
  1088. i.icons {
  1089. background: url(../images/home-icon.png) no-repeat -156px 0;
  1090. }
  1091. }
  1092. ul.ullist {
  1093. li {
  1094. height: 43px;
  1095. padding-left: 20px;
  1096. line-height: $ul-line-height;
  1097. &:hover {
  1098. span {
  1099. color: $primary-color;
  1100. cursor: pointer;
  1101. }
  1102. }
  1103. span {
  1104. display: inline-block;
  1105. width: 80%;
  1106. overflow: hidden;
  1107. font-size: $font-size;
  1108. color: $font-color;
  1109. text-overflow: ellipsis;
  1110. white-space: nowrap;
  1111. }
  1112. &:nth-of-type(2n) {
  1113. background: #f9fafa;
  1114. }
  1115. i {
  1116. display: inline-block;
  1117. width: 17px;
  1118. height: 18px;
  1119. margin-right: 10px;
  1120. font-style: normal;
  1121. text-align: center;
  1122. vertical-align: top;
  1123. }
  1124. &:first-child {
  1125. i {
  1126. font-size: 0;
  1127. vertical-align: super;
  1128. background: url(../images/home-icon.png) no-repeat 0 -67px;
  1129. }
  1130. }
  1131. &:nth-of-type(2) {
  1132. i {
  1133. font-size: 0;
  1134. vertical-align: super;
  1135. background: url(../images/home-icon.png) no-repeat -17px -67px;
  1136. }
  1137. }
  1138. &:nth-of-type(3) {
  1139. i {
  1140. font-size: 0;
  1141. vertical-align: super;
  1142. background: url(../images/home-icon.png) no-repeat -34px -67px;
  1143. }
  1144. }
  1145. }
  1146. }
  1147. }
  1148. }
  1149. .right-content {
  1150. float: right;
  1151. width: 243px;
  1152. .login-info {
  1153. height: 342px;
  1154. .guide {
  1155. margin: 10px 5px;
  1156. background: url(../images/home-no-login.png) no-repeat top right;
  1157. h1 {
  1158. i {
  1159. display: inline-block;
  1160. width: 26px;
  1161. height: 26px;
  1162. margin-right: 10px;
  1163. vertical-align: middle;
  1164. background: url(../images/home-icon.png) no-repeat -52px 0;
  1165. }
  1166. font-size: $btn-font-size-sm;
  1167. line-height: $h-line-height;
  1168. }
  1169. }
  1170. .num {
  1171. font-size: $font-size;
  1172. color: $font-color-sm;
  1173. .files-num {
  1174. padding: 2px 5px;
  1175. margin-right: 5px;
  1176. font-size: $font-size-lg;
  1177. font-weight: bold;
  1178. color: $color-blue;
  1179. background: #f0f7ff;
  1180. border: 1px solid #e0ecfb;
  1181. }
  1182. i {
  1183. margin: 0 5px;
  1184. font-style: normal;
  1185. color: $color-red;
  1186. }
  1187. }
  1188. ul {
  1189. overflow: hidden;
  1190. li {
  1191. float: left;
  1192. width: 50%;
  1193. padding: 15px 0;
  1194. font-size: $font-size;
  1195. color: $font-color;
  1196. cursor: pointer;
  1197. i {
  1198. margin-right: 5px;
  1199. color: $primary-color;
  1200. }
  1201. }
  1202. }
  1203. }
  1204. .map {
  1205. margin-top: 20px;
  1206. h3 {
  1207. i.icons {
  1208. background: url(../images/home-icon.png) no-repeat -104px 0;
  1209. }
  1210. }
  1211. ul {
  1212. li {
  1213. width: 200px;
  1214. height: 195px;
  1215. margin: 15px auto 0;
  1216. cursor: pointer;
  1217. border: 1px solid #e0ecfb;
  1218. &:hover {
  1219. border: 1px solid $primary-color;
  1220. .title {
  1221. color: $primary-color;
  1222. }
  1223. }
  1224. .map-img {
  1225. height: 102px;
  1226. vertical-align: middle;
  1227. border: 1px solid #e0ecfb;
  1228. img {
  1229. display: block;
  1230. width: 100%;
  1231. height: 100%;
  1232. margin: auto;
  1233. }
  1234. .no-img {
  1235. margin: 0;
  1236. margin-top: 10px;
  1237. }
  1238. }
  1239. .map-info {
  1240. padding: 7px;
  1241. border: 1px solid #efe9e9;
  1242. border-top: 0;
  1243. p {
  1244. margin-bottom: 5px;
  1245. font-size: $tag-font-size;
  1246. color: $font-more-color;
  1247. i {
  1248. padding-right: 5px;
  1249. font-size: $font-size;
  1250. font-weight: 500;
  1251. }
  1252. }
  1253. .title {
  1254. font-size: $font-size;
  1255. font-weight: 500;
  1256. color: $font-color-sm;
  1257. }
  1258. .message {
  1259. height: 24px;
  1260. overflow: hidden;
  1261. line-height: $btn-circle-size-sm;
  1262. text-overflow: ellipsis;
  1263. white-space: nowrap;
  1264. }
  1265. }
  1266. }
  1267. }
  1268. }
  1269. }
  1270. }
  1271. .footer {
  1272. width: 100%;
  1273. height: 80px;
  1274. padding-top: 25px;
  1275. font-size: $font-size-sm;
  1276. color: $font-more-color;
  1277. text-align: center;
  1278. background: $white;
  1279. p {
  1280. margin-bottom: 0;
  1281. }
  1282. }
  1283. </style>