Compare commits

...

6 Commits

20 changed files with 1022 additions and 73 deletions

View File

@ -19,22 +19,32 @@ const routes = [
{ {
path: '/materialManage/:data', path: '/materialManage/:data',
name: 'MaterialManage', name: 'MaterialManage',
component: () => import('../views//Material/MaterialManagement.vue') component: () => import('../views/Material/MaterialManagement.vue')
}, },
{ {
path: '/staffManage', path: '/staffManage',
name: 'StaffManage', name: 'StaffManage',
component: () => import('../views//Staff/StaffManagement.vue') component: () => import('../views/Staff/StaffManagement.vue')
}, },
{ {
path: '/equipDetail/:data', path: '/equipDetail/:data',
name: 'EquipDetail', name: 'EquipDetail',
component: () => import('../views//Equipment/EquipmentDetails.vue') component: () => import('../views/Equipment/EquipmentDetails.vue')
}, },
{ {
path: '/materialDetail/:data', path: '/materialDetail/:data',
name: 'MaterialDetail', name: 'MaterialDetail',
component: () => import('../views//Material/MaterialDetails.vue') component: () => import('../views/Material/MaterialDetails.vue')
},
{
path: '/iceEventManage/:data',
name: 'IceEventManage',
component: () => import('../views/IceEvent/IceEventManagement.vue')
},
{
path: '/iceEventAdd/:data',
name: 'IceEventAdd',
component: () => import('../views/IceEvent/IceEventAdd.vue')
}, },
] ]

View File

@ -25,7 +25,14 @@
}" }"
/> />
<van-grid-item icon="setting-o" text="人员管理" to="/StaffManage" /> <van-grid-item icon="setting-o" text="人员管理" to="/StaffManage" />
<van-grid-item icon="setting-o" text="冰雪灾害" to="/IceHail" /> <van-grid-item
icon="setting-o"
text="冰雪灾害"
:to="{
name: 'IceEventManage',
params: { data: encodeURIComponent(JSON.stringify(detailData)) },
}"
/>
</van-grid> </van-grid>
</div> </div>

View File

