更新
This commit is contained in:
@ -7,4 +7,25 @@ export function bigDataUpload(data) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 单个文件上传
|
||||||
|
export function uploadFile(file) {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
return service({
|
||||||
|
url: '/common/upload',
|
||||||
|
method: 'post',
|
||||||
|
data: formData,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典列表
|
||||||
|
export function getDictListByCode(data) {
|
||||||
|
return service({
|
||||||
|
url: api1 + `/sysDict/getSysDictByCode`,
|
||||||
|
method: "GET",
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
};
|
||||||
@ -5,9 +5,6 @@
|
|||||||
<van-icon name="arrow-left" color="#fff" size="18px" />
|
<van-icon name="arrow-left" color="#fff" size="18px" />
|
||||||
</span>
|
</span>
|
||||||
<span>{{ navTitle }}</span>
|
<span>{{ navTitle }}</span>
|
||||||
<van-popover v-model:show="showThemeSetting" :actions="actions" :theme="defaultThemeQp" :offset="[12, -15]"
|
|
||||||
placement="bottom-end" @select="onSelectSeting" :teleport="isbody">
|
|
||||||
</van-popover>
|
|
||||||
<van-icon :name="rightIcon" color="#fff" size="25px" @click.stop="onClickRight" v-if="showRight" />
|
<van-icon :name="rightIcon" color="#fff" size="25px" @click.stop="onClickRight" v-if="showRight" />
|
||||||
<span class="rightTitle" @click="onClickRight" v-if="rightTitle">{{
|
<span class="rightTitle" @click="onClickRight" v-if="rightTitle">{{
|
||||||
rightTitle
|
rightTitle
|
||||||
@ -17,9 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import watermark from "../utils/watermark.js";
|
|
||||||
import { ref, onMounted, defineEmits } from "vue";
|
import { ref, onMounted, defineEmits } from "vue";
|
||||||
import emitter from "../utils/eventBus.js";
|
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
navTitle: String, //标题
|
navTitle: String, //标题
|
||||||
@ -59,13 +54,6 @@ function onCLickFh() {
|
|||||||
router.back();
|
router.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSelectSeting(e) {
|
|
||||||
sessionStorage.clear()
|
|
||||||
localStorage.clear()
|
|
||||||
clearnAllCookie()
|
|
||||||
router.push("/login");
|
|
||||||
watermark.remove();//移除水印
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清除所有cookie
|
// 清除所有cookie
|
||||||
function clearnAllCookie() {
|
function clearnAllCookie() {
|
||||||
|
|||||||
@ -1,110 +1,111 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="home-page">
|
<div class="home-page">
|
||||||
<!-- 顶部导航栏 -->
|
<div class="container-box">
|
||||||
<div class="header-bg">
|
<!-- 顶部导航栏 -->
|
||||||
<div class="user-section">
|
<div class="header-bg">
|
||||||
<div class="avatar">
|
<div class="user-section">
|
||||||
{{ userInfo.nickName ? userInfo.nickName?.charAt(0) : "" }}
|
<div class="avatar">
|
||||||
|
{{ userInfo.nickName ? userInfo.nickName?.charAt(0) : "" }}
|
||||||
|
</div>
|
||||||
|
<div class="user-info">
|
||||||
|
<div class="user-name">{{ userInfo.nickName }}</div>
|
||||||
|
<div class="dept-name">{{ userInfo.departName }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info">
|
|
||||||
<div class="user-name">{{ userInfo.nickName }}</div>
|
<!-- 当前位置 -->
|
||||||
<div class="dept-name">{{ userInfo.departName }}</div>
|
<div class="location" v-if="userInfo.workAddress">
|
||||||
|
<van-icon name="location" class="location-icon" />
|
||||||
|
<span>{{ userInfo.workAddress }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 当前位置 -->
|
<!-- 功能卡片 -->
|
||||||
<div class="location" v-if="userInfo.workAddress">
|
<div class="function-cards">
|
||||||
<van-icon name="location" class="location-icon" />
|
<div v-for="(card, index) in functionCards" :key="index" class="card-item" :class="card.bgClass"
|
||||||
<span>{{ userInfo.workAddress }}</span>
|
@click="handleCardClick(card)">
|
||||||
|
<!-- 装饰性背景图标 -->
|
||||||
|
<div class="card-decor">
|
||||||
|
<van-icon :name="card.icon" class="decor-icon" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 内容 -->
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-title">{{ card.label }}</div>
|
||||||
|
<div class="card-subtitle">{{ card.subtitle }}</div>
|
||||||
|
<div class="card-count">
|
||||||
|
<span class="count-label">{{ card.countLabel }}</span>
|
||||||
|
<span class="count-value">{{ card.count }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-action">
|
||||||
|
<span>前往处理</span>
|
||||||
|
<van-icon name="arrow" class="action-icon" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 随手拍功能区 -->
|
||||||
|
<div class="ssp-section" @click="goToReport">
|
||||||
|
<div class="ssp-icon">
|
||||||
|
<van-icon name="photograph" class="ssp-icon-inner" />
|
||||||
|
</div>
|
||||||
|
<div class="ssp-content">
|
||||||
|
<div class="ssp-title">随手拍</div>
|
||||||
|
<div class="ssp-desc">随时随地上报违规</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 最新预警列表 -->
|
||||||
|
<div class="alerts-section">
|
||||||
|
<div class="section-header">
|
||||||
|
<h2 class="section-title">拦截预警</h2>
|
||||||
|
<div class="section-action" @click="goToAlertList">
|
||||||
|
<span>查看全部</span>
|
||||||
|
<span class="arrow">></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-loading v-if="initLoading" class="loading-state" color="#2563eb"
|
||||||
|
style="text-align:center;padding:20px;">加载中...</van-loading>
|
||||||
|
<van-list v-else v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
|
||||||
|
class="alerts-list">
|
||||||
|
<div v-for="alert in alertList" :key="alert.id" class="alert-item" @click="handleAlertClick(alert)">
|
||||||
|
<!-- 类型和等级 -->
|
||||||
|
<div class="alert-header">
|
||||||
|
<span class="alert-type">{{ alert.eventType }}</span>
|
||||||
|
<span class="alert-priority" :class="getLevelClass(alert.eventLevel)">
|
||||||
|
{{ getStatusText(alert.eventLevel) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 违章预警显示车牌信息 -->
|
||||||
|
<div class="alert-vehicle">
|
||||||
|
<van-icon name="logistics" />
|
||||||
|
<span>{{ alert.plateNo }}</span>
|
||||||
|
<span class="separator">|</span>
|
||||||
|
<span>{{ alert.vehicleColor }}</span>
|
||||||
|
<span class="separator">|</span>
|
||||||
|
<span>{{ alert.vehicleType }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 检测点位 -->
|
||||||
|
<div class="alert-location">
|
||||||
|
<van-icon name="location-o" />
|
||||||
|
<span class="label">检测点位:</span>
|
||||||
|
<span>{{ alert.siteName }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 检测时间 -->
|
||||||
|
<div class="alert-time">
|
||||||
|
<van-icon name="clock-o" />
|
||||||
|
<span class="label">检测时间:</span>
|
||||||
|
<span>{{ alert.passTime }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-list>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 功能卡片 -->
|
|
||||||
<div class="function-cards">
|
|
||||||
<div v-for="(card, index) in functionCards" :key="index" class="card-item" :class="card.bgClass"
|
|
||||||
@click="handleCardClick(card)">
|
|
||||||
<!-- 装饰性背景图标 -->
|
|
||||||
<div class="card-decor">
|
|
||||||
<van-icon :name="card.icon" class="decor-icon" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="card-title">{{ card.label }}</div>
|
|
||||||
<div class="card-subtitle">{{ card.subtitle }}</div>
|
|
||||||
<div class="card-count">
|
|
||||||
<span class="count-label">{{ card.countLabel }}</span>
|
|
||||||
<span class="count-value">{{ card.count }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="card-action">
|
|
||||||
<span>前往处理</span>
|
|
||||||
<van-icon name="arrow" class="action-icon" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 随手拍功能区 -->
|
|
||||||
<div class="ssp-section" @click="goToReport">
|
|
||||||
<div class="ssp-icon">
|
|
||||||
<van-icon name="photograph" class="ssp-icon-inner" />
|
|
||||||
</div>
|
|
||||||
<div class="ssp-content">
|
|
||||||
<div class="ssp-title">随手拍</div>
|
|
||||||
<div class="ssp-desc">随时随地上报违规</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 最新预警列表 -->
|
|
||||||
<div class="alerts-section">
|
|
||||||
<div class="section-header">
|
|
||||||
<h2 class="section-title">拦截预警</h2>
|
|
||||||
<div class="section-action" @click="goToAlertList">
|
|
||||||
<span>查看全部</span>
|
|
||||||
<span class="arrow">></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<van-loading v-if="initLoading" class="loading-state" color="#2563eb"
|
|
||||||
style="text-align:center;padding:20px;">加载中...</van-loading>
|
|
||||||
<van-list v-else v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
|
|
||||||
class="alerts-list">
|
|
||||||
<div v-for="alert in alertList" :key="alert.id" class="alert-item" @click="handleAlertClick(alert)">
|
|
||||||
<!-- 类型和等级 -->
|
|
||||||
<div class="alert-header">
|
|
||||||
<span class="alert-type">{{ alert.eventType }}</span>
|
|
||||||
<span class="alert-priority" :class="getLevelClass(alert.eventLevel)">
|
|
||||||
{{ getStatusText(alert.eventLevel) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 违章预警显示车牌信息 -->
|
|
||||||
<div class="alert-vehicle">
|
|
||||||
<van-icon name="logistics" />
|
|
||||||
<span>{{ alert.plateNo }}</span>
|
|
||||||
<span class="separator">|</span>
|
|
||||||
<span>{{ alert.vehicleColor }}</span>
|
|
||||||
<span class="separator">|</span>
|
|
||||||
<span>{{ alert.vehicleType }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 检测点位 -->
|
|
||||||
<div class="alert-location">
|
|
||||||
<van-icon name="location-o" />
|
|
||||||
<span class="label">检测点位:</span>
|
|
||||||
<span>{{ alert.siteName }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 检测时间 -->
|
|
||||||
<div class="alert-time">
|
|
||||||
<van-icon name="clock-o" />
|
|
||||||
<span class="label">检测时间:</span>
|
|
||||||
<span>{{ alert.passTime }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</van-list>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 底部导航栏 -->
|
<!-- 底部导航栏 -->
|
||||||
<BottomTabs :active-tab="'home'" />
|
<BottomTabs :active-tab="'home'" />
|
||||||
</div>
|
</div>
|
||||||
@ -304,9 +305,13 @@ function getStatusText(status) {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.home-page {
|
.home-page {
|
||||||
min-height: 100vh;
|
height: 100vh;
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
padding-bottom: 80px;
|
.container-box{
|
||||||
|
height: calc(100% - 80px);
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-bg {
|
.header-bg {
|
||||||
|
|||||||
@ -6,9 +6,7 @@
|
|||||||
<van-icon name="arrow-left" />
|
<van-icon name="arrow-left" />
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-title">随手拍</div>
|
<div class="nav-title">随手拍</div>
|
||||||
<div class="nav-right">
|
<div class="nav-right"></div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表单内容 -->
|
<!-- 表单内容 -->
|
||||||
@ -307,9 +305,8 @@ function goBack() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
async function handleSubmit() {
|
function handleSubmit() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 字段映射:页面字段 -> API字段
|
// 字段映射:页面字段 -> API字段
|
||||||
const submitData = { ...formData };
|
const submitData = { ...formData };
|
||||||
@ -318,15 +315,10 @@ async function handleSubmit() {
|
|||||||
submitData[`zpstr${index + 1}`] = photo.url;
|
submitData[`zpstr${index + 1}`] = photo.url;
|
||||||
submitData[`zpur1${index + 1}`] = photo.url;
|
submitData[`zpur1${index + 1}`] = photo.url;
|
||||||
});
|
});
|
||||||
const res = await addSsPai(submitData);
|
addSsPai(submitData).then(res => {
|
||||||
console.log("提交数据:", res);
|
|
||||||
if(res){
|
|
||||||
Toast("提交成功");
|
Toast("提交成功");
|
||||||
router.back();
|
router.back();
|
||||||
}else {
|
})
|
||||||
Toast(res.msg || "提交失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("提交失败:", error);
|
console.error("提交失败:", error);
|
||||||
Toast("提交失败,请重试");
|
Toast("提交失败,请重试");
|
||||||
|
|||||||
@ -5,13 +5,7 @@ import { getDictListByCode } from "./../api/common";
|
|||||||
* 分局字典代码获取字典词条列表
|
* 分局字典代码获取字典词条列表
|
||||||
* @param {字典代码} dict
|
* @param {字典代码} dict
|
||||||
*/
|
*/
|
||||||
// export function getDictList(dict) {
|
|
||||||
// return new Promise((ok) => {
|
|
||||||
// getDictListByCode({ dictCode: dict }).then((res) => {
|
|
||||||
// ok(res.itemList);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
export function getDictList(...dict) {
|
export function getDictList(...dict) {
|
||||||
const res = ref({})
|
const res = ref({})
|
||||||
return (()=>{
|
return (()=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user