web
2025-03-19 ae8d9d380854076d0b2da145576ae08f14a8f835
feat: 添加生态流量页面&做大屏分辨率适配
已修改20个文件
已添加5个文件
903 ■■■■ 文件已修改
index.html 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
postcss.config.cjs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/flow/fullscreen.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/flow/monitor-title-bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/flow/warn-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/screen/flow.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/screen/temp.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user.js 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/auth.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/rem.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/configuration/commonParameters/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/facilityList/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/facilityType/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/monitorList/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/flow/ecology/index.vue 302 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/flow/graphic/index.vue 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dict/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/permission/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/role/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
index.html
@@ -5,17 +5,18 @@
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" href="/favicon.ico">
  <title>金川水电站生态流量监测系统</title>
  <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
  <style>
    html,
    body,
    #app {
      height: 100%;
      margin: 0px;
      padding: 0px;
      margin: 0;
      padding: 0;
    }
    .chromeframe {
package-lock.json
@@ -17,11 +17,13 @@
        "element-plus": "^2.5.0",
        "file-saver": "2.0.5",
        "fuse.js": "6.6.2",
        "html2canvas": "^1.4.1",
        "js-cookie": "3.0.5",
        "jsencrypt": "3.3.2",
        "nprogress": "0.2.0",
        "pinia": "2.1.7",
        "pinia-plugin-persist": "^1.0.0",
        "postcss-pxtorem": "^6.1.0",
        "typescript": "^5.4.5",
        "vue": "3.3.9",
        "vue-cropper": "1.1.1",
@@ -1221,6 +1223,14 @@
        "node": ">=0.10.0"
      }
    },
    "node_modules/base64-arraybuffer": {
      "version": "1.0.2",
      "resolved": "https://registry.npmmirror.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
      "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
      "engines": {
        "node": ">= 0.6.0"
      }
    },
    "node_modules/big.js": {
      "version": "5.2.2",
      "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
@@ -1505,6 +1515,14 @@
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/css-line-break": {
      "version": "2.1.0",
      "resolved": "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz",
      "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
      "dependencies": {
        "utrie": "^1.0.2"
      }
    },
    "node_modules/css-select": {
@@ -2702,6 +2720,18 @@
        "he": "bin/he"
      }
    },
    "node_modules/html2canvas": {
      "version": "1.4.1",
      "resolved": "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz",
      "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
      "dependencies": {
        "css-line-break": "^2.1.0",
        "text-segmentation": "^1.0.3"
      },
      "engines": {
        "node": ">=8.0.0"
      }
    },
    "node_modules/htmlparser2": {
      "version": "3.10.1",
      "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
@@ -3873,6 +3903,14 @@
        "postcss": ">4 <9"
      }
    },
    "node_modules/postcss-pxtorem": {
      "version": "6.1.0",
      "resolved": "https://registry.npmmirror.com/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
      "integrity": "sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==",
      "peerDependencies": {
        "postcss": "^8.0.0"
      }
    },
    "node_modules/posthtml": {
      "version": "0.9.2",
      "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.9.2.tgz",
@@ -4929,6 +4967,14 @@
        "node": ">=10.13.0"
      }
    },
    "node_modules/text-segmentation": {
      "version": "1.0.3",
      "resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz",
      "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
      "dependencies": {
        "utrie": "^1.0.2"
      }
    },
    "node_modules/to-object-path": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
@@ -5386,6 +5432,14 @@
      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
      "dev": true
    },
    "node_modules/utrie": {
      "version": "1.0.2",
      "resolved": "https://registry.npmmirror.com/utrie/-/utrie-1.0.2.tgz",
      "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
      "dependencies": {
        "base64-arraybuffer": "^1.0.2"
      }
    },
    "node_modules/vary": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
package.json
@@ -24,11 +24,13 @@
    "element-plus": "^2.5.0",
    "file-saver": "2.0.5",
    "fuse.js": "6.6.2",
    "html2canvas": "^1.4.1",
    "js-cookie": "3.0.5",
    "jsencrypt": "3.3.2",
    "nprogress": "0.2.0",
    "pinia": "2.1.7",
    "pinia-plugin-persist": "^1.0.0",
    "postcss-pxtorem": "^6.1.0",
    "typescript": "^5.4.5",
    "vue": "3.3.9",
    "vue-cropper": "1.1.1",
