更新
This commit is contained in:
@ -8,3 +8,24 @@ export function bigDataUpload(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" />
|
||||
</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" />
|
||||
<span class="rightTitle" @click="onClickRight" v-if="rightTitle">{{
|
||||
rightTitle
|
||||
@ -17,9 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import watermark from "../utils/watermark.js";
|
||||
import { ref, onMounted, defineEmits } from "vue";
|
||||
import emitter from "../utils/eventBus.js";
|
||||
import router from "../router";
|
||||
const props = defineProps({
|
||||
navTitle: String, //标题
|
||||
@ -59,13 +54,6 @@ function onCLickFh() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
function onSelectSeting(e) {
|
||||
sessionStorage.clear()
|
||||
localStorage.clear()
|
||||
clearnAllCookie()
|
||||
router.push("/login");
|
||||
watermark.remove();//移除水印
|
||||
}
|
||||
|
||||
// 清除所有cookie
|
||||
function clearnAllCookie() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="home-page">
|
||||
<div class="container-box">
|
||||
<!-- 顶部导航栏 -->
|
||||
<div class="header-bg">
|
||||
<div class="user-section">
|
||||
@ -104,7 +105,7 @@
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 底部导航栏 -->
|
||||
<BottomTabs :active-tab="'home'" />
|
||||
</div>
|
||||
@ -304,9 +305,13 @@ function getStatusText(status) {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.home-page {
|
||||
min-height: 100vh;
|
||||
height: 100vh;
|
||||
background: #f5f5f5;
|
||||
padding-bottom: 80px;
|
||||
.container-box{
|
||||
height: calc(100% - 80px);
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.header-bg {
|
||||
|
||||
@ -6,9 +6,7 @@
|
||||
<van-icon name="arrow-left" />
|
||||
</div>
|
||||
<div class="nav-title">随手拍</div>
|
||||
<div class="nav-right">
|
||||
|
||||
</div>
|
||||
<div class="nav-right"></div>
|
||||
</div>
|
||||
|
||||
<!-- 表单内容 -->
|
||||
@ -307,9 +305,8 @@ function goBack() {
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
async function handleSubmit() {
|
||||
function handleSubmit() {
|
||||
isLoading.value = true;
|
||||
|
||||
try {
|
||||
// 字段映射:页面字段 -> API字段
|
||||
const submitData = { ...formData };
|
||||
@ -318,15 +315,10 @@ async function handleSubmit() {
|
||||
submitData[`zpstr${index + 1}`] = photo.url;
|
||||
submitData[`zpur1${index + 1}`] = photo.url;
|
||||
});
|
||||
const res = await addSsPai(submitData);
|
||||
console.log("提交数据:", res);
|
||||
if(res){
|
||||
addSsPai(submitData).then(res => {
|
||||
Toast("提交成功");
|
||||
router.back();
|
||||
}else {
|
||||
Toast(res.msg || "提交失败");
|
||||
}
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("提交失败:", error);
|
||||
Toast("提交失败,请重试");
|
||||
|
||||
@ -5,13 +5,7 @@ import { getDictListByCode } from "./../api/common";
|
||||
* 分局字典代码获取字典词条列表
|
||||
* @param {字典代码} dict
|
||||
*/
|
||||
// export function getDictList(dict) {
|
||||
// return new Promise((ok) => {
|
||||
// getDictListByCode({ dictCode: dict }).then((res) => {
|
||||
// ok(res.itemList);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
export function getDictList(...dict) {
|
||||
const res = ref({})
|
||||
return (()=>{
|
||||
|
||||
Reference in New Issue
Block a user