indexHome.vue 31 KB

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