你的提交信息
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled

This commit is contained in:
admin 2025-05-02 23:21:50 +08:00
parent d32abcc51c
commit d90a26dded
15 changed files with 221 additions and 280 deletions

6
.idea/jsLinters/eslint.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>

View File

@ -32,3 +32,12 @@ export function updatedicekeMiningrecord(dicekeMiningrecordform: any) {
data: dicekeMiningrecordform
})
}
/** 新增盘信息 */
export function adddicekeMiningrecord(dicekeMiningrecordform: any) {
return request({
url: `/dicekeMiningrecord/adddicekeMiningrecord`,
method: "post",
data: dicekeMiningrecordform
})
}

View File

@ -32,3 +32,12 @@ export function updatePlateAreaApi(plateAreaform: any) {
data: plateAreaform
})
}
export function addPlateAreaApi(plateAreaform: any) {
return request({
url: `/dicekePlatearea/addPlateArea`,
method: "post",
data: plateAreaform
})
}

View File

@ -32,3 +32,11 @@ export function updateshovelApi(shovelform: any) {
data: shovelform
})
}
export function addShovelApi(shovelform: any) {
return request({
url: `/dicekeShovel/addShovel`,
method: "post",
data: shovelform
})
}

View File

@ -1,39 +0,0 @@
/** 模拟接口响应数据 */
const SELECT_RESPONSE_DATA = {
code: 0,
data: [
{
label: "苹果",
value: 1
},
{
label: "香蕉",
value: 2
},
{
label: "橘子",
value: 3,
disabled: true
}
],
message: "获取 Select 数据成功"
}
const ERROR_MESSAGE = "接口发生错误"
/** 模拟接口 */
export function getSelectDataApi() {
return new Promise<typeof SELECT_RESPONSE_DATA>((resolve, reject) => {
// 模拟接口响应时间 2s
setTimeout(() => {
if (Math.random() < 0.8) {
// 模拟接口调用成功
resolve(SELECT_RESPONSE_DATA)
} else {
// 模拟接口调用出错
reject(new Error(ERROR_MESSAGE))
ElMessage.error(ERROR_MESSAGE)
}
}, 2000)
})
}

View File

@ -1,26 +0,0 @@
/** 模拟接口响应数据 */
const SUCCESS_RESPONSE_DATA = {
code: 0,
data: {
list: [] as number[]
},
message: "获取成功"
}
/** 模拟请求接口成功 */
export function getSuccessApi(list: number[]) {
return new Promise<typeof SUCCESS_RESPONSE_DATA>((resolve) => {
setTimeout(() => {
resolve({ ...SUCCESS_RESPONSE_DATA, data: { list } })
}, 1000)
})
}
/** 模拟请求接口失败 */
export function getErrorApi() {
return new Promise((_resolve, reject) => {
setTimeout(() => {
reject(new Error("发生错误"))
}, 1000)
})
}

View File

@ -1,30 +0,0 @@
<script lang="ts" setup>
import { useFetchSelect } from "@@/composables/useFetchSelect"
import { getSelectDataApi } from "./apis/use-fetch-select"
const { loading, options, value } = useFetchSelect({
api: getSelectDataApi
})
</script>
<template>
<div class="app-container">
<el-card shadow="never">
该示例是演示通过 composable 自动调用 api 后拿到 Select 组件需要的数据并传递给 Select 组件
</el-card>
<el-card header="Select 示例" shadow="never" v-loading="loading">
<el-select v-model="value" filterable>
<el-option v-for="(item, index) in options" v-bind="item" :key="index" placeholder="请选择" />
</el-select>
</el-card>
<el-card header="Select V2 示例(如果数据量过多,可以选择该组件)" shadow="never" v-loading="loading">
<el-select-v2 v-model="value" :options="options" filterable placeholder="请选择" />
</el-card>
</div>
</template>
<style lang="scss" scoped>
.el-card {
margin-bottom: 20px;
}
</style>

View File

