This commit is contained in:
parent
f314c04a59
commit
d32abcc51c
@ -1,7 +1,9 @@
|
||||
# 开发环境的环境变量(命名必须以 VITE_ 开头)
|
||||
|
||||
## 后端接口地址(如果解决跨域问题采用反向代理就只需写相对路径)
|
||||
VITE_BASE_URL = /api/v1
|
||||
## VITE_BASE_URL = /api/v1
|
||||
|
||||
VITE_BASE_URL = http://localhost:8000
|
||||
|
||||
## 开发环境域名和静态资源公共路径(一般 / 或 ./ 都可以)
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
11
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
11
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,11 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/v3-admin-vite.iml" filepath="$PROJECT_DIR$/.idea/v3-admin-vite.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
12
.idea/v3-admin-vite.iml
generated
Normal file
12
.idea/v3-admin-vite.iml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
34
src/common/apis/tables/diceke/DicekeMiningrecord.ts
Normal file
34
src/common/apis/tables/diceke/DicekeMiningrecord.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { request } from "@/http/axios"
|
||||
|
||||
/** 查 */
|
||||
export function findAllMiningrecord() {
|
||||
return request({
|
||||
url: "/dicekeMiningrecord/findAllMiningrecord",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 删 */
|
||||
export function deletedicekeMiningrecord(recordID: number) {
|
||||
return request({
|
||||
url: `/dicekeMiningrecord/deletedicekeMiningrecord/${recordID}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据id查平盘信息 */
|
||||
export function finddicekeMiningrecordById(id: number) {
|
||||
return request({
|
||||
url: `/dicekeMiningrecord/finddicekeMiningrecordById/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改盘信息 */
|
||||
export function updatedicekeMiningrecord(dicekeMiningrecordform: any) {
|
||||
return request({
|
||||
url: `/dicekeMiningrecord/updatedicekeMiningrecord`,
|
||||
method: "post",
|
||||
data: dicekeMiningrecordform
|
||||
})
|
||||
}
|
34
src/common/apis/tables/diceke/plateArea.ts
Normal file
34
src/common/apis/tables/diceke/plateArea.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { request } from "@/http/axios"
|
||||
|
||||
/** 查 */
|
||||
export function findAllPlateArea() {
|
||||
return request({
|
||||
url: "/dicekePlatearea/findAllPlateArea",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 删 */
|
||||
export function deletePlateArea(id: number) {
|
||||
return request({
|
||||
url: `/dicekePlatearea/deletePlateArea/${id}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据id查平盘信息 */
|
||||
export function findPlateAreaById(id: number) {
|
||||
return request({
|
||||
url: `/dicekePlatearea/findPlateAreaById/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改盘信息 */
|
||||
export function updatePlateAreaApi(plateAreaform: any) {
|
||||
return request({
|
||||
url: `/dicekePlatearea/updatePlateArea`,
|
||||
method: "post",
|
||||
data: plateAreaform
|
||||
})
|
||||
}
|
34
src/common/apis/tables/diceke/shovel.ts
Normal file
34
src/common/apis/tables/diceke/shovel.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { request } from "@/http/axios"
|
||||
|
||||
/** 查 */
|
||||
export function findAllshovel() {
|
||||
return request({
|
||||
url: "/dicekeShovel/findAllShovel",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 删 */
|
||||
export function deleteTableDataApi(id: number) {
|
||||
return request({
|
||||
url: `/dicekeShovel/deleteShovel/${id}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据id查询电铲信息 */
|
||||
export function findShovelById(id: number) {
|
||||
return request({
|
||||
url: `/dicekeShovel/findShovelById/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改电铲信息 */
|
||||
export function updateshovelApi(shovelform: any) {
|
||||
return request({
|
||||
url: `/dicekeShovel/updateShovel`,
|
||||
method: "post",
|
||||
data: shovelform
|
||||
})
|
||||
}
|
@ -30,8 +30,17 @@ export function updateTableDataApi(data: Tables.CreateOrUpdateTableRequestData)
|
||||
/** 查 */
|
||||
export function getTableDataApi(params: Tables.TableRequestData) {
|
||||
return request<Tables.TableResponseData>({
|
||||
url: "tables",
|
||||
url: "findAll",
|
||||
// url: "tables",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
/** 查 */
|
||||
export function getTableData() {
|
||||
return request<Tables.TableResponseData>({
|
||||
url: "renshi/renyuanjiegou/findAll",
|
||||
// url: "tables",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
BIN
src/common/assets/images/layouts/img.png
Normal file
BIN
src/common/assets/images/layouts/img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
BIN
src/common/assets/images/layouts/login_background.jpg
Normal file
BIN
src/common/assets/images/layouts/login_background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 171 KiB |
BIN
src/common/assets/images/layouts/logo_text-3.png
Normal file
BIN
src/common/assets/images/layouts/logo_text-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -37,7 +37,7 @@ function createInstance() {
|
||||
return Promise.reject(new Error("非本系统的接口"))
|
||||
}
|
||||
switch (code) {
|
||||
case 0:
|
||||
case 20000:
|
||||
// 本系统采用 code === 0 来表示没有业务错误
|
||||
return apiData
|
||||
case 401:
|
||||
|
137
src/pages/demo/diceke/DicekeMiningrecord.vue
Normal file
137
src/pages/demo/diceke/DicekeMiningrecord.vue
Normal file
@ -0,0 +1,137 @@
|
||||
<script>
|
||||
import {
|
||||
deletedicekeMiningrecord,
|
||||
findAllMiningrecord,
|
||||
finddicekeMiningrecordById
|
||||
} from "@@/apis/tables/diceke/DicekeMiningrecord.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dicekeMiningrecordQuery: null,
|
||||
updatedicekeMiningrecordform: false,
|
||||
dicekeMiningrecordform: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
findAllMiningrecord().then((Response) => {
|
||||
console.log(Response)
|
||||
this.dicekeMiningrecordQuery = Response.data.dicekeMiningrecordVoList
|
||||
console.log(this.dicekeMiningrecordQuery)
|
||||
})
|
||||
},
|
||||
// 删除平盘
|
||||
removeDataById(id) {
|
||||
ElMessageBox.confirm(
|
||||
"此操作将永久删除平盘记录,是否继续?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deletedicekeMiningrecord(id).then(() => {
|
||||
// 删除成功
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功!"
|
||||
})
|
||||
// 重新加载列表
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "info",
|
||||
message: "已取消删除"
|
||||
})
|
||||
})
|
||||
},
|
||||
handleEdit(id) {
|
||||
finddicekeMiningrecordById(id).then((Response) => {
|
||||
this.dicekeMiningrecordform = Response.data.dicekeMiningrecordServiceById
|
||||
this.updatedicekeMiningrecordform = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-table :data="dicekeMiningrecordQuery" border style="width: 100%" :span-method="spanMethod">
|
||||
<!-- 表格列定义 -->
|
||||
<el-table-column prop="plateRange" label="平盘(#)" />
|
||||
<el-table-column prop="shovelCode" label="铲号(#)" />
|
||||
<el-table-column prop="totalMiningTon" label="采矿量(t)" />
|
||||
<el-table-column prop="metalTon" label="金属量(#)" />
|
||||
<el-table-column prop="miningGrade" label="块段采矿品位(%)" />
|
||||
<el-table-column prop="oxidationRate" label="块段氧化率(%)" />
|
||||
<el-table-column prop="avgGrade" label="全月平均品位(%)" />
|
||||
<el-table-column prop="dressingGrade" label="选矿平均品位(%)" />
|
||||
<el-table-column prop="avgOxidationRate" label="全月平均氧化率(%)" />
|
||||
<el-table-column prop="beizhu" label="备注" />
|
||||
<el-table-column fixed="right" label="操作" width="150" align="center">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; justify-content: center; gap: 8px;">
|
||||
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.recordID)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text bg size="small"
|
||||
@click="removeDataById(scope.row.recordID)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog v-model="updatedicekeMiningrecordform" title="修改Mo品味信息" width="500">
|
||||
<el-form :model="dicekeMiningrecordform">
|
||||
<el-form-item label="采矿量(t)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.totalMiningTon" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="金属量(#)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.metalTon" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="块段采矿品位(%)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.miningGrade" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="块段氧化率(%)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.oxidationRate" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="全月平均品位(%)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.avgGrade" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="选矿平均品位(%)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.dressingGrade" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="全月平均氧化率(%)" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.avgOxidationRate" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" :label-width="formLabelWidth">
|
||||
<el-input v-model="dicekeMiningrecordform.beizhu" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="updatedicekeMiningrecordform = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="updatePlateArea">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
122
src/pages/demo/diceke/PlateArea.vue
Normal file
122
src/pages/demo/diceke/PlateArea.vue
Normal file
@ -0,0 +1,122 @@
|
||||
<script>
|
||||
import {
|
||||
deletePlateArea,
|
||||
findAllPlateArea,
|
||||
findPlateAreaById,
|
||||
updatePlateAreaApi
|
||||
} from "@@/apis/tables/diceke/plateArea.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
plateAreaQuerry: null, // 电铲平台数据
|
||||
updatePlateAreaform: false,
|
||||
plateAreaform: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
findAllPlateArea().then((Response) => {
|
||||
console.log(Response)
|
||||
this.plateAreaQuerry = Response.data.plateArea
|
||||
})
|
||||
},
|
||||
// 删除平盘
|
||||
removeDataById(id) {
|
||||
ElMessageBox.confirm(
|
||||
"此操作将永久删除平盘记录,是否继续?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deletePlateArea(id).then(() => {
|
||||
// 删除成功
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功!"
|
||||
})
|
||||
// 重新加载列表
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "info",
|
||||
message: "已取消删除"
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 修改平盘信息 */
|
||||
handleEdit(id) {
|
||||
findPlateAreaById(id).then((Response) => {
|
||||
this.plateAreaform = Response.data.dicekePlatearea
|
||||
this.updatePlateAreaform = true
|
||||
}).catch(() => {
|
||||
ElMessage.error("查询失败,请稍后重试")
|
||||
})
|
||||
},
|
||||
updatePlateArea() {
|
||||
updatePlateAreaApi(this.plateAreaform).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "修改成功!"
|
||||
})
|
||||
this.updatePlateAreaform = false
|
||||
this.getList()
|
||||
}).catch(() => {
|
||||
ElMessage.error("修改失败,请稍后重试")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-table :data="plateAreaQuerry" border style="width: 100%" :span-method="spanMethod">
|
||||
<!-- 表格列定义 -->
|
||||
<el-table-column prop="plateRange" label="平盘(#)" />
|
||||
<el-table-column fixed="right" label="操作" width="300" align="center">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; justify-content: center; gap: 8px;">
|
||||
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.plateID)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text bg size="small"
|
||||
@click="removeDataById(scope.row.plateID)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog v-model="updatePlateAreaform" title="修改平盘信息" width="500">
|
||||
<el-form :model="plateAreaform">
|
||||
<el-form-item label="平盘名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="plateAreaform.plateRange" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="updatePlateAreaform = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="updatePlateArea">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
129
src/pages/demo/diceke/shovel.vue
Normal file
129
src/pages/demo/diceke/shovel.vue
Normal file
@ -0,0 +1,129 @@
|
||||
<script>
|
||||
import {
|
||||
deleteTableDataApi,
|
||||
findAllshovel,
|
||||
findShovelById,
|
||||
updateshovelApi
|
||||
} from "@@/apis/tables/diceke/shovel.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shovelQuerry: null, // 电铲平台数据
|
||||
shovelform: null,
|
||||
updateshovelform: false
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
findAllshovel().then((Response) => {
|
||||
console.log(Response)
|
||||
this.shovelQuerry = Response.data.shovel
|
||||
this.processData()
|
||||
})
|
||||
},
|
||||
// 删除电铲
|
||||
removeDataById(id) {
|
||||
ElMessageBox.confirm(
|
||||
"此操作将永久删除电铲记录,是否继续?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteTableDataApi(id).then(() => {
|
||||
// 删除成功
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功!"
|
||||
})
|
||||
// 重新加载列表
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "info",
|
||||
message: "已取消删除"
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 修改电铲信息 */
|
||||
handleEdit(id) {
|
||||
findShovelById(id).then((Response) => {
|
||||
this.shovelform = Response.data.dicekeShovel
|
||||
this.updateshovelform = true
|
||||
}).catch(() => {
|
||||
ElMessage.error("查询失败,请稍后重试")
|
||||
})
|
||||
},
|
||||
|
||||
updateshovel() {
|
||||
updateshovelApi(this.shovelform).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "修改成功!"
|
||||
})
|
||||
this.updateshovelform = false
|
||||
this.getList()
|
||||
}).catch(() => {
|
||||
ElMessage.error("修改失败,请稍后重试")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<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 fixed="right" label="操作" width="300" align="center">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; justify-content: center; gap: 8px;">
|
||||
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.shovelID)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text bg size="small"
|
||||
@click="removeDataById(scope.row.shovelID)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog v-model="updateshovelform" title="修改平盘信息" width="500">
|
||||
<el-form :model="shovelform">
|
||||
<el-form-item label="铲号" :label-width="formLabelWidth">
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="updateshovelform = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="updateshovel">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
134
src/pages/demo/rsgl/rsgl.vue
Normal file
134
src/pages/demo/rsgl/rsgl.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<script>
|
||||
import { getTableData } from "@/common/apis/tables"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rsqlQuerry: null, // 人事信息返回列表
|
||||
rsglsum: [] // 人数和返回列表
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getTableData().then((Response) => {
|
||||
console.log(Response)
|
||||
this.rsqlQuerry = Response.data.renyuanjiegou
|
||||
this.rsglsum = Response.data.RENYUANSUM
|
||||
console.log(this.rsqlQuerry)
|
||||
console.log(this.rsglsum)
|
||||
this.processData()
|
||||
})
|
||||
},
|
||||
// 处理数据,将合计数据添加到表格
|
||||
processData() {
|
||||
const newData = []
|
||||
let currentChangQu = "" // 用于跟踪当前厂区
|
||||
|
||||
// 遍历每一行数据
|
||||
this.rsqlQuerry.forEach((row, _index) => {
|
||||
// 只有当厂区发生变化时才添加合计行
|
||||
if (row.changQu !== currentChangQu) {
|
||||
if (currentChangQu !== "") {
|
||||
newData.push(this.createTotalRow(currentChangQu)) // 添加上一个厂区的合计行
|
||||
}
|
||||
currentChangQu = row.changQu // 更新当前厂区
|
||||
}
|
||||
|
||||
newData.push(row) // 添加普通数据行
|
||||
})
|
||||
|
||||
// 最后添加合计行
|
||||
if (currentChangQu) {
|
||||
newData.push(this.createTotalRow(currentChangQu)) // 添加最后一个厂区的合计行
|
||||
}
|
||||
|
||||
this.rsqlQuerry = newData // 更新表格数据
|
||||
},
|
||||
|
||||
// 创建合计行
|
||||
createTotalRow(changQu) {
|
||||
const totalData = this.rsglsum[`${changQu}合计`] || {} // 获取对应厂区的合计数据
|
||||
|
||||
return {
|
||||
changQu: `${changQu}合计`, // 厂区名称后加“合计”
|
||||
zongRenShu: totalData.zongRenShu || 0,
|
||||
guanLiRY: totalData.guanLiRY || 0,
|
||||
fuWuRY: totalData.fuWuRY || 0,
|
||||
zhuanYeJishuRY: totalData.zhuanYeJishuRY || 0,
|
||||
shenChanFZRY: totalData.shenChanFZRY || 0,
|
||||
laoWuRY: totalData.laoWuRY || 0
|
||||
// 其他字段也可以按需添加
|
||||
}
|
||||
},
|
||||
|
||||
// 表格合并行
|
||||
spanMethod({ rowIndex, columnIndex }) {
|
||||
const currentRow = this.rsqlQuerry[rowIndex]
|
||||
if (!currentRow) return { rowspan: 1, colspan: 1 }
|
||||
|
||||
// 处理合计行
|
||||
if (currentRow.changQu.endsWith("合计")) {
|
||||
return { rowspan: 1, colspan: 1 } // 合计行无需合并
|
||||
}
|
||||
|
||||
// “厂区”是第一列(index 0)
|
||||
if (columnIndex === 0) {
|
||||
const prevRow = this.rsqlQuerry[rowIndex - 1]
|
||||
|
||||
// 判断当前行和上一行的厂区字段是否相同
|
||||
if (rowIndex > 0 && currentRow.changQu === prevRow.changQu) {
|
||||
return { rowspan: 0, colspan: 1 } // 不显示当前行
|
||||
} else {
|
||||
let rowspan = 1
|
||||
// 计算连续相同值的行数
|
||||
for (let i = rowIndex + 1; i < this.rsqlQuerry.length; i++) {
|
||||
if (this.rsqlQuerry[i] && this.rsqlQuerry[i].changQu === currentRow.changQu) {
|
||||
rowspan++
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
return { rowspan, colspan: 1 } // 合并相同厂区的行
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="block">
|
||||
<span class="demonstration">请选择日期</span>
|
||||
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="monthrange"
|
||||
range-separator="To"
|
||||
start-placeholder="Start month"
|
||||
end-placeholder="End month"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="rsqlQuerry" border style="width: 100%" :span-method="spanMethod">
|
||||
<!-- 表格列定义 -->
|
||||
<el-table-column prop="changQu" label="厂区" />
|
||||
<el-table-column prop="buMen" label="部门" />
|
||||
<el-table-column prop="zongRenShu" label="总人数" />
|
||||
<el-table-column prop="guanLiRY" label="管理人员" />
|
||||
<el-table-column prop="zhuanYeJishuRY" label="专业技术人员" />
|
||||
<el-table-column prop="shenChanFZRY" label="生产辅助工人" />
|
||||
<el-table-column prop="fuWuRY" label="服务人员" />
|
||||
<el-table-column label="合计人数">
|
||||
<template #default="{ row }">
|
||||
{{ (row.zongRenShu || 0) - (row.laoWuRY || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="laoWuRY" label="劳务人员" />
|
||||
<el-table-column prop="beiZhu" label="备注" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
@ -4,7 +4,7 @@ import { request } from "@/http/axios"
|
||||
/** 获取登录验证码 */
|
||||
export function getCaptchaApi() {
|
||||
return request<Auth.CaptchaResponseData>({
|
||||
url: "auth/captcha",
|
||||
url: "users/captcha",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
@ -12,7 +12,7 @@ export function getCaptchaApi() {
|
||||
/** 登录并返回 Token */
|
||||
export function loginApi(data: Auth.LoginRequestData) {
|
||||
return request<Auth.LoginResponseData>({
|
||||
url: "auth/login",
|
||||
url: "users/login",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
|
@ -1,10 +1,8 @@
|
||||
export interface LoginRequestData {
|
||||
/** admin 或 editor */
|
||||
username: "admin" | "editor"
|
||||
username: ""
|
||||
/** 密码 */
|
||||
password: string
|
||||
/** 验证码 */
|
||||
code: string
|
||||
}
|
||||
|
||||
export type CaptchaResponseData = ApiResponseData<string>
|
||||
|
@ -4,8 +4,8 @@ import type { LoginRequestData } from "./apis/type"
|
||||
import { useSettingsStore } from "@/pinia/stores/settings"
|
||||
import { useUserStore } from "@/pinia/stores/user"
|
||||
import ThemeSwitch from "@@/components/ThemeSwitch/index.vue"
|
||||
import { Key, Loading, Lock, Picture, User } from "@element-plus/icons-vue"
|
||||
import { getCaptchaApi, loginApi } from "./apis"
|
||||
import { Lock, User } from "@element-plus/icons-vue"
|
||||
import { loginApi } from "./apis"
|
||||
import Owl from "./components/Owl.vue"
|
||||
import { useFocus } from "./composables/useFocus"
|
||||
|
||||
@ -23,14 +23,10 @@ const loginFormRef = ref<FormInstance | null>(null)
|
||||
/** 登录按钮 Loading */
|
||||
const loading = ref(false)
|
||||
|
||||
/** 验证码图片 URL */
|
||||
const codeUrl = ref("")
|
||||
|
||||
/** 登录表单数据 */
|
||||
const loginFormData: LoginRequestData = reactive({
|
||||
username: "admin",
|
||||
password: "12345678",
|
||||
code: ""
|
||||
password: "12345678"
|
||||
})
|
||||
|
||||
/** 登录表单校验规则 */
|
||||
@ -56,31 +52,16 @@ function handleLogin() {
|
||||
}
|
||||
loading.value = true
|
||||
loginApi(loginFormData).then(({ data }) => {
|
||||
console.log(data)
|
||||
userStore.setToken(data.token)
|
||||
router.push("/")
|
||||
}).catch(() => {
|
||||
createCode()
|
||||
loginFormData.password = ""
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/** 创建验证码 */
|
||||
function createCode() {
|
||||
// 清空已输入的验证码
|
||||
loginFormData.code = ""
|
||||
// 清空验证图片
|
||||
codeUrl.value = ""
|
||||
// 获取验证码图片
|
||||
getCaptchaApi().then((res) => {
|
||||
codeUrl.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化验证码
|
||||
createCode()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -89,14 +70,19 @@ createCode()
|
||||
<Owl :close-eyes="isFocus" />
|
||||
<div class="login-card">
|
||||
<div class="title">
|
||||
<img src="@@/assets/images/layouts/logo-text-2.png">
|
||||
<div class="title-left">
|
||||
<img src="@@/assets/images/layouts/img.png">
|
||||
</div>
|
||||
<div class="title-text">
|
||||
数据运营管理平台
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<el-form ref="loginFormRef" :model="loginFormData" :rules="loginFormRules" @keyup.enter="handleLogin">
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model.trim="loginFormData.username"
|
||||
placeholder="用户名"
|
||||
placeholder="用户名或手机号"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
:prefix-icon="User"
|
||||
@ -116,7 +102,7 @@ createCode()
|
||||
@focus="handleFocus"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code">
|
||||
<!-- <el-form-item prop="code">
|
||||
<el-input
|
||||
v-model.trim="loginFormData.code"
|
||||
placeholder="验证码"
|
||||
@ -143,7 +129,7 @@ createCode()
|
||||
</el-image>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-button :loading="loading" type="primary" size="large" @click.prevent="handleLogin">
|
||||
登 录
|
||||
</el-button>
|
||||
@ -161,6 +147,11 @@ createCode()
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
// 添加背景图片样式
|
||||
background-image: url("@@/assets/images/layouts/login_background.jpg"); // 修改为你的背景图路径
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
.theme-switch {
|
||||
position: fixed;
|
||||
top: 5%;
|
||||
@ -176,13 +167,27 @@ createCode()
|
||||
overflow: hidden;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: 150px;
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
max-height: 40px;
|
||||
width: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
margin-top: 10px;
|
||||
font-size: 30px;
|
||||
font-weight: 800;
|
||||
color: black;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20px 50px 50px 50px;
|
||||
:deep(.el-input-group__append) {
|
||||
|
@ -90,6 +90,15 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "rsgl",
|
||||
component: () => import("@/pages/demo/rsgl/rsgl.vue"),
|
||||
name: "RSgl",
|
||||
meta: {
|
||||
title: "RSgl",
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "vxe-table",
|
||||
component: () => import("@/pages/demo/vxe-table/index.vue"),
|
||||
@ -180,6 +189,42 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/diceke",
|
||||
component: Layouts,
|
||||
redirect: "/diceke",
|
||||
meta: {
|
||||
title: "地测科",
|
||||
elIcon: "Link"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "shovel",
|
||||
component: () => import("@/pages/demo/diceke/shovel.vue"),
|
||||
name: "shovel",
|
||||
meta: {
|
||||
title: "电铲维护"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "plateArea",
|
||||
component: () => import("@/pages/demo/diceke/PlateArea.vue"),
|
||||
name: "plateArea",
|
||||
meta: {
|
||||
title: "平盘维护"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "dicekeMiningrecord",
|
||||
component: () => import("@/pages/demo/diceke/DicekeMiningrecord.vue"),
|
||||
name: "dicekeMiningrecord",
|
||||
meta: {
|
||||
title: "Mo品味报表"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
3
types/api.d.ts
vendored
3
types/api.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
/** 所有 api 接口的响应数据都应该准守该格式 */
|
||||
// 所有 api 接口的响应数据都应该准守该格式
|
||||
interface ApiResponseData<T> {
|
||||
success: boolean
|
||||
code: number
|
||||
data: T
|
||||
message: string
|
||||
|
2
types/auto/auto-imports.d.ts
vendored
2
types/auto/auto-imports.d.ts
vendored
@ -87,6 +87,6 @@ declare global {
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
}
|
||||
|
7
types/auto/components.d.ts
vendored
7
types/auto/components.d.ts
vendored
@ -16,10 +16,10 @@ declare module 'vue' {
|
||||
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
|
||||
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||
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']
|
||||
@ -33,18 +33,14 @@ declare module 'vue' {
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElLink: typeof import('element-plus/es')['ElLink']
|
||||
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']
|
||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
@ -52,7 +48,6 @@ declare module 'vue' {
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElText: typeof import('element-plus/es')['ElText']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
|
Loading…
x
Reference in New Issue
Block a user