fix:upalod

This commit is contained in:
wangzenghua 2025-02-11 09:29:25 +00:00
parent 0c679197ea
commit cef8f3c1fd
12 changed files with 21 additions and 264 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,223 +0,0 @@
<!--
* @Description:
* @Author: zenghua.wang
* @Date: 2023-06-20 14:29:45
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-01-25 09:24:27
-->
<template>
<div class="layout">
<div class="layout-header">
<div class="layout-header-top">
<div class="layout-header-top-left">
<span>您好欢迎来到农业产业服务平台</span>
<el-tag>运营大屏</el-tag>
<el-tag>产业服务APP</el-tag>
<el-tag>产业运营管理</el-tag>
</div>
<div class="layout-header-top-right">
<span>商家中心</span>
<span>个人中心</span>
<span>返回首页</span>
</div>
</div>
<div class="layout-header-bottom">
<div class="layout-header-bottom-left">
<div class="layout-header-bottom-search">
<div class="title">农业产业服务平台</div>
<el-input v-model="keyword" placeholder="请输入关键词进行搜索"></el-input>
<el-button type="primary" @click="Search">搜索</el-button>
</div>
<el-menu ellipsis class="layout-header-bottom-menu" mode="horizontal">
<app-link v-for="(item, index) in meuns" :key="index" :to="item.path">
<el-menu-item>{{ item.label }}</el-menu-item>
</app-link>
</el-menu>
</div>
<div class="layout-header-bottom-right">
<div class="layout-header-bottom-right-qr">
<div class="layout-header-bottom-right-qr-img">
<img :src="qrImg" alt="" />
<p>下载数农App</p>
</div>
<div class="layout-header-bottom-right-qr-img">
<img :src="qrImg" alt="" />
<p>打开数农小程序</p>
</div>
</div>
<p>使用数农手机服务更方便</p>
</div>
</div>
</div>
<!-- 子应用不能使用router-view的插槽功能 -->
<router-view v-if="isSubApp" />
<router-view v-else v-slot="{ Component, route }">
<transition name="fade-slide" mode="out-in" appear>
<keep-alive v-if="isReload" :include="cacheRoutes">
<component :is="useWrapComponents(Component, route)" :key="route.path" />
</keep-alive>
</transition>
</router-view>
</div>
</template>
<script setup name="layout">
import { computed, ref } from 'vue';
import { useSettingStore } from '@/store/modules/setting';
import { usePermissionStore } from '@/store/modules/permission';
import { useWrapComponents } from '@/hooks/useWrapComponents';
import { qrImg } from './base64img';
import AppLink from './Link.vue';
import { useRoute } from 'vue-router';
const route = useRoute();
const SettingStore = useSettingStore();
const PermissionStore = usePermissionStore();
const cacheRoutes = computed(() => PermissionStore.keepAliveRoutes);
const isReload = computed(() => SettingStore.isReload);
const isSubApp = computed(() => route.path.includes('sub'));
const keyword = ref('');
const meuns = ref([
{
label: '智慧种植',
path: '/login',
},
{
label: '农事服务',
path: '/sub-admin/home',
},
{
label: '涉农金融',
},
{
label: '电商交易',
},
{
label: '分拣包装',
},
{
label: '仓储物流',
},
{
label: '公共品牌运营',
},
]);
function Search() {
console.log(keyword.value, 'search');
}
</script>
<style lang="scss" scoped>
.layout {
width: 100%;
height: 100%;
box-sizing: border-box;
&-header {
height: 206px;
overflow: hidden;
&-top {
display: flex;
height: 44px;
justify-content: space-between;
align-items: center;
background-color: #f8f8f8;
padding: 0 32px;
&-left {
line-height: 36px;
font-size: 16px;
.el-tag {
color: #fff;
background-color: #a4adb3;
margin-left: 12px;
border-color: #a4adb3;
cursor: pointer;
font-size: 18px;
}
}
&-right {
span {
color: #000;
margin-left: 25px;
line-height: 36px;
font-size: 16px;
text-align: center;
cursor: pointer;
&:nth-child(1) {
margin-left: 0;
font-weight: bold;
}
}
}
}
&-bottom {
display: flex;
padding: 20px 32px 0;
&-left {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
width: calc(100% - 300px);
.layout-header-bottom-search {
display: flex;
align-items: center;
.title {
font-size: 45px;
white-space: nowrap;
}
.el-input {
flex-grow: 1;
max-width: 460px;
margin-left: 40px;
height: 50px;
font-size: 18px;
}
.el-button {
margin-left: 40px;
font-size: 18px;
height: 45px;
padding: 8px 24px;
}
}
.layout-header-bottom-menu {
justify-content: space-around;
border: none;
.el-menu-item {
font-size: 24px;
}
}
}
&-right {
margin-top: -10px;
width: 240px;
padding-left: 20px;
p {
text-align: center;
}
&-qr {
display: flex;
justify-content: space-between;
&-img {
img {
width: 110px;
height: 110px;
}
p {
text-align: center;
}
}
}
}
}
}
&-main {
width: 100%;
height: calc(100% - 206px);
background-color: #f8f8f8;
}
}
</style>

View File