@ -1,60 +0,0 @@
<script lang="ts" setup>
import { useFullscreenLoading } from "@@/composables/useFullscreenLoading"
import { getErrorApi, getSuccessApi } from "./apis/use-fullscreen-loading"
const svg = `
<path class="path" d="
M 30 15
L 28 17
M 25.61 25.61
A 15 15, 0, 0, 1, 15 30
A 15 15, 0, 1, 1, 27.99 7.5
L 15 15
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
`
const options = {
text: "即将发生错误...",
background: "#F56C6C20",
svg,
svgViewBox: "-10, -10, 50, 50"
}
async function querySuccess() {
//
// 1. getSuccessApi
// 2. getSuccessApi getSuccessApi
const res = await useFullscreenLoading(getSuccessApi)([1, 2, 3])
ElMessage.success(`${res.message},传参为 ${res.data.list.toString()}`)
}
async function queryError() {
try {
await useFullscreenLoading(getErrorApi, options)()
} catch (error) {
ElMessage.error((error as Error).message)
}
}
</script>
<template>
<div class="app-container">
<el-card shadow="never">
该示例是演示通过将要执行的函数传递给 composable composable 自动开启全屏 loading函数执行结束后自动关闭 loading
</el-card>
<el-card header="示例" shadow="never">
<el-button type="primary" @click="querySuccess">
查询成功
</el-button>
<el-button type="danger" @click="queryError">
查询失败
</el-button>
</el-card>
</div>
</template>
<style lang="scss" scoped>
.el-card {
margin-bottom: 20px;
}
</style>

View File

@ -1,59 +0,0 @@
<script lang="ts" setup>
import { useWatermark } from "@@/composables/useWatermark"
const localRef = ref<HTMLElement | null>(null)
const { setWatermark, clearWatermark } = useWatermark(localRef)
const { setWatermark: setGlobalWatermark, clearWatermark: clearGlobalWatermark } = useWatermark()
</script>
<template>
<div class="app-container">
<el-card shadow="never">
该示例是演示通过调用 composable 开启或关闭水印
支持局部全局自定义样式颜色透明度字体大小字体倾斜角度等并自带防御防删防隐藏和自适应功能
</el-card>
<el-card header="示例" shadow="never">
<div ref="localRef" class="local" />
<template #footer>
<el-button-group>
<el-button type="primary" @click="setWatermark('局部水印', { color: '#409eff' })">
创建局部水印
</el-button>
<el-button type="warning" @click="setWatermark('没有防御功能的局部水印', { color: '#e6a23c', defense: false })">
创建无防御局部水印
</el-button>
<el-button type="danger" @click="clearWatermark">
清除局部水印
</el-button>
</el-button-group>
<el-button-group>
<el-button type="primary" @click="setGlobalWatermark('全局水印', { color: '#409eff' })">
创建全局水印
</el-button>
<el-button type="warning" @click="setGlobalWatermark('没有防御功能的全局水印', { color: '#e6a23c', defense: false })">
创建无防御全局水印
</el-button>
<el-button type="danger" @click="clearGlobalWatermark">
清除全局水印
</el-button>
</el-button-group>
</template>
</el-card>
</div>
</template>
<style lang="scss" scoped>
.el-card {
margin-bottom: 20px;
}
.local {
height: 35vh;
border: 2px dashed var(--el-color-primary);
}
.el-button-group {
margin-right: 12px;
margin-bottom: 5px;
}
</style>

View File

