全局调整:页码统一初始展示20条数据
新增:控制页面
This commit is contained in:
parent
900f5e5163
commit
bd8e12dcba
9
ui/dasadmin/src/api/backend/control/request.ts
Normal file
9
ui/dasadmin/src/api/backend/control/request.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
export const sendValueReq = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/api/node/link/deviceControl',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
@ -70,6 +70,16 @@ const staticRoutes: Array<RouteRecordRaw> = [
|
||||
name: 'univer',
|
||||
component: () => import('/@/views/backend/node/univer.vue'),
|
||||
},
|
||||
{
|
||||
path: adminBaseRoutePath +'/airBlower',
|
||||
name: 'airBlower',
|
||||
component: () => import('/@/views/backend/equipment/airBlower/index.vue'),
|
||||
},
|
||||
{
|
||||
path: adminBaseRoutePath +'/control',
|
||||
name: 'control',
|
||||
component: () => import('/@/views/backend/equipment/control/index.vue'),
|
||||
}
|
||||
]
|
||||
|
||||
const staticFiles: Record<string, Record<string, RouteRecordRaw>> = import.meta.glob('./static/*.ts', { eager: true })
|
||||
|
@ -960,7 +960,7 @@ const downLoadModel = () => {
|
||||
}
|
||||
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(10)
|
||||
const currentPageSize = ref(20)
|
||||
const pageTotal = ref(0)
|
||||
const pagePagination = ref([10, 20, 30])
|
||||
const getcurrentPage = () => {
|
||||
|
@ -379,9 +379,9 @@ const getInstitutionList = (data: getDataType = { name: null }) => {
|
||||
})
|
||||
}
|
||||
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [ 10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const pageTotal = ref(0)
|
||||
const originData = ref<getTreeDataReturnType[]>()
|
||||
const tableData = computed(() => {
|
||||
|
@ -203,9 +203,9 @@ const tableData = computed(() => {
|
||||
return originData.value?.slice(start, end)
|
||||
})
|
||||
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const pageTotal = ref(0)
|
||||
const originData = ref<tableDataType<authorityDataListType>[]>()
|
||||
const addClick = () => {
|
||||
|
@ -546,9 +546,9 @@ const selectUpdataName = (data: string) => {
|
||||
formUserUpData.profilePicture = data
|
||||
}
|
||||
// 分页
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [ 10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const handleSizeChange = (val: number) => {
|
||||
formQuery.pageSize = val
|
||||
RyUserQuery(formQuery)
|
||||
|
203
ui/dasadmin/src/views/backend/equipment/control/index.vue
Normal file
203
ui/dasadmin/src/views/backend/equipment/control/index.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="controlPage" v-loading="loading" element-loading-text="提交中...">
|
||||
<el-button type="primary" size="large" @click="backEquipment" class="backBtn">返回</el-button>
|
||||
<h1 class="pageName">设备服务调试</h1>
|
||||
<div class="control">
|
||||
<el-form :model="serviceType146Form" :rules="validData(146)" ref="serviceType146Ref">
|
||||
<el-row>
|
||||
<el-col :span="1" :offset="2">
|
||||
<div class="title">遥调</div>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<div class="center">
|
||||
<el-form-item label="服务名" prop="serviceName">
|
||||
<el-input v-model="serviceType146Form.serviceName" placehoder="请输入服务名"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-form-item label="设定值" prop="opValue">
|
||||
<el-select v-model="serviceType146Form.opValue" placeholder="请选择设定值">
|
||||
<el-option :value="0"></el-option>
|
||||
<el-option :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button type="primary" @click="submit(146)">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<br />
|
||||
<el-form :model="serviceType147Form" :rules="validData(147)" ref="serviceType147Ref">
|
||||
<el-row>
|
||||
<el-col :span="1" :offset="2">
|
||||
<div class="title">遥控</div>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<div class="center">
|
||||
<el-form-item label="服务名" prop="serviceName">
|
||||
<el-input v-model="serviceType147Form.serviceName" placehoder="请输入服务名"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-form-item label="设定值" prop="opValue">
|
||||
<el-input v-model="serviceType147Form.opValue" placeholder="请输入设定值"> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button type="primary" @click="submit(147)">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { sendValueReq } from '/@/api/backend/control/request'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { ElMessage, FormInstance } from 'element-plus'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const loading = ref(false)
|
||||
|
||||
const serviceType146Ref = ref<FormInstance>()
|
||||
const serviceType147Ref = ref<FormInstance>()
|
||||
const serviceType146Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
opValue: null,
|
||||
})
|
||||
|
||||
const serviceType147Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
opValue: null,
|
||||
})
|
||||
|
||||
const validData = (type: number) => {
|
||||
if (type === 146) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择操作值',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
}
|
||||
} else if (type === 147) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入操作值',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9]+$/,
|
||||
message: '请输入数字',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
const submit = (type: number) => {
|
||||
if (type === 146) {
|
||||
serviceType146Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType146Form.value)
|
||||
}
|
||||
})
|
||||
} else if (type === 147) {
|
||||
serviceType147Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType147Form.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const sendValue = (data: any) => {
|
||||
const val = JSON.parse(JSON.stringify(data))
|
||||
val.deviceId = route.query.deviceId
|
||||
sendValueReq(val)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
ElMessage.success('发送成功!')
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error('发送失败!')
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const backEquipment = () => {
|
||||
router.push({ path: route.query.prevPath as string })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.controlPage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// justify-content: center;
|
||||
font-size: 18px;
|
||||
.pageName {
|
||||
margin: 80px auto;
|
||||
margin-bottom: 200px;
|
||||
}
|
||||
.backBtn {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
.control {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -49,6 +49,8 @@
|
||||
<el-table-column property="model" label="规格型号" />
|
||||
<el-table-column property="address" label="操作">
|
||||
<template #default="scope">
|
||||
<span style="color: #0064aa; cursor: pointer" @click="openControl(scope)">调控 </span>
|
||||
<span style="color: #0064aa"> | </span>
|
||||
<span style="color: #0064aa; cursor: pointer" @click="viewDeviceDetails(scope)">查看 </span>
|
||||
<span style="color: #0064aa"> | </span>
|
||||
<span style="color: #0064aa; cursor: pointer" @click="deviceDeletion(scope)"> 删除 </span>
|
||||
@ -440,6 +442,10 @@ import { ElTable, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type Node from 'element-plus/es/components/tree/src/model/node'
|
||||
import { useAdminInfo } from '/@/stores/adminInfo'
|
||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
interface Tree {
|
||||
@ -615,9 +621,9 @@ const deviceTypeQuery = () => {
|
||||
}
|
||||
|
||||
// 分页
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [ 10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const handleSizeChange = (val: number) => {
|
||||
formQuery.pageSize = val
|
||||
deviceQuery(formQuery)
|
||||
@ -939,6 +945,16 @@ const Export = () => {
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
const openControl = (data: any) => {
|
||||
router.push({
|
||||
name: 'control',
|
||||
query: {
|
||||
deviceId: data.row.id,
|
||||
prevPath: route.path,
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -484,7 +484,7 @@ const submitLinkForm = () => {
|
||||
|
||||
const paginationOptions = reactive({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
pageSizes: [10, 20, 30],
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user