提交 e79e30ac authored 作者: 刘佳星-公司's avatar 刘佳星-公司

路由设置和文件对应方便后期修改

上级 92be75d4
差异被折叠。
......@@ -103,19 +103,19 @@ export const constantRoutes = [
meta: { title: '人员管理', icon: 'dashboard', affix: true }
},
{
path: '/analysisPage',
path: '/dashboard/analysis',
component: () => import('../views/dashboard/analysis/index.vue'),
name: 'analySisPage',
meta: { title: '分析页面', icon: 'dashboard', affix: true }
},
{
path: '/workBenchPage',
path: '/dashboard/workbench',
component: () => import('../views/dashboard/workbench/index.vue'),
name: 'WorkbenchPage',
meta: { title: '工作台', icon: 'dashboard', affix: true }
},
{
path: '/usermanage',
path: '/systemmanage/staffManage',
component: () => import('../views/systemmanage/staffManage/index.vue'),
name: 'systemManage',
meta: { title: '人员管理', icon: 'dashboard', affix: true }
......@@ -127,51 +127,51 @@ export const constantRoutes = [
meta: { title: '建筑管理', icon: 'dashboard', affix: true }
},
{
path: '/uavdispatch',
path: '/uavshowdate',
component: () => import('../views/uavshowdate/index.vue'),
name: 'uavDispatch',
name: 'uavShowdate',
meta: { title: '无人机调度', icon: 'dashboard', affix: true }
},
{
path: '/firesurveillance',
path: '/areafiremanage/firesurveillance',
component: () => import('../views/areafiremanage/firesurveillance/index.vue'),
name: 'fireSurveillance',
meta: { title: '历史火情', icon: 'dashboard', affix: true }
},
{
path: '/historyfire',
path: '/areafiremanage/historyfire',
component: () => import('../views/areafiremanage/historyfire/index.vue'),
name: 'historyFire',
meta: { title: '当前火情', icon: 'dashboard', affix: true },
},
{
path: '/floordetaildate',
path: '/floordetail',
component: () => import('../views/areafiremanage/historyfire/components/floordetail.vue'),
name: 'floorDetailDate',
name: 'floorDetail',
meta: { title: '详细楼层火情', icon: 'dashboard', affix: true }
},
{
path: '/buildingdetaildate',
path: '/showdetaildate',
component: () => import('../views/areabuildmanage/components/showdetaildate.vue'),
name: 'buildingDetailDate',
name: 'showDetaildate',
meta: { title: '楼详细建筑数据', icon: 'dashboard', affix: true }
},
{
path: '/onefloorbuildingdetaildate',
path: '/areabuildmanage/onefloor',
component: () => import('../views/areabuildmanage/onefloor/index.vue'),
name: 'oneFloorBuildingDetailDate',
meta: { title: '层详细建筑数据', icon: 'dashboard', affix: true }
},
{
path: '/uavdetaildate',
path: '/uavshowdate/uavmanage',
component: () => import('../views/uavshowdate/uavmanage/index.vue'),
name: 'uavDetailDate',
meta: { title: '无人机管理', icon: 'dashboard', affix: true }
},
{
path: '/recordfireinfo',
path: '/areafiremanage/firerecord',
component: () => import('../views/areafiremanage/firerecord/index.vue'),
name: 'recordFireInfo',
meta: { title: '火情记录管理', icon: 'dashboard', affix: true }
......
......@@ -7,7 +7,7 @@
<div class="left-top">
<!-- 区域信息概览 -->
<div class="info-card region-overview">
<searchtop :searchShowData="searchShowData"></searchtop>
<searchtop :searchShowData="searchShowData"></searchtop>
</div>
</div>
......@@ -18,12 +18,16 @@
<div class="card-actions">
<el-button class="operation-button" type="primary" size="small">导出</el-button>
<el-button class="operation-button" type="primary" size="small" @click="handleAddInfoFn">新增建筑</el-button>
<el-button class="operation-button" type="primary" size="small" @click="handleRefreshInfoFn"><el-icon ><RefreshRight /></el-icon></el-button>
<el-button class="operation-button" type="primary" size="small"><el-icon><FullScreen /></el-icon></el-button>
<el-button class="operation-button" type="primary" size="small" @click="handleRefreshInfoFn"><el-icon>
<RefreshRight />
</el-icon></el-button>
<el-button class="operation-button" type="primary" size="small"><el-icon>
<FullScreen />
</el-icon></el-button>
</div>
</div>
<div class="card-table">
<tabledata :tableShowData="tableShowData" @tableDataRefresh="handleRefreshInfoFn"></tabledata>
<tabledata :tableShowData="tableShowData" @tableDataRefresh="handleRefreshInfoFn"></tabledata>
</div>
</div>
</div>
......@@ -31,14 +35,16 @@
<!-- 新增建筑抽屉 -->
<el-drawer v-model="isAddDrawer" title="添加建筑信息" :with-header="false" :before-close="beforeCloseAddBuildDrawer">
<Addbuild @closeAddDrawer="closeAddDrawer" @tableDataRefresh="handleRefreshInfoFn"></Addbuild>
<Addbuild @closeAddDrawer="closeAddDrawer" @tableDataRefresh="handleRefreshInfoFn"></Addbuild>
</el-drawer>
<!-- 修改建筑抽屉 -->
<el-drawer v-model="isBuildingEditDrawer" title="修改用户信息" :with-header="false" :before-close="beforeCloseAddBuildDrawer">
<showResetBuildingInfo :rowData="rowData" :isBuildingEditDrawer="isBuildingEditDrawer" @closeEditDrawer="closeBuildingEditDrawer" @tableDataRefresh="handleRefreshInfoFn"></showResetBuildingInfo>
<el-drawer v-model="isBuildingEditDrawer" title="修改用户信息" :with-header="false"
:before-close="beforeCloseAddBuildDrawer">
<showResetBuildingInfo :rowData="rowData" :isBuildingEditDrawer="isBuildingEditDrawer"
@closeEditDrawer="closeBuildingEditDrawer" @tableDataRefresh="handleRefreshInfoFn"></showResetBuildingInfo>
</el-drawer>
</div>
</template>
......@@ -51,17 +57,17 @@ import tabledata from '../commentcomponents/tabledata/index.vue';
import showResetBuildingInfo from './components/showResetBuildingInfo.vue';
import Addbuild from './components/addbuild.vue';
import router from '../../router';
import { buildingPageApi,buildingRemoveApi,buildingGetBuildCodeListApi } from '../../api/build';
import { useRoute,useRouter } from 'vue-router';
import { buildingPageApi, buildingRemoveApi, buildingGetBuildCodeListApi } from '../../api/build';
import { useRoute, useRouter } from 'vue-router';
import useAppStore from '../../store/module/app';
const useAppStoreInstance = useAppStore();
const route = useRoute();
// 搜索栏配置
const searchShowData = ref([
{ label: '功能描述', placeholder: "请输入", type: 'input', content: '',isShow: true },
{ label: '建筑编号', placeholder: "请选择", type: 'autocomplete', content: '',isShow: true, click:'buildingGetBuildCodeListApiFn', options: [] },
{ label: '建筑层数', placeholder: "请选择", type: 'autocomplete', content: '',isShow: true, click:'buildingGetTotalFloorNumListFn', options: [] },
{ label: '建筑名称', placeholder: "请选择", type: 'autocomplete', content: '',isShow: true, click:'buildingGetBuildNameListFn', options: [] },
{ label: '功能描述', placeholder: "请输入", type: 'input', content: '', isShow: true },
{ label: '建筑编号', placeholder: "请选择", type: 'autocomplete', content: '', isShow: true, click: 'buildingGetBuildCodeListApiFn', options: [] },
{ label: '建筑层数', placeholder: "请选择", type: 'autocomplete', content: '', isShow: true, click: 'buildingGetTotalFloorNumListFn', options: [] },
{ label: '建筑名称', placeholder: "请选择", type: 'autocomplete', content: '', isShow: true, click: 'buildingGetBuildNameListFn', options: [] },
]);
......@@ -101,10 +107,10 @@ const beforeCloseAddBuildDrawer = () => {
const buildingSeeDetails = (data) => {
console.log("查看详情", data);
router.push({
path: '/buildingdetaildate',
path: '/showdetaildate',
});
useAppStoreInstance.setPushParameter({buildId:data.buildId})
useAppStoreInstance.setPushParameter({ buildId: data.buildId })
}
const buildingDdeleteData = (data) => {
......@@ -116,24 +122,24 @@ const buildingDdeleteData = (data) => {
.then(() => {
try {
// 用户点击「确认」
const {buildId,buildName} = data;
buildingRemoveApi({ buildId: buildId })
.then(res => {
if (res.code === 200) {
ElMessage.success("`${buildName}已删除`");
handleRefreshInfoFn();
} else {
ElMessage.error(res.message || '删除失败'); // 更明确的错误提示
}
})
.catch(err => {
// API 请求失败
ElMessage.error(err?.message || '删除请求失败');
});
const { buildId, buildName } = data;
buildingRemoveApi({ buildId: buildId })
.then(res => {
if (res.code === 200) {
ElMessage.success("`${buildName}已删除`");
handleRefreshInfoFn();
} else {
ElMessage.error(res.message || '删除失败'); // 更明确的错误提示
}
})
.catch(err => {
// API 请求失败
ElMessage.error(err?.message || '删除请求失败');
});
} catch (error) {
console.error(error,'API 请求失败');
console.error(error, 'API 请求失败');
}
})
.catch(() => {
// 用户点击「取消」
......@@ -142,25 +148,25 @@ const buildingDdeleteData = (data) => {
};
const resetBuildingShowInfo = (data) => {
isBuildingEditDrawer.value = true;
rowData.value = data;
console.log("000000------------0000000000",rowData.value)
console.log("000000------------0000000000", rowData.value)
}
const closeBuildingEditDrawer = () => {
const closeBuildingEditDrawer = () => {
isBuildingEditDrawer.value = false;
// console.log("000000------------0000000000",isBuildingEditDrawer.value)
}
// 表格数据
const tableShowData = ref([{
tableHeader: [
{label: '建筑编号', prop: 'buildCode'},
{label: '建筑名称', prop: 'buildName'},
{label: '建筑层数', prop: 'totalFloorNum'},
{label: '火情次数', prop: 'fireNum'},
{label: '更新时间', prop: 'updateTime'},
{label: '操作', prop: 'Operation'}
{ label: '建筑编号', prop: 'buildCode' },
{ label: '建筑名称', prop: 'buildName' },
{ label: '建筑层数', prop: 'totalFloorNum' },
{ label: '火情次数', prop: 'fireNum' },
{ label: '更新时间', prop: 'updateTime' },
{ label: '操作', prop: 'Operation' }
],
tableBody: []
}]);
......@@ -172,34 +178,34 @@ const Operation = ref([
// onMounted(() => {
// initTableDateFn()
// });
const initTableDateFn = () => {
const initTableDateFn = () => {
console.log('初始化数据');
buildingPageApi({currentPageNum: 1, currentPageSize: 10}).then(res => {
if(res.code === 200){
let {list ,total,pageSize} = res.data;
if(!list){
ElMessage.warning('建筑列表暂无数据,请先添加建筑数据');
}else{
tableShowData.value[0].tableBody = []
list = list.filter(element => {
return element.isDeleted === 0;
});
list.forEach(element => {
element.Operation = [...Operation.value]
});
tableShowData.value[0].tableBody = list
tableShowData.value[0].total = total
tableShowData.value[0].pageSize = pageSize
console.log(tableShowData.value, '展示数据');
}
buildingPageApi({ currentPageNum: 1, currentPageSize: 10 }).then(res => {
if (res.code === 200) {
let { list, total, pageSize } = res.data;
if (!list) {
ElMessage.warning('建筑列表暂无数据,请先添加建筑数据');
} else {
tableShowData.value[0].tableBody = []
list = list.filter(element => {
return element.isDeleted === 0;
});
list.forEach(element => {
element.Operation = [...Operation.value]
});
tableShowData.value[0].tableBody = list
tableShowData.value[0].total = total
tableShowData.value[0].pageSize = pageSize
console.log(tableShowData.value, '展示数据');
}
}).catch(err => {
ElMessage.error(err?.message || "建筑列表请求失败")
}
})
};
}).catch(err => {
ElMessage.error(err?.message || "建筑列表请求失败")
})
};
// 监听路由变化
watch(route, () => {
......@@ -282,7 +288,7 @@ const containerStyle = computed(() => ({
flex: 1;
justify-content: space-between;
align-items: center;
height: 8%;
height: 8%;
}
.operation-button {
......@@ -291,7 +297,7 @@ const containerStyle = computed(() => ({
.card-table {
width: 100%;
flex:1;
flex: 1;
overflow: hidden;
border-radius: 8px;
}
......@@ -300,7 +306,7 @@ const containerStyle = computed(() => ({
.left-top {
flex-direction: column;
}
.region-overview {
width: 100%;
flex: none;
......
......@@ -10,7 +10,8 @@
<div class="card-table">
<onefloorbuildingdetaildate></onefloorbuildingdetaildate>
<onefloorbuildingdetaildate>
</areabuildmanage /onefloor>
</div>
</div>
......@@ -24,7 +25,7 @@
<script setup>
import { reactive, computed, ref, onMounted } from 'vue';
// import searchtop from '../../commentcomponents/searchtop/index.vue';
import onefloorbuildingdetaildate from '../components/onefloorbuildingdetaildate.vue'
import onefloorbuildingdetaildate from '../components/areabuildmanage/onefloor.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { staffGetPageInfoApi } from "../../../api/staff.js"
......
<template>
<div class="login">
<div class="login-container">
<!-- 左侧标题区域 -->
<div class="left-panel">
......@@ -11,53 +11,30 @@
<p class="sub-title">高效·智能·安全</p>
</div> -->
</div>
<!-- 右侧登录表单区域 -->
<div class="right-panel">
<div class="login-card">
<h2 class="welcome-text">欢迎回来</h2>
<p class="login-desc">请输入您的账号和密码登录</p>
<el-form
ref="formref"
:model="form"
:rules="rules"
class="login-form"
>
<el-form ref="formref" :model="form" :rules="rules" class="login-form">
<el-form-item prop="phone">
<el-input
v-model="form.phone"
placeholder="输入手机号码"
prefix-icon="Phone"
clearable
class="custom-input"
@keyup.enter="commit"
/>
<el-input v-model="form.phone" placeholder="输入手机号码" prefix-icon="Phone" clearable class="custom-input"
@keyup.enter="commit" />
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="form.password"
placeholder="输入密码"
type="password"
prefix-icon="Lock"
clearable
class="custom-input"
@keyup.enter="commit"
/>
<el-input v-model="form.password" placeholder="输入密码" type="password" prefix-icon="Lock" clearable
class="custom-input" @keyup.enter="commit" />
</el-form-item>
<div class="form-options">
<el-checkbox v-model="rememberMe" class="remember-checkbox">记住账号</el-checkbox>
<el-button type="text" class="forgot-password">忘记密码?</el-button>
</div>
<el-button
type="primary"
class="login-button"
@click="commit"
:loading="loginLoading"
>
<el-button type="primary" class="login-button" @click="commit" :loading="loginLoading">
登录
</el-button>
</el-form>
......@@ -105,21 +82,21 @@ const commit = () => {
formref.value.validate(valid => {
if (valid) {
loginLoading.value = true;
// 登录请求
loginApi(form).then(res => {
loginLoading.value = false;
console.log(res, '测试');
if (res.code === 200) {
setToken(res.data.token);
let { phone, id,name,avatarUrl ,role,status} = res.data.user;
let { phone, id, name, avatarUrl, role, status } = res.data.user;
// console.log('phone, id,name,avatarUrl ,role',useAppStoreInstance.userInfo);
localStorage.setItem('user', JSON.stringify({ phone, id,name,avatarUrl ,role,status}));
useAppStoreInstance.userInfo = ( {phone, id,name,avatarUrl ,role,status})
console.log('phone, id,name,avatarUrl ,role',useAppStoreInstance.userInfo);
localStorage.setItem('lastValidMenuPath','/home')
localStorage.setItem('user', JSON.stringify({ phone, id, name, avatarUrl, role, status }));
useAppStoreInstance.userInfo = ({ phone, id, name, avatarUrl, role, status })
console.log('phone, id,name,avatarUrl ,role', useAppStoreInstance.userInfo);
localStorage.setItem('lastValidMenuPath', '/home')
// localStorage.setItem('saveMenuState',JSON.stringify({lastValidMenuPath:'/home',openMenus:[true,null,null,null,null]}))
if (rememberMe.value) {
localStorage.setItem('rememberedAccount', form.phone);
......@@ -127,7 +104,7 @@ const commit = () => {
localStorage.removeItem('rememberedAccount');
}
localStorage.setItem('menu', 1); // 默认选中工作台
router.replace({ path: '/analysisPage' });
router.replace({ path: '/dashboard/analysis' });
ElMessage.success('登录成功!');
} else {
ElMessage.error(res.message || '登录失败,请检查账号密码');
......@@ -283,7 +260,7 @@ initFormData();
border-color: #e5e6eb;
box-shadow: none;
transition: all 0.2s ease;
&:focus-within {
border-color: #165dff;
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
......@@ -295,18 +272,18 @@ initFormData();
.login-container {
flex-direction: column;
}
.left-panel {
height: 200px;
width: 100%;
background: linear-gradient(180deg, rgba(0, 47, 108, 0.9), rgba(0, 47, 108, 0.7));
padding: 0 2rem;
}
.main-title {
font-size: 1.8rem;
}
.right-panel {
width: 100%;
height: calc(100vh - 200px);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论