home.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <div class="page">
  3. <el-row gutter="10">
  4. <el-col :span="6">
  5. <div class="home_box">
  6. <div class="tg_top adfacjb">
  7. <div class="tgt_l">执行项目</div>
  8. <div class="tgt_r">
  9. <img src="@/assets/images/agent/home_xm.png">
  10. </div>
  11. </div>
  12. <div class="tg_num adfac">{{ 42 }}<span>个</span></div>
  13. <div class="tg_jd">
  14. <div class="tj tj1" :style="{'width':70+'%'}"></div>
  15. </div>
  16. <div class="tg_tn adfac">
  17. <div class="tt_pre adfac">进行中<span>{{6}}</span></div>
  18. <div class="tt_pre adfac">已完成<span>{{36}}</span></div>
  19. </div>
  20. </div>
  21. </el-col>
  22. <el-col :span="6">
  23. <div class="home_box">
  24. <div class="tg_top adfacjb">
  25. <div class="tgt_l">调查问卷</div>
  26. <div class="tgt_r">
  27. <img src="@/assets/images/agent/home_wj.png">
  28. </div>
  29. </div>
  30. <div class="tg_num adfac">{{ 120 }}<span>份</span></div>
  31. <div class="tg_jd">
  32. <div class="tj tj2" :style="{'width':40+'%'}"></div>
  33. </div>
  34. <div class="tg_tn adfac">
  35. <div class="tt_pre adfac">已完成<span>{{36}}</span></div>
  36. <div class="tt_pre adfac">进行中<span>{{6}}</span></div>
  37. </div>
  38. </div>
  39. </el-col>
  40. <el-col :span="6">
  41. <div class="home_box">
  42. <div class="tg_top adfacjb">
  43. <div class="tgt_l">团队</div>
  44. <div class="tgt_r">
  45. <img src="@/assets/images/agent/home_td.png">
  46. </div>
  47. </div>
  48. <div class="tg_num adfac">{{ 43 }}<span>个</span></div>
  49. <div class="tg_jd">
  50. <div class="tj tj3" :style="{'width':100+'%'}"></div>
  51. </div>
  52. <div class="tg_tn adfac">
  53. <div class="tt_pre adfac">团队成员<span>{{236}}</span></div>
  54. </div>
  55. </div>
  56. </el-col>
  57. <el-col :span="6">
  58. <div class="home_box">
  59. <div class="tg_top adfacjb">
  60. <div class="tgt_l">知识总量</div>
  61. <div class="tgt_r">
  62. <img src="@/assets/images/agent/home_zs.png">
  63. </div>
  64. </div>
  65. <div class="tg_num adfac">{{ 356720 }}<span>条</span></div>
  66. <div class="tg_jd">
  67. <div class="tj tj4" :style="{'width':80+'%'}"></div>
  68. </div>
  69. <div class="tg_tn adfac">
  70. <div class="tt_pre adfac">解析中<span>{{6}}</span></div>
  71. <div class="tt_pre adfac">已完成<span>{{356714}}</span></div>
  72. </div>
  73. </div>
  74. </el-col>
  75. </el-row>
  76. <el-row gutter="10" style="margin-top: 10px;">
  77. <el-col :span="12">
  78. <div class="home_box">
  79. <div class="tj_top adfacjb">
  80. <div class="tjt_l">
  81. <p>答卷数量统计</p>
  82. <el-date-picker style="border: none;"
  83. v-model="startEndDate"
  84. type="daterange"
  85. range-separator="-"
  86. start-placeholder="开始日期"
  87. end-placeholder="结束日期">
  88. </el-date-picker>
  89. </div>
  90. <div class="tjt_r adf">
  91. <div class="tjtr_pre" :class="{'active':tidx===1}" @click="handleChangeTime(1)">近15天</div>
  92. <div class="tjtr_pre" :class="{'active':tidx===2}" @click="handleChangeTime(2)">近一年</div>
  93. </div>
  94. </div>
  95. <div class="tj_chart">
  96. <div ref="djsltjRef" style="width: 100%; height: 260px;"></div>
  97. </div>
  98. </div>
  99. </el-col>
  100. <el-col :span="12">
  101. <div class="home_box">
  102. <div class="zb_title">问卷类别占比</div>
  103. <div ref="wjlbzbRef" style="width: 100%; height: 300px;"></div>
  104. </div>
  105. </el-col>
  106. </el-row>
  107. <el-row gutter="10" style="margin-top: 10px;">
  108. <el-col :span="12">
  109. <div class="home_box">
  110. <div class="hb_title adfacjb">
  111. <div class="hbt_l">最近的调查问卷</div>
  112. <div class="hbt_r">查看更多 ></div>
  113. </div>
  114. <div class="hb_list">
  115. <div class="hl_item adfacjb" v-for="(item,index) in dcwjList" :key="index">
  116. <div class="hil_l">
  117. <p>{{ item.name }}</p>
  118. <p class="tip">{{ item.team }} · {{ item.persons }}名成员</p>
  119. </div>
  120. <div class="hil_r">
  121. <div class="hr_btn" v-if="item.status===1">已完成</div>
  122. <div class="hr_btn jxz" v-if="item.status===0">进行中</div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </el-col>
  128. <el-col :span="12">
  129. <div class="home_box">
  130. <div class="hb_title adfacjb">
  131. <div class="hbt_l">近期报告</div>
  132. <div class="hbt_r">更多报告 ></div>
  133. </div>
  134. <div class="hb_list">
  135. <div class="hl_item adfacjb" v-for="(item,index) in jqbgList" :key="index">
  136. <div class="hil_l">
  137. <p>{{ item.name }}</p>
  138. <p class="tip">{{ item.type }} · 生成于{{ item.time }}</p>
  139. </div>
  140. <div class="hil_r">
  141. <div class="hr_btn ck">查看</div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </el-col>
  147. </el-row>
  148. </div>
  149. </template>
  150. <script setup name="">
  151. import * as echarts from "echarts";
  152. import { ref, getCurrentInstance, onMounted } from 'vue'
  153. const { proxy } = getCurrentInstance();
  154. const tidx = ref(1);
  155. const startEndDate = ref('');
  156. const djsltjRef = ref(null);
  157. const wjlbzbRef = ref(null);
  158. const dcwjList = ref([
  159. {name:'领导团队评估',team:'泰科公司阿尔法团队',persons:12,status:1},
  160. {name:'领导团队评估',team:'泰科公司阿尔法团队',persons:12,status:0},
  161. {name:'领导团队评估',team:'泰科公司阿尔法团队',persons:12,status:1},
  162. {name:'领导团队评估',team:'泰科公司阿尔法团队',persons:12,status:1},
  163. {name:'领导团队评估',team:'泰科公司阿尔法团队',persons:12,status:1}
  164. ]);
  165. const jqbgList = ref([
  166. {name:'TechCorp 团队分析',type:'团队报告',time:'2025-04-20 13:00'},
  167. {name:'TechCorp 团队分析',type:'个人报告',time:'2025-04-20 13:00'},
  168. {name:'TechCorp 团队分析',type:'团队报告',time:'2025-04-20 13:00'},
  169. {name:'TechCorp 团队分析',type:'团队报告',time:'2025-04-20 13:00'},
  170. {name:'TechCorp 团队分析',type:'团队报告',time:'2025-04-20 13:00'}
  171. ])
  172. const handleChangeTime = (idx) => {
  173. tidx.value = idx;
  174. }
  175. const initDjsltjChart = () => {
  176. let myChart = echarts.init(djsltjRef.value);
  177. let option = {
  178. xAxis: {
  179. type: 'category',
  180. data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
  181. },
  182. tooltip: {
  183. trigger: 'axis'
  184. },
  185. yAxis: {
  186. type: 'value'
  187. },
  188. grid: {
  189. left: '1%',
  190. right: '1%',
  191. bottom: '1%',
  192. top: '10%',
  193. containLabel: true
  194. },
  195. series: [
  196. {
  197. data: [0, 40, 30, 70, 100, 60, 50, 40, 70, 60, 50, 0],
  198. type: 'line',
  199. smooth: true,
  200. showSymbol: false,
  201. areaStyle: {
  202. opacity: 0.8,
  203. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  204. {
  205. offset: 0,
  206. color: '#D5E5FC'
  207. },
  208. {
  209. offset: 1,
  210. color: '#F2E9F0'
  211. }
  212. ])
  213. },
  214. lineStyle: {
  215. width: 3,
  216. color:{
  217. type: 'linear',
  218. x: 0,
  219. y: 0,
  220. x2: 1,
  221. y2: 0,
  222. colorStops: [{
  223. offset: 1, color: '#8360FC'
  224. }, {
  225. offset: 0.5, color: '#8E49CB'
  226. }, {
  227. offset: 0, color: '#25D9FF'
  228. }]
  229. }
  230. },
  231. }
  232. ]
  233. };
  234. myChart.setOption(option)
  235. }
  236. const initWjlbzbChart = () => {
  237. let myChart = echarts.init(wjlbzbRef.value);
  238. let option = {
  239. tooltip: {
  240. trigger: 'item'
  241. },
  242. legend: {
  243. bottom: '-1%',
  244. left: 'center'
  245. },
  246. color:['#761E6A','#D2B7CE','#9D5F94'],
  247. series: [
  248. {
  249. name: '问卷类别占比',
  250. type: 'pie',
  251. radius: ['50%', '80%'],
  252. center: ['50%', '45%'],
  253. itemStyle: {
  254. borderRadius: 0
  255. },
  256. data: [
  257. { value: 1048, name: '高级问卷' },
  258. { value: 735, name: '中级问卷' },
  259. { value: 580, name: '初级问卷' },
  260. ]
  261. }
  262. ]
  263. };
  264. myChart.setOption(option)
  265. }
  266. onMounted(()=>{
  267. initDjsltjChart();
  268. initWjlbzbChart();
  269. })
  270. </script>
  271. <style scoped lang="scss">
  272. .page{
  273. padding: 14px 16px;
  274. background-color: #FAFAFA;
  275. overflow-y: auto;
  276. .home_box{
  277. padding: 26px 20px;
  278. background: #FFFFFF;
  279. border-radius: 6px;
  280. border: 1px solid #F3F4F6;
  281. .tg_top{
  282. .tgt_l{
  283. font-family: PingFangSC, PingFang SC;
  284. font-weight: 400;
  285. font-size: 14px;
  286. color: #646464;
  287. line-height: 16px;
  288. }
  289. .tgt_r{
  290. img{
  291. width: 40px;
  292. height: 40px;
  293. }
  294. }
  295. }
  296. .tg_num{
  297. margin-top: 1px;
  298. font-family: DINAlternate, DINAlternate;
  299. font-weight: bold;
  300. font-size: 32px;
  301. color: #252525;
  302. line-height: 32px;
  303. span{
  304. font-family: PingFangSC, PingFang SC;
  305. font-weight: 400;
  306. font-size: 14px;
  307. color: #999999;
  308. line-height: 16px;
  309. margin-left: 5px;
  310. }
  311. }
  312. .tg_jd{
  313. margin-top: 14px;
  314. width: 100%;
  315. height: 8px;
  316. background: #F3F4F6;
  317. position: relative;
  318. border-radius: 4px;
  319. .tj{
  320. height: 8px;
  321. border-radius: 4px;
  322. position: absolute;
  323. left: 0;
  324. top: 0;
  325. &.tj1{
  326. background: linear-gradient( 270deg, #3C82F6 0%, #3C82F6 100%);
  327. }
  328. &.tj2{
  329. background: linear-gradient( 270deg, #9D5F94 0%, #904A87 100%);
  330. }
  331. &.tj3{
  332. background: linear-gradient( 90deg, #189B9B 0%, #7DC6C6 100%);
  333. }
  334. &.tj4{
  335. background: linear-gradient( 90deg, #FFD750 0%, #FDE182 100%);
  336. }
  337. }
  338. }
  339. .tg_tn{
  340. margin-top: 18px;
  341. .tt_pre{
  342. font-family: PingFangSC, PingFang SC;
  343. font-weight: 400;
  344. font-size: 14px;
  345. color: #6B7280;
  346. line-height: 14px;
  347. span{
  348. color: #252525;
  349. margin-left: 5px;
  350. }
  351. &:last-child{
  352. margin-left: 48px;
  353. }
  354. }
  355. }
  356. .tj_top{
  357. .tjt_l{
  358. p{
  359. font-family: PingFang-SC, PingFang-SC;
  360. font-weight: bold;
  361. font-size: 16px;
  362. color: #393939;
  363. line-height: 22px;
  364. }
  365. }
  366. .tjt_r{
  367. .tjtr_pre{
  368. width: 54px;
  369. height: 32px;
  370. border-radius: 6px;
  371. border: 1px solid #E5E7EB;
  372. font-family: PingFangSC, PingFang SC;
  373. font-weight: 400;
  374. font-size: 12px;
  375. color: #4B5563;
  376. line-height: 28px;
  377. text-align: center;
  378. cursor: pointer;
  379. margin-left: 16px;
  380. &.active{
  381. background: #904A87;
  382. color: #FFFFFF;
  383. }
  384. }
  385. }
  386. }
  387. .zb_title{
  388. font-family: PingFang-SC, PingFang-SC;
  389. font-weight: bold;
  390. font-size: 16px;
  391. color: #252525;
  392. line-height: 22px;
  393. }
  394. .hb_title{
  395. .hbt_l{
  396. font-family: PingFang-SC, PingFang-SC;
  397. font-weight: bold;
  398. font-size: 16px;
  399. color: #252525;
  400. line-height: 22px;
  401. }
  402. .hbt_r{
  403. font-family: PingFangSC, PingFang SC;
  404. font-weight: 400;
  405. font-size: 14px;
  406. color: #833478;
  407. line-height: 20px;
  408. text-align: right;
  409. cursor: pointer;
  410. }
  411. }
  412. .hb_list{
  413. margin-top: 12px;
  414. .hl_item{
  415. width: 100%;
  416. padding: 10px 20px;
  417. box-sizing: border-box;
  418. margin-top: 12px;
  419. background: #F9FAFB;
  420. border-radius: 8px;
  421. .hil_l{
  422. p{
  423. font-family: PingFang-SC, PingFang-SC;
  424. font-weight: bold;
  425. font-size: 14px;
  426. color: #252525;
  427. line-height: 20px;
  428. &.tip{
  429. font-weight: 400;
  430. color: #6B7280;
  431. margin-top: 2px;
  432. }
  433. }
  434. }
  435. .hil_r{
  436. .hr_btn{
  437. width: 68px;
  438. height: 28px;
  439. background: #E1F0F0;
  440. border-radius: 14px;
  441. font-family: PingFangSC, PingFang SC;
  442. font-weight: 400;
  443. font-size: 14px;
  444. color: #009191;
  445. line-height: 28px;
  446. text-align: center;
  447. &.jxz{
  448. background: #FCECB6;
  449. color: #864F10;
  450. }
  451. &.ck{
  452. background: rgba(118,30,106,0.16);
  453. color: #761E6A;
  454. cursor: pointer;
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. ::v-deep .el-range-editor.el-input__inner{
  463. padding: 3px 0 !important;
  464. }
  465. ::v-deep .el-date-editor .el-range__icon{
  466. display: none !important;
  467. }
  468. ::v-deep .el-date-editor .el-range-input{
  469. width: 30% !important;
  470. }
  471. </style>