多个bug修改

master
LAPTOP-S9HJSOEB\昊天 7 months ago
parent 86b2da5273
commit 1c257a36bd

@ -4,7 +4,8 @@ NODE_ENV=production
VITE_DEV=true
# 请求路径
VITE_BASE_URL='http://192.168.2.162:48080'
VITE_BASE_URL='http://127.0.0.1:48080'
VITE_BASE_PORT='48081'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server

@ -5,6 +5,7 @@ VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.162:48080'
VITE_BASE_PORT='48081'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server

@ -5,6 +5,7 @@ VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.162:48080'
VITE_BASE_PORT='48081'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server

@ -5,6 +5,7 @@ VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.162:48080'
VITE_BASE_PORT='48081'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server

@ -21,5 +21,9 @@ export const homeApi = {
stockLaneInventoryStatistics: async () => {
return await request.post({ url: `/logistics/stock/laneInventoryStatistics` })
},
// 首页巷道盘点统计
stockLaneInventoryStatisticsPie: async () => {
return await request.post({ url: `/logistics/stock/laneInventoryStatisticsPie` })
},
}

@ -55,6 +55,11 @@ export const StreetApi = {
return await request.delete({ url: `/logistics/street/delete?id=` + id })
},
// 删除巷道
linkCheck: async (id: number) => {
return await request.get({ url: `/logistics/street/linkCheck?id=` + id })
},
// 导出巷道 Excel
exportStreet: async (params) => {
return await request.download({ url: `/logistics/street/export-excel`, params })

@ -149,9 +149,9 @@
<script>
import axios from 'axios' // axios
import { config } from '@/config/axios/config'
const { result_code, base_url, request_timeout } = config
import {CameraControlApi} from '@/api/cameraControl/camera'
const { result_code, base_url, request_timeout } = config
export default {
props: {

@ -1,3 +1,9 @@
const getCurrentBaseUrl = () => {
// 获取当前页面的协议和主机
console.log(window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT)
return window.location.protocol + '//' + window.location.hostname+ ":"+import.meta.env.VITE_BASE_PORT
}
const config: {
base_url: string
result_code: number | string
@ -7,7 +13,7 @@ const config: {
/**
* api
*/
base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
base_url:getCurrentBaseUrl() + import.meta.env.VITE_API_URL,
/**
*
*/

@ -183,7 +183,7 @@ const getAll = async () => {
const chartData = stockLaneInventoryStatistics.value
//
//
deviceStatusChartOption.value = {
tooltip: {
trigger: 'axis',
@ -224,14 +224,12 @@ const getAll = async () => {
grid: {
left: '3%',
right: '4%',
bottom: '3%',
bottom: '10%', //
containLabel: true
},
xAxis: laneInventoryStatistics.value.xaxis,
yAxis: {
type: 'value',
interval: 1, // 1
splitNumber: 5 // 5
},
series: laneInventoryStatistics.value.series
}
@ -253,26 +251,14 @@ const getAll = async () => {
},
xAxis: laneInventoryLine.value.xaxis,
yAxis: {
type: 'value',
interval: 1, // 1
splitNumber: 5 // 5
type: 'value'
},
series: laneInventoryLine.value.series
}
//
const data = await StockApi.getStreetStatus({})
for (const item of data) {
if (buttonByStatusMap.value.has(item.statusString)) {
buttonByStatusMap.value.set(
item.statusString,
buttonByStatusMap.value.get(item.statusString)! + 1
)
} else {
buttonByStatusMap.value.set(item.statusString, 1)
}
}
stockPieOptions.series[0].data = echartData()
const data = await homeApi.stockLaneInventoryStatisticsPie()
stockPieOptions.series[0].data = data
} catch (error) {
console.error('获取数据时出错:', error)
}
@ -335,7 +321,7 @@ let eventSource: any = null
const sseUid = ref(`${Date.now()}-${Math.floor(Math.random() * 10000)}`)
const sse = ()=>{
// EventSource SSE
eventSource = new EventSource(import.meta.env.VITE_BASE_URL+'/app-api/sse/createSse?uid=' + sseUid.value );
eventSource = new EventSource(window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT+'/app-api/sse/createSse?uid=' + sseUid.value );
//
eventSource.onmessage = (event) => {
@ -351,6 +337,7 @@ eventSource.onerror = (error) => {
};
}
const colorListHex = {'未盘点':'#ebc26e','盘点异常':'#ed6d6d','盘点正确':'#6cc238','人工核对正确':'#5061c2'};
//
const stockPieOptions = reactive({
tooltip: {
@ -369,8 +356,9 @@ const stockPieOptions = reactive({
borderRadius: 10,
borderWidth: 2,
color: function (params) {
const colorList = ['#fa5762', '#97fa8c', '#32cd32', '#ff6347']
return colorList[params.dataIndex] // index
// 使 params.dataIndex
return colorListHex[params.name];
}
},
label: {
@ -485,6 +473,7 @@ onUnmounted(() => {
}
.colour-text {
color: white;
margin:10px;
}
.card-header::v-deep .el-card__header {
border-bottom: none !important;

@ -51,6 +51,7 @@
</template>
<script lang="ts" setup>
import { config } from '@/config/axios/config'
defineOptions({ name: 'ModelImportForm' })
const message = useMessage() //
@ -68,7 +69,7 @@ const formRules = reactive({
})
const formRef = ref() // Ref
const uploadRef = ref() // Ref
const importUrl = import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/bpm/model/import'
const importUrl =config.base_url+ '/bpm/model/import'
const uploadHeaders = ref() // Header
const fileList = ref([]) //

@ -12,7 +12,7 @@ import * as ConfigApi from '@/api/infra/config'
defineOptions({ name: 'InfraDruid' })
const loading = ref(true) //
const url = ref(import.meta.env.VITE_BASE_URL + '/druid/index.html')
const url = ref(window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT + '/druid/index.html')
/** 初始化 */
onMounted(async () => {

@ -11,7 +11,7 @@ import * as ConfigApi from '@/api/infra/config'
defineOptions({ name: 'InfraAdminServer' })
const loading = ref(true) //
const src = ref(import.meta.env.VITE_BASE_URL + '/admin/applications')
const src = ref(window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT + '/admin/applications')
/** 初始化 */
onMounted(async () => {

@ -11,8 +11,7 @@ import * as ConfigApi from '@/api/infra/config'
defineOptions({ name: 'InfraSwagger' })
const loading = ref(true) //
const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI
// const src = ref(import.meta.env.VITE_BASE_URL + '/swagger-ui') // Swagger UI
const src = ref(window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT + '/doc.html') // Knife4j UI
/** 初始化 */
onMounted(async () => {

@ -79,7 +79,7 @@ defineOptions({ name: 'InfraWebSocket' })
const message = useMessage() //
const server = ref(
(import.meta.env.VITE_BASE_URL + '/infra/ws').replace('http', 'ws') + '?token=' + getAccessToken()
(window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT+ '/infra/ws').replace('http', 'ws') + '?token=' + getAccessToken()
) // WebSocket
const getIsOpen = computed(() => status.value === 'OPEN') // WebSocket
const getTagColor = computed(() => (getIsOpen.value ? 'success' : 'red')) // WebSocket

@ -160,11 +160,13 @@
:align="column.align || 'center'"
:prop="column.label"
>
<!--原先可以点击查看信息
@click="getDialogVisible(scope.row.streetName,scope.row.direction,scope.row.row, scope.row.column,scope.row.id)" -->
<template #default="scope">
<el-button
link
@click="getDialogVisible(scope.row.streetName,scope.row.direction,scope.row.row, scope.row.column,scope.row.id)"
:type='scope.row["wms"+capitalize(column.label)] != scope.row[(column.label)]?"danger":"success"'>
:type='scope.row.status==0?"warning":(scope.row["wms"+capitalize(column.label)] != scope.row[(column.label)]?"danger":"success")'>
{{ scope.row["wms"+capitalize(column.label)] }}
</el-button>
</template>
@ -183,15 +185,16 @@
<el-table-column label="时间" align="center"
:formatter="dateFormatter" prop="createTime"/>
<el-table-column label="盘点图片" align="center" prop="pic" min-width="150">
<!-- <el-table-column label="盘点图片" align="center" prop="pic" min-width="150">
<template #default="scope">
<div v-if="scope.row.urlResources" class="image-cell-container">
<div v-if="scope.row.urlResources && scope.row.urlResources.length > 0" class="image-cell-container">
<el-image
v-for="(pic, index) in scope.row.urlResources"
v-for="(pic, index) in scope.row.urlResources.filter(p => p.little === '缺件拍照').slice(0, 1)"
:key="index"
:src="pic.url"
style="width: 100px; height: 100px; margin-right: 10px;"
:preview-src-list="[pic.url]"
:preview-src-list="scope.row.urlResources.filter(p => p.little === '缺件拍照').slice(0, 1).map(p => p.url)"
:initial-index="0"
:preview-teleported="true"
fit="cover"
@ -201,7 +204,7 @@
无图片
</div>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作" align="center">
<template #default="scope">
@ -212,7 +215,7 @@
@click="getDialogVisible(scope.row.streetName,scope.row.direction,scope.row.row, scope.row.column,scope.row.id)"
v-hasPermi="['logistics:check-log:delete']"
>
操作
详情
</el-button>
<el-button
@ -306,8 +309,10 @@ const getPicList = (pic: any) => {
return pic.map.url
}
const handleClose = () => {
const handleClose = async () => {
dialogVisible.value = false
//
await getList()
}
//
const capitalize = (str: string): string => {
@ -422,6 +427,16 @@ onMounted(() => {
.image-cell-container::-webkit-scrollbar {
height: 6px;
}
.image-cell-container::-webkit-scrollbar-thumb {
background-color: #c1c1c1; /* 灰色滚动条 */
border-radius: 3px;
}
.image-cell-container::-webkit-scrollbar-track {
background-color: #f1f1f1; /* 滚动条轨道背景色 */
border-radius: 3px;
}
.image__error .image-slot {
font-size: 30px;
}

@ -84,43 +84,39 @@
<el-col style="height: 30vh;" :span="5">
<el-card style="height: 100%;" shadow="always">
<p>统计信息</p>
<p style="margin: 0%;">统计信息</p>
<!-- ECharts 准备一个定义了宽高的 DOM -->
<Echart style="height:200px;" :options="option" />
<Echart style="height:230px;" :options="option" />
</el-card>
</el-col>
<el-col style="height: 30vh;" :span="18">
<el-card style="height: 100%;" shadow="always">
<div style="width: 100%;height: 100%;">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<!-- 遍历 Map 中的每个 key-value -->
<!-- 遍历 Map 中的每个 key-value -->
<div v-for="(title) in buttonByObjectMap.keys()" :key="title">
<!-- 标题 -->
<h4>{{ title }}</h4>
<!-- 遍历每个标题下的按钮数组 -->
<el-space :size="size" :spacer="spacer">
<div
class="mb-15px"
style="width: 5%;" v-for="(button, index) in buttonByObjectMap.get(title)" :key="index">
<el-col style="height: 28vh;" :span="18">
<el-card shadow="always">
<el-scrollbar height="28vh" width="28vw">
<!-- 使用 tabs 在上方选择标题 -->
<el-tabs type="border-card" >
<el-tab-pane
v-for="(title, index) in Array.from(buttonByObjectMap.keys())"
:key="index"
:label="title"
>
<!-- 按钮区域超过宽度自动换行 -->
<div style="display: flex; flex-wrap: wrap; gap: 10px; padding: 10px;">
<el-button
v-for="(button, btnIndex) in buttonByObjectMap.get(title)"
:key="btnIndex"
:type="getButtonType(button.row, button.column)"
:key="'button2-' + index"
:disabled="isDisabled(button.row, button.column)"
@click="getDialogVisible(button.row, button.column)"
style="margin: 1px;width: 4%;"
>
{{ button.row }}-{{ button.column }}
</el-button>
</div>
</el-space>
</div>
</div>
</el-card>
</el-tab-pane>
</el-tabs>
</el-scrollbar>
</el-card>
</el-col>
</el-row>
@ -155,7 +151,7 @@ const { t } = useI18n() // 国际化ist
const statusList = ['未盘点', '盘点异常', '盘点正确', '人工盘点正常'];
const colorList = ['warning', 'danger', 'success', 'success'];
const colorListHex = {'未盘点':'#ebc26e','盘点异常':'#ed6d6d','盘点正确':'#6cc238','人工盘点正常':'#b1c238'};
const colorListHex = {'未盘点':'#ebc26e','盘点异常':'#ed6d6d','盘点正确':'#6cc238','人工核对正确':'#5061c2'};
let rows = ref(12);
let columns = ref(48);
//
@ -266,6 +262,8 @@ const handleQuery = async () => {
}
const handleClose = () => {
dialogVisible.value = false
getStreetStatus()
startTimer()
}
const isDisabled = (row: number, column: number): boolean => {
@ -385,7 +383,7 @@ const option = reactive({
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
@ -399,6 +397,7 @@ const option = reactive({
borderWidth: 2,
color: function (params) {
console.log(params.name);
console.log(colorListHex[params.name]);
// var status = buttonByStatusMap.value.get(params.name);
// 使 params.dataIndex

@ -4,7 +4,7 @@
<div class="modal-content" @click.stop> -->
<!-- 跑马灯容器 -->
<div class="carousel-container">
<el-carousel v-if="!loading" height="500px" arrow="always">
<el-carousel v-if="!loading" height="370px" arrow="always">
<el-carousel-item v-for="(image, index) in carouselImages" :key="index">
<!-- 添加双击事件和放大容器 -->
<el-image
@ -158,8 +158,9 @@ export default {
stockId: props.stockId,
checkLogId: props.checkLogId
});
resStatus.value = true;
ElMessage.status('人工识别成功')
fetchStockInfo();
};
const closeBoxCard = () => {

@ -89,6 +89,14 @@
v-hasPermi="['logistics:street:update']"
>
编辑
</el-button>
<el-button
link
type="primary"
@click="showConnectionStatus(scope.row.id)"
v-hasPermi="['logistics:street:link']"
>
连接
</el-button>
<el-button
link
@ -98,9 +106,32 @@
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
v-model="dialogVisible"
title="连接状态详情"
width="500px"
@close="handleDialogClose"
>
<div
height="700px" v-if="connectionStatusData && connectionStatusData.length > 0">
<el-alert
v-loading="loadingLink"
v-for="(item, index) in connectionStatusData"
:key="index"
:title="formatConnectionStatus(item)"
:type="item.connect ? 'success' : 'error'"
:closable="false"
class="mb-10px"
/>
</div>
</el-dialog>
<!-- 分页 -->
<Pagination
:total="total"
@ -115,8 +146,6 @@
</template>
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { StreetApi, StreetVO } from '@/api/logistics/street'
import StreetForm from './StreetForm.vue'
@ -127,6 +156,12 @@ defineOptions({ name: 'Street' })
const message = useMessage() //
const { t } = useI18n() //
//
const connectionStatusData = ref<any[]>([])
const currentStreetId = ref<number | null>(null)
const loadingLink = ref(true) //
const dialogVisible = ref(false)
const loading = ref(true) //
const list = ref<StreetVO[]>([]) //
const total = ref(0) //
@ -169,6 +204,62 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
// /** */
// const linkCheck = async (id: number) => {
// try {
// //
// await StreetApi.linkCheck(id)
// message.success('')
// //
// await getList()
// } catch (err) {
// message.error('')
// }
// }
/** 显示连接状态详情 */
const showConnectionStatus = async (id: number) => {
try {
dialogVisible.value = true
loadingLink.value = true //
const data = await StreetApi.linkCheck(id)
connectionStatusData.value = data
currentStreetId.value = id
} catch (err) {
message.error('获取连接状态失败')
} finally {
loadingLink.value = false //
}
}
/** 格式化连接状态显示 */
const formatConnectionStatus = (item: any) => {
if (!item.ip || !item.port) {
return `${item.type} 连接状态异常!配置信息不完整`
}
return `${item.type} 连接${item.connect ? '正常' : '异常'}ip${item.ip},端口:${item.port}`
}
// /** */
// const getConnectionStatusText = (id: number) => {
// return ''
// }
// /** */
// const getConnectionStatusType = (id: number) => {
// //
// return 'primary'
// }
/** 关闭对话框 */
const handleDialogClose = () => {
connectionStatusData.value = []
currentStreetId.value = null
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

@ -63,7 +63,7 @@ import { getAccessToken } from '@/utils/auth'
import { Reply } from './types'
const message = useMessage()
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-temporary'
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT+ '/admin-api/mp/material/upload-temporary'
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } //
const props = defineProps<{

@ -67,7 +67,7 @@ import { Reply } from './types'
const message = useMessage()
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-temporary'
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname +":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-temporary'
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } //
const props = defineProps<{

@ -58,7 +58,7 @@ import { Reply } from './types'
const message = useMessage()
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-temporary'
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-temporary'
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() }
const props = defineProps<{

@ -61,7 +61,7 @@ import { getAccessToken } from '@/utils/auth'
import { Reply } from './types'
const message = useMessage()
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-temporary'
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-temporary'
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } //
const props = defineProps<{

@ -67,7 +67,7 @@ import { UploadType, useBeforeUpload } from '@/views/mp/hooks/useUpload'
import { NewsItem } from './types'
const message = useMessage()
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' //
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-permanent' //
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } //
const props = defineProps<{

@ -143,7 +143,7 @@ const props = defineProps<{
const accountId = inject<number>('accountId')
// ========== ==========
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' //
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-permanent' //
const editorConfig = createEditorConfig(UPLOAD_URL, accountId)
// v-model=newsList

@ -3,7 +3,7 @@ import { getAccessToken } from '@/utils/auth'
import { UploadType, useBeforeUpload } from '@/views/mp/hooks/useUpload'
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } // 请求头
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传地址
const UPLOAD_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + '/admin-api/mp/material/upload-permanent' // 上传地址
interface UploadData {
type: UploadType

@ -10,6 +10,6 @@ import { getAccessToken } from '@/utils/auth'
defineOptions({ name: 'JimuReport' })
const BASE_URL = import.meta.env.VITE_BASE_URL
const BASE_URL = window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT
const src = ref(BASE_URL + '/jmreport/list?token=' + getAccessToken())
</script>

@ -52,7 +52,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) //
const uploadRef = ref()
const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/system/user/import'
window.location.protocol + '//' + window.location.hostname+":"+import.meta.env.VITE_BASE_PORT + import.meta.env.VITE_API_URL + '/system/user/import'
const uploadHeaders = ref() // Header
const fileList = ref([]) //
const updateSupport = ref(0) //

1
types/env.d.ts vendored

@ -17,6 +17,7 @@ interface ImportMetaEnv {
readonly VITE_APP_DEFAULT_LOGIN_PASSWORD: string
readonly VITE_APP_DOCALERT_ENABLE: string
readonly VITE_BASE_URL: string
readonly VITE_BASE_PORT: string
readonly VITE_UPLOAD_URL: string
readonly VITE_API_URL: string
readonly VITE_BASE_PATH: string

Loading…
Cancel
Save