index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <div style="padding:10px" @click.stop="void(0)">
  3. <div class="" style="text-align: center;top:2%;width: 100%;letter-spacing: 5px;color: #cdd2fb;font-size: 18px;">
  4. <span style="position: relative;">
  5. <el-button style="margin-left:10px" @click="impquery">刷新</el-button>
  6. </span>
  7. </div>
  8. <div style="height: 790px;width: 100%;background-color: rgb(237 237 237 / 23%);margin-top: 10px;display: flex;">
  9. <div style="height: 790px;width: 28%;margin-right: 1%;">
  10. <div class="table_caption" style="height: 30px;line-height: 30px;">存放时间统计(Top10)</div>
  11. <div style="height: 760px;width: 99%;border: 1px solid #ededed;background: #fff;padding-left: 10px;" ref="top10"></div>
  12. </div>
  13. <div style="height: 790px;width: 70%;margin-left: 1%;">
  14. <div class="table_caption" style="height: 30px;line-height: 30px;">库存分析(近30日)</div>
  15. <div style="height: 400px;width: 100%;" ref="echarts1"></div>
  16. <div class="table_caption" style="height: 30px;line-height: 30px;">库存统计(今日)</div>
  17. <el-table class="titletable" cellspacing="0" cellpadding="0" height="330px" width="800px" :data="datalist">
  18. <el-table-column label="种类" align="center" prop="name" fixed></el-table-column>
  19. <el-table-column label="当前库存" align="center" prop="curr">
  20. <template #default="scope">
  21. <a v-if="scope.row.name.indexOf('空盘头')==-1&&scope.row.curr>0" javascript="void(0)" @click="currDetail(scope.row)" style="color: cornflowerblue;text-decoration: underline;">{{ scope.row.curr }}</a>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="入库数量" align="center" prop="in"></el-table-column>
  25. <el-table-column label="出库数量" align="center" prop="out"></el-table-column>
  26. <el-table-column label="最大库存量" align="center" prop="max"></el-table-column>
  27. <el-table-column label="最小库存量" align="center" prop="min"></el-table-column>
  28. <el-table-column label="平均库存" align="center" prop="avg"></el-table-column>
  29. </el-table>
  30. </div>
  31. </div>
  32. </div>
  33. <el-dialog title="占比详情" v-model="openDetail" width="500px" append-to-body>
  34. <el-form style="height:450px;width:100%;">
  35. <el-table row-key="id" :data="detaildata" style="height:430px;width:100%;">
  36. <el-table-column label="名称" align="left" prop="name" ></el-table-column>
  37. <el-table-column label="数量" align="left" prop="num" ></el-table-column>
  38. <el-table-column label="占比(%)" align="left" prop="ratio">
  39. <template #default="scope">
  40. {{(scope.row.ratio*100).toFixed(2)+'%'}}
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </el-form>
  45. <template #footer>
  46. <div class="dialog-footer">
  47. <el-button @click="openDetail=false">关闭</el-button>
  48. </div>
  49. </template>
  50. </el-dialog>
  51. <el-dialog :title="currDlgTitle" v-model="currOpenDetail" width="900px" append-to-body>
  52. <el-form style="height:550px;width:100%;display: flex;">
  53. <el-table ref="currtable" row-key="id" :data="currdata" style="height:530px;width:50%;" highlight-current-row>
  54. <el-table-column label="长丝旦数(D)" align="left" prop="lot13" ></el-table-column>
  55. <el-table-column label="整经根数/验布幅宽(cm)" align="left" prop="lot15" width="200"></el-table-column>
  56. <el-table-column label="盘头数量" align="left" prop="num">
  57. <template #default="scope">
  58. <a javascript="void(0)" @click="currNumDetail(scope.row,1)" style="color: cornflowerblue;text-decoration: underline;">{{ scope.row.num }}</a>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <el-table row-key="id" :data="currdetaildata" style="height:530px;width:48%;margin-left: 2%;">
  63. <el-table-column label="时间" align="left" prop="date" ></el-table-column>
  64. <el-table-column label="生产人员" align="left" prop="lot12" ></el-table-column>
  65. <el-table-column label="生产机台" align="left" prop="lot17"></el-table-column>
  66. </el-table>
  67. </el-form>
  68. <template #footer>
  69. <div class="dialog-footer">
  70. <el-button @click="currOpenDetail=false">关闭</el-button>
  71. </div>
  72. </template>
  73. </el-dialog>
  74. </template>
  75. <script>
  76. import { ref,onMounted,watch } from 'vue';
  77. import {pantou,baiPi} from "@/api/house/api";
  78. import { ElDatePicker,ElMessage } from 'element-plus';
  79. import 'element-plus/dist/index.css'; // 确保导入样式文件
  80. import * as echarts from 'echarts';
  81. export default {
  82. props:{
  83. },
  84. components:{
  85. },
  86. setup(props,{emit}){
  87. const { proxy } = getCurrentInstance();
  88. let datalist=ref([]);
  89. let detailDataList=ref([]);
  90. const echarts1=ref(null);
  91. const top10 = ref(null);
  92. const detaildata=ref([]);
  93. const openDetail=ref(false);
  94. const currOpenDetail=ref(false);
  95. const currDlgTitle=ref('');
  96. const currdata=ref([]);
  97. const currdetaildata=ref([]);
  98. const loading=ref(true);
  99. const cacheData=ref({});
  100. const currtable=ref(null);
  101. function impquery(){
  102. detailDataList.value=[];
  103. datalist.value=[];
  104. const msg = ElMessage({
  105. message:"正在加载数据",
  106. type:"info",
  107. duration:0, //一直显示
  108. });
  109. loading.value = true;
  110. pantou().then((res)=>{
  111. loading.value = false;
  112. msg.close();
  113. if(res.code!=200){
  114. return;
  115. }
  116. cacheData.value = res.data;
  117. datalist.value = res.data.stocks;
  118. showTop(res.data.tops);
  119. showLine(res.data.usages);
  120. }).catch(res=>{
  121. ElMessage({
  122. message:"数据获取失败!",
  123. type:"error",
  124. });
  125. });
  126. }
  127. function currDetail(data){
  128. if(data.curr!=null && data.curr>0){
  129. currOpenDetail.value=true;
  130. currDlgTitle.value=data.name + "—当前库存详情";
  131. currdata.value = data.calc;
  132. currNumDetail(data.calc[0],null);
  133. }
  134. }
  135. function currNumDetail(data,flag){
  136. if(data.details!=null && data.details.length>0){
  137. currdetaildata.value = data.details;
  138. if(flag==null){
  139. setTimeout(() => {
  140. currtable.value.$el.querySelector('tbody tr').classList.add('current-row');
  141. }, 50);
  142. }else{
  143. currtable.value.$el.querySelector('tbody tr').classList.remove('current-row');
  144. }
  145. }
  146. }
  147. function showLine(data){
  148. var myChart = echarts.init(echarts1.value);
  149. const dataColor = ['#4EB2FE', '#f19051', '#F47505', '#20d450'];
  150. const data1 = [];
  151. const data3 = [];
  152. const nameArr = [];
  153. for (let index = 0; index < data.length; index++) {
  154. const element = data[index];
  155. data1.push(element.max);
  156. data3.push(element.rate*100);
  157. nameArr.push(element.date.substring(5));
  158. }
  159. const axiscolor = ['#dde1e8', '#222222'];
  160. const colorArr1 = ['#f66c6b', '#fb8484', '#ff9d9d'];
  161. const colorArr2 = ['#1aa4f2', '#4eb6f9', '#88cbfe'];
  162. const color1 = {
  163. type: 'linear',
  164. x: 0,
  165. x2: 0,
  166. y: 1,
  167. y2: 0,
  168. colorStops: [
  169. {
  170. offset: 0,
  171. color: colorArr1[0]
  172. },
  173. {
  174. offset: 0.5,
  175. color: colorArr1[1]
  176. },
  177. {
  178. offset: 1,
  179. color: colorArr1[1]
  180. }
  181. ]
  182. };
  183. const color2 = {
  184. type: 'linear',
  185. x: 0,
  186. x2: 0,
  187. y: 1,
  188. y2: 0,
  189. colorStops: [
  190. {
  191. offset: 0,
  192. color: colorArr2[0]
  193. },
  194. {
  195. offset: 0.5,
  196. color: colorArr2[1]
  197. },
  198. {
  199. offset: 1,
  200. color: colorArr2[1]
  201. }
  202. ]
  203. };
  204. const barWidth = 12;
  205. var option = {
  206. // backgroundColor: 'pink',
  207. tooltip: {
  208. trigger: 'axis',
  209. textStyle: {
  210. fontSize: '100%'
  211. }
  212. },
  213. legend: [
  214. {
  215. data: ['最大使用量'],
  216. // textStyle: {
  217. // color: '#9FC6F6'
  218. // },
  219. top: '2%',
  220. left: '40%',
  221. icon: 'rect', // 形状
  222. itemWidth: 10, // 宽
  223. itemHeight: 10 // 高
  224. },
  225. {
  226. data: ['使用率'],
  227. // textStyle: {
  228. // color: '#9FC6F6'
  229. // },
  230. top: '2%',
  231. left: '54%',
  232. icon: 'rect',
  233. itemWidth: 10,
  234. itemHeight: 3
  235. }
  236. ],
  237. xAxis: {
  238. axisTick: {
  239. show: false
  240. },
  241. axisLine: {
  242. lineStyle: {
  243. color: axiscolor[1],
  244. width: 2
  245. }
  246. },
  247. axisLabel: {
  248. interval: 0,
  249. fontSize: 12,
  250. rotate: -45,
  251. color: axiscolor[1]
  252. },
  253. data: nameArr
  254. },
  255. yAxis: [
  256. {
  257. type: 'value',
  258. name: '单位:个',
  259. nameTextStyle: {
  260. // fontFamily: 'ShiShangZhongHeiJianTi',
  261. // fontSize: 20,
  262. color: '#999999',
  263. // align: 'center',
  264. // padding: [0, 0, 10, 0]
  265. },
  266. axisTick: {
  267. show: false
  268. },
  269. axisLine: {
  270. show: true,
  271. lineStyle: {
  272. color: axiscolor[0],
  273. width: 2
  274. }
  275. },
  276. splitLine: {
  277. show: true,
  278. lineStyle: {
  279. color: '#dde1e8',
  280. type: 'dashed'
  281. }
  282. },
  283. axisLabel: {
  284. fontFamily: 'Dinpro',
  285. fontSize: 14,
  286. color: axiscolor[1]
  287. }
  288. },
  289. {
  290. name: '单位:%',
  291. nameTextStyle: {
  292. // // fontFamily: 'ShiShangZhongHeiJianTi',
  293. // // fontSize: 20,
  294. color: '#999999',
  295. // align: 'center',
  296. // // padding: [0, 50, 10, 0]
  297. },
  298. type: 'value',
  299. axisTick: {
  300. show: false
  301. },
  302. axisLine: {
  303. show: true,
  304. lineStyle: {
  305. color: axiscolor[0],
  306. width: 2
  307. }
  308. },
  309. axisLabel: {
  310. color: axiscolor[1],
  311. fontFamily: 'Dinpro',
  312. fontSize: 10
  313. },
  314. splitLine: {
  315. show: true,
  316. lineStyle: {
  317. color: '#dde1e8',
  318. type: 'dashed'
  319. }
  320. }
  321. }
  322. ],
  323. series: [
  324. {
  325. z: 1,
  326. name: '最大使用量',
  327. type: 'bar',
  328. barWidth: barWidth,
  329. barGap: '20%',
  330. data: data1,
  331. itemStyle: {
  332. color: color2
  333. }
  334. },
  335. {
  336. name: '使用率',
  337. type: 'line',
  338. smooth: true,
  339. symbolSize: 1,
  340. yAxisIndex: 1,
  341. itemStyle: {
  342. color: dataColor[3]
  343. },
  344. lineStyle: {
  345. width: 2,
  346. color: dataColor[3]
  347. },
  348. // animationDuration: 5800,
  349. // animationEasing: 'quadraticOut',
  350. showSymbol: true,
  351. data: data3
  352. }
  353. ],
  354. grid: {
  355. top: '15%',
  356. left: '5%',
  357. right: '3%',
  358. bottom: '10%'
  359. }
  360. };
  361. myChart.setOption(option);
  362. // 添加点击事件监听器
  363. myChart.on('click', function (params) {
  364. if (params.componentType === 'series') {
  365. console.log('点击了系列', params.seriesName, '的', params.dataIndex, '项');
  366. // 在这里处理你的逻辑,例如更新数据等
  367. openDetail.value=true;
  368. detaildata.value = cacheData.value['usages'][params.dataIndex].details;
  369. }
  370. });
  371. }
  372. function showTop(data){
  373. var myChart = echarts.init(top10.value);
  374. let data1 = [];
  375. let data2 = [];
  376. let data3 = [];
  377. for (let index = 0; index < data.length; index++) {
  378. const element = data[index];
  379. data3.push(element.day);
  380. data2.push(index+1);
  381. data1.push({
  382. name:element.name,
  383. date:element.date,
  384. value:element.day,
  385. })
  386. }
  387. let data4 = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100];
  388. let style = {
  389. width: 24,
  390. height: 18,
  391. padding: [2, 2, 0, 0],
  392. fontSize: 12,
  393. align: "center",
  394. color: "#ffffff"
  395. };
  396. var option = {
  397. tooltip: {
  398. show: true,
  399. trigger: "item",
  400. padding: [8, 15],
  401. backgroundColor: "rgba(12, 51, 115,0.8)",
  402. borderColor: "rgba(3, 11, 44, 0.5)",
  403. textStyle: {
  404. color: "rgba(255, 255, 255, 1)",
  405. fontFamily: "SourceHanSansCN-Normal",
  406. fontSize: 14
  407. },
  408. formatter: function (params) {
  409. if(params.seriesIndex==0) return "";
  410. const name = params.name;
  411. const date = params.data.date; // 假设数据中包含 date 字段
  412. const value = params.value;
  413. // if (params.componentType === 'yAxis' && params.componentIndex === 0) {
  414. // return null; // 屏蔽第一个 yAxis 的提示
  415. // }
  416. return `${name}<br/>日期:${date}<br/>距当前天数:${value}`;
  417. }
  418. },
  419. legend: {
  420. show: false
  421. },
  422. grid: {
  423. left: "10%",
  424. right: "8%",
  425. top: "1%",
  426. bottom: "2%"
  427. },
  428. xAxis: [
  429. {
  430. splitLine: {
  431. show: false
  432. },
  433. type: "value",
  434. show: false,
  435. axisLine: {
  436. //x轴坐标轴,false为隐藏,true为显示
  437. show: false
  438. }
  439. }
  440. ],
  441. yAxis: [
  442. {
  443. show: true,
  444. splitLine: {
  445. show: false
  446. },
  447. axisLine: {
  448. show: false
  449. },
  450. type: "category",
  451. axisTick: {
  452. show: false
  453. },
  454. axisPointer: { show: false },
  455. triggerEvent: false, // 关键解决方案
  456. inverse: true,
  457. data: data2,
  458. axisLabel: {
  459. show: true,
  460. margin: 20,
  461. textStyle: {
  462. color: "rgba(255, 255, 255, 1)",
  463. fontFamily: "SourceHanSansCN-Normal",
  464. fontSize: 14
  465. },
  466. formatter: function (params, index) {
  467. // var index = params;
  468. const id = index + 1;
  469. //console.log("111111", params);
  470. if (id < 4) {
  471. return [`{rank${id}|${id}}`].join("\n");
  472. } else {
  473. return [`{rank|${id}}`].join("\n");
  474. }
  475. // if (index - 1 < 3) {
  476. // return ;
  477. // } else {
  478. // return ['{b|' + index + '}'].join('\n');
  479. // }
  480. },
  481. rich: {
  482. rank1: {
  483. ...style,
  484. backgroundColor: {
  485. image:
  486. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAAXNSR0IArs4c6QAAARZJREFUOE/tlb1KA0EUhc+5u41F1lbB1tY0Gt8iPoD2eQFtLXwAU/sMIoKQQd0tUghiqW1awZQWQiSGTLzjzrKbymKmCRkYhjt/3zDnzhza/VYXIlegbIEJQEGzTf9i0TGtZVz1+VjGsGmP9/kdaoW2k324zcGljT3o3wBdP6YptpcB1p06DAA0BdeAUisvfCWy17CPweMpgblelYocVIMyC2+x8XnM6+dJLAAAecH0pxsP4DJTBjEBT5jOjmIBbvA1OeFw+B0egOQS5uEsWhat4ks+yOYQ0a80xG9qaQrNz6rQdjZfQe4FArzRFO0m4DDb/XWZC0B2nKFASnOp+YEzG41TQFIA3nh0bmVA75gl58zzUR2wADMYXqBI8VUUAAAAAElFTkSuQmCC"
  487. }
  488. },
  489. rank2: {
  490. ...style,
  491. backgroundColor: {
  492. image:
  493. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAAXNSR0IArs4c6QAAAPFJREFUOE/tlTFKA0EUhr9/UuUGK9imTW4SD6CNlc2GgJgubBYPoLWHEEHwBjaWprUVIsQ+m2YnZHYdZtdydxrxwcDMMLwP5r33/7I5U9ADKEHQXLY6m9Z9eHZ79+4LuNKMZ4KQXWmDlLi7bgAHUcpJC2CsS9wPAKU+W5XSrv4Bvsg/Nbxny41yyihfVFfgiT3numbXew18J8IbYhoPULX8SzwAvFJwFgvwyJALXVL0D4A7vllE66K/OMmZKTH1eHRXU6vUibuPo1y/I417UtO1UiZNwJIRA3OL7Kk3l1C6f5lL7RsNE3KG80lJpjkfIeAAkjJvqT1lfksAAAAASUVORK5CYII="
  494. }
  495. },
  496. rank3: {
  497. ...style,
  498. backgroundColor: {
  499. image:
  500. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAAXNSR0IArs4c6QAAAPBJREFUOE/tlT9OwzAUh7+fYWfpAFIZOrBSpblHegC69wLtihAHoDOHQAgabsDSsV1ZKzUnaDvFla00JFG31AviWZZly3rfs98/2ZQE8Yq4xokBVJnHfXU9dSYyDGMN+PR6CpFN2XjlTmk7gDMsU8xNE2BLi9sDUFya6jnuBf+AemAYZnww0RN5kC8q/PlOhwfdsju7DzzAhTEsEElIgAN9hQR8s2UYCvDGFSP12IcAvBAxlQJF0d/M5Bz50b6aGqwGRRaU5XrOEsP9WQBipZh+vVzPuUM8Y+iWZfvYUNzNi0bzaTab38xdc8mjIn6qgAME+UlV+Na7MwAAAABJRU5ErkJggg=="
  501. }
  502. },
  503. rank: {
  504. ...style,
  505. backgroundColor: {
  506. image:
  507. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAAXNSR0IArs4c6QAAAQdJREFUOE/tlb9KxEAQh7/fWvkGCra2+hK59ixWbLSx8gW0FfEBFHOVna0JhyD4BjaWprUVvM5SDzQjm0tCTsQmt424zbDsn29mmPmNBiMbCi4RKxIgCFbuF/vz2QTHQe51S2cpSe1F9ec9AcGpSea1OgcYpGat1/0iqKLOfOVmu/QP+F4QiPOs4JATlSFPC09RABrc2Ae7+Y7eogDqonmYlgxjAkI/3cUDOO4/p2zFATjGy6/sXe3rPQbg7LrgKFoV/cFOTlIrJVR1ZE+xw2G5D5LXEbsktUeJjQUBitxrc15NL2wdxylizTUR1AMldKRrhsvSLML2TrMP/s7ePZs4Hm/rqQv4AucUYfTiSAZXAAAAAElFTkSuQmCC"
  508. }
  509. },
  510. a: {
  511. padding: [0, 0, 35, 10]
  512. },
  513. b: {
  514. backgroundColor: {
  515. type: "linear",
  516. x: 0,
  517. y: 0,
  518. x2: 1,
  519. y2: 0,
  520. colorStops: [
  521. {
  522. offset: 0,
  523. color: "#29DFF6"
  524. },
  525. {
  526. offset: 1,
  527. color: "#00A8FF"
  528. }
  529. ],
  530. global: false // 缺省为 false
  531. },
  532. color: "#D1E7FF",
  533. width: 60,
  534. height: 60,
  535. padding: [5, 0, 0, 0],
  536. borderRadius: 30,
  537. fontSize: 14,
  538. align: "center",
  539. fontWeight: 500
  540. }
  541. }
  542. }
  543. },
  544. {
  545. type: "category",
  546. inverse: true,
  547. axisTick: "none",
  548. axisLine: "none",
  549. show: true,
  550. position: "right",
  551. axisLabel: {
  552. inside: true,
  553. // verticalAlign: "bottom",
  554. // lineHeight: 30,
  555. padding: [-24, 0, 0, 0], // 上、右、下、左(负值可上移文字)
  556. // verticalAlign: "top", // 设置垂直对齐方式
  557. margin: 0, //刻度标签与轴线之间的距离
  558. show: true,
  559. textStyle: {
  560. verticalAlign: "top", // 设置垂直对齐方式
  561. color: "#445482",
  562. fontFamily: "SourceHanSansCN-Normal",
  563. fontSize: 14
  564. },
  565. formatter: function (value) {
  566. return value + "";
  567. }
  568. },
  569. data: data3
  570. }
  571. ],
  572. series: [
  573. {
  574. name: "背景",
  575. type: "bar",
  576. barWidth: 12,
  577. barGap: "-100%",
  578. data: data4,
  579. itemStyle: {
  580. normal: {
  581. color: "#D1E7FF",
  582. barBorderRadius: 10
  583. }
  584. }
  585. },
  586. {
  587. show: true,
  588. name: "",
  589. type: "bar",
  590. data: data1,
  591. barWidth: 12, // 柱子宽度
  592. showBackground: false,
  593. backgroundStyle: {
  594. color: {
  595. type: "linear",
  596. x: 0,
  597. y: 0,
  598. x2: 1,
  599. y2: 1,
  600. colorStops: [
  601. {
  602. offset: 0,
  603. color: "#D1E7FF"
  604. },
  605. {
  606. offset: 1,
  607. color: "#D1E7FF"
  608. }
  609. ]
  610. }
  611. },
  612. label: {
  613. show: true,
  614. offset: [5, -17],
  615. color: "#132852",
  616. fontFamily: "SourceHanSansCN-Normal",
  617. fontSize: 14,
  618. fontWeight: 500,
  619. position: "left",
  620. align: "left",
  621. formatter: function (params) {
  622. return params.data.name;
  623. }
  624. },
  625. itemStyle: {
  626. barBorderRadius: [5, 5, 5, 5],
  627. color: {
  628. type: "linear",
  629. x: 0,
  630. y: 0,
  631. x2: 1,
  632. y2: 0,
  633. colorStops: [
  634. {
  635. offset: 0,
  636. color: "#29DFF6"
  637. },
  638. {
  639. offset: 1,
  640. color: "#00A8FF"
  641. }
  642. ]
  643. }
  644. }
  645. }
  646. ],
  647. dataZoom: [
  648. {
  649. width: 15,
  650. yAxisIndex: [0, 1], // 这里是从X轴的0刻度开始
  651. show: false, // 是否显示滑动条,不影响使用
  652. type: "slider" // 这个 dataZoom 组件是 slider 型 dataZoom 组件
  653. // startValue: 1, // 从头开始。
  654. // endValue: 4 // 展示到第几个。
  655. }
  656. ]
  657. };
  658. myChart.setOption(option);
  659. }
  660. onMounted(()=>{
  661. impquery();
  662. })
  663. return{
  664. datalist,
  665. impquery,
  666. loading,
  667. echarts1,
  668. top10,
  669. openDetail,
  670. detaildata,
  671. currDetail,
  672. currOpenDetail,
  673. currDlgTitle,
  674. currdata,
  675. currNumDetail,
  676. currdetaildata,
  677. currtable,
  678. }
  679. }
  680. }
  681. </script>
  682. <style>
  683. .el-table__body tr.current-row>td.el-table__cell
  684. {
  685. background-color: #aacbec;
  686. }
  687. </style>