indexHome.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  1. <!--首页-->
  2. <template>
  3. <div class="app-container indexHome scrollbar-box">
  4. <div class="top-max-big-box">
  5. <div class="top-for-max-box">
  6. <div class="top-for-big-box">
  7. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_sy_hxpkysl.png">
  8. <div>
  9. <p>化学品可用数量</p>
  10. <p class="font-color-1">{{chemicalUsageCountData.chemicalUsableNum}}</p>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="top-for-max-box">
  15. <div class="top-for-big-box">
  16. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_sy_hxpgsl.png">
  17. <div>
  18. <p>化学品柜数量</p>
  19. <p class="font-color-2">{{chemicalUsageCountData.cabinetNum}}</p>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="top-for-max-box">
  24. <div class="top-for-big-box">
  25. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_sy_hxpyjsl.png">
  26. <div>
  27. <p>化学品用结数量</p>
  28. <p class="font-color-3">{{chemicalUsageCountData.chemicalOutNum}}</p>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="top-for-max-box">
  33. <div class="top-for-big-box">
  34. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_sy_hxpzfsl.png">
  35. <div>
  36. <p>化学品作废数量</p>
  37. <p class="font-color-4">{{chemicalUsageCountData.chemicalCancelNum}}</p>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="top-for-max-box">
  42. <div class="top-for-big-box">
  43. <img src="@/assets/ZDimages/medicUniversity-3_1/icon_sy_hxpjjgq.png">
  44. <div>
  45. <p>化学品即将过期</p>
  46. <p class="font-color-5">{{chemicalUsageCountData.overdueTime}}</p>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="center-max-big-box">
  52. <div class="center-left-max-box">
  53. <div class="center-left-big-box">
  54. <p class="min-box-title-p">化学品特别提示</p>
  55. <div class="center-left-min-box">
  56. <div>
  57. <p>待归还数:</p>
  58. <p style="color:#FF6200;">{{chemicalUnusualCountData.toBeReturned}}</p>
  59. </div>
  60. <div>
  61. <p>超时未归还数:</p>
  62. <p style="color:#FF2D2D;">{{chemicalUnusualCountData.overtimeReturn}}</p>
  63. </div>
  64. </div>
  65. <div class="center-left-min-box">
  66. <div>
  67. <p>今日领用数:</p>
  68. <p>{{chemicalUnusualCountData.todayCollect}}</p>
  69. </div>
  70. <div>
  71. <p>今日归还数:</p>
  72. <p>{{chemicalUnusualCountData.todayReturn}}</p>
  73. </div>
  74. </div>
  75. <div class="center-left-min-box">
  76. <div>
  77. <p>今日用结数:</p>
  78. <p>{{chemicalUnusualCountData.todayOutNum}}</p>
  79. </div>
  80. <div>
  81. <p>今日作废数:</p>
  82. <p>{{chemicalUnusualCountData.todayCancelNum}}</p>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="center-center-max-box">
  88. <div class="center-center-big-box">
  89. <p class="min-box-title-p">化学品使用量TOP6</p>
  90. <div class="center-center-for-box" v-for="(item,index) in chemicalUsagesCountData" :key="index">
  91. <p :class="item.classifyLevel == 1?'for-color-p-1':(item.classifyLevel == 2?'for-color-p-2':'')">{{item.classifyLevel=='1'?'危险':(item.classifyLevel=='2'?'普通':'')}}</p>
  92. <p>{{item.chemicalUsages}}</p>
  93. <p>{{item.adminUser}}</p>
  94. </div>
  95. <p style="text-align: center;font-weight:500;font-size:16px;color:#999;line-height:100px;" v-if="!chemicalUsagesCountData[0]">暂无数据</p>
  96. <p class="position-min-button" @click="goPage('usageRecord')" v-hasPermi="['chemical:hxpUserecord:list']">更多</p>
  97. </div>
  98. </div>
  99. <div class="center-right-max-box">
  100. <div class="center-right-bigOne-box">
  101. <p class="min-box-title-p">化学品属性占比</p>
  102. <div class="center-right-big-box">
  103. <div id="eCharts-box-1"></div>
  104. <div class="eCharts-right-list-box">
  105. <div v-for="(item,index) in chemicalClassifyMixList">
  106. <p :style="'background:'+eChartsListColor[index]+';'"></p>
  107. <p>{{item.classifyAttribute}}</p>
  108. <p>{{item.chemicalMix}}</p>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="bottom-max-big-box">
  116. <div class="bottom-left-max-box">
  117. <div class="bottom-left-big-box">
  118. <p class="min-box-title-p" style="margin-bottom:24px;">报警通知</p>
  119. <div class="bottom-left-for-max-box">
  120. <div class="bottom-left-for-box" :class="{anim:animate==true}" ref="con1"
  121. v-for="(item,index) in alarmList" :key="index" v-if="index<6" @click="lockInfo(item)">
  122. <p>{{item.alarmTime}}</p>
  123. <p>{{item.alarmContent}}</p>
  124. <!--<p v-if="!item.alarmContent">{{item.alarmContent}}</p>-->
  125. <!--<el-tooltip class="item" effect="dark" :content="item.alarmContent" placement="top" v-else>-->
  126. <!--<p style="overflow: hidden;height:24px;">{{item.alarmContent}}</p>-->
  127. <!--</el-tooltip>-->
  128. <p>{{item.alarmMode}}</p>
  129. <p>{{item.liableUserName}}</p>
  130. <!--<p v-if="!item.liableUserName">{{item.liableUserName}}</p>-->
  131. <!--<el-tooltip class="item" effect="dark" :content="item.liableUserName" placement="top" v-else>-->
  132. <!--<p>{{item.liableUserName}}</p>-->
  133. <!--</el-tooltip>-->
  134. </div>
  135. <p style="text-align: center;font-weight:500;font-size:16px;color:#999;line-height:100px;" v-if="!alarmList[0]">暂无数据</p>
  136. </div>
  137. <p class="position-min-button" @click="goPage('alarmRecord')" v-hasPermi="['chemical:hxpAlarmRecord:list']">更多</p>
  138. </div>
  139. </div>
  140. <div class="bottom-right-max-box">
  141. <div class="bottom-right-big-box">
  142. <div class="title-button-box">
  143. <p :class="buttonType == 1?'button-color-1':(buttonType == 2?'button-color-2':'')" @click="libraryButton(1)">入库数量</p>
  144. <p :class="buttonType == 2?'button-color-1':(buttonType == 1?'button-color-2':'')" @click="libraryButton(2)">出库数量</p>
  145. </div>
  146. <div id="bottom-right-eCharts-box"></div>
  147. <p class="position-min-button" @click="goPage('library')" v-if="buttonType == 1 && goPageTypeOne">更多</p>
  148. <p class="position-min-button" @click="goPage('library')" v-if="buttonType == 2 && goPageTypeTwo">更多</p>
  149. </div>
  150. </div>
  151. </div>
  152. <!--报警信息查看-->
  153. <el-dialog title="报警信息" :visible.sync="homeDialogType" :close-on-click-modal="false" v-if="homeDialogType" @close="homeDialogOff" width="700px" append-to-body class="index-home-dialog-box">
  154. <div class="index-home-dialog-big-box">
  155. <p>报警时间:</p>
  156. <p>{{homeDialogData.alarmTime}}</p>
  157. </div>
  158. <div class="index-home-dialog-big-box">
  159. <p>报警内容:</p>
  160. <p>{{homeDialogData.alarmContent}}</p>
  161. <!--<el-input-->
  162. <!--disabled-->
  163. <!--resize="none"-->
  164. <!--type="textarea"-->
  165. <!--:autosize="{ minRows: 2, maxRows: 4}"-->
  166. <!--placeholder="请输入内容"-->
  167. <!--v-model="homeDialogData.liableUserName">-->
  168. <!--</el-input>-->
  169. </div>
  170. <div class="index-home-dialog-big-box-one">
  171. <div class="index-home-dialog-min-box">
  172. <p>负责人:</p>
  173. <p>{{homeDialogData.adminNames[0]}}</p>
  174. </div>
  175. <div class="index-home-dialog-min-box">
  176. <p>联系方式:</p>
  177. <p>{{homeDialogData.adminNames[1]}}</p>
  178. </div>
  179. </div>
  180. <div class="index-home-dialog-big-box-one">
  181. <div class="index-home-dialog-min-box">
  182. <p>学院:</p>
  183. <p>{{homeDialogData.alarmDeptName}}</p>
  184. </div>
  185. <div class="index-home-dialog-min-box">
  186. <p>实验室:</p>
  187. <p>{{homeDialogData.subName}}</p>
  188. </div>
  189. </div>
  190. <div class="index-home-dialog-big-box-one">
  191. <div class="index-home-dialog-min-box">
  192. <p>安全责任人:</p>
  193. <p>
  194. <span v-for="(item,index) in homeDialogData.adminUserList">{{item}}<span v-if="index+1!=homeDialogData.adminUserList.length">、</span></span>
  195. </p>
  196. </div>
  197. <div class="index-home-dialog-min-box">
  198. <p>联系方式:</p>
  199. <p>
  200. <span v-for="(item,index) in homeDialogData.adminPhoneList">{{item}}<span v-if="index+1!=homeDialogData.adminPhoneList.length">、</span></span>
  201. </p>
  202. </div>
  203. </div>
  204. <div class="index-home-dialog-big-box-one">
  205. <div class="index-home-dialog-min-box">
  206. <p>报警方式:</p>
  207. <p>{{homeDialogData.alarmMode}}</p>
  208. </div>
  209. <div class="index-home-dialog-min-box">
  210. <p>处理状态:</p>
  211. <p v-if="homeDialogData.alarmModeStatus==3&&homeDialogData.buttonType == 1"
  212. class="buttonTypeTwo" @click="handle">待处理</p>
  213. <p v-else :class="homeDialogData.handlingStatus == 1?'buttonTypeOne':(homeDialogData.handlingStatus == 2?'buttonType':'')">
  214. {{homeDialogData.handlingStatus == 1?'待处理':(homeDialogData.handlingStatus == 2?'已处理':'')}}</p>
  215. </div>
  216. </div>
  217. <div slot="footer" class="teacher-import-dialog-button-box">
  218. <p class="inquire-button-one" @click="homeDialogOff">确定</p>
  219. </div>
  220. </el-dialog>
  221. </div>
  222. </template>
  223. <script>
  224. import { chemicalUsageCount,chemicalUnusualCount,chemicalUsagesCount,chemicalClassifyMix,alarmRecordList,joinOutCount,stockTotal,handle } from "@/api/medicUniversity-3_1/index";
  225. import echarts from 'echarts'
  226. export default {
  227. name: "indexHome",
  228. data() {
  229. return {
  230. goPageTypeOne:this.hasPermiDom(['chemical:hxpStock:listJoin']),
  231. goPageTypeTwo:this.hasPermiDom(['chemical:hxpStock:listOut']),
  232. //化学品总量
  233. maxNum:0,
  234. //化学品数量
  235. chemicalUsageCountData:{},
  236. //化学品特表提示
  237. chemicalUnusualCountData:{},
  238. //化学品使用量TOP6
  239. chemicalUsagesCountData:[],
  240. //化学品分类统计
  241. chemicalClassifyMixList:[],
  242. chemicalClassifyMixData:[],
  243. //出库入库统计
  244. joinOutCountTime:[],
  245. joinOutCountData:[],
  246. //报警通知列表
  247. alarmList:[],
  248. alarmListData:[],
  249. buttonType:1,
  250. eChartsListColor : ["#009DFF", "#FFA200", "#FF2A00", "#A069FF", "#63FFE5", "#C4C4C4"],
  251. eChartsList:[],
  252. //定时滚动
  253. timer:{},
  254. animate:false,
  255. //报警详情弹窗
  256. homeDialogType:false,
  257. homeDialogData:{},
  258. };
  259. },
  260. created() {
  261. },
  262. mounted(){
  263. this.chemicalUsageCount();
  264. this.chemicalUnusualCount();
  265. this.chemicalUsagesCount();
  266. this.stockTotal();
  267. // this.chemicalClassifyMix();
  268. this.alarmRecordList(1);
  269. this.joinOutCount(1);
  270. },
  271. methods: {
  272. //查看详情
  273. lockInfo(item){
  274. console.log(item);
  275. this.$set(this,'homeDialogData',item);
  276. this.$set(this.homeDialogData,'adminNames',item.adminNames.split(' '));
  277. let list = item.safeUserNames.split('、')
  278. let userList = [];
  279. let phoneList = [];
  280. for(let i=0;i<list.length;i++){
  281. let newList = list[i].split(' ');
  282. userList.push(newList[0])
  283. phoneList.push(newList[1])
  284. }
  285. this.$set(this.homeDialogData,'adminUserList',userList);
  286. this.$set(this.homeDialogData,'adminPhoneList',phoneList);
  287. this.homeDialogType = true;
  288. },
  289. homeDialogOff(){
  290. this.homeDialogType = false;
  291. this.$set(this,'homeDialogData',{});
  292. },
  293. //处理报警记录
  294. handle(){
  295. let self = this;
  296. this.$confirm('确定要处理吗?', "警告", {
  297. confirmButtonText: "确定",
  298. cancelButtonText: "取消",
  299. type: "warning"
  300. }).then(function() {
  301. handle({id:self.homeDialogData.id}).then(response => {
  302. self.msgSuccess(response.msg);
  303. for(let i=0;i<self.alarmList.length;i++){
  304. if(self.homeDialogData.id == self.alarmList[i].id){
  305. self.$set(self.homeDialogData,'handlingStatus',2);
  306. self.$set(self.homeDialogData,'buttonType',2);
  307. self.alarmRecordList();
  308. }
  309. }
  310. self.$forceUpdate();
  311. })
  312. }).then(() => {
  313. }).catch(() => {});
  314. },
  315. //出库/入库切换方法
  316. libraryButton(type){
  317. if(this.buttonType != type){
  318. this.buttonType = type;
  319. this.joinOutCount(type);
  320. }
  321. },
  322. //跳转方法
  323. goPage(type){
  324. if(type == 'usageRecord'){
  325. //使用记录
  326. this.$router.push({
  327. path: `/chemicalLibrary/usageRecord`,
  328. })
  329. }else if(type == 'alarmRecord'){
  330. //报警通知
  331. this.$router.push({
  332. path: `/chemicalLibrary/alarmRecord`,
  333. })
  334. }else if(type == 'library'){
  335. if(this.buttonType == 1){
  336. //入库
  337. this.$router.push({
  338. path: `/chemicalLibrary/InventoryManagement/warehousingRecord`,
  339. });
  340. }else if(this.buttonType == 2){
  341. //出库
  342. this.$router.push({
  343. path: `/chemicalLibrary/InventoryManagement/OutboundRecord`,
  344. });
  345. }
  346. }
  347. },
  348. //化学品数量
  349. chemicalUsageCount(){
  350. chemicalUsageCount().then(response => {
  351. this.chemicalUsageCountData = response.data;
  352. // this.chemicalClassifyMix();
  353. })
  354. },
  355. //化学品特别提示
  356. chemicalUnusualCount(){
  357. chemicalUnusualCount().then(response => {
  358. this.chemicalUnusualCountData = response.data;
  359. })
  360. },
  361. //化学品使用量排行top6
  362. chemicalUsagesCount(){
  363. chemicalUsagesCount().then(response => {
  364. this.chemicalUsagesCountData = response.data;
  365. })
  366. },
  367. //获取化学品总量接口
  368. stockTotal(){
  369. stockTotal().then(response => {
  370. this.maxNum = response.data;
  371. this.chemicalClassifyMix();
  372. })
  373. },
  374. //化学品分类统计
  375. chemicalClassifyMix(){
  376. chemicalClassifyMix().then(response => {
  377. let newList = [];
  378. for(let i=0;i<response.data.length;i++){
  379. if(i<6){
  380. newList.push(response.data[i]);
  381. }
  382. }
  383. this.chemicalClassifyMixList = JSON.parse(JSON.stringify(newList));
  384. let list = [];
  385. for(let i=0;i<newList.length;i++){
  386. let obj = {
  387. name:newList[i].classifyAttribute,
  388. value:newList[i].chemicalMix.replace('%','')
  389. }
  390. list.push(obj);
  391. }
  392. this.$set(this,'chemicalClassifyMixData',list)
  393. this.eChartsOne();
  394. })
  395. },
  396. //报警通知列表
  397. alarmRecordList(type){
  398. let self = this;
  399. alarmRecordList({pageNum:1,pageSize:100,handlingStatus:1,}).then(response => {
  400. let id = localStorage.getItem('userId')
  401. for(let i=0;i<response.rows.length;i++){
  402. response.rows[i].safeUserId = response.rows[i].safeUserId.split(",");
  403. for(let o=0;o<response.rows[i].safeUserId.length;o++){
  404. if(response.rows[i].safeUserId[o] == id){
  405. response.rows[i].buttonType = 1;
  406. }
  407. }
  408. }
  409. this.alarmList = response.rows;
  410. if(type == 1){
  411. if(response.rows[6]){
  412. this.timer = setInterval(this.scroll,3000)
  413. }
  414. }
  415. })
  416. },
  417. //出库/入库数据
  418. joinOutCount(type){
  419. joinOutCount({status:type}).then(response => {
  420. let timeList = [];
  421. let dataList = [];
  422. for(let i=0;i<response.data.length;i++){
  423. timeList.push(response.data[i].nowData);
  424. dataList.push(response.data[i].stockNum);
  425. }
  426. this.$set(this,'joinOutCountTime',timeList);
  427. this.$set(this,'joinOutCountData',dataList);
  428. this.eChartsTwo();
  429. })
  430. },
  431. //eCharts方法
  432. eChartsOne(){
  433. let self = this;
  434. let myChart = this.$echarts.init(document.getElementById('eCharts-box-1'));
  435. let bgColor = "#fff";
  436. let title = "库存总量";
  437. let echartData = this.chemicalClassifyMixData;
  438. let formatNumber = function (num) {
  439. console.log("num",num);
  440. let reg = /(?=(\B)(\d{3})+$)/g;
  441. return num.toString().replace(reg, ",");
  442. };
  443. let total = echartData.reduce((a, b) => {
  444. return a + b.value * 1;
  445. }, 0);
  446. let option = {
  447. backgroundColor: bgColor,
  448. color: this.eChartsListColor,
  449. title: [
  450. {
  451. // text: "{name|" + title + "}\n{val|" + formatNumber(total) + "}",
  452. text: "{name|" + title + "}\n{val|" + formatNumber(this.maxNum) + "}",
  453. top: "center",
  454. left: "center",
  455. type:false,
  456. textStyle: {
  457. rich: {
  458. name: {
  459. fontSize: 18,
  460. fontWeight: "normal",
  461. color: "#333333",
  462. padding: [10, 0],
  463. },
  464. val: {
  465. fontSize: 18,
  466. fontWeight: "normal",
  467. color: "#333333",
  468. },
  469. },
  470. },
  471. },
  472. ],
  473. series: [
  474. {
  475. type: "pie",
  476. radius: ["50%", "70%"],
  477. center: ["50%", "50%"],
  478. data: echartData,
  479. hoverAnimation: false,
  480. itemStyle: {
  481. normal: {
  482. borderColor: bgColor,
  483. borderWidth: 2,
  484. },
  485. },
  486. labelLine: {
  487. normal: {
  488. show: false,
  489. },
  490. },
  491. label: {
  492. normal: {
  493. show: false,
  494. },
  495. },
  496. },
  497. ],
  498. };
  499. myChart.setOption(option);
  500. },
  501. //eCharts方法
  502. eChartsTwo(){
  503. let self = this;
  504. let myChart = this.$echarts.init(document.getElementById('bottom-right-eCharts-box'));
  505. let option = {
  506. tooltip: {
  507. trigger: "axis",
  508. axisPointer: {
  509. lineStyle: {
  510. color: {
  511. type: "linear",
  512. x: 0,
  513. y: 0,
  514. x2: 0,
  515. y2: 1,
  516. colorStops: [
  517. {
  518. offset: 0,
  519. color: "rgba(203, 158, 255,1)",
  520. },
  521. {
  522. offset: 0.5,
  523. color: "rgba(203, 158, 255,1)",
  524. },
  525. {
  526. offset: 1,
  527. color: "rgba(203, 158, 255,1)",
  528. },
  529. ],
  530. global: false,
  531. },
  532. },
  533. },
  534. },
  535. grid: {
  536. top: "15%",
  537. left: "10%",
  538. right: "5%",
  539. bottom: "15%",
  540. // containLabel: true
  541. },
  542. xAxis: [
  543. {
  544. type: "category",
  545. axisLine: {
  546. show: false,
  547. },
  548. axisLabel: {
  549. color: "#333",
  550. width: 100,
  551. },
  552. splitLine: {
  553. show: false,
  554. },
  555. boundaryGap: true,
  556. data: this.joinOutCountTime,
  557. },
  558. ],
  559. yAxis: [
  560. {
  561. type: "value",
  562. min: 0,
  563. // max: 140,
  564. splitNumber: 4,
  565. splitLine: {
  566. show: true,
  567. lineStyle: {
  568. color: "#666",
  569. opacity: 0.23,
  570. },
  571. },
  572. axisLine: {
  573. show: true,
  574. lineStyle: {
  575. color: "#999",
  576. },
  577. },
  578. axisLabel: {
  579. show: true,
  580. margin: 20,
  581. textStyle: {
  582. color: "#333",
  583. },
  584. },
  585. axisTick: {
  586. show: true,
  587. },
  588. },
  589. ],
  590. series: [
  591. {
  592. name: "数量",
  593. type: "line",
  594. showAllSymbol: false,
  595. symbol: "none",
  596. symbolSize: 10,
  597. lineStyle: {
  598. normal: {
  599. color: "#00AEFF",
  600. },
  601. },
  602. label: {
  603. show: false,
  604. position: "top",
  605. textStyle: {
  606. color: "#A582EA",
  607. },
  608. },
  609. itemStyle: {
  610. color: "#00AEFF",
  611. borderColor: "#00AEFF",
  612. borderWidth: 0,
  613. show: false,
  614. },
  615. areaStyle: {
  616. normal: {
  617. color: new echarts.graphic.LinearGradient(
  618. 0,
  619. 0,
  620. 0,
  621. 1,
  622. [
  623. {
  624. offset: 0,
  625. color: "rgba(203,158,255,1)",
  626. },
  627. {
  628. offset: 1,
  629. color: "rgba(203,158,255,0)",
  630. },
  631. ],
  632. false
  633. ),
  634. },
  635. },
  636. data: this.joinOutCountData,
  637. },
  638. ],
  639. };
  640. myChart.setOption(option);
  641. },
  642. //定时滚动
  643. scroll() {
  644. let self = this;
  645. self.$refs.con1[0].style.marginTop = '-48px';
  646. self.animate = !self.animate;
  647. setTimeout(function () {
  648. self.alarmList.push(self.alarmList[0]);
  649. self.alarmList.shift();
  650. self.$refs.con1[0].style.marginTop = '0px';
  651. self.animate = !self.animate; // 这个地方如果不把animate 取反会出现消息回滚的现象,此时把元素的过渡属性取消掉就可以完美实现无缝滚动的效果了
  652. }, 500)
  653. },
  654. },
  655. beforeDestroy() {
  656. //清除定时器
  657. clearInterval(this.timer);
  658. console.log("beforeDestroy");
  659. },
  660. destroyed() {
  661. //清除定时器
  662. clearInterval(this.timer);
  663. console.log("destroyed");
  664. }
  665. }
  666. </script>
  667. <style scoped lang="scss">
  668. .indexHome{
  669. flex:1;
  670. display: flex;
  671. flex-direction: column;
  672. p{
  673. margin:0;
  674. padding:0;
  675. color:#333;
  676. }
  677. .anim{
  678. transition: all 0.5s;
  679. }
  680. .top-max-big-box{
  681. margin-bottom:22px;
  682. .top-for-max-box{
  683. display: inline-block;
  684. margin:22px 0 0 21px;
  685. .top-for-big-box{
  686. width:290px;
  687. height:120px;
  688. border-radius:10px;
  689. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  690. display: flex;
  691. img{
  692. width:68px;
  693. height:68px;
  694. margin:26px 26px 26px 16px;
  695. }
  696. div{
  697. p:nth-child(1){
  698. line-height:68px;
  699. font-size:18px;
  700. font-weight:500;
  701. }
  702. p:nth-child(2){
  703. line-height:30px;
  704. font-size:30px;
  705. }
  706. .font-color-1{
  707. color:#0360FF;
  708. }
  709. .font-color-2{
  710. color:#742EFF;
  711. }
  712. .font-color-3{
  713. color:#0DDBDB;
  714. }
  715. .font-color-4{
  716. color:#FFA201;
  717. }
  718. .font-color-5{
  719. color:#FF4F4F;
  720. }
  721. }
  722. }
  723. }
  724. }
  725. .center-max-big-box{
  726. /*display: flex;*/
  727. padding:0 0 0 20px;
  728. .center-left-max-box{
  729. display: inline-block;
  730. width:497px;
  731. margin:0 22px 22px 0;
  732. .center-left-big-box{
  733. overflow: hidden;
  734. height:351px;
  735. border-radius:10px;
  736. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  737. .center-left-min-box{
  738. display: flex;
  739. width:450px;
  740. margin:0 auto;
  741. font-size:16px;
  742. font-weight:500;
  743. div{
  744. flex:1;
  745. display: flex;
  746. p{
  747. line-height:94px;
  748. }
  749. p:nth-child(1){
  750. width:150px;
  751. text-align: right;
  752. }
  753. p:nth-child(2){
  754. flex:1;
  755. font-size:34px;
  756. }
  757. }
  758. }
  759. }
  760. }
  761. .center-center-max-box{
  762. display: inline-block;
  763. width:497px;
  764. margin:0 22px 22px 0;
  765. .center-center-big-box{
  766. overflow: hidden;
  767. position: relative;
  768. width:500px;
  769. height:351px;
  770. border-radius:10px;
  771. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  772. .center-center-for-box{
  773. display: flex;
  774. margin-top:24px;
  775. p{
  776. line-height:24px;
  777. font-weight:500;
  778. }
  779. p:nth-child(1){
  780. width:50px;
  781. font-size:12px;
  782. color:#fff;
  783. margin-right:15px;
  784. margin-left:30px;
  785. text-align: center;
  786. border-radius:4px;
  787. }
  788. p:nth-child(2){
  789. flex:1;
  790. font-size:16px;
  791. display:block;
  792. overflow:hidden;
  793. text-overflow:ellipsis;
  794. white-space:nowrap;
  795. margin-right:30px;
  796. }
  797. p:nth-child(3){
  798. margin-right:30px;
  799. }
  800. .for-color-p-1{
  801. background: #FC7F1A;
  802. }
  803. .for-color-p-2{
  804. background: #0183FA;
  805. }
  806. }
  807. }
  808. }
  809. .center-right-max-box{
  810. display: inline-block;
  811. width:497px;
  812. margin:0 0 22px 0;
  813. .center-right-bigOne-box{
  814. height:351px;
  815. border-radius:10px;
  816. overflow: hidden;
  817. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  818. .center-right-big-box{
  819. width:497px;
  820. height:270px;
  821. display: flex;
  822. #eCharts-box-1{
  823. flex:1;
  824. }
  825. .eCharts-right-list-box{
  826. width:220px;
  827. padding-top:60px;
  828. div{
  829. display: flex;
  830. margin-bottom:15px;
  831. p{
  832. line-height: 20px;
  833. font-size:14px;
  834. font-weight:500;
  835. }
  836. p:nth-child(1){
  837. width:14px;
  838. height:14px;
  839. margin:3px 10px 3px 0;
  840. }
  841. p:nth-child(2){
  842. flex: 1;
  843. }
  844. p:nth-child(3){
  845. margin:0 20px 0 15px;
  846. }
  847. }
  848. }
  849. }
  850. }
  851. }
  852. }
  853. .bottom-max-big-box{
  854. /*display: flex;*/
  855. padding:0 0 20px 20px;
  856. .bottom-left-max-box{
  857. display: inline-block;
  858. width: 758px;
  859. margin:0 20px 20px 0;
  860. .bottom-left-big-box{
  861. height:347px;
  862. border-radius:10px;
  863. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  864. position: relative;
  865. overflow: hidden;
  866. .bottom-left-for-max-box{
  867. overflow: hidden;
  868. .bottom-left-for-box{
  869. display: flex;
  870. margin-bottom:24px;
  871. cursor: pointer;
  872. p{
  873. font-size:16px;
  874. line-height:24px;
  875. font-weight:500;
  876. }
  877. p:nth-child(1){
  878. width:160px;
  879. margin-right:50px;
  880. margin-left:30px;
  881. text-align: center;
  882. border-radius:4px;
  883. }
  884. p:nth-child(2){
  885. flex:1;
  886. display:block;
  887. overflow:hidden;
  888. text-overflow:ellipsis;
  889. white-space:nowrap;
  890. margin-right:30px;
  891. }
  892. p:nth-child(3){
  893. margin-right:30px;
  894. }
  895. p:nth-child(4){
  896. text-align: right;
  897. width:160px;
  898. margin-right:30px;
  899. display:block;
  900. overflow:hidden;
  901. text-overflow:ellipsis;
  902. white-space:nowrap;
  903. }
  904. }
  905. }
  906. }
  907. }
  908. .bottom-right-max-box{
  909. display: inline-block;
  910. width: 758px;
  911. overflow: hidden;
  912. border-radius:10px;
  913. box-shadow: 0 4px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
  914. .bottom-right-big-box{
  915. position: relative;
  916. overflow: hidden;
  917. margin-left:20px;
  918. height:347px;
  919. .title-button-box{
  920. display: flex;
  921. margin:20px 0 0 28px;
  922. p{
  923. text-align: center;
  924. width:90px;
  925. height:38px;
  926. line-height:38px;
  927. cursor: pointer;
  928. font-size:18px;
  929. font-weight:500;
  930. }
  931. p:nth-child(1){
  932. border-top-left-radius: 4px;
  933. border-bottom-left-radius: 4px;
  934. }
  935. p:nth-child(2){
  936. border-top-right-radius: 4px;
  937. border-bottom-right-radius: 4px;
  938. }
  939. .button-color-1{
  940. color:#fff;
  941. background: #0183FA;
  942. }
  943. .button-color-2{
  944. color:#333333;
  945. background: #fff;
  946. border:1px solid #A2A2A2;
  947. }
  948. }
  949. #bottom-right-eCharts-box{
  950. flex:1;
  951. height:289px;
  952. width:758px;
  953. }
  954. }
  955. }
  956. }
  957. .min-box-title-p{
  958. font-size:18px;
  959. font-weight:500;
  960. line-height:20px;
  961. margin-top:20px;
  962. margin-left:30px;
  963. }
  964. .position-min-button{
  965. position:absolute;
  966. right:20px;
  967. top:20px;
  968. font-weight: 500;
  969. font-size:16px;
  970. cursor: pointer;
  971. }
  972. }
  973. </style>
  974. <style lang="scss">
  975. .index-home-dialog-box{
  976. .index-home-dialog-big-box{
  977. display: flex;
  978. margin: 0 20px;
  979. p{
  980. font-size:14px;
  981. font-weight:500;
  982. line-height:20px;
  983. }
  984. p:nth-child(1){
  985. width:100px;
  986. text-align: right;
  987. }
  988. p:nth-child(2){
  989. flex:1;
  990. }
  991. }
  992. .index-home-dialog-big-box-one{
  993. display: flex;
  994. margin: 0 20px;
  995. .index-home-dialog-min-box{
  996. display: flex;
  997. flex:1;
  998. p{
  999. font-size:14px;
  1000. font-weight:500;
  1001. line-height:20px;
  1002. }
  1003. p:nth-child(1){
  1004. width:100px;
  1005. text-align: right;
  1006. }
  1007. p:nth-child(2){
  1008. flex: 1;
  1009. }
  1010. .buttonType{
  1011. font-weight: 700;
  1012. color:#333;
  1013. }
  1014. .buttonTypeOne{
  1015. font-weight: 700;
  1016. color:#2765CD;
  1017. }
  1018. .buttonTypeTwo{
  1019. width:60px;
  1020. flex:none!important;
  1021. text-align: center;
  1022. font-weight: 700;
  1023. background: #2765CD;
  1024. color:#fff;
  1025. border-radius:4px;
  1026. cursor: pointer;
  1027. }
  1028. }
  1029. }
  1030. }
  1031. </style>