优化
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled

This commit is contained in:
吕杰刚 2025-07-22 20:02:31 +08:00
parent 3acec66ddd
commit 6b53804282
8 changed files with 99 additions and 150 deletions

2
.env
View File

@ -1,7 +1,7 @@
# 所有环境的环境变量(命名必须以 VITE_ 开头) # 所有环境的环境变量(命名必须以 VITE_ 开头)
## 项目标题 ## 项目标题
VITE_APP_TITLE = 数据运营管理平台 VITE_APP_TITLE = 智慧矿山数据管理平台
## 路由模式 hash 或 html5 ## 路由模式 hash 或 html5
VITE_ROUTER_HISTORY = hash VITE_ROUTER_HISTORY = hash

View File

@ -3,8 +3,8 @@
## 后端接口地址(如果解决跨域问题采用反向代理就只需写相对路径) ## 后端接口地址(如果解决跨域问题采用反向代理就只需写相对路径)
## VITE_BASE_URL = /api/v1 ## VITE_BASE_URL = /api/v1
# VITE_BASE_URL = http://124.71.209.231:8000 VITE_BASE_URL = http://124.71.209.231:8000
VITE_BASE_URL = null # VITE_BASE_URL = null
## 开发环境域名和静态资源公共路径(一般 / 或 ./ 都可以) ## 开发环境域名和静态资源公共路径(一般 / 或 ./ 都可以)

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -4,7 +4,7 @@ const VITE_APP_TITLE = import.meta.env.VITE_APP_TITLE
<template> <template>
<footer class="layout-footer"> <footer class="layout-footer">
MIT © 2021-PRESENT {{ VITE_APP_TITLE }} MIT © 2025-PRESENT {{ VITE_APP_TITLE }}
</footer> </footer>
</template> </template>

View File

@ -5,7 +5,7 @@ import SvgDashboard from "../images/dashboard.svg?component" // vite-svg-loader
<template> <template>
<div class="app-container center"> <div class="app-container center">
<SvgDashboard class="svg" /> <SvgDashboard class="svg" />
<p>欢迎来到数据运营管理平台</p> <p>欢迎来到智慧矿山数据管理平台</p>
</div> </div>
</template> </template>

View File