postcss.config.cjs
对比新文件
@@ -0,0 +1,15 @@
const config = {
    plugins: {
        'postcss-pxtorem': {
            rootValue: 16, // 根元素字体大小,默认为16px
            unitPrecision: 2, //精度
            propList: ['*'], // 需要转换的属性,'*'表示全部属性,也可以指定['font-size', 'margin*']等
            selectorBlackList: [], // 忽略转换的选择器,比如['body', 'html']
            replace: true, // 是否直接替换而不是添加回退
            mediaQuery: false, // 是否允许在媒体查询中转换px
            minPixelValue: 0, // 最小转换数值,小于这个值的px单位将不被转换
        },
    },
};
module.exports = config;
src/assets/images/flow/fullscreen.png
src/assets/images/flow/monitor-title-bg.png
src/assets/images/flow/warn-icon.png
src/main.js
@@ -7,7 +7,6 @@
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createApp } from 'vue'
import Cookies from 'js-cookie'
import ElementPlus from 'element-plus'
@@ -20,6 +19,7 @@
import store from './store'
import router from './router'
import directive from './directive' // directive
import './utils/rem.js'
// 注册指令
import plugins from './plugins' // plugins
src/screen/flow.vue
@@ -1,18 +1,34 @@
<template>
    <div class="main">
        <div class="header">
            <div class="top">金川水电站生态流量监测系统 </div>
            <div class="top">
                <div class="top-name">金川水电站生态流量监测系统</div>
                <div class="top-modal">
                    公告弹窗提示
                    <el-switch v-model="openWarn" />
                </div>
            </div>
            <div class="nav">
                <div v-for="(item,index) in btnList" :key="index" @click="navTo(item)" class="plain" :class="item.url === route.path ? 'active' : ''">{{ item.name }}</div>
                <div v-for="(item,index) in btnList" :key="index" @click="navTo(item)" class="plain" :class="item.url === route.path ? 'active' : ''">
                    <span>{{ item.name }}</span>
                </div>
            </div>
        </div>
        <div class="content">
            <router-view></router-view>
            <div class="warningBox" v-if="openWarn">
                <img src="@/assets/images/flow/warn-icon.png">
                <div class="text">{{text}}</div>
            </div>
        </div>
    </div>
</template>
<script setup>
import{ useRouter,useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user.js'
import {onMounted, ref, watch} from "vue";
const userStore = useUserStore()
const router = useRouter()
const route = ref(useRoute())
@@ -24,9 +40,36 @@
    {name:'报警管理',url:'/flow/warning'},
    {name:'报表管理',url:'/flow/report'},
])
const openWarn = ref(false)
const text = ref('新扎沟口流量监测点水位到达下限值, 金川水电站生态流量监测点水位到达下限值,流量监测点水位到达下限值')
let timer = null;
watch(openWarn, (newVal) => {
    if(newVal){
        splitText()
    } else {
        clearInterval(timer)
    }
})
// 设置警告滚动
const splitText = () => {
    timer = setInterval(function () {
        const val = text.value.substring(1) + text.value.substring(0,1)
        text.value = val
    }, 300)
}
const navTo = (item) =>{
    router.push(item.url)
}
onMounted(() => {
    if(userStore.userType == 1) {
        btnList.value.push({name:'系统管理',url:'/user'})
    }
})
</script>
@@ -44,11 +87,18 @@
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 38px;
            font-weight: 700;
            color: #fff;
            position: relative;
            z-index: 100;
            .top-name{
                font-size: 48px;
            }
            .top-modal{
                position: absolute;
                right: 100px;
                cursor: pointer;
            }
        }
        .nav{
            display: flex;
@@ -75,6 +125,31 @@
    .content{
        width: 100%;
        height: 86%;
        position: relative;
        .warningBox{
            position: absolute;
            left: 0;
            top: 2%;
            z-index: 100;
            width: 100%;
            padding: 0 150px;
            height: 100px;
            display: flex;
            align-items: center;
            background: linear-gradient( 270deg,
                rgba(255,74,74,0) 0%,
                rgba(255,74,74,0.5) 8%,
                rgba(255,74,74,0.5) 50%,
                rgba(255,74,74,0.5) 92%,
                rgba(255,74,74,0) 100%);
            .text{
                margin: 0 30px;
                color: #fff;
                font-size: 36px;
                overflow: hidden;
                white-space: nowrap;
            }
        }
    }
}
</style>
src/screen/temp.vue
@@ -45,7 +45,7 @@
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 38px;
            font-size: 48px;
            font-weight: 700;
            color: #fff;
            position: relative;
