新增单风机静态页面
This commit is contained in:
parent
ded06566e9
commit
56b82f7233
@ -1,4 +1,12 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
//左侧树查询
|
||||
export function enumTreeQuery(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/enum/queryEnumTypesList',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
// 枚举类型新增
|
||||
export function enumTypeAdd(params: object = {}) {
|
||||
return createAxios({
|
||||
@ -8,6 +16,24 @@ export function enumTypeAdd(params: object = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑类型新增
|
||||
export function enumTypecurEdit(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/enum/updateEnumTypes',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 枚举类型删除
|
||||
export function enumTypeDelete(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/enum/deleteEnumTypes',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
//表格查询
|
||||
export function enumListQuery(params: object = {}) {
|
||||
return createAxios({
|
||||
@ -17,14 +43,7 @@ export function enumListQuery(params: object = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
//左侧树查询
|
||||
export function enumTreeQuery(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/enum/queryEnumTypesList',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 枚举值新增
|
||||
export function enumValueAdd(params: object = {}) {
|
||||
return createAxios({
|
||||
|
BIN
ui/dasadmin/src/assets/WindBlower/bg.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 623 KiB |
BIN
ui/dasadmin/src/assets/WindBlower/direction.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/direction.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
ui/dasadmin/src/assets/WindBlower/generator.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/generator.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
ui/dasadmin/src/assets/WindBlower/pitch.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/pitch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
ui/dasadmin/src/assets/WindBlower/power.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/power.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
BIN
ui/dasadmin/src/assets/WindBlower/speed.png
Normal file
BIN
ui/dasadmin/src/assets/WindBlower/speed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
1281
ui/dasadmin/src/views/backend/WindBlower/index.vue
Normal file
1281
ui/dasadmin/src/views/backend/WindBlower/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
@node-click="handleNodeClick"
|
||||
@node-contextmenu="enumContextMenu"
|
||||
/>
|
||||
|
||||
</el-main>
|
||||
@ -79,6 +80,31 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!--编辑枚举类型-->
|
||||
<el-dialog v-model="visibleTypeEdit" title="编辑枚举类型" width="500" :before-close="handleCloseTypeEdit">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
:model="formInlineEdit"
|
||||
:rules="rules"
|
||||
style="padding: 24px 40px; font-size: 14px; line-height: 1.5; word-wrap: break-word; font-size: 20px"
|
||||
>
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="formInlineEdit.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label=" 描述:">
|
||||
<el-input v-model="formInlineEdit.description" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visibleTypeEdit = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmitTypeEdit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!--新增枚举值-->
|
||||
<el-dialog v-model="visibleValueAdd" title="新增枚举值" width="500" :before-close="handleClosevalue">
|
||||
<el-form
|
||||
@ -155,21 +181,39 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<ContextMenu :pos="enumcontextMenuPos" v-model:visible="enumOperateVisible">
|
||||
<template #default>
|
||||
<div class="modelOperate">
|
||||
<el-button @click="enumTypeEdit(curnodeData)">修改</el-button>
|
||||
<el-popconfirm title="确认删除?" @confirm="delenumType">
|
||||
<template #reference>
|
||||
<el-button @click.stop>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</ContextMenu>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {nextTick, onMounted, reactive, ref} from 'vue'
|
||||
import { Search, Plus, CaretRight } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox, FormRules } from 'element-plus'
|
||||
import { Search, Plus } from '@element-plus/icons-vue'
|
||||
import { ElMessage, FormRules } from 'element-plus'
|
||||
import {
|
||||
enumListQuery,
|
||||
enumTreeQuery,
|
||||
enumTypeAdd,
|
||||
enumTypecurEdit,
|
||||
enumTypeDelete,
|
||||
enumValueAdd,
|
||||
enumValueDelete, enumValuepageEdit
|
||||
enumValueDelete,
|
||||
enumValuepageEdit
|
||||
} from "/@/api/backend/Enumeration/request";
|
||||
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'
|
||||
import {delModelReq} from "/@/api/backend/deviceModel/request";
|
||||
|
||||
|
||||
const activeName = ref('1')
|
||||
@ -179,7 +223,6 @@ interface Tree {
|
||||
enumDesc: string,
|
||||
}
|
||||
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'description',
|
||||
@ -236,13 +279,23 @@ const enumTreeTypeList = () => {
|
||||
})
|
||||
}
|
||||
const queryParameter = ref()
|
||||
const nodename = ref()
|
||||
const curnodeData=ref({
|
||||
id: '',
|
||||
description: '',
|
||||
name:''
|
||||
})
|
||||
const handleNodeClick = (data: any) => {
|
||||
queryParameter.value = data
|
||||
enumTypeId.value=data.id
|
||||
queryListData.enumTypeId=data.id,
|
||||
queryListData.description=queryName.value,
|
||||
queryListData.pageNum=currentPage.value,
|
||||
queryListData.enumTypeId=data.id
|
||||
queryListData.description=queryName.value
|
||||
queryListData.pageNum=currentPage.value
|
||||
queryListData.pageSize=currentPageSize.value
|
||||
nodename.value=data.description
|
||||
curnodeData.value.id=data.id
|
||||
curnodeData.value.name=data.name
|
||||
curnodeData.value.description=data.description
|
||||
queryenumValueMethod(queryListData)
|
||||
}
|
||||
|
||||
@ -492,6 +545,87 @@ const EditonSubmitvalue = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const visibleTypeEdit=ref(false)
|
||||
const formInlineEdit=reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
description: ''
|
||||
})
|
||||
const enumTypeEdit = (curnodeData) => {
|
||||
visibleTypeEdit.value=true
|
||||
formInlineEdit.id = curnodeData.id
|
||||
formInlineEdit.name = curnodeData.name
|
||||
formInlineEdit.description = curnodeData.description
|
||||
}
|
||||
const handleCloseTypeEdit = (done: () => void) => {
|
||||
visibleTypeEdit.value = false
|
||||
}
|
||||
|
||||
const onSubmitTypeEdit = () => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
enumTypecurEdit(formInlineEdit).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
enumTreeTypeList()
|
||||
ElMessage({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.msg,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
visibleTypeEdit.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const contextMenuTreeData=ref({
|
||||
id:'',
|
||||
name: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
const enumOperateVisible = ref(false)
|
||||
const enumcontextMenuPos = ref({
|
||||
x: 0,
|
||||
y: 0,
|
||||
})
|
||||
const enumContextMenu = (event: any,curnodeData) => {
|
||||
enumcontextMenuPos.value.x = event.pageX
|
||||
enumcontextMenuPos.value.y = event.pageY
|
||||
contextMenuTreeData.value = curnodeData
|
||||
if(nodename.value=="枚举类型配置"||nodename.value==undefined){
|
||||
enumOperateVisible.value = false
|
||||
}else{
|
||||
enumOperateVisible.value = true
|
||||
}
|
||||
}
|
||||
const delenumType = () => {
|
||||
enumTypeDelete({ id: contextMenuTreeData.value!.id! })
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
enumTreeTypeList()
|
||||
ElMessage({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.msg,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '删除失败')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
enumTreeTypeList()
|
||||
})
|
||||
@ -584,5 +718,16 @@ $paginationHeight: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.modelOperate{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
.el-button {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user