@ -1,17 +1,35 @@
<script> <script>
import { import {} from "@@/apis/tables/drainageWorkshop/pumpOperationLog.ts";
updateFangpaishuiPumpoperationrecordApi,
deleteFangpaishuiPumpoperationrecordApi,
findPumpoperationrecordByDetailApi,
addFangpaishuiPumpoperationrecordApi,
findFangpaishuiPumpoperationrecordByMonthApi,
} from "@@/apis/tables/drainageWorkshop/pumpOperationLog.ts";
import { getSpecificDate } from "@@/utils/datetime"; import { getSpecificDate } from "@@/utils/datetime";
export default { export default {
data() { data() {
return { return {
date: "", date: "",
tableList: [], tableList: [
{
projectName: "运矿量",
unit: "节",
month: { plan: "15167", actual: "15624", percentage: "103.01" },
cumulativeForMonth: {
plan: "",
actual: "",
percentage: "",
},
notes: "每次交班必须至少留1列重矿在葵站待命",
},
{ projectName: "其中:东倒", unit: "节", month: { plan: "" } },
{ projectName: "西倒", unit: "节" },
{ projectName: "", unit: "单位" },
{ projectName: "装车质量", unit: "t/列" },
{ projectName: "电机车周转量", unit: "吨公里" },
{ projectName: "电机车综合效率", unit: "吨台班" },
{ projectName: "电机车出车率(台班)", unit: "吨" },
{ projectName: "电机作业率(分时)", unit: "吨" },
{ projectName: "电机车完好率(台班)", unit: "吨" },
{ projectName: "", unit: "单位" },
{ projectName: "列车周转时间", unit: "分" },
{ projectName: "大选厂卸车数" },
],
}; };
}, },
created() { created() {
@ -21,8 +39,8 @@ export default {
methods: { methods: {
// //
async getList() { async getList() {
const res = await findAllMiningglossApi(); // const res = await findAllMiningglossApi();
console.log(res); // console.log(res);
}, },
// //
async getMouthLoss() { async getMouthLoss() {
@ -30,80 +48,15 @@ export default {
const res = await findTotalMiningByMonthApi(data); const res = await findTotalMiningByMonthApi(data);
console.log(res); console.log(res);
}, },
removeDataById(id) { //
ElMessageBox.confirm("此操作将永久删除降水量记录,是否继续?", "提示", { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
confirmButtonText: "确定", if (columnIndex === 0) {
cancelButtonText: "取消", if (rowIndex === 12) {
type: "warning", return {
}) rowspan: 1,
.then(() => { colspan: 1,
deletePrecipitation(id).then(() => { };
// }
ElMessage({
type: "success",
message: "删除成功!",
});
//
this.getList();
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除",
});
});
},
handleAdd() {
this.isEdit = false; //
this.precipitationform = { plateRange: "" }; //
this.updateprecipitationform = true; //
},
handleEdit(id) {
this.isEdit = true;
findPrecipitationById(id)
.then((Response) => {
this.precipitationform = Response.data.precipitationById;
console.log(this.precipitationform);
this.updateprecipitationform = true;
})
.catch(() => {
ElMessage.error("查询失败,请稍后重试");
});
},
formatMonth(dateTime) {
if (!dateTime) return "-";
return dateTime.slice(0, 7); // "yyyy-MM"
// dayjs
// return dayjs(dateTime).format('YYYY-MM');
},
updatePrecipitation() {
if (this.isEdit) {
updatePrecipitationApi(this.precipitationform)
.then(() => {
ElMessage({
type: "success",
message: "修改成功!",
});
this.updateprecipitationform = false;
this.getList();
})
.catch(() => {
ElMessage.error("修改失败,请稍后重试");
});
} else {
addPrecipitationApi(this.precipitationform)
.then(() => {
ElMessage({
type: "success",
message: "新增成功!",
});
this.updateprecipitationform = false;
this.getList();
})
.catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
} }
}, },
}, },
@ -127,67 +80,60 @@ export default {
:data="tableList" :data="tableList"
border border
style="width: 100%" style="width: 100%"
:span-method="spanMethod" :span-method="objectSpanMethod"
:header-align="center" :header-align="center"
:cell-style="rowStyle" :cell-style="rowStyle"
> >
<!-- 表格列定义 --> <el-table-column
<el-table-column align="center" prop="amount" label="平盘(m)" /> align="center"
<el-table-column align="center" prop="amount" label="铲号(#)" /> prop="projectName"
<el-table-column align="center" prop="amount" label="出矿量(t)" /> fixed
<el-table-column align="center" prop="amount" label="剥离量(t)" /> label="项目"
<el-table-column align="center" prop="amount" label="采剥总量(t)" /> ></el-table-column>
<el-table-column align="center" prop="amount" label="计量单位" /> <el-table-column
<el-table-column align="center" prop="amount" label="月份" /> align="center"
<el-table-column align="center" fixed="right" label="操作" width="300"> prop="unit"
<template #default="scope"> label="单位"
<div style="display: flex; justify-content: center; gap: 8px"> ></el-table-column>
<el-button <el-table-column align="center" prop="amount" label="月份">
type="primary" <el-table-column
size="small" align="center"
@click="handleEdit(scope.row.precipID)" prop="month.plan"
> label="计划"
修改 ></el-table-column>
</el-button> <el-table-column
<el-button align="center"
type="danger" prop="month.actual"
size="small" label="实际"
@click="removeDataById(scope.row.precipID)" ></el-table-column>
> <el-table-column
删除 align="center"
</el-button> prop="month.percentage"
</div> label="%"
</template> ></el-table-column>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="amount" label="一月份累计">
<el-table-column
align="center"
prop="cumulativeForMonth.plan"
label="计划"
></el-table-column>
<el-table-column
align="center"
prop="cumulativeForMonth.actual"
label="实际"
></el-table-column>
<el-table-column
align="center"
prop="cumulativeForMonth.percentage"
label="%"
></el-table-column>
</el-table-column>
<el-table-column
align="center"
prop="notes"
label="备注"
></el-table-column>
</el-table> </el-table>
<el-dialog
v-model="updateprecipitationform"
title="修改降水量信息"
width="500"
>
<el-form :model="precipitationform">
<el-form-item label="降水量" :label-width="formLabelWidth">
<el-input v-model="precipitationform.amount" autocomplete="off" />
</el-form-item>
<el-form-item label="计量单位" :label-width="formLabelWidth">
<el-input v-model="precipitationform.unit" autocomplete="off" />
</el-form-item>
<el-form-item label="月份" :label-width="formLabelWidth">
<el-date-picker
v-model="precipitationform.monthDate"
type="datetime"
placeholder="选择月份"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="updateprecipitationform = false"> 取消 </el-button>
<el-button type="primary" @click="updatePrecipitation">
提交
</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>

View File

@ -156,7 +156,7 @@ async function handleUserLogin(formEl) {
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
if (valid) { if (valid) {
loading.value = true; loading.value = true;
loginFormData.password = $md5(loginFormData.password); // loginFormData.password = $md5(loginFormData.password);
loginApi(loginFormData) loginApi(loginFormData)
.then(({ data }) => { .then(({ data }) => {
userStore.setToken(data.token); userStore.setToken(data.token);
@ -240,6 +240,7 @@ function updateCountdown() {
} }
// //
function forgetPwd() { function forgetPwd() {
forgetFormData.password = ''
isForgetPwd.value = true; isForgetPwd.value = true;
} }
watch(isDisabled, (newVal, oldVal) => { watch(isDisabled, (newVal, oldVal) => {
@ -258,7 +259,7 @@ watch(isDisabled, (newVal, oldVal) => {
<div class="title-left"> <div class="title-left">
<img src="@@/assets/images/layouts/img.png" /> <img src="@@/assets/images/layouts/img.png" />
</div> </div>
<div class="title-text">数据运营管理平台</div> <div class="title-text">智慧矿山数据管理平台</div>
</div> </div>
<div class="content"> <div class="content">
<el-form <el-form
@ -356,12 +357,12 @@ watch(isDisabled, (newVal, oldVal) => {
<el-link type="primary" @click="forgetPwd()">忘记密码 </el-link> <el-link type="primary" @click="forgetPwd()">忘记密码 </el-link>
</div> </div>
<div class="login-thirdprty"> <div class="login-thirdprty" v-if="!isForgetPwd">
<div class="css-1vli2z"></div> <div class="css-1vli2z"></div>
<div class="css-wna3id">其他方式登录</div> <div class="css-wna3id">其他方式登录</div>
<div class="css-1vli2z"></div> <div class="css-1vli2z"></div>
</div> </div>
<div class="iconAll"> <div class="iconAll" v-if="!isForgetPwd">
<button> <button>
<i class="iconfont icon-weixin"></i> <i class="iconfont icon-weixin"></i>
</button> </button>

View File

@ -35,8 +35,10 @@ declare module 'vue' {
ElMain: typeof import('element-plus/es')['ElMain'] ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']