@ -0,0 +1,517 @@
<template>
<div class="home">
<van-nav-bar title="冰雪填报" fixed left-arrow @click-left="onClickLeft">
</van-nav-bar>
<van-cell-group>
<van-cell title="当前站点" :value="yhzDetail.mc" />
</van-cell-group>
<div class="content">
<h3>基本信息</h3>
<van-form class="IceEventAddForm" label-align="left" colon>
<van-field v-model="form.event.occurTime" label="发生时间" center>
<template #button>
<van-button
plain
round
type="primary"
size="mini"
@click="getCurrentTime"
>校准时间</van-button
>
</template>
</van-field>
<van-field
v-model="form.event.occurLocation"
label="发生地点"
center
placeholder="请填写"
/>
<van-field
v-model="form.event.routeNo"
label="线路编号"
center
placeholder="请填写"
/>
<van-field
v-model="form.event.startStakeNo"
label="起点桩号"
center
placeholder="请填写"
/>
<van-field
v-model="form.event.endStakeNo"
label="止点桩号"
center
placeholder="请填写"
/>
<van-field
v-model="form.event.disasterMileage"
label="受灾里程"
center
placeholder="请填写"
/>
</van-form>
<h3>处置情况</h3>
<van-form class="IceEventAddForm" label-align="left" colon>
<van-field label="处置措施" center>
<template #input>
<div class="disposal-buttons">
<van-button
plain
:type="
form.event.disposalMeasures === '限速通行'
? 'primary'
: 'default'
"
size="small"
@click="toggleDisposal('限速通行')"
>
限速通行
</van-button>
<van-button
plain
:type="
form.event.disposalMeasures === '封闭交通'
? 'primary'
: 'default'
"
size="small"
@click="toggleDisposal('封闭交通')"
class="last-button"
>
封闭交通
</van-button>
</div>
</template>
</van-field>
<van-field
v-model="form.event.expectRecoverTime"
label="预计恢复时间"
center
placeholder="请选择"
readonly
clickable
@click="showExpectPicker = true"
/>
<van-popup
:show="showExpectPicker"
round
position="bottom"
close-on-click-overlay
@close="showExpectPicker = false"
>
<van-date-picker
type="datetime"
:min-date="minDate"
:max-date="maxDate"
@confirm="handleConfirmExpectTime"
@cancel="showExpectPicker = false"
/>
</van-popup>
</van-form>
<h3>实施情况</h3>
<van-form class="IceEventAddForm" label-align="left" colon>
<van-field
v-model="form.material.snowMeltingAgent"
type="number"
label="融雪剂"
center
placeholder="请填写"
>
<template #extra> </template>
</van-field>
<van-field
v-model="form.material.antiSlipSand"
type="number"
label="防滑沙"
center
placeholder="请填写"
>
<template #extra> </template>
</van-field>
<van-field
v-model="form.material.antiSlipChains"
type="number"
label="防滑链"
center
placeholder="请填写"
>
<template #extra> </template>
</van-field>
<van-field
v-model="form.material.sandbags"
type="number"
label="麻袋"
center
placeholder="请填写"
>
<template #extra> </template>
</van-field>
<van-field
v-model="form.material.inputManpower"
type="number"
label="投入人力"
center
placeholder="请填写"
>
<template #extra> 人次 </template>
</van-field>
<van-field
v-model="form.material.inputFunds"
type="number"
label="投入资金"
center
placeholder="请填写"
>
<template #extra> 万元 </template>
</van-field>
<van-field
v-model="form.material.inputEquipment"
type="number"
label="投入设备"
center
placeholder="请填写"
>
<template #extra> 台班 </template>
</van-field>
<van-field label="当前通行情况" center>
<template #input>
<div class="disposal-buttons">
<van-button
plain
:type="form.traffic.currentStatus === 1 ? 'primary' : 'default'"
size="small"
@click="form.traffic.currentStatus = 1"
>
正常通行
</van-button>
<van-button
plain
:type="form.traffic.currentStatus === 2 ? 'primary' : 'default'"
size="small"
@click="form.traffic.currentStatus = 2"
>
限速通行
</van-button>
<van-button
plain
:type="form.traffic.currentStatus === 3 ? 'primary' : 'default'"
size="small"
@click="form.traffic.currentStatus = 3"
class="last-button"
>
封闭交通
</van-button>
</div>
</template>
</van-field>
<van-field label="有无车辆滞留" center>
<template #input>
<div class="disposal-buttons">
<van-button
plain
:type="
form.traffic.hasStrandedVehicles === 1 ? 'primary' : 'default'
"
size="small"
@click="form.traffic.hasStrandedVehicles = 1"
>
有滞留
</van-button>
<van-button
plain
:type="
form.traffic.hasStrandedVehicles === 0 ? 'primary' : 'default'
"
size="small"
@click="form.traffic.hasStrandedVehicles = 0"
class="last-button"
>
无滞留
</van-button>
</div>
</template>
</van-field>
<van-field
v-model="form.traffic.strandedVehicleCount"
type="number"
label="滞留车辆数"
center
placeholder="请填写"
/>
<van-field
v-model="form.traffic.actualRecoverTime"
label="实际恢复时间"
center
placeholder="请选择"
readonly
clickable
@click="showActualPicker = true"
/>
<van-popup
:show="showActualPicker"
round
position="bottom"
close-on-click-overlay
@close="showActualPicker = false"
>
<van-date-picker
type="datetime"
:min-date="minDate"
:max-date="maxDate"
@confirm="handleConfirmActualTime"
@cancel="showActualPicker = false"
/>
</van-popup>
<van-field label="附件" center>
<template #input>
<van-uploader
v-model="fileList"
@delete="handleDelete"
name="photos"
:file-list="fileList"
:file-type="['image/jpeg', 'image/png']"
:after-read="afterRead"
multiple
:max-count="6"
/>
</template>
</van-field>
</van-form>
</div>
<van-button type="primary" class="add-btn" icon="plus" @click="handleAdd">
填报
</van-button>
</div>
</template>
<script setup>
import "vant/es/toast/style";
import "vant/es/popup/style";
import { ref, onMounted, reactive, toRaw, watch } from "vue";
import { useRouter, useRoute } from "vue-router";
import { showToast, showLoadingToast } from "vant";
import { request } from "../../../../shared/utils/request";
const router = useRouter();
const route = useRoute();
const yhzDetail = ref({}); //
const INIT_FORM = reactive({
event: {
occurLocation: "", //
routeNo: "", // 线
occurTime: "", //
startStakeNo: "", //
endStakeNo: "", //
disasterMileage: "", //
expectRecoverTime: "", //
actualRecoverTime: "", //
serviceStationId: "", // ID
district: "", //
reportTime: "", //
reporterPhone: "", //
disposalMeasures: "", //
createTime: "", //
updateTime: "", //
isDeleted: "", // 0- 1-
},
material: {
inputManpower: null, //
inputFunds: null, //
inputEquipment: null, //
snowMeltingAgent: null, //
sandbags: null, //
antiSlipSand: null, //
antiSlipChains: null, //
createTime: "", //
updateTime: "", //
},
traffic: {
currentStatus: 0, // 1- 2- 3-
hasStrandedVehicles: 0, // 0- 1-
strandedVehicleCount: null, //
actualRecoverTime: "", //
createTime: "", //
updateTime: "", //
},
photos: [],
});
const form = reactive({ ...INIT_FORM });
const fileList = ref([]);
//
const formatTime = (date = new Date()) => {
const pad = (n) => n.toString().padStart(2, "0");
return (
`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(
date.getDate()
)} ` +
`${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(
date.getSeconds()
)}`
);
};
const getCurrentTime = () => {
form.event.occurTime = formatTime();
};
const toggleDisposal = (type) => {
form.event.disposalMeasures =
form.event.disposalMeasures === type ? "" : type;
};
//
onMounted(() => {
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.data));
console.log("yhzDetail", toRaw(yhzDetail.value));
form.event.occurTime = formatTime(); //
});
const onClickLeft = () => {
router.push({
name: "IceEventManage",
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
});
};
const handleAdd = () => {
console.log("form", toRaw(form));
};
//
const showExpectPicker = ref(false);
const minDate = new Date();
const maxDate = new Date(2050, 11, 31);
const handleConfirmExpectTime = ({ selectedValues }) => {
form.event.expectRecoverTime = selectedValues.join("-");
showExpectPicker.value = false;
};
//
const showActualPicker = ref(false);
const handleConfirmActualTime = ({ selectedValues }) => {
form.traffic.actualRecoverTime = selectedValues.join("-");
showActualPicker.value = false;
};
//
const afterRead = async (file) => {
try {
const toast = showLoadingToast({
message: "上传中...",
forbidClick: true,
duration: 0, // 0
});
const formData = new FormData();
formData.append("file", file.file);
const res = await request({
url: "/snow-ops-platform/file/upload",
method: "post",
data: formData,
});
toast.close();
if (res.code === "00000") {
form.photos.push({ photoUrl: res.data });
const index = fileList.value.findIndex((f) => f.file === file.file);
if (index !== -1) {
fileList.value[index].serverUrl = res.data;
}
console.log("form.photos", toRaw(form.photos));
console.log("fileList.value", fileList.value);
} else {
throw new Error(res.message);
}
} catch (error) {
toast.close();
showToast({
type: "fail",
message: error.message,
});
}
};
//
const handleDelete = (file) => {
if (file.serverUrl) {
const index = form.photos.findIndex((p) => p.photoUrl === file.serverUrl);
if (index !== -1) {
form.photos.splice(index, 1);
}
}
};
</script>
<style scoped>
.home {
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
}
.content {
padding: 16px 16px 80px 16px;
}
.content .van-cell-group .van-cell {
margin-bottom: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.add-btn {
position: fixed;
bottom: 20px;
left: 16px;
right: 16px;
width: calc(100% - 32px);
margin: 0 auto;
border-radius: 24px;
font-size: 16px;
height: 44px;
z-index: 999;
}
.grid {
margin-top: 16px;
}
.btn {
margin-top: 24px;
}
.status-tag {
display: inline-block;
padding: 3px 8px;
border-radius: 4px;
color: white;
font-size: 12px;
}
.status-good {
background-color: #07c160;
}
.status-warning {
background-color: #ff976a;
}
.status-danger {
background-color: #ee0a24;
}
.IceEventAddForm {
padding: 16px 16px 16px 16px;
}
.disposal-buttons {
display: flex;
gap: 10px;
padding: 8px 0;
}
.disposal-buttons .van-button {
flex: 1;
}
.last-button {
margin-right: 16px;
}
</style>

View File

@ -0,0 +1,116 @@
<template>
<div class="home">
<van-nav-bar title="物资管理" fixed left-arrow @click-left="onClickLeft" />
<van-cell-group>
<van-cell title="当前站点" :value="yhzDetail.mc" />
</van-cell-group>
<div class="content">
<van-cell-group>
<van-cell
title="物资信息"
style="font-size: 18px; font-weight: bold; line-height: inherit"
>
</van-cell>
<van-cell :title="'物资名称: ' + wzDetailData.wzmc"> </van-cell>
<van-cell :title="'数量: ' + wzDetailData.sl"> </van-cell>
<van-cell :title="'余量: ' + wzDetailData.ye"> </van-cell>
<van-cell :title="'单位: ' + wzDetailData.dw"> </van-cell>
<van-cell :title="'存放地点: ' + wzDetailData.cfdd"> </van-cell>
<van-cell :title="'区县名称: ' + wzDetailData.qxmc"> </van-cell>
<van-cell :title="'负责人: ' + wzDetailData.fzr"> </van-cell>
<van-cell :title="'联系电话: ' + wzDetailData.lxdh"> </van-cell>
<van-cell :title="'入库日期: ' + wzDetailData.rkrq"> </van-cell>
</van-cell-group>
</div>
</div>
</template>
<script setup>
import "vant/es/toast/style";
import "vant/es/popup/style";
import { ref, onMounted, toRaw, reactive } from "vue";
import { useRouter, useRoute } from "vue-router";
import { showToast, showLoadingToast } from "vant";
import { request } from "../../../../shared/utils/request";
const router = useRouter();
const route = useRoute();
const yhzDetail = ref({});
const wzData = ref([]);
const wzDetailData = ref({}); //
onMounted(() => {
const data = JSON.parse(decodeURIComponent(route.params.data));
yhzDetail.value = data.yhzDetail;
wzData.value = data.material;
console.log("传递过来的参数:", data);
getwzDetail();
});
//
const getwzDetail = async () => {
try {
const res = await request({
url: `/snow-ops-platform/yjwz/getById?rid=${wzData.value.rid}`,
method: "GET",
});
if (res.code && res.code === "00000") {
wzDetailData.value = res.data;
} else {
throw new Error(res.message);
}
} catch (error) {
showToast({
message: error.message,
type: "error",
});
console.log("error", error);
}
};
const onClickLeft = () => {
router.push({
name: "MaterialManage",
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
});
};
</script>
<style scoped>
.home {
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
}
.content {
padding: 16px;
}
.grid {
margin-top: 16px;
}
.btn {
margin-top: 24px;
}
.status-tag {
display: inline-block;
padding: 3px 8px;
border-radius: 4px;
color: white;
font-size: 12px;
}
.status-good {
background-color: #07c160;
}
.status-warning {
background-color: #ff976a;
}
.status-danger {
background-color: #ee0a24;
}
</style>

View File

@ -0,0 +1,176 @@
<template>
<div class="home">
<van-nav-bar title="冰雪灾害" fixed left-arrow @click-left="onClickLeft">
</van-nav-bar>
<van-search
shape="round"
v-model="searchValue"
:show-action="false"
placeholder="请输入地点关键词"
/>
<van-cell-group>
<van-cell title="当前站点" :value="yhzDetail.mc" />
</van-cell-group>
<div class="content">
<van-cell-group>
<van-cell
v-for="(item, index) in eventList"
:key="index"
:title="item.wzmc"
is-link
:label="`填报时间:${item.sl} (${item.dw})`"
:to="{
name: 'MaterialDetail',
params: {
data: encodeURIComponent(
JSON.stringify({
yhzDetail: yhzDetail,
material: item,
})
),
},
}"
>
</van-cell>
</van-cell-group>
</div>
<van-button type="primary" class="add-btn" icon="plus" @click="handleAdd">
冰雪填报
</van-button>
</div>
</template>
<script setup>
import "vant/es/toast/style";
import "vant/es/popup/style";
import { ref, onMounted, reactive, toRaw, watch } from "vue";
import { useRouter, useRoute } from "vue-router";
import { showToast, showLoadingToast } from "vant";
import { request } from "../../../../shared/utils/request";
const router = useRouter();
const route = useRoute();
const searchValue = ref(""); //
const yhzDetail = ref({}); //
const eventList = ref([]); //
// rid
const getIceEventList = async (occurLocation) => {
try {
const yhzid = yhzDetail.value.id;
if (!yhzid) {
return;
}
const data = {
yhzid,
occurLocation,
paageNum: 1,
paageSize: 9999,
};
const res = await request({
url: "/snow-ops-platform/event/list",
method: "GET",
params: data,
});
if (res.code && res.code === "00000") {
eventList.value = res.data.records;
} else {
throw new Error(res.message);
}
} catch (error) {
showToast({
type: "error",
message: error.message || "获取物资列表失败",
});
}
};
//
onMounted(() => {
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.data));
console.log("yhzDetail", toRaw(yhzDetail.value));
getIceEventList();
});
watch(
() => searchValue.value,
(newVal, oldVal) => {
if (newVal !== oldVal) {
getIceEventList(newVal);
}
}
);
const onClickLeft = () => {
router.push("/");
};
const handleAdd = () => {
router.push({
name: "IceEventAdd",
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
})
};
</script>
<style scoped>
.home {
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
}
.content {
padding: 16px 16px 80px 16px;
}
.content .van-cell-group .van-cell {
margin-bottom: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.add-btn {
position: fixed;
bottom: 20px;
left: 16px;
right: 16px;
width: calc(100% - 32px);
margin: 0 auto;
border-radius: 24px;
font-size: 16px;
height: 44px;
z-index: 999;
}
.grid {
margin-top: 16px;
}
.btn {
margin-top: 24px;
}
.status-tag {
display: inline-block;
padding: 3px 8px;
border-radius: 4px;
color: white;
font-size: 12px;
}
.status-good {
background-color: #07c160;
}
.status-warning {
background-color: #ff976a;
}
.status-danger {
background-color: #ee0a24;
}
.materialAddForm {
padding: 16px 16px 80px 16px;
}
</style>

View File

@ -1,16 +1,14 @@
<template> <template>
<div id="app"> <div id="app">
<router-view /> <Index></Index>
</div> </div>
</template> </template>
<script> <script setup>
export default { import Index from "./views/index.vue";
name: 'App'
}
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
#app { #app {
width: 100%; width: 100%;
height: 100vh; height: 100vh;

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -0,0 +1,56 @@
import { h, ref, onMounted, reactive, watch, toRaw, nextTick } from "vue";
import { request } from "@/utils/request";
import { Search } from "@element-plus/icons-vue";
import { useRoute, useRouter } from 'vue-router'
const menuList = ref([])
// 获取菜单列表
const getMenuList = async () => {
try {
const res = await request({
url: '/snow-ops-platform/menu/getMenus',
method: 'GET'
})
if (res.code === '00000') {
menuList.value = res.data
} else {
throw new Error(res.message)
}
} catch (error) {
ElMessage.error(error.message);
console.log(error);
}
}
export default () => {
// 点击菜单处理
const router = useRouter();
const handleMenuClick = (menu) => {
console.log('menu', menu)
if (menu.path) {
router.push({
path: menu.path,
});
}
};
onMounted(async () => {
await getMenuList();
const firstMenuItem = menuList.value[0]?.children?.[0];
if (firstMenuItem) {
handleMenuClick(firstMenuItem);
}
})
return {
menuList,
handleMenuClick,
}
};

View File

@ -0,0 +1,48 @@
<template>
<el-menu class="MyMenu" :default-active="`1-${script.menuList.value[0]?.children[0]?.uid}`">
<el-sub-menu index="1">
<template #title>
<span>{{ script.menuList.value[0]?.title }}</span>
</template>
<el-menu-item
:index="`1-${menuItem.uid}`"
:key="menuItem.uid"
v-for="menuItem in script.menuList.value[0]?.children"
@click="script.handleMenuClick(menuItem)"
>
<img :src="menuItem.icon" class="menu-icon" v-if="menuItem.icon" />
<span>{{ menuItem.title }}</span>
</el-menu-item>
</el-sub-menu>
</el-menu>
</template>
<script setup>
import { Menu as IconMenu, HomeFilled } from "@element-plus/icons-vue";
import scriptFn from "./index.js";
const script = scriptFn();
</script>
<style scoped lang="less">
.MyMenu {
padding: 16px;
--el-menu-bg-color: transparent;
--el-menu-active-color: #fff;
:deep(.el-menu-item) {
border-radius: 5px;
transition: all 0.3s;
&:hover {
transform: translateX(5px);
}
}
:deep(.el-menu-item.is-active) {
background-color: #34acf7 !important;
}
.menu-icon {
width: 18px;
height: 18px;
margin-right: 8px;
vertical-align: middle;
}
}
</style>

View File

@ -5,6 +5,19 @@ const service = axios.create({
timeout: 10000 timeout: 10000
}) })
// 请求拦截器
service.interceptors.request.use(config => {
// 暂时先写死token 实际项目中再调整token的获取位置
const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE5ODU1OTk2NjUxNDk4NjE4OTAsImFjY291bnQiOiJyZWd1bGFyQWRtaW4iLCJ1dWlkIjoiMDBhYTkyYzItYzFlZi00MmNiLWEzZGMtNzFkNDdjODc0YmI2IiwicmVtZW1iZXJNZSI6dHJ1ZSwiZXhwaXJhdGlvbkRhdGUiOjE3NjI1MzAzNjEzMDIsIm90aGVycyI6bnVsbCwic3ViIjoiMTk4NTU5OTY2NTE0OTg2MTg5MCIsImlhdCI6MTc2MjUwMTU2MSwiZXhwIjoxNzYyNTMwMzYxfQ.z38vXkxdJETfUBXrG45QIMTQcIt3qeshlOo95qyL0y198rMJUq_SF8mmMvMJhInHFJ1_0wX7dmL39acT0w5Ccw'
// const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `${token}`;
}
return config;
}, error => {
return Promise.reject(error);
});
export async function request(config) { export async function request(config) {
try { try {
const res = await service(config) const res = await service(config)

View File

@ -93,19 +93,16 @@ const script = scriptFn();
const { treeRef, dialogRef } = script; const { treeRef, dialogRef } = script;
</script> </script>
<style scoped> <style scoped>
/* * {
border: 1px solid #ccc;
} */
.root { .root {
height: 100%; height: 100%;
/* padding: 45px; */ width: 100%;
display: flex; display: flex;
gap: 20px; gap: 20px;
} }
/* 左侧树形结构区域 */ /* 左侧树形结构区域 */
.left-tree { .left-tree {
width: 20vw; width: 20%;
height: 100%; height: 100%;
padding: 25px 25px 0 25px; padding: 25px 25px 0 25px;
display: flex; display: flex;
@ -127,7 +124,7 @@ const { treeRef, dialogRef } = script;
/* 右侧表单区域 */ /* 右侧表单区域 */
.right-form { .right-form {
width: 80vw; width: 80%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
display: flex; display: flex;

View File

@ -31,7 +31,6 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Home', name: 'Home',

View File

@ -70,19 +70,16 @@ const script = scriptFn();
const { treeRef, dialogRef } = script; const { treeRef, dialogRef } = script;
</script> </script>
<style scoped> <style scoped>
/* * {
border: 1px solid #ccc;
} */
.root { .root {
height: 100%; height: 100%;
/* padding: 45px; */ width: 100%;
display: flex; display: flex;
gap: 20px; gap: 20px;
} }
/* 左侧树形结构区域 */ /* 左侧树形结构区域 */
.left-tree { .left-tree {
width: 20vw; width: 20%;
height: 100%; height: 100%;
padding: 25px 25px 0 25px; padding: 25px 25px 0 25px;
display: flex; display: flex;
@ -104,7 +101,7 @@ const { treeRef, dialogRef } = script;
/* 右侧表单区域 */ /* 右侧表单区域 */
.right-form { .right-form {
width: 80vw; width: 80%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
display: flex; display: flex;

View File

@ -546,6 +546,7 @@ const handleClickWz = (row) => {
<style scoped> <style scoped>
.root { .root {
height: 100%; height: 100%;
padding: 25px;
} }
.event-box { .event-box {
margin: 20px 0; margin: 20px 0;

View File

@ -355,44 +355,6 @@ const getDetailData = async (row) => {
} }
}; };
// 打开新增物资弹窗
const openAddModel = () => {
model.title = `新增物资`;
model.content = AddDialog;
Object.assign(form, INIT_FORM);
model.props = {
detailData: {},
form: form,
};
model.onCancel = () => {
dialogType.value = '';
modelVisible.value = false;
};
model.onConfirm = async () => {
try {
console.log('form', toRaw(form))
const res = await request({
url: '/snow-ops-platform/yjwz/add',
method: 'POST',
data: toRaw(form),
});
if (res.code === '00000') {
ElMessage.success('新增成功');
dialogType.value = '';
modelVisible.value = false;
getyhzeventList(qxmc.value, yhzid.value, filterData);
} else {
throw new Error(res.message);
}
} catch (error) {
ElMessage.error(error.message);
console.log('error', error)
}
};
modelVisible.value = true;
}
export default () => { export default () => {
const treeRef = ref(null); const treeRef = ref(null);
@ -467,6 +429,5 @@ export default () => {
modelVisible, modelVisible,
dialogRef, dialogRef,
model, model,
openAddModel,
} }
} }

View File

@ -36,9 +36,6 @@
</div> </div>
<div class="form-box"> <div class="form-box">
<div class="event-box"> <div class="event-box">
<el-button type="primary" size="large" @click="script.addEvent"
>新增事件</el-button
>
<el-button type="primary" size="large" @click="script.generateReport" <el-button type="primary" size="large" @click="script.generateReport"
>生成报告</el-button >生成报告</el-button
> >
@ -81,19 +78,16 @@ const script = scriptFn();
const { treeRef, dialogRef } = script; const { treeRef, dialogRef } = script;
</script> </script>
<style scoped> <style scoped>
/* * {
border: 1px solid #ccc;
} */
.root { .root {
height: 100%; height: 100%;
/* padding: 45px; */ width: 100%;
display: flex; display: flex;
gap: 20px; gap: 20px;
} }
/* 左侧树形结构区域 */ /* 左侧树形结构区域 */
.left-tree { .left-tree {
width: 20vw; width: 20%;
height: 100%; height: 100%;
padding: 25px 25px 0 25px; padding: 25px 25px 0 25px;
display: flex; display: flex;
@ -115,7 +109,7 @@ const { treeRef, dialogRef } = script;
/* 右侧表单区域 */ /* 右侧表单区域 */
.right-form { .right-form {
width: 80vw; width: 80%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
display: flex; display: flex;

View File

@ -0,0 +1,59 @@
<template>
<div class="root">
<div class="header">
<img class="logo" src="../assets/imgs/logo.png" alt="logo" />
<h2>政务·渝路智管</h2>
</div>
<div class="content">
<div class="content-leftbar">
<MenuBar></MenuBar>
</div>
<div class="content-main">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script setup>
import MenuBar from "../component/MenuBar/index.vue";
</script>
<style lang="scss" scoped>
.root {
width: 100%;
height: 100%;
overflow: hidden;
}
.header {
height: 64px;
width: 100%;
background-image: url("../assets/imgs/header.png");
background-size: cover;
background-position: center;
display: flex;
align-items: center;
.logo {
width: 42px;
height: 42px;
margin-left: 16px;
margin-right: 16px;
}
}
.content {
height: calc(100% - 64px);
width: 100%;
display: flex;
}
.content-leftbar {
width: 248px;
height: 100%;
background-image: url("../assets/imgs/menu.png");
background-size: cover;
background-position: center;
}
.content-main {
width: calc(100% - 248px);
height: 100%;
}
</style>

View File

@ -56,7 +56,7 @@ export default defineConfig(({ command, mode }) => {
: '/' : '/'
const resolvedBase = const resolvedBase =
command === 'build' ? normalizeBasePath(baseCandidate) : '/' command === 'build' ? normalizeBasePath(baseCandidate) : '/'
const cesiumBaseUrl = resolvedBase === '/' ? '/cesium' : `${resolvedBase}cesium` const cesiumBaseUrl = resolvedBase === '/' ? '/cesium' : `/cesium`
return { return {
base: resolvedBase, base: resolvedBase,