shouye.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <div style="height: 100vh;" class="backPage">
  3. <div style="width: 100%;height: 7vh;padding-top: 1%;display: flex;align-items: center;">
  4. <img style="position: absolute;left: 1.5%;top:1%;width: 58%;z-index: 100;height:5%;" src="@/assets/上海水务首页图片包1/上海市水务海洋数字孪生模型服务平台.png" alt="">
  5. <!-- <div style="margin-left: 1%;color: white;font-size: 2rem;">上海市水务海洋数字孪生模型服务管理系统</div> -->
  6. </div>
  7. <div style="display: flex;width: 97%;margin-left: 1.5%;margin-top: 0.5%;;border-radius: 20px;">
  8. <div style="height: 55vh;width: 30%;display: flex;flex-direction: column;justify-content: space-between;background-color: #AACEF9;border-radius: 20px;" class="shadow">
  9. <div style="height: 53vh;width: 100%;display: flex;flex-direction: column;justify-content: space-between;">
  10. <div style="display: flex;align-items: center;width: 80%;;height: 10vh;margin-top: 3%;margin-left: 10%;" class="menu-item" @click="pushto('platform/componentReg')">
  11. <img style="margin-left: 5%;height: 2.5rem;width: 10%;" src="@/assets/上海水务首页图片包1/模型注册.png" alt="">
  12. <!-- <svg-icon icon-class="zhuce" style="margin-left: 5%;font-size: 1.5rem;" /> -->
  13. <div style="font-size: 2rem;color: white;margin-left: 5%;">模型注册管理</div>
  14. </div>
  15. <div style="display: flex;align-items: center;width: 80%;;height: 10vh;margin-top: 3%;margin-left: 10%;" class="menu-item" @click="pushto('register/edtiModel')">
  16. <img style="margin-left: 5%;height: 2.5rem;width: 10%;" src="@/assets/上海水务首页图片包1/服务管理.png" alt="">
  17. <div style="font-size: 2rem;color: white;margin-left: 5%;">模型服务管理</div>
  18. </div>
  19. <div style="display: flex;align-items: center;width: 80%;;height: 10vh;margin-top: 3%;margin-left: 10%;" class="menu-item" @click="pushto('standardization/modelUsing')">
  20. <img style="margin-left: 5%;height: 2.5rem;width: 10%;" src="@/assets/上海水务首页图片包1/标准化开发.png" alt="">
  21. <div style="font-size: 2rem;color: white;margin-left: 5%;">模型标准化开发</div>
  22. </div>
  23. <div style="display: flex;align-items: center;width: 80%;;height: 10vh;margin-top: 3%;margin-left: 10%;" class="menu-item" @click="pushto('datamonitor/model_operation_monitoring')">
  24. <img style="margin-left: 5%;height: 2.5rem;width: 10%;" src="@/assets/上海水务首页图片包1/模型监控管理.png" alt="">
  25. <div style="font-size: 2rem;color: white;margin-left: 5%;">模型监控管理</div>
  26. </div>
  27. <div style="display: flex;align-items: center;width: 80%;;height: 10vh;margin-top: 3%;margin-left: 10%;" class="menu-item" @click="pushto('evaluate/score')">
  28. <img style="margin-left: 5%;height: 2.5rem;width: 10%;" src="@/assets/上海水务首页图片包1/模型评价.png" alt="">
  29. <div style="font-size: 2rem;color: white;margin-left: 5%;">模型评价管理</div>
  30. </div>
  31. </div>
  32. </div>
  33. <el-carousel
  34. :interval="4000"
  35. height="auto"
  36. style="width: 70%;height: 55vh;margin-left: 1%;border: 1px solid rgb(160, 207, 255);border-radius: 20px;"
  37. arrow="always"
  38. autoplay>
  39. <el-carousel-item style="height: 55vh">
  40. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/上海城区洪涝仿真模型.png" alt="">
  41. </el-carousel-item>
  42. <el-carousel-item style="height: 55vh">
  43. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/上海沿海风暴模型.png" alt="">
  44. </el-carousel-item>
  45. <el-carousel-item style="height: 55vh">
  46. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/黄浦江水系水文分析预报数值模拟模型.png"
  47. alt="">
  48. </el-carousel-item>
  49. <el-carousel-item style="height: 55vh">
  50. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/内涝风险实时预警与预报模型.png" alt="">
  51. </el-carousel-item>
  52. <el-carousel-item style="height: 55vh">
  53. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/上海城区洪涝仿真模型.png" alt="">
  54. </el-carousel-item>
  55. <el-carousel-item style="height: 55vh">
  56. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/苏州河水系水情预报模型.png" alt="">
  57. </el-carousel-item>
  58. <el-carousel-item style="height: 55vh">
  59. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/上海市中心城区排水系统模型.png" alt="">
  60. </el-carousel-item>
  61. <el-carousel-item style="height: 55vh">
  62. <img style="height: 100%;width: 100%;" src="@/assets/上海水务首页图片包1/温带风暴潮预报模型.png" alt="">
  63. </el-carousel-item>
  64. </el-carousel>
  65. </div>
  66. <div style="margin-top: 1%;height: 33vh;width: 97%;margin-left: 1.5%;display: flex;border-radius: 20px;background-color: #A9D2FB;" class="shadow">
  67. <div id="bt1" style="width: 50%;height: 100%;">
  68. </div>
  69. <div id="bt2" style="width: 50%;height: 100%;">
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script setup>
  75. import {useRouter} from 'vue-router'
  76. import {onMounted} from 'vue';
  77. import {snailJobLine} from "@/api/service/timing.js";
  78. import * as echarts from 'echarts';
  79. import {getMdAllList } from "@/api/service/log.js";
  80. const router = useRouter()
  81. function pushto(routers) {
  82. router.push(routers);
  83. }
  84. function getLast7DaysRange() {
  85. const end = new Date();
  86. const start = new Date();
  87. end.setDate(start.getDate() - 1);
  88. start.setDate(end.getDate() - 7);
  89. function formatDate(date) {
  90. const year = date.getFullYear();
  91. const month = String(date.getMonth() + 1).padStart(2, '0');
  92. const day = String(date.getDate()).padStart(2, '0');
  93. return `${year}-${month}-${day}`;
  94. }
  95. return {
  96. start: formatDate(start),
  97. end: formatDate(end)
  98. };
  99. }
  100. async function getchart2(){
  101. const last7Days = getLast7DaysRange();
  102. var par = {
  103. params:{
  104. beginTime:last7Days.start,
  105. endTime:last7Days.end,
  106. }
  107. }
  108. await getMdAllList(par).then(res=>{
  109. var dates = []
  110. var counts = []
  111. res.data.forEach(item=>{
  112. item.total = 0
  113. item.lineCharts.forEach(item1=>{
  114. item.total = item.total + item1.num
  115. })
  116. })
  117. var y = []
  118. var chartDom = document.getElementById('bt2');
  119. var myChart = echarts.init(chartDom);
  120. res.data.forEach(item=>{
  121. if(item.mdName!=='上海模型服务'){
  122. var par = {
  123. name: item.mdName,
  124. value: item.total,
  125. }
  126. y.push(par)
  127. }
  128. })
  129. console.log(y)
  130. const option = {
  131. title: {
  132. text: '模型调用次数统计',
  133. subtext: '',
  134. top: '5%',
  135. textStyle: {
  136. color: 'rgb(51, 126, 204)'
  137. },
  138. left: 'center'
  139. },
  140. tooltip: {
  141. trigger: 'item'
  142. },
  143. series: [
  144. {
  145. name: '',
  146. type: 'pie',
  147. radius: '50%',
  148. roseType: 'area',
  149. data:y,
  150. center: ['50%', '55%'],
  151. color: ['#0050df','#fc69a7', '#19e3e3', '#ffcc1c', '#f89e67','#2bba68', '#019bfe'],
  152. label: {
  153. // 关键配置:文字颜色跟随区域颜色
  154. color: 'auto', // 设置为 'auto' 使文字颜色跟随区域颜色[1](@ref)
  155. fontSize: 18,
  156. },
  157. emphasis: {
  158. itemStyle: {
  159. shadowBlur: 10,
  160. shadowOffsetX: 0,
  161. shadowColor: 'rgba(0, 0, 0, 0.5)'
  162. }
  163. }
  164. }
  165. ]
  166. };
  167. myChart.setOption(option)
  168. })
  169. }
  170. async function getEchartData(){
  171. await snailJobLine({type: 'MONTH'}).then(res=>{
  172. console.log(res.data.map(item => item.createDt));
  173. var datay = []
  174. var data = []
  175. let obj = {
  176. name: '成功',
  177. type: 'bar',
  178. color: 'rgba(0,80,223,1)',
  179. data: []
  180. }
  181. let obj1 = {
  182. name: '失败',
  183. type: 'bar',
  184. color:'rgba(252,105,167,1)',
  185. data: []
  186. }
  187. let obj2 = {
  188. name: '停止',
  189. type: 'bar',
  190. color:'rgba(25,227,227,1)',
  191. data: []
  192. }
  193. let obj3 = {
  194. name: '取消',
  195. type: 'bar',
  196. color:'rgba(2255,204,28,1)',
  197. data: []
  198. }
  199. res.data.forEach(item=>{
  200. obj.data.push(item.success)
  201. obj1.data.push(item.failNum)
  202. obj2.data.push(item.stop)
  203. obj3.data.push(item.cancel)
  204. })
  205. datay.push(obj)
  206. datay.push(obj1)
  207. datay.push(obj2)
  208. datay.push(obj3)
  209. var chartDom = document.getElementById('bt1');
  210. var myChart = echarts.init(chartDom);
  211. const option = {
  212. title: {
  213. text: '模型调用成功率',
  214. subtext: '',
  215. left: 'center',
  216. textStyle: {
  217. color: 'rgb(51, 126, 204)'
  218. },
  219. top: '5%',
  220. },
  221. // 提示框配置
  222. tooltip: {
  223. trigger: 'axis',
  224. axisPointer: {
  225. type: 'shadow'
  226. },
  227. },
  228. // 图例配置
  229. legend: {
  230. top: '20%',
  231. itemGap: 100,
  232. textStyle: {
  233. color: '#fff' // 字体颜色白色
  234. }
  235. },
  236. // 网格配置
  237. grid: {
  238. left: '3%',
  239. right: '4%',
  240. top: '30%',
  241. bottom: '8%',
  242. containLabel: true
  243. },
  244. // X轴配置
  245. xAxis: {
  246. type: 'category',
  247. data: res.data.map(item => item.createDt),
  248. axisTick: {
  249. show: false
  250. },
  251. // 设置x轴标签样式
  252. axisLabel: {
  253. color: '#fff', // 字体颜色白色
  254. rotate: -15 // 倾斜45度
  255. },
  256. axisLine: {
  257. show: false
  258. },
  259. },
  260. // Y轴配置
  261. yAxis: {
  262. type: 'value',
  263. name: '',
  264. axisLine: {
  265. show: false
  266. },
  267. // 隐藏y轴刻度线
  268. axisTick: {
  269. show: false
  270. },
  271. // 隐藏y轴分割线
  272. splitLine: {
  273. show: false
  274. },
  275. // 设置y轴标签样式
  276. axisLabel: {
  277. color: '#fff' // 字体颜色白色
  278. }
  279. },
  280. series: datay
  281. }
  282. // 设置配置项并渲染图表
  283. myChart.setOption(option)
  284. })
  285. }
  286. onMounted(() => {
  287. getEchartData()
  288. getchart2()
  289. });
  290. </script>
  291. <!--
  292. //background-image:url('@/assets/上海水务首页图片包/浅蓝.png');
  293. //background-repeat: no-repeat;
  294. //background-position: center center;
  295. -->
  296. <style scoped>
  297. .back1 {
  298. background-image:url('@/assets/images/title-background.png');
  299. }
  300. .back2 {
  301. background-image: url('@/assets/上海水务首页图片包/深蓝.png');
  302. background-repeat: no-repeat;
  303. background-position: center center;
  304. transition: transform .2s ease-in;
  305. }
  306. .backPage{
  307. background-image: url('@/assets/上海水务首页图片包1/背景图.png');
  308. }
  309. .back2:hover {
  310. transform: translateX(-20px);
  311. box-shadow: 0 0 6px rgba(0, 0, 0, .12);
  312. }
  313. .menu-item {
  314. background-color: #7ABAFF;
  315. border: 1px solid rgb(160, 207, 255);
  316. border-radius: 20px;
  317. }
  318. .shadow {
  319. box-shadow:
  320. -5px 0 8px -2px rgba(0, 0, 0, 0.1),
  321. 0 -5px 8px -2px rgba(0, 0, 0, 0.1),
  322. 0 5px 8px -2px rgba(0, 0, 0, 0.1);
  323. }
  324. .menu-item:hover {
  325. background-color: #3F9FFC;
  326. cursor: pointer;
  327. transform: translateX(-20px);
  328. }
  329. </style>