代码提交1111

This commit is contained in:
luoshiwen 2024-11-11 09:48:26 +08:00
parent e9ad90c9bd
commit 4a10ebd599
19 changed files with 439 additions and 192 deletions

View File

@ -5,4 +5,6 @@ VITE_APP_TITLE = 烟厂
VITE_APP_ENV = 'development'
#开发环境
VITE_APP_BASE_API = '/dev-api'
VITE_APP_BASE_API = ''
VITE_PREVIEW_URL = '/preview'

View File

@ -7,5 +7,8 @@ VITE_APP_ENV = 'production'
#生产环境
VITE_APP_BASE_API = ''
#文件地址
VITE_PREVIEW_URL = '/preview'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip

BIN
dist.rar Normal file

Binary file not shown.

BIN
dist.zip

Binary file not shown.

Binary file not shown.

View File

@ -1,89 +1,97 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | U3D_TobaccoWarehouseISMDTSystem</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<style>
body,html{
</head>
<style>
body,html{
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%;">
<canvas id="unity-canvas" style="width: 100%;height: 100%;" tabindex="-1"></canvas>
<div id="unity-loading-bar">
}
</style>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height:100%">
<canvas id="unity-canvas" style="width: 100%;height:100%" tabindex="-1"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-warning"> </div>
<div id="unity-footer">
</div>
<div id="unity-warning"></div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">U3D_TobaccoWarehouseISMDTSystem</div>
</div>
</div>
<script>
</div>
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
<button onclick="OpenHtmlMQTT()">Connect</button>
<button onclick="publishMessage()">Publish</button>
<button onclick="disconnectMQTT()">Disconnect</button>
<script src="./js/mqtt.min.js"></script>
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
<script>
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
function updateBannerVisibility() {
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
}
var div = document.createElement('div');
div.innerHTML = msg;
warningBanner.appendChild(div);
if (type == 'error') div.style = 'background: red; padding: 10px;';
else {
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function() {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function () {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
}
updateBannerVisibility();
}
}
var buildUrl = "Build";
var loaderUrl = buildUrl + "/延安烟厂.loader.js";
var config = {
dataUrl: buildUrl + "/延安烟厂.data.unityweb",
frameworkUrl: buildUrl + "/延安烟厂.framework.js.unityweb",
codeUrl: buildUrl + "/延安烟厂.wasm.unityweb",
var buildUrl = "Build";
var loaderUrl = buildUrl + "/webgl.loader.js";
var config = {
dataUrl: buildUrl + "/webgl.data.unityweb",
frameworkUrl: buildUrl + "/webgl.framework.js.unityweb",
codeUrl: buildUrl + "/webgl.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "U3D_TobaccoWarehouseISMDTSystem",
productVersion: "0.1",
showBanner: unityShowBanner,
};
};
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
@ -98,32 +106,112 @@
// config.devicePixelRatio = 1;
} else {
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
// canvas.style.width = "1920px";
// canvas.style.height = "1080px";
}
// canvas.style.width = "960px";
// canvas.style.height = "600px";
}
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
let client;
function OpenHtmlMQTT() {
client = mqtt.connect('ws://172.16.1.106:8083/mqtt');
client.on('connect', () => {
console.log('连接...');
const devices = [
Array.from({length: 10}, (_, i) => `car${i + 1}`),//小车
"cm1",//去加盖机
Array.from({length: 7}, (_, i) => `convoyor510${i + 1}`),//输送机
Array.from({length: 51}, (_, i) => `convoyor52${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({length: 30}, (_, i) => `convoyor54${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({length: 4}, (_, i) => `dpm${i + 1}`),//拆码垛机
Array.from({length: 7}, (_, i) => `elv${i + 1}`),//提升机
"fe1",//落地时提升机
Array.from({length: 2}, (_, i) => `qcbd${i + 1}`)//快换电池装置
];
devices.forEach(device => {
console.log(device);
client.subscribe(device, {
onSuccess: () => {
console.log(`已订阅: ${device}`);
},
onFailure: (err) => {
console.error(`订阅失败: ${device}:`, err);
}
});
});
// client.subscribe('car1', (err) => {
// if (!err) {
// console.log('Subscribed to car1');
// }
// });
//
});
client.on('message', (topic, message) => {
const mes = JSON.stringify({device: topic, message: message.toString()});
// console.log(mes);
unityInstance.SendMessage('APP', 'Message', mes)
});
client.on('error', (err) => {
console.error('Connection error: ', err);
});
}
function publishMessage() {
if (client) {
client.publish('car1', 'Hello');
}
}
function disconnectMQTT() {
if (client) {
client.end(() => {
console.log('关闭连接');
});
}
}
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
// 为window添加unityInstance对象
window.unityInstance = unityInstance
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
document.body.appendChild(script);
</script>
</body>
</script>
</body>
</html>

10
public/model/js/mqtt.min.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
src/assets/images/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -341,8 +341,18 @@ onMounted(() => {
)
1 1;
box-sizing: border-box;
}
}
:deep(.el-select .el-input){
width: vw(212);
height: vh(36);
line-height: vh(36);
}
:deep(.el-input .el-input__inner){
line-height: vh(36) !important;
height: vh(36) !important;
}
:deep(.el-select:hover:not(.el-select--disabled) .el-input__wrapper),
:deep(.el-select .el-input.is-focus .el-input__wrapper) {
box-shadow: none !important;

View File

@ -45,31 +45,38 @@
</li>
</ul>
<div style="float: right">
<el-pagination
v-model:current-page="params1.pageIndex"
:page-size="params1.pageSize"
:size="params1.pageSize"
:pager-count='5'
layout="total, prev, pager, next"
:total="total"
prev-text="上一页"
next-text="下一页"
@current-change="GetPageGuideDocsData"
>
</el-pagination>
</div>
<el-pagination
v-model:current-page="params1.pageIndex"
:page-size="params1.pageSize"
:size="params1.pageSize"
:pager-count="5"
layout="total, prev, pager, next"
:total="total"
prev-text="上一页"
next-text="下一页"
@current-change="GetPageGuideDocsData"
>
</el-pagination>
</div>
</div>
</div>
</div>
<div class="el-overlay" v-show="pdfShow">
<div class="pdf">
<div class="pdf-nav">
{{ pdfTitle }} <span @click="pdfShow=false"></span>
</div>
<iframe :src="pdfUrl"></iframe>
</div>
</div>
</template>
<script setup>
import { ref } from "vue";
import {
getDocsIdentity,
GetPageGuideDocs,
} from "@/api/equipmentManagement/index";
import {downloadPdf} from "@/api/operation/index"
import { downloadPdf } from "@/api/operation/index";
import { onMounted } from "vue";
const emit = defineEmits(["closeGuidance"]);
const allName = ref([]);
@ -89,25 +96,32 @@ const params1 = {
//
async function download(item) {
const response = await downloadPdf(item.filePath);
const response = await downloadPdf(
import.meta.env.VITE_PREVIEW_URL + "/" + item.filePath
);
const url = window.URL.createObjectURL(new Blob([response]));
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", "file.pdf");
link.setAttribute("download", item.fileName);
document.body.appendChild(link);
link.click();
}
const pdfShow = ref(false);
const pdfUrl = ref("");
const pdfTitle = ref("");
function previewFile(item) {
window.open(import.meta.env.VITE_APP_BASE_API + item.filePath);
// window.open(import.meta.env.VITE_PREVIEW_URL+item.filePath);
pdfTitle.value = item.fileName;
pdfShow.value = true;
pdfUrl.value = import.meta.env.VITE_PREVIEW_URL + item.filePath;
}
const total = ref(0)
const total = ref(0);
//
function GetPageGuideDocsData(item) {
GetPageGuideDocs(params1).then((res) => {
total.value = res.result.totalNum
total.value = res.result.totalNum;
fileList.value = res.result.data;
});
}
@ -121,6 +135,41 @@ onMounted(() => {
});
</script>
<style scoped lang="scss">
.pdf {
overflow: hidden;
width: vw(950);
height: 100%;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
position: absolute;
iframe {
width: 100%;
height: 96%;
}
&-nav {
width: 100%;
font-size: 1rem;
color: #000;
background-color: #fff;
height: 4%;
// line-height: 4%;
display: flex;
align-items: center;
justify-content: center;
span{
display: inline-block;
width: vw(20);
height:vh(20);
background-image: url('@/assets/images/close.png');
background-size: 100% 100%;
margin-left: vw(10);
cursor: pointer;
}
}
}
.box {
width: vw(1088);
height: vh(636);
@ -221,7 +270,7 @@ onMounted(() => {
height: vh(440);
}
}
ul::-webkit-scrollbar{
ul::-webkit-scrollbar {
display: none;
}
ul {
@ -243,9 +292,11 @@ onMounted(() => {
// font-size: 1rem;
color: rgba(25, 174, 250, 1);
margin-right: vw(24);
font-size: 0.875rem;
}
.download {
color: rgba(28, 238, 251, 1);
font-size: 0.875rem;
}
}
}

View File

@ -127,7 +127,7 @@ const getRowClassName = ({ row, rowIndex }) => {
};
function rowClick(row) {
tableRowIndex.value = row.index;
options.src = import.meta.env.VITE_APP_BASE_API + tableList.value[row.index].videoPath
options.src = import.meta.env.VITE_PREVIEW_URL + tableList.value[row.index].videoPath
console.log(options.src);
}
const equipmentCode = ref("");
@ -143,7 +143,7 @@ function getPageGuideVideosData(item) {
GetPageGuideVideos(params1).then((res) => {
tableList.value = res.result.data;
total.value = res.result.totalNum
options.src = import.meta.env.VITE_APP_BASE_API + tableList.value[0].videoPath
options.src = import.meta.env.VITE_PREVIEW_URL + tableList.value[0].videoPath
});
}
onMounted(() => {

View File

@ -14,7 +14,10 @@
v-for="(item, index) in Math.ceil(chartList.length / 8)"
:key="item.id"
>
<div v-if="index == chartIndex" style="display: flex;width: 100%;" >
<div
v-if="index == chartIndex"
style="display: flex; width: 100%"
>
<div
class="box-content-chart-item"
v-for="item in chartList.slice(index * 8, 8 * (index + 1))"
@ -33,7 +36,7 @@
</div>
<div class="box-content-inBound">
<div class="box-content-inBound-title">
<span> 入库信息统计 </span>
<span> {{props.title==='入库信息'?'入库信息统计':'出库信息统计'}} </span>
<div>
<ul v-if="storeList">
<li><span>单位</span><span>公斤</span></li>
@ -53,9 +56,7 @@
v-model="params.year"
type="year"
placeholder="请选择年份"
@change="
getBrandChart(true);
"
@change="getBrandChart(true)"
/>
</section>
<section>
@ -75,7 +76,7 @@
@change="getBrandChart()"
>
<el-option
v-for="(item,index) in options"
v-for="(item, index) in options"
:key="'key' + index"
:label="item"
:value="item"
@ -90,10 +91,14 @@
<el-collapse-item title="品牌" name="1">
<div class="brand">
<div
v-for="(item,index) in brandList"
v-for="(item, index) in brandList"
:key="item"
@click="selectBrand(item,index)"
:class="index==brandIndex?'num-select brand-item':'brand-item'"
@click="selectBrand(item, index)"
:class="
index == brandIndex
? 'num-select brand-item'
: 'brand-item'
"
>
<span>{{ item.slice(0, 2) }}</span>
<span>{{ item.slice(2) }}</span>
@ -127,8 +132,21 @@ const props = defineProps({
title: String,
});
//
const brandIndex = ref(0)
const options = ref(['1','2','3','4','5','6','7','8','9','10','11','12'])
const brandIndex = ref(0);
const options = ref([
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
]);
const activeNames = ref(["1"]);
const emit = defineEmits(["closeBoundMsg"]);
const chartIndex = ref(0);
@ -182,7 +200,6 @@ const chartList = ref([
// type: "()",
// value: 20,
// },
// {
// id: 19,
// name: "",
@ -200,25 +217,25 @@ const chartList = ref([
function getChartList() {
if (props.title === "入库信息") {
getBrandPercent().then((res) => {
chartList.value = res.result.columnDatas.map((ele,index) => {
chartList.value = res.result.columnDatas.map((ele, index) => {
return {
id:index++,
kg:ele.number + '箱',
id: index++,
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
msg:true,
msg: true,
};
});
});
} else {
getOutBrandPercent().then((res) => {
chartList.value = res.result.columnDatas.map((ele,index) => {
chartList.value = res.result.columnDatas.map((ele, index) => {
return {
id:index++,
kg:ele.number + '箱',
id: index++,
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
msg:true,
msg: true,
};
});
});
@ -249,8 +266,8 @@ const params = reactive({
function getAllBrandName(boolean) {
if (boolean) {
params.year = params.year.getFullYear().toString();
} else{
console.log(params.month.slice(0,-2));
} else {
console.log(params.month.slice(0, -2));
// params.month = params.month.slice(-2)
}
if (props.title === "入库信息") {
@ -268,17 +285,17 @@ function getAllBrandName(boolean) {
}
}
//
function selectBrand(item,index){
brandIndex.value = index
params.brandName = item
getBrandChart()
function selectBrand(item, index) {
brandIndex.value = index;
params.brandName = item;
getBrandChart();
}
// chart
function getBrandChart(boolean) {
if (boolean) {
params.year = params.year.getFullYear().toString();
} else{
console.log(params.month.slice(0,-2));
} else {
console.log(params.month.slice(0, -2));
// params.month = params.month.slice(-2)
}
if (props.title === "入库信息") {
@ -337,8 +354,17 @@ function drawBarChart(res) {
right: "2%",
top: "15%",
},
tooltip:{
show:true
tooltip: {
show: true,
formatter: function (data) {
// 1000
console.log(data,'xxxxxxxxxx');
if(params.month){
return params.year +'-'+ params.month +'-'+ data.name+ ' : ' + `<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` + '公斤'
}else{
return params.year +'-'+ data.name+ ' : ' + `<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` + '公斤'
}
},
},
xAxis: {
data: res.map((ele, index) => {
@ -351,7 +377,7 @@ function drawBarChart(res) {
},
axisLabel: {
color: "#fff",
fontSize: '0.875rem',
fontSize: "0.875rem",
},
},
yAxis: {
@ -369,6 +395,16 @@ function drawBarChart(res) {
axisLabel: {
color: "#fff",
fontSize: "0.875rem",
formatter: function (value) {
// 1000
if (value >= 1000) {
return value / 10000 + "万";
} else if (value >= 10000000) {
return value / 100000000 + "亿";
} else {
return value;
}
},
},
splitLine: {
show: true,
@ -425,7 +461,7 @@ onMounted(() => {
});
</script>
<style scoped lang="scss">
.num-select{
.num-select {
background-image: url("@/assets/images/dialog/num-select.png") !important;
}
.swiper {

View File

@ -103,19 +103,20 @@
<span class="name">品牌</span>
<span>{{ item.itemDesc }}</span>
</li>
<li>
<span class="name">工单开始时间</span>
<span>{{ item.creatTime }}</span>
</li>
<li>
<span class="name">剩余箱数</span>
<span>{{ item.leftNum }}</span>
</li>
<li>
<span class="name">剩余投料量</span>
<span>{{ item.remainWeight }}公斤</span>
</li>
<!-- <li>
<span class="name">工单开始时间</span>
<span>{{ item.creatTime }}</span>
</li> -->
<li>
<span class="name">剩余箱数</span>
<span>{{ item.leftNum }}</span>
</li>
<li style="opacity:0"></li>
<li style="opacity:0"></li>
</ul>
</div>

View File

@ -1,7 +1,7 @@
<template>
<Nav />
<div class="unity">
<iframe src="model/index.html" frameborder="0"></iframe>
<!-- <iframe src="model/index.html" frameborder="0"></iframe> -->
</div>
<div class="home">
<div class="home-left">
@ -425,8 +425,9 @@ const searchData = ref();
// echarts
function drawInventoryNewsEcahrt(result) {
// result. = 400
// result. = 300
let myChart = echarts.init(document.getElementById("inventoryNews"));
console.log(result,'xxxxxxxxxxx');
var scaleData = [
// {
// name: "",
@ -444,24 +445,51 @@ function drawInventoryNewsEcahrt(result) {
// radius1: ["67%", "68%"],
// },
];
let index = 0
for(let key in result){
let index = 0;
for (let key in result) {
scaleData.push({
name:key,
value:result[key],
radius1:[51+index*8 + '%' + '', 53+index*8 + '%' + '']
})
index ++
name: key,
value: result[key],
});
index++;
}
console.log(scaleData,'xxxxxxxxx');
// let box = {
// name:'',
// value:,
// }
//
scaleData.forEach((el) => {
for (let key in result) {
if (el.name === key) {
el.value = result[key];
}
// scaleData.forEach((el,index) => {
// console.log(el);
// });
let box = {
name:'特殊箱子',
value:0,
}
for(let i = 0;i<scaleData.length;i++){
if(scaleData[i].name==='特殊空箱子'){
box.value = box.value + scaleData[i].value
scaleData.splice(i,1)
i--
}
});
if(scaleData[i].name==='特殊实箱子'){
box.value = box.value + scaleData[i].value
scaleData.splice(i,1)
i--
}
}
// console.log(scaleData);
// box.radius1 = [43 + (scaleData.length-1) * 8 + "%" + "", 45 + (scaleData.length-1) * 8 + "%" + ""]
if(box.value != 0){
scaleData.push(box)
}
scaleData.forEach((el,index)=>{
el.radius1 = [43 + index * 8 + "%" + "", 45 + index * 8 + "%" + ""]
})
var placeHolderStyle = {
label: {
show: false,
@ -476,11 +504,16 @@ function drawInventoryNewsEcahrt(result) {
var seriesObj = [];
var color = [
"rgba(23, 151, 217, 1)",
// "rgba(28, 238, 251, 1)",
"rgba(255, 215, 0,1)",
// "rgba(0, 245, 194, 1)",
"rgba(255, 255, 224,1)",
// "rgba(0, 245, 194, 1)",
"rgba(28, 238, 251, 1)",
"rgba(0, 245, 194, 1)",
"rgba(255, 192, 203,1)",
];
for (var i = 0; i < scaleData.length; i++) {
console.log(scaleData[i].name);
seriesObj.push({
name: "",
type: "pie",
@ -545,9 +578,12 @@ function drawInventoryNewsEcahrt(result) {
itemWidth: fontSize(0.1),
itemHeight: fontSize(0.1),
itemGap: fontSize(0.2),
data: scaleData.map((el) => {
data: scaleData.map((el,index) => {
return el.name;
}),
// itemStyle:{
// color:color
// },
show: true,
textStyle: {
color: "#fff",
@ -562,7 +598,7 @@ function drawInventoryNewsEcahrt(result) {
textAlign: "right",
// width: "40",
padding: [0, 0, 0, 10],
color: color[i],
// color: color,
},
},
},
@ -605,44 +641,44 @@ function drawInventoryNewsEcahrt(result) {
],
},
legend: {
icon: "circle",
orient: "vertical",
x: "60%",
y: "center",
itemWidth: fontSize(0.1),
itemHeight: fontSize(0.1),
itemGap: fontSize(0.2),
data: scaleData.map((el) => {
return el.name;
}),
show: true,
textStyle: {
color: "#fff",
fontSize: "0.875rem",
rich: {
name: {
color: "#fff",
fontSize: "0.875rem",
},
val: {
fontSize: ".875rem",
textAlign: "right",
// width: "40",
color: color[i],
icon: "circle",
orient: "vertical",
x: "60%",
y: "center",
itemWidth: fontSize(0.1),
itemHeight: fontSize(0.1),
itemGap: fontSize(0.2),
data: scaleData.map((el) => {
return el.name;
}),
show: true,
textStyle: {
color: "#fff",
fontSize: "0.875rem",
rich: {
name: {
color: "#fff",
fontSize: "0.875rem",
},
val: {
fontSize: ".875rem",
textAlign: "right",
// width: "40",
color: color[i],
},
},
},
},
formatter: function (name) {
let total = 0;
for (var i = 0; i < scaleData.length; i++) {
if (scaleData[i].name === name) {
total = scaleData[i].value;
formatter: function (name) {
let total = 0;
for (var i = 0; i < scaleData.length; i++) {
if (scaleData[i].name === name) {
total = scaleData[i].value;
}
}
}
return `{name|${name}} {val|${total}}`;
return `{name|${name}} {val|${total}}`;
},
},
},
});
});
}

View File

@ -26,6 +26,16 @@ export default defineConfig({
target: 'http://172.16.1.106:5005/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
},
'/api': {
target: 'http://172.16.1.106:5005/api',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
},
'/preview': {
target: 'http://172.16.1.106:5005/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/preview/, '')
}
}
},