@ -8,28 +8,28 @@ export const leftApps = [
// entry: VITE_APP_SUB_OS,
// activeRule: '/sub-operation-service/',
// title: '运营服务',
// icon: 'platform/icon-home.png',
// icon: 'images/platform/icon-home.png',
// },
// {
// name: 'sub-admin',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-admin/',
// title: '管理后台',
// icon: 'platform/icon-admin.png',
// icon: 'images/platform/icon-admin.png',
// },
// {
// name: 'sub-app',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-app/',
// title: 'APP',
// icon: 'platform/icon-app.png',
// icon: 'images/platform/icon-app.png',
// },
// {
// name: 'sub-screen',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-screen/',
// title: '数据大屏',
// icon: 'platform/icon-screen.png',
// icon: 'images/platform/icon-screen.png',
// },
];
@ -39,28 +39,28 @@ export const rightApps = [
entry: VITE_APP_SUB_GAS,
activeRule: '/sub-government-affairs-service/',
title: '政务服务',
icon: 'platform/icon-home.png',
icon: 'images/platform/icon-home.png',
},
// {
// name: 'sub-government-admin',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-government-admin/',
// title: '管理后台',
// icon: 'platform/icon-admin.png',
// icon: 'images/platform/icon-admin.png',
// },
// {
// name: 'sub-government-app',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-government-app/',
// title: 'APP',
// icon: 'platform/icon-app.png',
// icon: 'images/platform/icon-app.png',
// },
// {
// name: 'sub-government-screen',
// entry: VITE_APP_SUB_ADMIN,
// activeRule: '/sub-government-screen/',
// title: '数据大屏',
// icon: 'platform/icon-screen.png',
// icon: 'images/platform/icon-screen.png',
// },
];

View File

@ -25,7 +25,7 @@ const registerGlobalMicroApps = () => {
});
start({
prefetch: true, // 取消预加载
prefetch: false,
sandbox: { experimentalStyleIsolation: true },
});

View File

@ -3,7 +3,7 @@
<h2 class="platform-title">数字农业产业管理平台</h2>
<div class="platform-panel">
<div class="platform-panel-item">
<div class="icon"><img src="@/assets/images/platform/icon-yy.png" /></div>
<div class="icon"><img :src="getAssetsFile('images/platform/icon-yy.png')" /></div>
<b>农业产业运营服务平台</b>
<ul class="entry">
<li v-for="item in leftApps" :key="item.name" @click="gotoPage(item)">
@ -15,7 +15,7 @@
</ul>
</div>
<div class="platform-panel-item">
<div class="icon"><img src="@/assets/images/platform/icon-zw.png" /></div>
<div class="icon"><img :src="getAssetsFile('images/platform/icon-zw.png')" /></div>
<b>农业产业政务服务平台</b>
<ul class="entry">
<li v-for="item in rightApps" :key="item.name" @click="gotoPage(item)">
@ -36,11 +36,11 @@ import actions from '@/micro/actions';
import { getAssetsFile } from '@/utils';
const gotoPage = (row) => {
const data = {};
const curentApp = microApps.find((item) => row.name === item.name);
actions.setGlobalState({
curentApp,
});
// const curentApp = microApps.find((item) => row.name === item.name);
// actions.setGlobalState({
// curentApp,
// });
console.log('===', actions.getGlobalState('user'));
window.history.pushState({}, row.name, row.activeRule);
};
</script>

View File

@ -1,20 +0,0 @@
<template>
<div id="sub-app"></div>
</template>
<script>
import { registerGlobalMicroApps } from '@/micro';
export default {
mounted() {
if (!window.qiankunStarted) {
window.qiankunStarted = true;
registerGlobalMicroApps();
}
},
};
</script>
<style>
#sub-app {
width: 100%;
}
</style>

View File

@ -3,7 +3,7 @@
* @Author: zenghua.wang
* @Date: 2022-02-23 21:12:37
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-02-11 16:18:41
* @LastEditTime: 2025-02-11 17:18:36
*/
import lodash from 'lodash';
import dayjs from 'dayjs';
@ -300,8 +300,7 @@ export const getAssetsFile = (url) => {
*/
export const setUploadField = (url) => {
// if (isEmpty(url) || url.includes('http')) return null;
if (isEmpty(url)) return null;
return url;
return isEmpty(url) ? null : url;
};
/**
* @Title: 下载文件

View File

@ -51,7 +51,7 @@
import { reactive, ref } from 'vue';
import { useApp } from '@/hooks';
import { CRUD_OPTIONS } from '@/config';
import { isEmpty, imageToBase64, downloadFile } from '@/utils';
import { isEmpty, imageToBase64, setUploadField, downloadFile } from '@/utils';
import { CommonUpload } from '@/apis';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity } from '@/apis/quality';
@ -336,6 +336,7 @@ const rowUploadPicture = async ({ file }) => {
//
const rowSave = (row, done, loading) => {
delete row.base64;
row.qualityReportUrl = setUploadField(row.qualityReportUrl);
AddEntity(row)
.then((res) => {
if (res.code === 200) {
@ -359,6 +360,7 @@ const rowEdit = (row) => {
};
const rowUpdate = (row, index, done, loading) => {
delete row.base64;
row.qualityReportUrl = setUploadField(row.qualityReportUrl);
UpdateEntity(row)
.then((res) => {
if (res.code === 200) {