src/store/modules/user.js
@@ -7,59 +7,16 @@
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { login } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { getToken, getUserType } from '@/utils/auth'
// import defAva from '@/assets/images/home/map.png'
const useUserStore = defineStore(
  'user',
const useUserStore = defineStore('user',
  {
    state: () => ({
      token: getToken(),
      id: '',
      name: '',
      avatar: '',
      roles: [],
      permissions: []
      userType: getUserType(),
    }),
    actions: {
      // 登录
      login(userInfo) {
        return new Promise((resolve, reject) => {
          login(userInfo).then(res => {
            setToken(res.data.token)
            this.token = res.token
            console.log(res.data.menus)
            permissionStore.setSidebarRouters(routes);
            resolve()
          }).catch(error => {
            reject(error)
          })
        })
      },
      // 获取用户信息
      // getInfo() {
      //   return new Promise((resolve, reject) => {
      //     getInfo(3).then(res => {
      //       const user = res.user
      //       const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar;
      //       if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
      //         this.roles = res.roles
      //         this.permissions = res.permissions
      //       } else {
      //         this.roles = ['ROLE_DEFAULT']
      //       }
      //       this.id = user.userId
      //       this.name = user.userName
      //       this.avatar = avatar
      //       resolve(res)
      //     }).catch(error => {
      //       reject(error)
      //     })
      //   })
      // },
    }
    actions: {}
  })
export default useUserStore
src/utils/auth.js
@@ -7,7 +7,6 @@
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export function getToken() {
  return localStorage.getItem('token')
}
@@ -18,3 +17,7 @@
export function removeToken() {
  return localStorage.removeItem('token')   
}
export function getUserType() {
  return localStorage.getItem('userType')
}
src/utils/rem.js
对比新文件
@@ -0,0 +1,8 @@
function resize () {
    const baseFontSize = 16
    const windowWidth = document.documentElement.clientWidth;
    const newVal = Math.round((windowWidth / 1920) * baseFontSize)
    document.documentElement.style.fontSize = `${newVal}px`;
}
window.addEventListener('resize', resize);
src/views/configuration/commonParameters/index.vue
@@ -36,7 +36,7 @@
            align="center"
          >
        </el-table-column>
          <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
          <el-table-column label="操作" width="auto" align="center" class-name="small-padding fixed-width">
             <template #default="scope">
                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
src/views/facility/facilityList/index.vue
@@ -320,7 +320,7 @@
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template #default="scope">
                    <el-button link type="primary" icon="Edit" @click="handleband(scope.row)">参数绑定</el-button>
                    <el-button link type="primary" icon="Edit" v-has="['update',route]"
@@ -341,7 +341,7 @@
        />
        <!-- 添加/修改表单 -->
        <el-dialog :title="title" v-model="open" append-to-body center>
            <el-form class="form-box" ref="facilityTypeRef" :model="form" :rules="rules" label-width='120' >
            <el-form class="form-box" ref="facilityTypeRef" :model="form" :rules="rules" label-width='auto' >
                <el-form-item :label="formLabel.facilityCode" prop="facilityCode">
                    <el-input v-model="form.facilityCode" :placeholder="inpTip+formLabel.facilityCode"/>
                </el-form-item>
src/views/facility/facilityType/index.vue
@@ -212,7 +212,7 @@
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template #default="scope">
                    <el-button link type="primary" icon="Edit" v-has="['update',route]"
                               @click="handleUpdate(scope.row)">修改
src/views/facility/monitorList/index.vue
@@ -220,7 +220,7 @@
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template #default="scope">
                    <el-button link type="primary" icon="Edit" v-has="['update',route]"
                               @click="handleUpdate(scope.row)">修改
@@ -240,7 +240,7 @@
        />
        <!-- 添加/修改表单 -->
        <el-dialog :title="title" v-model="open" append-to-body center>
            <el-form class="form-box" ref="formRef" :model="form" :rules="rules" label-width='120'>
            <el-form class="form-box" ref="formRef" :model="form" :rules="rules" label-width='auto'>
                <el-form-item :label="formLabel.pointName" prop="pointName">
                    <el-input v-model="form.pointName" :placeholder="'请输入'+formLabel.pointName"/>
                </el-form-item>
src/views/login.vue
@@ -107,7 +107,7 @@
    code: '',
    uuid: '',
    machineCode: '',
    rememberMe: false
    rememberMe: true
});
const codeUrl = ref('');
const loginRules = {
@@ -200,25 +200,6 @@
                loading.value = false;
                setToken(res.data.token)
                //普通管理员筛除菜单、权限、数据字典,普通用户筛除系统管理
                if (res.data.userType == 2) {
                    res.data.menus.forEach((item, index) => {
                        if (item.id == '10001') {
                            item.children.forEach((itemChild, childIndex) => {
                                if (itemChild.id == '10101' || itemChild.id == '10102' || itemChild.id == '1822894922704416770') {
                                    item.children.splice(childIndex, 1)
                                }
                            })
                        }
                    })
                } else if (res.data.userType == 3) {
                    res.data.menus.forEach((item, index) => {
                        if (item.id == '10001') {
                            res.data.menus.splice(index, 1)
                        }
                    })
                }
                console.log(123123, res.data.menus)
                let filteredMenus = filterTreeMenus(res.data.menus, 1)
                console.log('filterTreeMenus菜单权限过滤', filteredMenus)
@@ -231,7 +212,7 @@
                localStorage.setItem('id', JSON.stringify(res.data.id))
                localStorage.setItem('userType', JSON.stringify(res.data.userType))
                router.push("/screen");//overview
                router.push("/screen");
            }).catch(error => {
                loading.value = false;
                proxy.$modal.msgError('登录失败!')
@@ -243,7 +224,7 @@
function getCookie() {
    const userName = Cookies.get("userName") || '';
    const password = decrypt(Cookies.get("password")) || '';
    const rememberMe = Cookies.get("rememberMe") || false;
    const rememberMe = Cookies.get("rememberMe") || true;
    loginForm.userName = userName ? userName : loginForm.userName;
    loginForm.password = password ? password : loginForm.password;
    loginForm.rememberMe = rememberMe ? rememberMe : loginForm.rememberMe;
src/views/screen/flow/ecology/index.vue
@@ -1,13 +1,309 @@
<script setup>
import {onMounted, reactive} from 'vue'
import * as echarts from 'echarts/core';
import { GridComponent, ToolboxComponent, TooltipComponent, TitleComponent } from 'echarts/components';
import { LineChart, BarChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
echarts.use([GridComponent, LineChart, BarChart, CanvasRenderer, UniversalTransition, ToolboxComponent, TooltipComponent, TitleComponent]);
const state = reactive({
    zhakouVal: 1,
    dianzhanVal: 1
})
const zkssChartRef = ref(); //扎口瞬时图表
const zkljChartRef = ref(); //扎口累计图表
const dzssChartRef = ref(); //电站瞬时图表
const dzljChartRef = ref(); //电站累计图表
let zkssCharts = null;
let zkljCharts = null;
let dzssCharts = null;
let dzljCharts = null;
const selectOption = ref([
    { label: '本年', value: 1 },
    { label: '本季', value: 2 },
    { label: '本月', value: 3 },
    { label: '本周', value: 4 },
    { label: '本日', value: 5 },
])
// 获取折线图配置
const getLineOption = (data, startColor, endColor) => {
    let xdata = [];
    let sdata = [];
    data.forEach(item => {
        xdata.push(item.name)
        sdata.push(item.value)
    })
    return {
        title: {
            text: '瞬时流量分析',
            textStyle: {
              color: '#fff'
            },
            padding: [0, 0, 0, 30]
        },
        tooltip: {
            trigger: 'axis',
        },
        grid: {
            top: 80,
            left: 60,
            right: 60,
            bottom: 60
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: xdata,
            axisLabel: {
                color: '#fff',
                fontSize: '1.2rem'
            }
        },
        yAxis: {
            type: 'value',
            name: 'm³/s',
            nameTextStyle: {
                color: '#fff',
                fontSize: '1.2rem'
            },
            axisLabel: {
                color: '#fff',
                fontSize: '1.2rem'
            }
        },
        series: [
            {
                data: sdata,
                type: 'line',
                areaStyle: {
                    color: {
                        type: 'linear',
                        x: 0,
                        y: 0,
                        x2: 0,
                        y2: 1,
                        colorStops: [{
                            offset: 0, color: startColor // 0% 处的颜色
                        }, {
                            offset: 1, color: endColor // 100% 处的颜色
                        }],
                        global: false // 缺省为 false
                    }
                }
            }
        ]
    }
}
// 获取柱状图配置
const getBarOption = (data, color) => {
    let xdata = [];
    let sdata = [];
    data.forEach(item => {
        xdata.push(item.name)
        sdata.push(item.value)
    })
    return {
        title: {
            text: '瞬时流量分析',
            textStyle: {
                color: '#fff'
            },
            padding: [0, 0, 0, 30]
        },
        tooltip: {
            trigger: 'axis',
        },
        grid: {
            top: 80,
            left: 60,
            right: 60,
            bottom: 60
        },
        xAxis: {
            type: 'category',
            data: xdata,
            axisLabel: {
                color: '#fff',
                fontSize: '1.2rem'
            }
        },
        yAxis: {
            type: 'value',
            name: '10⁸m³',
            nameTextStyle: {
                color: '#fff',
                fontSize: '1.2rem'
            },
            axisLabel: {
                color: '#fff',
                fontSize: '1.2rem'
            }
        },
        series: [
            {
                data: sdata,
                type: 'bar',
                itemStyle: {
                    color: color
                }
            }
        ]
    }
}
// 新扎口图表
const initZkLine = () => {
    if(zkssChartRef.value) {
        zkssCharts = echarts.init(zkssChartRef.value);
        let data = [
            { name: '一月', value: 36 },
            { name: '二月', value: 66 },
            { name: '三月', value: 122 },
            { name: '四月', value: 78 },
            { name: '五月', value: 63 },
        ]
        const option = getLineOption(data, 'rgba(94,229,92,1)', 'rgba(94,229,92,0.2)')
        zkssCharts.setOption(option)
    }
}
const initZkBar = () => {
    if(zkljChartRef.value) {
        zkljCharts = echarts.init(zkljChartRef.value);
        let data = [
            { name: '一月', value: 36 },
            { name: '二月', value: 66 },
            { name: '三月', value: 122 },
            { name: '四月', value: 78 },
            { name: '五月', value: 63 },
        ]
        const option = getBarOption(data, 'rgba(94,229,92,1)')
        zkljCharts.setOption(option)
    }
}
// 电站图表
const initDzLine = () => {
    if(dzssChartRef.value) {
        dzssCharts = echarts.init(dzssChartRef.value);
        let data = [
            { name: '一月', value: 36 },
            { name: '二月', value: 66 },
            { name: '三月', value: 122 },
            { name: '四月', value: 78 },
            { name: '五月', value: 63 },
        ]
        const option = getLineOption(data, 'rgba(23,108,229,1)', 'rgba(23,108,229,0.2)')
        dzssCharts.setOption(option)
    }
}
const initDzBar = () => {
    if(dzljChartRef.value) {
        dzljCharts = echarts.init(dzljChartRef.value);
        let data = [
            { name: '一月', value: 36 },
            { name: '二月', value: 66 },
            { name: '三月', value: 122 },
            { name: '四月', value: 78 },
            { name: '五月', value: 63 },
        ]
        const option = getBarOption(data, 'rgba(23,108,229,1)')
        dzljCharts.setOption(option)
    }
}
const initCharts = () => {
    initZkLine()
    initZkBar()
    initDzLine()
    initDzBar()
}
onMounted(() => {
    initCharts()
})
</script>
<template>
    <div>
        生态流量
    <div class="ecology">
        <div class="ecology-l item">
            <div class="item-t">
                <div class="title">新扎口流量监测点</div>
                <el-select
                    v-model="state.zhakouVal"
                    class="m-2"
                    placeholder="Select"
                    size="large"
                    style="width: 15.5rem"
                >
                    <el-option
                        v-for="item in selectOption"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                    />
                </el-select>
            </div>
            <div class="item-chart-ss" ref="zkssChartRef"></div>
            <div class="item-chart-lj" ref="zkljChartRef"></div>
        </div>
        <div class="ecology-r item">
            <div class="item-t">
                <div class="title">水电站流量监测点</div>
                <el-select
                    v-model="state.dianzhanVal"
                    class="m-2"
                    placeholder="Select"
                    size="large"
                    style="width: 15.5rem"
                >
                    <el-option
                        v-for="item in selectOption"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                    />
                </el-select>
            </div>
            <div class="item-chart-ss" ref="dzssChartRef"></div>
            <div class="item-chart-lj" ref="dzljChartRef"></div>
        </div>
    </div>
</template>
<style scoped lang="scss">
.ecology{
    height: 100%;
    background: linear-gradient( 180deg, #91BDDB 0%, rgba(102, 102, 102, 0.5) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    .item{
        width: 48%;
        height: 96%;
        background: rgba(23,108,229,0.3);
        border: 1px solid #176CE5;
        .item-t{
            height: 10%;
            padding: 0 30px;
            display: flex;
            align-items: center;
            .title{
                font-size: 36px;
                color: #fff;
                margin-right: 30px;
            }
        }
        .item-chart-ss{
            height: 45%;
        }
        .item-chart-lj{
            height: 45%
        }
    }
}
</style>
src/views/screen/flow/graphic/index.vue
@@ -1,13 +1,310 @@
<script setup>
import {ref} from "vue";
import {getUserType} from '@/utils/auth.js'
import html2canvas from "html2canvas";
const userType = ref(getUserType())
const monitorRef = ref()
const searchVal = ref('')
const selectType = ref(1);
const typeOption = ref([
    { label: '水电站流量监测点', value: 1 },
    { label: '新扎口流量监测点', value: 2 },
])
const video = ref()
// 全屏操作
const handleFullScreen = () => {
    monitorRef.value.requestFullscreen()
}
// 抓拍
const handleSnap = () => {
    if(video.value) {
        html2canvas(video.value).then(canvas => {
            const link = document.createElement("a");
            link.href = canvas.toDataURL("image/png");
            link.download = '截图.png';
            link.click()
        })
    }
}
</script>
<template>
    <div>
        图像监测
    <div class="graphic">
        <div class="graphic-menu">
            <div class="menu-t">监控点列表</div>
            <el-menu class="el-menu">
                <el-sub-menu index="1">
                    <template #title>
                        <span>可移动监测点</span>
                    </template>
                    <el-menu-item index="1-1">水电站流量监测点</el-menu-item>
                </el-sub-menu>
                <el-sub-menu index="2">
                    <template #title>
                        <span>固定位监测点</span>
                    </template>
                    <el-menu-item index="2-1">新扎口流量监测点</el-menu-item>
                </el-sub-menu>
            </el-menu>
        </div>
        <div class="graphic-monitor">
            <div class="monitor-tool">
                <div class="tool-l">
                    <div class="name">监测点类型</div>
                    <el-select
                        v-model="selectType"
                        class="tool-select"
                        placeholder="Select"
                        style="width: 15rem"
                    >
                        <el-option
                            v-for="item in typeOption"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                    <el-input v-model="searchVal" style="width: 20rem" />
                    <el-button><el-icon><Search /></el-icon>搜索</el-button>
                    <el-button style="margin-left: 0" v-if="userType === '1'"><el-icon><Plus /></el-icon>新增</el-button>
                </div>
                <div class="tool-r" @click="handleFullScreen">
                    <img src="@/assets/images/flow/fullscreen.png" />
                    全屏
                </div>
            </div>
            <div class="monitor-box" ref="monitorRef">
                <div class="monitor-list">
                    <div class="item">
                        <div class="title">新扎口流量监测点</div>
                        <div class="videoBox" ref="video"></div>
                        <div class="info">
                            <div class="info-list">
                                <div class="info-item">
                                    <div class="name">水位:</div>
                                    <div class="val"><span>2332</span>m</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">表面流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">水面宽度:</div>
                                    <div class="val"><span>100</span>m</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">平均流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">过水面积:</div>
                                    <div class="val"><span>30</span>㎡</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">雷达流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">实时流速:</div>
                                    <div class="val"><span>120</span>㎡/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">起点距:</div>
                                    <div class="val"><span>500</span>m</div>
                                </div>
                            </div>
                            <div class="info-btn">
                                <el-button style="width: 6rem" @click="handleSnap">抓拍</el-button>
                            </div>
                        </div>
                    </div>
                    <div class="item">
                        <div class="title">新扎口流量监测点</div>
                        <div class="videoBox"></div>
                        <div class="info">
                            <div class="info-list">
                                <div class="info-item">
                                    <div class="name">水位:</div>
                                    <div class="val"><span>2332</span>m</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">表面流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">水面宽度:</div>
                                    <div class="val"><span>100</span>m</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">平均流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">过水面积:</div>
                                    <div class="val"><span>30</span>㎡</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">雷达流速:</div>
                                    <div class="val"><span>4.5</span>m/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">实时流速:</div>
                                    <div class="val"><span>120</span>㎡/s</div>
                                </div>
                                <div class="info-item">
                                    <div class="name">起点距:</div>
                                    <div class="val"><span>500</span>m</div>
                                </div>
                            </div>
                            <div class="info-btn">
                                <el-button style="width: 6rem">抓拍</el-button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<style scoped lang="scss">
.graphic{
    height: 100%;
    display: flex;
    &-menu{
        flex-shrink: 0;
        width: 20%;
        height: 100%;
        padding: 10px 0;
        background: linear-gradient( 135deg, #91BDDB 0%, #9EC2DB 99%);
        overflow-y: scroll;
        &::-webkit-scrollbar {
            display: none;
        }
        .menu-t{
            height: 40px;
            line-height: 40px;
            padding-left: 20px;
            font-size: 26px;
            color: #fff;
            background: url("@/assets/images/flow/monitor-title-bg.png") no-repeat;
            background-size: 100% 100%;
        }
        .el-menu{
            background-color: transparent;
            border-right: none;
            :deep(.el-menu){
                background-color: transparent;
            }
            :deep(.el-sub-menu__title:hover) {
                background-color: rgba(0, 0, 0, 0.06);
            }
            :deep(.el-menu-item.is-active) {
                color: #fff;
            }
        }
    }
    &-monitor{
        flex-shrink: 0;
        width: 80%;
        height: 100%;
        background: linear-gradient( 180deg, #91BDDB 0%, rgba(102, 102, 102, 0.5) 100%);
        .monitor-tool{
            width: 100%;
            height: 60px;
            padding: 0 30px;
            background: linear-gradient( 90deg, #91BDDB 0%, #DADFE3 100%);
            display: flex;
            align-items: center;
            justify-content: space-between;
            .tool-l{
                display: flex;
                align-items: center;
                gap: 1rem;
                .name{
                    font-size: 1.1rem;
                }
            }
            .tool-r{
                display: flex;
                align-items: center;
                img{
                    width: 25px;
                    margin-right: 10px;
                }
            }
        }
        .monitor-box{
            height: calc(100% - 60px);
            .monitor-list{
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 0 30px;
                .item{
                    width: 48%;
                    height: 96%;
                    background: rgba(23,108,229,0.3);
                    border: 1px solid #176CE5;
                    padding: 20px;
                    .title{
                        height: 12%;
                        text-align: center;
                        font-size: 42px;
                        color: #fff;
                    }
                    .videoBox{
                        width: 100%;
                        height: 60%;
                        background: url("@/assets/images/login_icon.png") no-repeat;
                    }
                    .info{
                        width: 100%;
                        height: 25%;
                        display: flex;
                        margin-top: 20px;
                        .info-list{
                            width: 80%;
                            display: flex;
                            flex-wrap: wrap;
                            color: #fff;
                            font-size: 20px;
                            .info-item{
                                width: 50%;
                                padding: 8px 0;
                                flex-shrink: 0;
                                display: flex;
                                align-items: center;
                                .name{
                                    width: 100px;
                                }
                                .val span{
                                    display: inline-block;
                                    padding: 0 20px;
                                }
                            }
                        }
                        .info-btn{
                            width: 20%;
                            padding: 1rem 0;
                            display: flex;
                            align-items: flex-end;
                            :deep(.el-button){
                                color: #fff;
                                background: rgba(94,229,92,0.6);
                                border-radius: 4px 4px 4px 4px;
                                border: 1px solid rgba(94,229,92,0.6);
                            }
                        }
                    }
                }
            }
        }
    }
}
</style>
src/views/system/dict/index.vue
@@ -342,7 +342,7 @@
                :key="index"
                align="center"
            ></el-table-column>
            <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template #default="scope">
                    <el-button link type="primary" icon="Edit" @click="handleDetail(scope.row)">查看字典数据</el-button>
                    <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
@@ -405,7 +405,7 @@
                >
                </el-table-column>
                <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
                <el-table-column label="操作" width="auto" align="center" class-name="small-padding fixed-width">
                    <template #default="scope">
                        <el-button link :type="dataForm.dictValue == scope.row.dictValue ? 'warning' : 'primary'"
                                   icon="Edit" @click="handleUpdateData(scope.row)">修改
@@ -416,7 +416,7 @@
                </el-table-column>
            </el-table>
            <el-form title="添加数据" v-show="isHandle" class="dataForm-box" ref="postDataRef" :rules="dataRules"
                     :model="dataForm" inline label-width="100px">
                     :model="dataForm" inline label-width="6.25rem">
                <el-form-item prop="dictType">
                    <span>{{ dataForm.dictType }}</span>
                </el-form-item>
src/views/system/permission/index.vue
@@ -35,7 +35,7 @@
            :key="index"
            align="center"
          ></el-table-column>
          <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template #default="scope">
                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
src/views/system/role/index.vue
@@ -44,7 +44,7 @@
            align="center"
          >
        </el-table-column>
          <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template #default="scope">
                <el-button link type="primary" icon="Edit" @click="handlePermission(scope.row)">权限分配</el-button>
                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-has="['update',route]">修改</el-button>
src/views/system/user/index.vue
@@ -44,11 +44,11 @@
              >
                <template #default="scope">
                    <div v-if="key === 'userType'">
                        {{userTypeList.filter(fil => fil.dictValue == scope.row.userType.toString())[0].dictLabel}}
                        {{userTypeList?.filter(fil => fil.dictValue == scope.row.userType.toString())[0].dictLabel}}
                    </div>
                </template>
            </el-table-column>
              <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
              <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template #default="scope">
                    <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
                    <el-button v-if="scope.row.userType == 3" link type="primary" icon="Edit" @click="handleRole(scope.row)">绑定角色</el-button>
vite.config.js
@@ -39,20 +39,12 @@
    },
    //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
    css: {
      postcss: {
        plugins: [
          {
            postcssPlugin: 'internal:charset-removal',
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === 'charset') {
                  atRule.remove();
                }
              }
            }
          }
        ]
      }
      preprocessorOptions: {
        css: { charset: false },
        scss: {
          api: 'modern-compiler',
        },
      },
    }
  }
})