@ -1,16 +1,21 @@
<script>
import {
adddicekeMiningrecord,
deletedicekeMiningrecord,
findAllMiningrecord,
finddicekeMiningrecordById
finddicekeMiningrecordById, updatedicekeMiningrecord
} from "@@/apis/tables/diceke/DicekeMiningrecord.js"
import {findAllPlateArea} from "@@/apis/tables/diceke/plateArea.js";
import {findAllshovel} from "@@/apis/tables/diceke/shovel.js";
export default {
data() {
return {
dicekeMiningrecordQuery: null,
updatedicekeMiningrecordform: false,
dicekeMiningrecordform: null
dicekeMiningrecordform: null,
plateAreaQuerry: null,
shovelQuerry: null
}
},
created() {
@ -54,11 +59,69 @@ export default {
})
})
},
handleAdd() {
this.isEdit = false;
this.dicekeMiningrecordform = {
shovelID: null,
plateID: null,
totalMiningTon: '',
metalTon: '',
miningGrade: '',
oxidationRate: '',
avgGrade: '',
dressingGrade: '',
avgOxidationRate: '',
beizhu: ''
}; //
//
Promise.all([findAllPlateArea(), findAllshovel()])
.then(([plateAreaResponse, shovelResponse]) => {
this.plateAreaQuerry = plateAreaResponse.data.plateArea;
this.shovelQuerry = shovelResponse.data.shovel;
this.updatedicekeMiningrecordform = true; //
})
.catch(() => {
ElMessage.error("加载平盘和电产信息失败,请稍后重试");
});
this.updatedicekeMiningrecordform = true;
},
handleEdit(id) {
this.isEdit = true
finddicekeMiningrecordById(id).then((Response) => {
this.dicekeMiningrecordform = Response.data.dicekeMiningrecordServiceById
this.updatedicekeMiningrecordform = true
})
findAllPlateArea().then((Response)=>{
this.plateAreaQuerry = Response.data.plateArea
})
findAllshovel().then((Response)=>{
this.shovelQuerry = Response.data.shovel
})
},
updatePlateArea(){
if (this.isEdit){
updatedicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
})
this.updatedicekeMiningrecordform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else{
adddicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
});
this.updatedicekeMiningrecordform = false;
this.getList(); //
}).catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
}
}
}
}
@ -66,6 +129,20 @@ export default {
<template>
<div class="app-container">
<div style="margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;">
<!-- 查询条件输入框 -->
<el-input v-model="searchQuery" placeholder="请输入铲号或平盘" style="width: 200px; margin-right: 10px;" />
<el-button type="primary" @click="searchData">查询</el-button>
<!-- 新增按钮 -->
<el-button
type="primary"
@click="handleAdd"
icon="el-icon-plus"
style="width: 100px; display: flex; justify-content: center; align-items: center;">
新增
</el-button>
</div>
<el-table :data="dicekeMiningrecordQuery" border style="width: 100%" :span-method="spanMethod">
<!-- 表格列定义 -->
<el-table-column prop="plateRange" label="平盘(#" />
@ -97,6 +174,17 @@ export default {
</el-table>
<el-dialog v-model="updatedicekeMiningrecordform" title="修改Mo品味信息" width="500">
<el-form :model="dicekeMiningrecordform">
<el-form-item label="电产" :label-width="formLabelWidth">
<el-select v-model="dicekeMiningrecordform.shovelID" placeholder="请选择电产">
<el-option v-for="shovel in shovelQuerry" :key="shovel.shovelID" :label="shovel.shovelCode" :value="shovel.shovelID" />
</el-select>
</el-form-item>
<el-form-item label="平盘" :label-width="formLabelWidth">
<el-select v-model="dicekeMiningrecordform.plateID" placeholder="请选择平盘">
<el-option v-for="plateArea in plateAreaQuerry" :key="plateArea.plateID" :label="plateArea.plateRange" :value="plateArea.plateID" />
</el-select>
</el-form-item>
<el-form-item label="采矿量t" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.totalMiningTon" autocomplete="off" />
</el-form-item>

View File

@ -1,5 +1,6 @@
<script>
import {
addPlateAreaApi,
deletePlateArea,
findAllPlateArea,
findPlateAreaById,
@ -54,8 +55,14 @@ export default {
})
})
},
handleAdd() {
this.isEdit = false //
this.plateAreaform = { plateRange: '' } //
this.updatePlateAreaform = true //
},
/** 修改平盘信息 */
handleEdit(id) {
this.isEdit = true
findPlateAreaById(id).then((Response) => {
this.plateAreaform = Response.data.dicekePlatearea
this.updatePlateAreaform = true
@ -64,16 +71,30 @@ export default {
})
},
updatePlateArea() {
updatePlateAreaApi(this.plateAreaform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
if (this.isEdit){
updatePlateAreaApi(this.plateAreaform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
})
this.updatePlateAreaform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
this.updatePlateAreaform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else {
addPlateAreaApi(this.plateAreaform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
})
this.updatePlateAreaform = false
this.getList()
}).catch(() => {
ElMessage.error("新增失败,请稍后重试")
})
}
}
}
}
@ -81,6 +102,9 @@ export default {
<template>
<div class="app-container">
<div style="margin-bottom: 20px;">
<el-button type="primary" @click="handleAdd" icon="el-icon-plus">新增平盘</el-button>
</div>
<el-table :data="plateAreaQuerry" border style="width: 100%" :span-method="spanMethod">
<!-- 表格列定义 -->
<el-table-column prop="plateRange" label="平盘(#" />

View File

@ -1,5 +1,6 @@
<script>
import {
addShovelApi,
deleteTableDataApi,
findAllshovel,
findShovelById,
@ -24,7 +25,7 @@ export default {
findAllshovel().then((Response) => {
console.log(Response)
this.shovelQuerry = Response.data.shovel
this.processData()
console.log(this.shovelQuerry)
})
},
//
@ -56,38 +57,86 @@ export default {
})
})
},
//
handleAdd() {
this.isEdit = false
this.shovelform = { shovelCode: '', attribute: '1' }
this.updateshovelform = true //
},
/** 修改电铲信息 */
handleEdit(id) {
findShovelById(id).then((Response) => {
this.shovelform = Response.data.dicekeShovel
this.updateshovelform = true
}).catch(() => {
ElMessage.error("查询失败,请稍后重试")
})
this.isEdit = true
findShovelById(id).then((Response) => {
this.shovelform = Response.data.dicekeShovel
if (this.shovelform.attribute === 1) {
this.shovelform.attribute = '自营'
} else if (this.shovelform.attribute === 2) {
this.shovelform.attribute = '外委'
}
this.updateshovelform = true
}).catch(() => {
ElMessage.error("查询失败,请稍后重试")
})
},
updateshovel() {
updateshovelApi(this.shovelform).then(() => {
if (this.shovelform.attribute === '自营') {
this.shovelform.attribute = 1
} else if (this.shovelform.attribute === '外委') {
this.shovelform.attribute = 2
}
if(this.isEdit){
updateshovelApi(this.shovelform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
})
this.updateshovelform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else {
addShovelApi(this.shovelform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
type: "success",
message: "新增成功!"
})
this.updateshovelform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
ElMessage.error("新增失败,请稍后重试")
})
}
}
}
}
</script>
<template>
<div class="app-container">
<div style="margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;">
<div>
<el-input v-model="searchQuery" placeholder="请输入铲号" style="width: 200px; margin-right: 10px;" />
<el-button type="primary" @click="searchData">查询</el-button>
</div>
<!-- 新增按钮 -->
<el-button
type="primary"
@click="handleAdd"
icon="el-icon-plus"
style="width: 100px; display: flex; justify-content: center; align-items: center;">
新增
</el-button> </div>
<el-table :data="shovelQuerry" border style="width: 100%" :span-method="spanMethod">
<!-- 表格列定义 -->
<el-table-column prop="shovelCode" label="铲号(#" />
<el-table-column prop="attribute" label="属性" />
<el-table-column label="属性">
<template #default="scope">
<span>{{ scope.row.attribute === 1 ? '自营' : '外委' }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="300" align="center">
<template #default="scope">
<div style="display: flex; justify-content: center; gap: 8px;">
@ -111,7 +160,10 @@ export default {
<el-input v-model="shovelform.shovelCode" autocomplete="off" />
</el-form-item>
<el-form-item label="属性" :label-width="formLabelWidth">
<el-input v-model="shovelform.attribute" autocomplete="off" />
<el-select v-model="shovelform.attribute" placeholder="请选择属性">
<el-option label="自营" value="1"></el-option>
<el-option label="外委" value="2"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>

View File

@ -1,6 +1,6 @@
export interface LoginRequestData {
/** admin 或 editor */
username: ""
username: string
/** 密码 */
password: string
}

View File

@ -128,40 +128,6 @@ export const constantRoutes: RouteRecordRaw[] = [
}
}
]
},
{
path: "composable-demo",
redirect: "/demo/composable-demo/use-fetch-select",
name: "ComposableDemo",
meta: {
title: "组合式函数"
},
children: [
{
path: "use-fetch-select",
component: () => import("@/pages/demo/composable-demo/use-fetch-select.vue"),
name: "UseFetchSelect",
meta: {
title: "useFetchSelect"
}
},
{
path: "use-fullscreen-loading",
component: () => import("@/pages/demo/composable-demo/use-fullscreen-loading.vue"),
name: "UseFullscreenLoading",
meta: {
title: "useFullscreenLoading"
}
},
{
path: "use-watermark",
component: () => import("@/pages/demo/composable-demo/use-watermark.vue"),
name: "UseWatermark",
meta: {
title: "useWatermark"
}
}
]
}
]
},

View File

@ -8,7 +8,6 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBacktop: typeof import('element-plus/es')['ElBacktop']
@ -19,7 +18,6 @@ declare module 'vue' {
ElCard: typeof import('element-plus/es')['ElCard']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
@ -31,13 +29,11 @@ declare module 'vue' {
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
@ -52,7 +48,4 @@ declare module 'vue' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}