web
昨天 55373c6b400d879ba4a4cdae752fe5140c7b11f6
fix:修改上传图片地址
已修改10个文件
216 ■■■■■ 文件已修改
.env.development 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Breadcrumb/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/screen/flow.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/facilityList/index.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/facilityType/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/facility/monitorList/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/userCenter.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -6,7 +6,7 @@
VITE_APP_ENV = 'development'
# 图片地址
VITE_APP_IMG_BASEURL='http://192.168.0.200:8036/upload'
VITE_APP_IMG_BASEURL='https://www.huiwuyuntong.com/water-hydropower-beta/upload'
#后端本地
  VITE_APP_PUBLIC_REQUEST_API = 'http://192.168.0.67:8036'
  VITE_APP_PUBLIC_REQUEST_API = 'https://www.huiwuyuntong.com/water-hydropower-beta'
src/components/Breadcrumb/index.vue
@@ -20,7 +20,7 @@
  const first = matched[0]
  // 判断是否为首页
  if (!isDashboard(first)) {
    matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched)
    matched = [{ path: '/', meta: { title: '首页' } }].concat(matched)
  }
  levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
src/layout/components/Navbar.vue
@@ -16,13 +16,13 @@
          </div>
          <template #dropdown>
            <el-dropdown-menu>
<!--              <router-link to="/userCenter">-->
<!--                <el-dropdown-item >个人中心</el-dropdown-item>-->
<!--              </router-link>-->
              <router-link to="/userCenter">
                <el-dropdown-item >个人中心</el-dropdown-item>
              </router-link>
<!--              <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings">-->
<!--                <span>布局设置</span>-->
<!--              </el-dropdown-item>-->
              <el-dropdown-item command="logout">
              <el-dropdown-item divided command="logout">
                <span>退出登录</span>
              </el-dropdown-item>
            </el-dropdown-menu>
src/router/index.js
@@ -37,16 +37,7 @@
  {
    path: '/',
    hidden: true,
    component: Layout,
    redirect: '/screen',
    children: [
      {
        path: 'userCenter',
        component: () => import('@/views/userCenter.vue'),
        name: 'userCenter',
        meta: { title: '个人中心', icon: 'PhUserCircleFill', affix: true }
      },
    ]
  },
  {
    path: '/login',
@@ -67,6 +58,19 @@
    path: '/screen',
    component: Screen,
    hidden: true
  },
  {
    path: '',  //单独添加得后台路由,需要一层layout
    hidden: true,
    component: Layout,
    children: [
      {
        path: '/userCenter',
        component: () => import('@/views/userCenter.vue'),
        name: 'userCenter',
        meta: { title: '个人中心', icon: 'PhUserCircleFill', affix: true }
      },
    ]
  }
]
src/screen/flow.vue
@@ -7,7 +7,7 @@
                    <span>选择系统</span>
                </div>
                <div class="top-name">金川水电站生态流量监测系统</div>
                <div class="top-modal">
                <div class="top-modal" v-if="text">
                    公告弹窗提示
                    <el-switch v-model="openWarn" />
                </div>
