你的提交信息
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
d32abcc51c
commit
d90a26dded
6
.idea/jsLinters/eslint.xml
generated
Normal file
6
.idea/jsLinters/eslint.xml
generated
Normal 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>
|
@ -32,3 +32,12 @@ export function updatedicekeMiningrecord(dicekeMiningrecordform: any) {
|
|||||||
data: dicekeMiningrecordform
|
data: dicekeMiningrecordform
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 新增盘信息 */
|
||||||
|
export function adddicekeMiningrecord(dicekeMiningrecordform: any) {
|
||||||
|
return request({
|
||||||
|
url: `/dicekeMiningrecord/adddicekeMiningrecord`,
|
||||||
|
method: "post",
|
||||||
|
data: dicekeMiningrecordform
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -32,3 +32,12 @@ export function updatePlateAreaApi(plateAreaform: any) {
|
|||||||
data: plateAreaform
|
data: plateAreaform
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function addPlateAreaApi(plateAreaform: any) {
|
||||||
|
return request({
|
||||||
|
url: `/dicekePlatearea/addPlateArea`,
|
||||||
|
method: "post",
|
||||||
|
data: plateAreaform
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -32,3 +32,11 @@ export function updateshovelApi(shovelform: any) {
|
|||||||
data: shovelform
|
data: shovelform
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function addShovelApi(shovelform: any) {
|
||||||
|
return request({
|
||||||
|
url: `/dicekeShovel/addShovel`,
|
||||||
|
method: "post",
|
||||||
|
data: shovelform
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -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)
|
|
||||||
})
|
|
||||||
}
|
|
@ -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)
|
|
||||||
})
|
|
||||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,16 +1,21 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
|
adddicekeMiningrecord,
|
||||||
deletedicekeMiningrecord,
|
deletedicekeMiningrecord,
|
||||||
findAllMiningrecord,
|
findAllMiningrecord,
|
||||||
finddicekeMiningrecordById
|
finddicekeMiningrecordById, updatedicekeMiningrecord
|
||||||
} from "@@/apis/tables/diceke/DicekeMiningrecord.js"
|
} from "@@/apis/tables/diceke/DicekeMiningrecord.js"
|
||||||
|
import {findAllPlateArea} from "@@/apis/tables/diceke/plateArea.js";
|
||||||
|
import {findAllshovel} from "@@/apis/tables/diceke/shovel.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dicekeMiningrecordQuery: null,
|
dicekeMiningrecordQuery: null,
|
||||||
updatedicekeMiningrecordform: false,
|
updatedicekeMiningrecordform: false,
|
||||||
dicekeMiningrecordform: null
|
dicekeMiningrecordform: null,
|
||||||
|
plateAreaQuerry: null,
|
||||||
|
shovelQuerry: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
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) {
|
handleEdit(id) {
|
||||||
|
this.isEdit = true
|
||||||
finddicekeMiningrecordById(id).then((Response) => {
|
finddicekeMiningrecordById(id).then((Response) => {
|
||||||
this.dicekeMiningrecordform = Response.data.dicekeMiningrecordServiceById
|
this.dicekeMiningrecordform = Response.data.dicekeMiningrecordServiceById
|
||||||
this.updatedicekeMiningrecordform = true
|
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>
|
<template>
|
||||||
<div class="app-container">
|
<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 :data="dicekeMiningrecordQuery" border style="width: 100%" :span-method="spanMethod">
|
||||||
<!-- 表格列定义 -->
|
<!-- 表格列定义 -->
|
||||||
<el-table-column prop="plateRange" label="平盘(#)" />
|
<el-table-column prop="plateRange" label="平盘(#)" />
|
||||||
@ -97,6 +174,17 @@ export default {
|
|||||||
</el-table>
|
</el-table>
|
||||||
<el-dialog v-model="updatedicekeMiningrecordform" title="修改Mo品味信息" width="500">
|
<el-dialog v-model="updatedicekeMiningrecordform" title="修改Mo品味信息" width="500">
|
||||||
<el-form :model="dicekeMiningrecordform">
|
<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-form-item label="采矿量(t)" :label-width="formLabelWidth">
|
||||||
<el-input v-model="dicekeMiningrecordform.totalMiningTon" autocomplete="off" />
|
<el-input v-model="dicekeMiningrecordform.totalMiningTon" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
|
addPlateAreaApi,
|
||||||
deletePlateArea,
|
deletePlateArea,
|
||||||
findAllPlateArea,
|
findAllPlateArea,
|
||||||
findPlateAreaById,
|
findPlateAreaById,
|
||||||
@ -54,8 +55,14 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.isEdit = false // 设置为新增操作
|
||||||
|
this.plateAreaform = { plateRange: '' } // 初始化为空数据
|
||||||
|
this.updatePlateAreaform = true // 显示弹窗
|
||||||
|
},
|
||||||
/** 修改平盘信息 */
|
/** 修改平盘信息 */
|
||||||
handleEdit(id) {
|
handleEdit(id) {
|
||||||
|
this.isEdit = true
|
||||||
findPlateAreaById(id).then((Response) => {
|
findPlateAreaById(id).then((Response) => {
|
||||||
this.plateAreaform = Response.data.dicekePlatearea
|
this.plateAreaform = Response.data.dicekePlatearea
|
||||||
this.updatePlateAreaform = true
|
this.updatePlateAreaform = true
|
||||||
@ -64,6 +71,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updatePlateArea() {
|
updatePlateArea() {
|
||||||
|
if (this.isEdit){
|
||||||
updatePlateAreaApi(this.plateAreaform).then(() => {
|
updatePlateAreaApi(this.plateAreaform).then(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "success",
|
type: "success",
|
||||||
@ -74,6 +82,19 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error("修改失败,请稍后重试")
|
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>
|
<template>
|
||||||
<div class="app-container">
|
<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 :data="plateAreaQuerry" border style="width: 100%" :span-method="spanMethod">
|
||||||
<!-- 表格列定义 -->
|
<!-- 表格列定义 -->
|
||||||
<el-table-column prop="plateRange" label="平盘(#)" />
|
<el-table-column prop="plateRange" label="平盘(#)" />
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
|
addShovelApi,
|
||||||
deleteTableDataApi,
|
deleteTableDataApi,
|
||||||
findAllshovel,
|
findAllshovel,
|
||||||
findShovelById,
|
findShovelById,
|
||||||
@ -24,7 +25,7 @@ export default {
|
|||||||
findAllshovel().then((Response) => {
|
findAllshovel().then((Response) => {
|
||||||
console.log(Response)
|
console.log(Response)
|
||||||
this.shovelQuerry = Response.data.shovel
|
this.shovelQuerry = Response.data.shovel
|
||||||
this.processData()
|
console.log(this.shovelQuerry)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 删除电铲
|
// 删除电铲
|
||||||
@ -56,10 +57,22 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 新增电铲信息
|
||||||
|
handleAdd() {
|
||||||
|
this.isEdit = false
|
||||||
|
this.shovelform = { shovelCode: '', attribute: '1' }
|
||||||
|
this.updateshovelform = true // 显示弹窗
|
||||||
|
},
|
||||||
/** 修改电铲信息 */
|
/** 修改电铲信息 */
|
||||||
handleEdit(id) {
|
handleEdit(id) {
|
||||||
|
this.isEdit = true
|
||||||
findShovelById(id).then((Response) => {
|
findShovelById(id).then((Response) => {
|
||||||
this.shovelform = Response.data.dicekeShovel
|
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
|
this.updateshovelform = true
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error("查询失败,请稍后重试")
|
ElMessage.error("查询失败,请稍后重试")
|
||||||
@ -67,6 +80,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateshovel() {
|
updateshovel() {
|
||||||
|
|
||||||
|
if (this.shovelform.attribute === '自营') {
|
||||||
|
this.shovelform.attribute = 1
|
||||||
|
} else if (this.shovelform.attribute === '外委') {
|
||||||
|
this.shovelform.attribute = 2
|
||||||
|
}
|
||||||
|
if(this.isEdit){
|
||||||
updateshovelApi(this.shovelform).then(() => {
|
updateshovelApi(this.shovelform).then(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "success",
|
type: "success",
|
||||||
@ -77,6 +97,18 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error("修改失败,请稍后重试")
|
ElMessage.error("修改失败,请稍后重试")
|
||||||
})
|
})
|
||||||
|
}else {
|
||||||
|
addShovelApi(this.shovelform).then(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "新增成功!"
|
||||||
|
})
|
||||||
|
this.updateshovelform = false
|
||||||
|
this.getList()
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.error("新增失败,请稍后重试")
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,10 +116,27 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<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 :data="shovelQuerry" border style="width: 100%" :span-method="spanMethod">
|
||||||
<!-- 表格列定义 -->
|
<!-- 表格列定义 -->
|
||||||
<el-table-column prop="shovelCode" label="铲号(#)" />
|
<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">
|
<el-table-column fixed="right" label="操作" width="300" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div style="display: flex; justify-content: center; gap: 8px;">
|
<div style="display: flex; justify-content: center; gap: 8px;">
|
||||||
@ -111,7 +160,10 @@ export default {
|
|||||||
<el-input v-model="shovelform.shovelCode" autocomplete="off" />
|
<el-input v-model="shovelform.shovelCode" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="属性" :label-width="formLabelWidth">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export interface LoginRequestData {
|
export interface LoginRequestData {
|
||||||
/** admin 或 editor */
|
/** admin 或 editor */
|
||||||
username: ""
|
username: string
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
password: string
|
password: string
|
||||||
}
|
}
|
||||||
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
7
types/auto/components.d.ts
vendored
7
types/auto/components.d.ts
vendored
@ -8,7 +8,6 @@ export {}
|
|||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
|
||||||
ElAside: typeof import('element-plus/es')['ElAside']
|
ElAside: typeof import('element-plus/es')['ElAside']
|
||||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||||
ElBacktop: typeof import('element-plus/es')['ElBacktop']
|
ElBacktop: typeof import('element-plus/es')['ElBacktop']
|
||||||
@ -19,7 +18,6 @@ declare module 'vue' {
|
|||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||||
@ -31,13 +29,11 @@ declare module 'vue' {
|
|||||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||||
ElImage: typeof import('element-plus/es')['ElImage']
|
|
||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
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']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
||||||
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']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
@ -52,7 +48,4 @@ declare module 'vue' {
|
|||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
}
|
}
|
||||||
export interface ComponentCustomProperties {
|
|
||||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user