百度在线地图
This commit is contained in:
26
src/api/Business/index.ts
Normal file
26
src/api/Business/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 新增菜单接口
|
||||
export function addNode(data: any) {
|
||||
return createAxios({
|
||||
url: '/device-boot/node/addNode',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//修改前置机
|
||||
export function updateNode(data: any) {
|
||||
return createAxios({
|
||||
url: '/device-boot/node/updateNode',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//删除前置机
|
||||
export function delNode(data: any) {
|
||||
return createAxios({
|
||||
url: '/device-boot/node/delNode',
|
||||
method: 'post',
|
||||
params: { id: data }
|
||||
})
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 装置基础数据和模板数据
|
||||
export function getDeviceData(deviceId: string, type: string, lineId = '') {
|
||||
let form = new FormData()
|
||||
form.append('deviceId', deviceId)
|
||||
form.append('lineId', lineId)
|
||||
form.append('type', type)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/deviceData',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 更新组和指标关系
|
||||
export function getDevCapacity(devId: string) {
|
||||
let form = new FormData()
|
||||
form.append('id', devId)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/capacity/getDevCapacity',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 根据数据集获取指标数据
|
||||
export function getTargetById(id: string) {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csDataArray/getTargetById',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 更新组和指标关系
|
||||
export function updateGroArr(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csGroArr/updateGroArr',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 查询分组
|
||||
export function getGroup(dataSet: string) {
|
||||
let form = new FormData()
|
||||
form.append('dataSet', dataSet)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csGroup/getGroup',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
// 装置分组实时数据
|
||||
export function deviceHisData(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csGroup/deviceHistoryData',
|
||||
method: 'POST',
|
||||
data: Object.assign(
|
||||
{
|
||||
endTime: '',
|
||||
id: '',
|
||||
lineId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
startTime: ''
|
||||
},
|
||||
data
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// 装置分组历史数据
|
||||
export function deviceRtData(data: any) {
|
||||
let form = new FormData()
|
||||
form.append('id', data.id)
|
||||
form.append('lineId', data.lineId)
|
||||
form.append('pageNum', data.pageNum)
|
||||
form.append('pageSize', data.pageSize)
|
||||
form.append('searchValue', data.searchValue)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csGroup/deviceRtData',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 设备列表
|
||||
export function getDeviceTree() {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csLedger/deviceTree',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
// 监测点列表
|
||||
export function getLineTree() {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csLedger/lineTree',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 编辑设备模版
|
||||
export const AuditDevModel = (data:any) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/devmodel/AuditDevModel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 新增程序版本
|
||||
export const addEdData = (data) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/edData/addEdData',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
export const auditEdData = (data) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/edData/auditEdData',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 上传拓扑图模板监测点位置
|
||||
export const addLineTemplate = (data: any) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/lineTemplate/addLineTemplate',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
// 上传拓扑图
|
||||
export const uploadTopo = file => {
|
||||
let form = new FormData()
|
||||
form.append('file', file)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/topologyTemplate/uploadImage',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询拓扑图模板
|
||||
export const getTopoTemplate = () => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/topologyTemplate/queryImage',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
//删除拓扑图模板
|
||||
export const deleteTopoTemplate = id => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/topologyTemplate/deleteImage',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
// 查询游客配置
|
||||
export const getVisitorConfig = () => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csTouristData/queryAll',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询营销人员未选择的工程
|
||||
*/
|
||||
export const queryEnginnerByUseId = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csMarketData/queryEnginnerByUseId',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 更新游客配置
|
||||
export const updateVisitorConfig = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csTouristData/add',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// * 根据用户获取营销数据
|
||||
export const queryByUseId = (data: any) => {
|
||||
return createAxios({
|
||||
url: 'cs-device-boot/csMarketData/queryByUseId',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// * 新增营销数据
|
||||
export const add = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csMarketData/add',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 移除营销数据
|
||||
*/
|
||||
export const removeMarketData = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/csMarketData/remove',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 查询设备数据趋势
|
||||
export function getDeviceDataTrend(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/datatrend/querydatatrend',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 更新组和指标关系
|
||||
export function queryCommonStatisticalByTime(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/stable/queryCommonStatisticalByTime',
|
||||
method: 'post',
|
||||
data: Object.assign(
|
||||
{
|
||||
devId: '',
|
||||
endTime: '',
|
||||
frequency: '',
|
||||
startTime: '',
|
||||
statisticalId: '',
|
||||
valueType: '',
|
||||
},
|
||||
data
|
||||
),
|
||||
})
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 查询app个人中心信息详情
|
||||
* @param id
|
||||
*/
|
||||
export const queryAppInfo = (type: string) => {
|
||||
let form = new FormData()
|
||||
form.append('type', type)
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/appinfo/queryAppInfoByType',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增app基础信息
|
||||
**/
|
||||
export const addAppInfo = (data: { type: string, content: string }) => {
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/appinfo/addAppInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
// 新增出厂设备
|
||||
export const addEquipmentDelivery = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/addEquipmentDelivery',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除出厂设备
|
||||
export const deleteEquipmentDelivery = (id: any) => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/AuditEquipmentDelivery',
|
||||
method: 'POST',
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
// 恢复出厂设置
|
||||
export const resetEquipmentDelivery = (id: any) => {
|
||||
let form = new FormData()
|
||||
form.append('nDid', id)
|
||||
return createAxios({
|
||||
url: '/access-boot/device/resetFactory',
|
||||
method: 'POST',
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑出厂设备
|
||||
|
||||
export const editEquipmentDelivery = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/updateEquipmentDelivery',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 上传拓扑图
|
||||
export const uploadTopo = (file: any) => {
|
||||
let form = new FormData()
|
||||
form.append('file', file)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/topologyTemplate/uploadImage',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: form
|
||||
})
|
||||
}
|
||||
// 批量导入设备
|
||||
export const batchImportDevice = (file: any) => {
|
||||
let form = new FormData()
|
||||
form.append('file', file)
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/importEquipment',
|
||||
method: 'POST',
|
||||
responseType: 'blob',
|
||||
data: form
|
||||
})
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 更新问题状态
|
||||
export function auditFeedBack(data:any) {
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/feedback/auditFeedBack',
|
||||
method: 'post',
|
||||
params:data
|
||||
})
|
||||
}
|
||||
12
src/main.ts
12
src/main.ts
@@ -14,20 +14,18 @@ import '@fortawesome/fontawesome-free/css/all.css'
|
||||
import '@/styles/index.scss'
|
||||
import '@/assets/font/iconfont.css'
|
||||
import { ElDialog } from 'element-plus'
|
||||
// 引入vue-amap
|
||||
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap'
|
||||
import '@vuemap/vue-amap/dist/style.css'
|
||||
import BaiduMap from 'vue-baidu-map-3x'
|
||||
|
||||
window.XEUtils = XEUtils
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
initAMapApiLoader({
|
||||
key:'',
|
||||
offline: true
|
||||
app.use(BaiduMap, {
|
||||
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN'
|
||||
// type: 'WebGL' // ||API 默认API (使用此模式 BMap=BMapGL)
|
||||
})
|
||||
app.use(router)
|
||||
app.use(pinia)
|
||||
app.use(VueAMap)
|
||||
app.use(ElementPlus)
|
||||
app.use(VXETable)
|
||||
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
||||
|
||||
286
src/views/pms/Business/terminal/pre.vue
Normal file
286
src/views/pms/Business/terminal/pre.vue
Normal file
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="前置等级">
|
||||
<el-select v-model="tableStore.table.params.nodeGrade" clearable placeholder="请选择前置等级">
|
||||
<el-option v-for="item in fontdveoption" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择状态">
|
||||
<el-option v-for="item in statusoption" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"></Table>
|
||||
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
v-model="dialogFormVisible"
|
||||
:close-on-click-modal="false"
|
||||
class="cn-operate-dialog"
|
||||
:before-close="resetForm"
|
||||
>
|
||||
<el-form :model="formData" label-width="120px" :rules="rules" ref="ruleFormRef">
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP:" prop="ip" class="top">
|
||||
<el-input v-model="formData.ip" placeholder="请输入Ip"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级:" prop="nodeGrade" class="top">
|
||||
<el-select v-model="formData.nodeGrade" placeholder="请选择等级" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in fontdveoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大装置数:" prop="nodeDevNum" class="top">
|
||||
<el-input
|
||||
v-model="formData.nodeDevNum"
|
||||
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
||||
maxlength="5"
|
||||
placeholder="请输入最大装置数"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序:" prop="sort" class="top">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="remark" class="top">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
type="textarea"
|
||||
placeholder="请输入描述"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="resetForm">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||
import { addNode, delNode, updateNode } from '@/api/Business'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/log/debug'
|
||||
})
|
||||
|
||||
const fontdveoption: any = ref([
|
||||
{ id: 0, name: '极重要' },
|
||||
{ id: 1, name: '普通' },
|
||||
{ id: 2, name: '备用' }
|
||||
])
|
||||
const statusoption: any = ref([
|
||||
{ id: 0, name: '未启用' },
|
||||
{ id: 1, name: '启用' }
|
||||
])
|
||||
|
||||
const ruleFormRef = ref()
|
||||
|
||||
const formData: any = ref({
|
||||
name: '',
|
||||
ip: '',
|
||||
nodeGrade: '',
|
||||
nodeDevNum: '',
|
||||
sort: '',
|
||||
remark: ''
|
||||
})
|
||||
const rules = reactive({
|
||||
name: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
|
||||
ip: [{ required: true, message: 'ip不可为空', trigger: 'blur' }],
|
||||
nodeGrade: [{ required: true, message: '等级不可为空', trigger: 'blur' }],
|
||||
nodeDevNum: [{ required: true, message: '最大装置数不可为空', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '排序不可为空', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '描述不可为空', trigger: 'blur' }]
|
||||
})
|
||||
const dialogFormVisible = ref(false)
|
||||
const dialogTitle = ref('新增前置机')
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/node/nodeList',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '名称', field: 'name' },
|
||||
{ title: 'IP', field: 'ip' },
|
||||
{
|
||||
title: '等级',
|
||||
field: 'nodeGrade',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'success',
|
||||
1: 'warning',
|
||||
2: 'info'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '极重要',
|
||||
1: '普通',
|
||||
2: '备用'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '最大监测点数量',
|
||||
field: 'nodeDevNum'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
field: 'sort'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未启用',
|
||||
1: '启用'
|
||||
}
|
||||
},
|
||||
{ title: '描述', field: 'remark' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
|
||||
click: async row => {
|
||||
dialogFormVisible.value = true
|
||||
dialogTitle.value = '前置机修改'
|
||||
formData.value = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
delNode(row.id).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
for (let key in tableStore.table.params) {
|
||||
if (tableStore.table.params[key] === '') {
|
||||
delete tableStore.table.params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
tableStore.table.params.orderBy = 'desc'
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
dialogFormVisible.value = true
|
||||
dialogTitle.value = '新增前置机'
|
||||
}
|
||||
|
||||
// 确认
|
||||
const onSubmit = () => {
|
||||
ruleFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
if (dialogTitle.value == '新增前置机') {
|
||||
addNode(formData.value).then(res => {
|
||||
ElMessage.success('新增前置机')
|
||||
resetForm()
|
||||
tableStore.onTableAction('search', {})
|
||||
})
|
||||
} else {
|
||||
updateNode(formData.value).then(res => {
|
||||
ElMessage.success('修改成功')
|
||||
resetForm()
|
||||
tableStore.onTableAction('search', {})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 清空表格
|
||||
const resetForm = () => {
|
||||
dialogFormVisible.value = false
|
||||
formData.value = {
|
||||
name: '',
|
||||
ip: '',
|
||||
nodeGrade: '',
|
||||
nodeDevNum: '',
|
||||
sort: '',
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 100)
|
||||
})
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.qrcode-label {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -99;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
flex-direction: column;
|
||||
|
||||
.qrcode-label-title {
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.qrcode-label-img {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,20 +1,32 @@
|
||||
<template>
|
||||
<el-amap :center="center" :zoom="zoom" style="height: 100%; width: 100%">
|
||||
<el-amap-layer-tile :tile-url="url" />
|
||||
</el-amap>
|
||||
<div style="padding: 10px">
|
||||
<baidu-map
|
||||
class="bm-view"
|
||||
:zoom="zoom"
|
||||
:center="{ lng: 116.404, lat: 39.915 }"
|
||||
@ready="handler"
|
||||
:style="height"
|
||||
></baidu-map>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElAmap, ElAmapLayerTile } from '@vuemap/vue-amap'
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const center = ref([121.59996, 31.197646])
|
||||
const zoom = ref(6)
|
||||
|
||||
const url = location.origin + '/map/[z]/[x]/[y]/tile.png'
|
||||
console.log('====================================')
|
||||
console.log(url)
|
||||
console.log('====================================')
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
const height = mainHeight(20)
|
||||
const zoom = ref(12)
|
||||
const center = ref({lng: 0, lat: 0});
|
||||
const handler = ({ BMap, map }: any) => {
|
||||
console.log(BMap, map)
|
||||
center.value.lng = 116.404
|
||||
center.value.lat = 39.915
|
||||
zoom.value = 15
|
||||
map.enableScrollWheelZoom(true)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style>
|
||||
.bm-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user