@@ -74,10 +74,13 @@
// 获取报警内容
const getWarnList = () => {
    let errorCode = [10, 20]
    let str = ''
    warnHistory({limit: 10, page: 1, monitorType: 2}).then(res => {
        res.data.list?.forEach((item)=>{
            str += item.description + ','
            if(errorCode.includes(item.isConfirm)){
                str += item.description + ','
            }
        })
        text.value = str
    })
src/views/facility/facilityList/index.vue
@@ -6,6 +6,7 @@
import waterFacilityParameter from "@/api/facility/parameter.js";
import setPostParams from "@/utils/searchParams.js";
import {onMounted} from "vue";
const route = useRoute();
const {proxy} = getCurrentInstance();
const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
@@ -15,7 +16,7 @@
 */
/** 搜索按钮操作 */
function handleQuery() {
    getList({keywords: searchParams.value.facilityCode})
    getList(searchParams.value)
}
/** 重置按钮操作 */
@@ -40,7 +41,7 @@
    facilityTypeName: '设备类型',
    pointName: '设备监控点',
    facilityUrl: '设备图片',
    installDate:'安装日期',
    installDate: '安装日期',
})
/** 获取权限列表 */
@@ -63,7 +64,7 @@
    facilityType: '设备类型',
    pointId: '设备监控点',
    facilityUrl: '设备图片',
    remark:'备注信息',
    remark: '备注信息',
    createTimeView: '创建时间'
})
const rules = ref({
@@ -79,7 +80,14 @@
});
//查询监控点
const pointList = ref();
const cascaderOption = { label: 'pointName', value: 'id', children: 'childrenList', checkStrictly: true, expandTrigger: 'hover', emitPath: false }; //级联选择器配置
const cascaderOption = {
    label: 'pointName',
    value: 'id',
    children: 'childrenList',
    checkStrictly: true,
    expandTrigger: 'hover',
    emitPath: false
}; //级联选择器配置
const getPoint = async () => {
    await pointApi().getParentPoint().then((res) => {
        pointList.value = res.data
@@ -97,20 +105,20 @@
//获取参数列表数据
//设备参数table
const tableParamData = ref([]);
const getParamList = async() => {
    await commonParameters().search({limit:10000,page: 1}).then((res)=>{
const getParamList = async () => {
    await commonParameters().search({limit: 10000, page: 1}).then((res) => {
        tableParamData.value = res.data.list;
    })
}
//获取已绑定参数数据
const getSelectParamList = async(val) => {
    await waterFacilityParameter().getParam(val).then((res)=>{
const getSelectParamList = async (val) => {
    await waterFacilityParameter().getParam(val).then((res) => {
        const data = res.data
        console.log("参数列表",data)
        if(data.length > 0){
            data.forEach( item =>{
                tableParamData.value.forEach((tableItem)=>{
                    if(item.columnsCode == tableItem.mark){
        console.log("参数列表", data)
        if (data.length > 0) {
            data.forEach(item => {
                tableParamData.value.forEach((tableItem) => {
                    if (item.columnsCode == tableItem.mark) {
                        tableRef.value.toggleRowSelection(tableItem, undefined)
                    }
                })
@@ -118,6 +126,7 @@
        }
    })
}
/** 新增按钮操作 */
async function handleAdd() {
    reset();
@@ -162,9 +171,9 @@
const title = ref("");
const isDetail = ref(false);
const multipleSelection = ref([])
let  tableParamHeader = ref({
let tableParamHeader = ref({
    name: '参数名称',
    mark:'参数标识',
    mark: '参数标识',
    unit: '参数单位',
})
/**
@@ -172,11 +181,11 @@
 */
//绑定数据
const facilityData = ref({
    facilityId:'',
    parameterList:[]
    facilityId: '',
    parameterList: []
})
//已选择设备参数
const handleSelectionParams = (val) =>{
const handleSelectionParams = (val) => {
    multipleSelection.value = val
}
/**
@@ -184,23 +193,23 @@
 */
//提交绑定
const handleSubmit = async() =>{
    multipleSelection.value.forEach((item) =>{
const handleSubmit = async () => {
    multipleSelection.value.forEach((item) => {
        facilityData.value.parameterList.push({
            columnsCode:item.mark,
            columnsShow:item.name,
            columnsUnits:item.unit,
            columnsCode: item.mark,
            columnsShow: item.name,
            columnsUnits: item.unit,
        })
    })
    let res = await waterFacilityParameter().create(facilityData.value)
    if(res.code == 200){
    if (res.code == 200) {
        proxy.$modal.msgSuccess('绑定成功!')
        facilityData.value.parameterList = []
        openParamForm.value = false
        tableRef.value.clearSelection()
    }else{
    } else {
        proxy.$modal.msgError('绑定失败!')
        openParamForm.value = false
        tableRef.value.clearSelection()
@@ -208,7 +217,7 @@
}
//上传文件,添加图片地址信息
const uploadData = (data) => {
    form.value.facilityUrl = imgBaseUrl + data.toString();
    form.value.facilityUrl = data.toString();
}
/** 提交按钮 */
@@ -247,13 +256,15 @@
    openParamForm.value = false;
    reset();
}
/** 绑定按钮操作 */
const handleband = async(row) =>{
const handleband = async (row) => {
    facilityData.value.facilityId = row.id
    await getParamList()
    getSelectParamList(row.id)
    openParamForm.value = true
}
/** 表单重置 */
function reset() {
    form.value = {
@@ -262,7 +273,7 @@
        facilityType: '',
        pointId: '',
        facilityUrl: '',
        remark:'',
        remark: '',
        installDate: ''
    };
    proxy.resetForm("facilityTypeRef");
@@ -278,13 +289,13 @@
<template>
    <div class="app-container">
        <el-form :model="searchParams" ref="queryRef" :inline="true">
            <el-form-item label="" prop="">
            <el-form-item label="" prop="keywords">
                <el-input
                        v-model="searchParams.facilityCode"
                        placeholder="请输入搜索信息"
                        clearable
                        style="width: 200px"
                        @keyup.enter="handleQuery"
                    v-model="searchParams.keywords"
                    placeholder="请输入搜索信息"
                    clearable
                    style="width: 200px"
                    @keyup.enter="handleQuery"
                />
            </el-form-item>
            <el-form-item>
@@ -296,26 +307,26 @@
        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button
                        type="primary"
                        plain
                        icon="Plus"
                        @click="handleAdd"
                    type="primary"
                    plain
                    icon="Plus"
                    @click="handleAdd"
                >新增
                </el-button>
            </el-col>
        </el-row>
        <!--表格及分页-->
        <el-table  :data="tableData">
        <el-table :data="tableData">
            <el-table-column
                    v-for="(item, key, index) of tableHeader"
                    :prop="key.toString()"
                    :label="item"
                    :key="index"
                    align="center"
                v-for="(item, key, index) of tableHeader"
                :prop="key.toString()"
                :label="item"
                :key="index"
                align="center"
            >
                <template #default="scope">
                    <div v-if="key.toString() === 'facilityUrl'" style="height: 50px;margin: 0 auto">
                        <img :src="imgBaseUrl + scope.row.facilityUrl" class="table-headImg" alt="" />
                        <img :src="imgBaseUrl + scope.row.facilityUrl" class="table-headImg" alt=""/>
                    </div>
                </template>
            </el-table-column>
@@ -332,15 +343,15 @@
            </el-table-column>
        </el-table>
        <pagination
                :total="pageParam.total"
                v-model:page="pageParam.page"
                v-model:limit="pageParam.limit"
                :page-sizes="[10,20,30]"
                @pagination="getList"
            :total="pageParam.total"
            v-model:page="pageParam.page"
            v-model:limit="pageParam.limit"
            :page-sizes="[10,20,30]"
            @pagination="getList"
        />
        <!-- 添加/修改表单 -->
        <el-dialog :title="title" v-model="open" append-to-body center>
            <el-form class="form-box" ref="facilityTypeRef" :model="form" :rules="rules" label-width='auto' >
            <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>
@@ -350,15 +361,16 @@
                <el-form-item label="选择设备类型" prop="facilityType">
                    <el-select v-model="form.facilityType" :placeholder="inpTip+formLabel.facilityType">
                        <el-option
                                v-for="(item,index) in facilityTypeList"
                                :label="item.name"
                                :value="item.id"
                                :key="index"
                            v-for="(item,index) in facilityTypeList"
                            :label="item.name"
                            :value="item.id"
                            :key="index"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="选择监控点" prop="pointId">
                    <el-cascader v-model="form.pointId" :options="pointList" :show-all-levels="false" :props="cascaderOption" />
                    <el-cascader v-model="form.pointId" :options="pointList" :show-all-levels="false"
                                 :props="cascaderOption"/>
                </el-form-item>
                <el-form-item label="安装日期" prop="installDate">
                    <el-date-picker
@@ -371,7 +383,7 @@
                    />
                </el-form-item>
                <el-form-item :label="formLabel.remark" prop="remark">
                    <el-input v-model="form.remark" :placeholder="inpTip+formLabel.remark" />
                    <el-input v-model="form.remark" :placeholder="inpTip+formLabel.remark"/>
                </el-form-item>
                <el-form-item label="资料上传" prop="facilityUrl" style="flex: 1">
                    <upload-icons @uploadData="uploadData" :imageList="form.facilityUrl" :limit="1"></upload-icons>
@@ -388,8 +400,8 @@
        <!-- 设备参数弹窗 -->
        <el-dialog title="设备参数" v-model="openParamForm" width="50vw" center align-center append-to-body>
            <!--表格-->
            <el-table ref='tableRef'  :data="tableParamData" height="75vh" @selection-change="handleSelectionParams" >
                <el-table-column type="selection" width="55" align ="center" />
            <el-table ref='tableRef' :data="tableParamData" height="75vh" @selection-change="handleSelectionParams">
                <el-table-column type="selection" width="55" align="center"/>
                <el-table-column
                    v-for="(item, key, index) of tableParamHeader"
                    :prop="key.toString()"
@@ -409,13 +421,15 @@
</template>
<style lang="scss" scoped>
.table-headImg{
.table-headImg {
    max-width: 100px;
    height: 50px;
}
.form-box{
.form-box {
    justify-content: normal;
    :deep(.el-cascader){
    :deep(.el-cascader) {
        flex-grow: 1;
    }
}
src/views/facility/facilityType/index.vue
@@ -19,7 +19,7 @@
 */
/** 搜索按钮操作 */
function handleQuery() {
    getList({keywords: searchParams.value.name})
    getList(searchParams.value)
}
/** 重置按钮操作 */
@@ -171,9 +171,9 @@
<template>
    <div class="app-container">
        <el-form :model="searchParams" ref="queryRef" :inline="true">
            <el-form-item label="" prop="">
            <el-form-item label="" prop="keywords">
                <el-input
                    v-model="searchParams.name"
                    v-model="searchParams.keywords"
                    placeholder="请输入搜索信息"
                    clearable
                    style="width: 200px"
src/views/facility/monitorList/index.vue
@@ -20,7 +20,7 @@
 */
/** 搜索按钮操作 */
function handleQuery() {
    getList({keywords: searchParams.value.keywords})
    getList(searchParams.value)
}
/** 重置按钮操作 */
@@ -55,7 +55,7 @@
async function getList(val) {
    loading.value = true;
    let postParam = setPostParams(val)
    await pointApi().search({...postParam, ...searchParams.value}).then((res) => {
    await pointApi().search(postParam).then((res) => {
        tableData.value = res.data.list
        pageParam.value.total = res.data.total
        pageParam.value.limit = res.data.limit
@@ -152,7 +152,7 @@
//上传文件,添加图片地址信息
const uploadData = (data) => {
    form.value.imageUrl = imgBaseUrl + data.toString();
    form.value.imageUrl = data.toString();
}
/** 提交按钮 */
@@ -211,7 +211,7 @@
<template>
    <div class="app-container">
        <el-form :model="searchParams" ref="queryRef" :inline="true">
            <el-form-item label="" prop="">
            <el-form-item label="" prop="keywords">
                <el-input
                    v-model="searchParams.keywords"
                    placeholder="请输入搜索信息"
src/views/system/user/index.vue
@@ -138,7 +138,6 @@
import setPostParams from "@/utils/searchParams.js";
const {proxy} = getCurrentInstance();
const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
/**
 * 搜索相关
@@ -247,7 +246,7 @@
//上传文件,添加图片地址信息
const uploadData = (img) => {
    form.value.headImg = imgBaseUrl + img.toString()
    form.value.headImg = img.toString()
}
//获取用户分类列表
src/views/userCenter.vue
@@ -29,7 +29,7 @@
                    <div class="name">密码:</div>
                    <div class="info pwd">
                        ********
                        <el-button type="plain" @click="isShow = true">修改密码</el-button>
                        <el-button type="default" @click="isShow = true">修改密码</el-button>
                    </div>
                </div>
            </div>
@@ -61,6 +61,9 @@
<script setup>
import {userDetail} from '@/api/login'
import {removeToken} from '@/utils/auth'
import {ElMessageBox} from "element-plus";
const { proxy } = getCurrentInstance();
const form = ref({})
const preUrl = ref(import.meta.env.VITE_APP_IMG_BASEURL)
@@ -81,6 +84,19 @@
    }
}
// 退出登录
const loginOut = () => {
    ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then((e) => {
        removeToken()
        window.location.reload();
    })
}
//修改密码
const rules = {
    oldPassword: [