提交: 公共配置文件 调整
This commit is contained in:
parent
fcdcd9c804
commit
29f48b1271
|
@ -10,12 +10,11 @@
|
|||
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/iconfont.css">
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_2506643_9w119og75cs.css">
|
||||
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=aabc97a5e095102787d405719847ecf0"></script>
|
||||
|
||||
<script src="<%= BASE_URL %>js/config.js"></script>
|
||||
|
||||
<script src="https://webapi.amap.com/maps?v=1.4.15&key=aabc97a5e095102787d405719847ecf0&plugin=AMap.PlaceSearch"></script>
|
||||
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
|
||||
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=aabc97a5e095102787d405719847ecf0&plugin=AMap.Geocoder"></script>
|
||||
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<style>
|
||||
html,
|
||||
|
|
|
@ -1,50 +1,7 @@
|
|||
const env = process.env
|
||||
// 项目url 地址
|
||||
var iotPlatformUrl = ''; // 第三方云平台ur
|
||||
// iot.gkiiot.com 192.168.18.139
|
||||
var flowIotUrl = '';
|
||||
let iotWebSocketBaseUrl = ''
|
||||
let devLiveWebSocketBaseUrl = ''
|
||||
let sysWebSocket = 'ws://'
|
||||
let prodApi = '/prod-api';
|
||||
let wsProtocol = 'ws://';
|
||||
let iotWebSocketAlarmBaseUrl = ''
|
||||
let BaseUrl = ''
|
||||
|
||||
// 手动配置的地址
|
||||
var iotHost="192.168.10.241:32024"; // 海创iot 平台 host
|
||||
// var hrefHost = window.location.host;
|
||||
// let httpProtocol = window.location.protocol;
|
||||
var hrefHost = '192.168.18.139';
|
||||
let httpProtocol = 'http';
|
||||
|
||||
|
||||
if (env.NODE_ENV == 'development') {
|
||||
flowIotUrl = 'http://127.0.0.1:1880/#flow/'
|
||||
hrefHost = "192.168.18.139"
|
||||
BaseUrl = '/dev-api'
|
||||
} else if(env.NODE_ENV == 'production') {
|
||||
// if (hrefHost.indexOf('.gkiiot.com') >= 0) {
|
||||
// iotHost = 'iot.gkiiot.com'
|
||||
// }
|
||||
BaseUrl = httpProtocol + '//' + iotHost + prodApi
|
||||
if(httpProtocol.indexOf("https") > -1){
|
||||
sysWebSocket = 'wss://';
|
||||
}
|
||||
} else if(env.NODE_ENV == 'test') {
|
||||
}
|
||||
iotWebSocketAlarmBaseUrl = sysWebSocket + hrefHost + ':8899/ws/alarm/live'
|
||||
sysWebSocket = sysWebSocket + hrefHost + prodApi;
|
||||
iotWebSocketBaseUrl = sysWebSocket + '/ws/dev/up/'
|
||||
devLiveWebSocketBaseUrl = sysWebSocket + '/ws/dev/live/'
|
||||
iotPlatformUrl = 'http://' + iotHost + '/prod-api'
|
||||
|
||||
export {
|
||||
iotPlatformUrl,
|
||||
sysWebSocket,
|
||||
iotWebSocketBaseUrl,
|
||||
iotWebSocketAlarmBaseUrl,
|
||||
devLiveWebSocketBaseUrl,
|
||||
BaseUrl,
|
||||
prodApi
|
||||
window.dasConfig = {
|
||||
ip: '192.168.10.241',
|
||||
port: 32024,
|
||||
prodApi: '/prod-api',
|
||||
protocol: 'http://'
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listRegion(query) {
|
||||
return request({
|
||||
url: '/system/region/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getRegion(regionCode) {
|
||||
return request({
|
||||
url: '/system/region/' + regionCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增【请填写功能名称】
|
||||
export function addRegion(data) {
|
||||
return request({
|
||||
url: '/system/region',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改【请填写功能名称】
|
||||
export function updateRegion(data) {
|
||||
return request({
|
||||
url: '/system/region',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delRegion(regionCode) {
|
||||
return request({
|
||||
url: '/system/region/' + regionCode,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出【请填写功能名称】
|
||||
export function exportRegion(query) {
|
||||
return request({
|
||||
url: '/system/region/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询建筑列表
|
||||
export function listBuildings(query) {
|
||||
return request({
|
||||
url: '/system/buildings/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询建筑详细
|
||||
export function getBuildings(query) {
|
||||
return request({
|
||||
url: '/system/buildings',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增建筑
|
||||
export function addBuildings(data) {
|
||||
return request({
|
||||
url: '/system/buildings',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改建筑
|
||||
export function updateBuildings(data) {
|
||||
return request({
|
||||
url: '/system/buildings',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除建筑
|
||||
export function delBuildings(query) {
|
||||
return request({
|
||||
url: '/system/buildings',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出建筑
|
||||
export function exportBuildings(query) {
|
||||
return request({
|
||||
url: '/system/buildings/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取项目空间下拉树列表
|
||||
export function listRegionSpaceTree(query) {
|
||||
console.log('aaa-', query)
|
||||
return request({
|
||||
url: "/system/buildings/tree-list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import axios from "axios";
|
||||
import { iotPlatformUrl } from '/public/js/config'
|
||||
import { iotPlatformUrl } from '@/config/env'
|
||||
import { getDevcieApp } from "@/api/app";
|
||||
|
||||
var appInfo = {}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
const env = process.env
|
||||
// 项目url 地址
|
||||
var iotPlatformUrl = ''; // 第三方云平台ur
|
||||
// iot.gkiiot.com 192.168.18.139
|
||||
var flowIotUrl = '';
|
||||
let iotWebSocketBaseUrl = ''
|
||||
let devLiveWebSocketBaseUrl = ''
|
||||
let sysWebSocket = 'ws://'
|
||||
let prodApi = window.dasConfig.ip || '/prod-api';
|
||||
let wsProtocol = 'ws://';
|
||||
let iotWebSocketAlarmBaseUrl = ''
|
||||
|
||||
window.dasConfig = {
|
||||
ip: 'http://192.168.10.241:32024'
|
||||
}
|
||||
|
||||
// 手动配置的地址
|
||||
var iotHost="192.168.10.241:32024"; // 海创iot 平台 host
|
||||
var hrefHost = window.location.host;
|
||||
// let httpProtocol = window.location.protocol;
|
||||
var hrefHost = '192.168.18.139';
|
||||
let httpProtocol = 'http';
|
||||
|
||||
|
||||
if (env.NODE_ENV == 'development') {
|
||||
flowIotUrl = 'http://127.0.0.1:1880/#flow/'
|
||||
hrefHost = "192.168.18.139"
|
||||
} else if(env.NODE_ENV == 'production') {
|
||||
// if (hrefHost.indexOf('.gkiiot.com') >= 0) {
|
||||
// iotHost = 'iot.gkiiot.com'
|
||||
// }
|
||||
if(httpProtocol.indexOf("https") > -1){
|
||||
sysWebSocket = 'wss://';
|
||||
}
|
||||
if (window.dasConfig.ip) {
|
||||
hrefHost = window.dasConfig.ip
|
||||
}
|
||||
} else if(env.NODE_ENV == 'test') {
|
||||
}
|
||||
iotWebSocketAlarmBaseUrl = sysWebSocket + hrefHost + ':8899/ws/alarm/live'
|
||||
sysWebSocket = sysWebSocket + hrefHost + prodApi;
|
||||
iotWebSocketBaseUrl = sysWebSocket + '/ws/dev/up/'
|
||||
devLiveWebSocketBaseUrl = sysWebSocket + '/ws/dev/live/'
|
||||
iotPlatformUrl = 'http://' + iotHost + prodApi
|
||||
|
||||
export {
|
||||
iotPlatformUrl,
|
||||
sysWebSocket,
|
||||
iotWebSocketBaseUrl,
|
||||
iotWebSocketAlarmBaseUrl,
|
||||
devLiveWebSocketBaseUrl,
|
||||
prodApi
|
||||
}
|
|
@ -4,13 +4,12 @@ import store from '@/store'
|
|||
import { getToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import { preventCloseFu } from "@/utils/hciot";
|
||||
import { BaseUrl } from '/public/js/config'
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: BaseUrl,
|
||||
baseURL: process.env.NODE_ENV === "production" ? `${window.dasConfig.protocol}${window.dasConfig.ip}:${window.dasConfig.port}/${window.dasConfig.prodApi}` : process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000
|
||||
})
|
||||
|
|
|
@ -146,7 +146,7 @@ export function handleTree(data, id, parentId, children, rootId) {
|
|||
});
|
||||
branchArr.length > 0 ? father.children = branchArr : '';
|
||||
//返回第一层
|
||||
return father[parentId] === rootId;
|
||||
return father[parentId] == rootId;
|
||||
});
|
||||
return treeData != '' ? treeData : data;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ import TypeDistributionWrap from "./profile/typeDistribution";
|
|||
import trendWrap from "./profile/trend";
|
||||
import MapWrap from "./profile/mapWrap";
|
||||
import MapWrapPersonal from "./profile/personalCenter";
|
||||
import { iotWebSocketAlarmBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketAlarmBaseUrl } from "@/config/env";
|
||||
|
||||
import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app";
|
||||
export default {
|
||||
|
|
|
@ -68,7 +68,7 @@ import TypeDistributionWrap from "./profile/typeDistribution";
|
|||
import trendWrap from "./profile/trend";
|
||||
import MapWrap from "./profile/mapWrap";
|
||||
import MapWrapPersonal from "./profile/personalCenter";
|
||||
import { iotWebSocketAlarmBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketAlarmBaseUrl } from "@/config/env";
|
||||
|
||||
import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app";
|
||||
export default {
|
||||
|
|
|
@ -81,7 +81,7 @@ import TypeDistributionWrap from "./profile/typeDistribution";
|
|||
import trendWrap from "./profile/trend";
|
||||
import MapWrap from "./profile/mapWrap";
|
||||
import MapWrapPersonal from "./profile/personalCenter";
|
||||
import { iotWebSocketAlarmBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketAlarmBaseUrl } from "@/config/env";
|
||||
import Cookies from "js-cookie";
|
||||
import { NextLoading } from '@/utils/loading';
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ import SelectTableWrap from "@/components/SelectTable/index";
|
|||
|
||||
import axios from "axios";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { basePlatformUrl } from '/public/js/config'
|
||||
import { basePlatformUrl } from '@/config/env'
|
||||
import { getDeviceFunList, getDeviceCmdList } from "@/api/iot/device";
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ import InfoWrap from "./info";
|
|||
import ChildDevice from "./childDevice";
|
||||
import DeviceLog from "@/views/profile/DeviceDetailsView/deviceLog";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import TriggerWrap from "@/views/profile/DeviceTrigger/index";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
<template>
|
||||
<div class="app-container iot-region">
|
||||
<component :is="componentView" :sourceKey="sourceKey" @handleEvent="handleEvent"></component>
|
||||
|
||||
<div
|
||||
class="to-home-wrap2"
|
||||
@click="toTableClick"
|
||||
v-show="componentView !== 'Table'"
|
||||
>
|
||||
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle
|
||||
>返回列表</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Table from "./profile/table";
|
||||
import Detail from './profile/details'
|
||||
export default {
|
||||
name: "Project",
|
||||
components: {
|
||||
Table,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
projectTypeOptions: [],
|
||||
componentView: "Table",
|
||||
sourceKey: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// if (this.$route.query["projectId"]) {
|
||||
// this.handleDetails(this.$route.query);
|
||||
// }
|
||||
this.componentView = "Table";
|
||||
},
|
||||
methods: {
|
||||
handleEvent(data) {
|
||||
if (data.event === 'linkDetail') {
|
||||
this.sourceKey = data.value.regionCode;
|
||||
this.componentView = "Detail";
|
||||
}
|
||||
},
|
||||
// 跳转详情页
|
||||
toTableClick() {
|
||||
if (this.$route.query["projectId"]) {
|
||||
this.$router.push("/project/project");
|
||||
}
|
||||
this.componentView = "Table";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.iot-region {
|
||||
.eldialog-wrap {
|
||||
.el-dialog__header {
|
||||
border-bottom: 1px solid #747373;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 0px;
|
||||
}
|
||||
.el-form {
|
||||
padding: 20px;
|
||||
padding-right: 40px;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
height: 60px;
|
||||
border-top: 1px solid #747373;
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding-top: 15px;
|
||||
.el-button + .el-button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-button {
|
||||
padding-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.to-home-wrap2 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 100;
|
||||
color: #656363;
|
||||
font-size: 20px;
|
||||
cursor: default;
|
||||
width: 100px;
|
||||
.el-button--medium.is-circle {
|
||||
width: 25px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
background: #f26a6a;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.to-home-wrap2:hover {
|
||||
color: #1890ff;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,13 @@
|
|||
<template>
|
||||
<div class="iot-region-info">
|
||||
这里部分作用 区域 管理情况的看板
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "IotRegionInfo",
|
||||
data() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,373 @@
|
|||
<template>
|
||||
<div class="app-container iot-detail-space">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="上级建筑" prop="parentCode">
|
||||
<treeselect
|
||||
style="width: 200px;"
|
||||
v-model="queryParams.parentCode"
|
||||
:options="querySpaceOptions"
|
||||
:normalizer="normalizer"
|
||||
placeholder="请选择上级建筑"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="建筑名称" prop="buildingName">
|
||||
<el-input
|
||||
v-model="queryParams.buildingName"
|
||||
placeholder="建筑名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="建筑类型" prop="buildingType">
|
||||
<el-select v-model="queryParams.buildingType" placeholder="建筑类型" clearable>
|
||||
<!-- <el-option label="请选择字典生成" value="" /> -->
|
||||
<el-option
|
||||
v-for="dict in spaceTypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="spaceList"
|
||||
row-key="buildingCode"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children' }"
|
||||
>
|
||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
||||
<el-table-column label="建筑名称" align="left" prop="buildingName" />
|
||||
<el-table-column label="建筑类型" align="center" prop="buildingType" :formatter="statusFormat" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-search"
|
||||
@click="handleDetails(scope.row)"
|
||||
>建筑设备</el-button> -->
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改项目建筑对话框 -->
|
||||
<el-dialog class="eldialog-wrap" :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="上级建筑:" prop="parentCode">
|
||||
<treeselect v-model="form.parentCode" :normalizer="normalizer" :options="spaceOptions" placeholder="请选择上级建筑" />
|
||||
</el-form-item>
|
||||
<el-form-item label="建筑名称:" prop="buildingName">
|
||||
<el-input v-model="form.buildingName" placeholder="请输入建筑名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="建筑编码:" prop="buildingCode">
|
||||
<el-input v-model="form.buildingCode" placeholder="请输入建筑编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型:" prop="buildingType">
|
||||
<el-select v-model="form.buildingType" style="width: 100%;" placeholder="请选择建筑类型">
|
||||
<!-- <el-option label="请选择字典生成" value="" /> -->
|
||||
<el-option
|
||||
v-for="dict in spaceTypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button size="mini" @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
class="eldialog-wrap"
|
||||
:title="spaceDeviceTitle"
|
||||
:visible.sync="selectTableShow"
|
||||
width="75%"
|
||||
top="10vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<!-- <space-device-wrap
|
||||
v-if="selectTableShow"
|
||||
:sourceId="sourceId"
|
||||
:buildingCode="infoData.buildingCode"
|
||||
></space-device-wrap> -->
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" @click="() =>{selectTableShow = false}">确 定</el-button>
|
||||
<el-button size="mini" @click="() =>{selectTableShow = false}">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listBuildings,
|
||||
getBuildings,
|
||||
delBuildings,
|
||||
addBuildings,
|
||||
updateBuildings,
|
||||
listRegionSpaceTree
|
||||
} from "@/api/iot/regionSpace";
|
||||
// import SpaceDeviceWrap from "./spaceDevice";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "Space",
|
||||
components: {
|
||||
Treeselect,
|
||||
// SpaceDeviceWrap
|
||||
},
|
||||
props: ["infoData"],
|
||||
data() {
|
||||
return {
|
||||
selectTableShow: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 项目建筑表格数据
|
||||
spaceList: [],
|
||||
// 项目建筑树选项
|
||||
spaceOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
parentCode: null,
|
||||
buildingCode: null,
|
||||
buildingName: null,
|
||||
spaceCode: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
spaceTypeOptions: [],
|
||||
querySpaceOptions: [],
|
||||
sourceId: "",
|
||||
spaceDeviceTitle: ""
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDicts("space_type").then(response => {
|
||||
this.spaceTypeOptions = response.data;
|
||||
});
|
||||
this.getQueryTreeselect();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
indexFormatter(val) {
|
||||
return val + 1;
|
||||
},
|
||||
// 打开厂商选择窗口 ——表格
|
||||
handleDetails(row) {
|
||||
this.sourceId = row.spaceId;
|
||||
this.spaceDeviceTitle = `[ ${row.buildingName} ] 建筑--设备管理`;
|
||||
this.selectTableShow = true;
|
||||
},
|
||||
// 菜单状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.spaceTypeOptions, row.buildingType);
|
||||
},
|
||||
/** 查询项目建筑列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.regionCode = this.infoData.regionCode;
|
||||
listBuildings(this.queryParams).then(response => {
|
||||
this.spaceList = this.handleTree(response.rows, "buildingCode", "parentCode");
|
||||
console.log('----', this.spaceList)
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 转换项目建筑数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.buildingCode,
|
||||
label: node.buildingName,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect(param) {
|
||||
listRegionSpaceTree(param).then(response => {
|
||||
this.spaceOptions = [];
|
||||
const data = { buildingCode: 0, buildingName: "顶级节点", children: [] };
|
||||
data.children = this.handleTree(response.data, "buildingCode", "parentCode");
|
||||
// data.children = response.data;
|
||||
console.log('---', data)
|
||||
this.spaceOptions.push(data);
|
||||
});
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getQueryTreeselect() {
|
||||
let param = {
|
||||
regionCode: this.infoData.regionCode
|
||||
};
|
||||
listBuildings(param).then(response => {
|
||||
this.querySpaceOptions = [];
|
||||
const data = { buildingCode: 0, buildingName: "顶级节点", children: [] };
|
||||
data.children = this.handleTree(response.data, "buildingCode", "parentCode");
|
||||
this.querySpaceOptions.push(data);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
regionCode: this.infoData.regionCode,
|
||||
buildingName: null,
|
||||
buildingType: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
let param = {
|
||||
regionCode: this.infoData.regionCode
|
||||
};
|
||||
this.getTreeselect(param);
|
||||
this.open = true;
|
||||
this.title = "添加建筑";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
let param = {
|
||||
regionCode: this.infoData.regionCode,
|
||||
buildingCode: row.buildingCode
|
||||
};
|
||||
this.getTreeselect(param);
|
||||
if (row != null) {
|
||||
this.form.regionCode = row.regionCode;
|
||||
}
|
||||
getBuildings({ buildingCode: row.buildingCode }).then(response => {
|
||||
this.form = JSON.parse(JSON.stringify(response.data));
|
||||
this.open = true;
|
||||
this.title = "修改项目建筑";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.recordId != null) {
|
||||
updateBuildings(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addBuildings(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$confirm(
|
||||
'是否确认删除项目建筑编号为"' + row.buildingName + '"的数据项?',
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(function() {
|
||||
debugger
|
||||
return delBuildings({ buildingCode: row.buildingCode });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.iot-detail-space {
|
||||
.eldialog-wrap {
|
||||
.el-dialog__header {
|
||||
border-bottom: 1px solid #747373;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 0px;
|
||||
height: calc(100vh - 200px);
|
||||
overflow: auto;
|
||||
}
|
||||
.el-form {
|
||||
padding: 20px;
|
||||
padding-right: 40px;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
height: 60px;
|
||||
border-top: 1px solid #747373;
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding-top: 15px;
|
||||
.el-button + .el-button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-button {
|
||||
padding-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,68 @@
|
|||
<template>
|
||||
<div class="iot-region-details-warp">
|
||||
<div class="info-tabs">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="区域信息" name="info">
|
||||
<div class="tabs-body">
|
||||
<info></info>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="区域空间" name="space">
|
||||
<div class="tabs-body">
|
||||
<space v-if="activeName === 'space'" :infoData="infoData"></space>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- <el-tab-pane label="项目租户" name="tenant">
|
||||
<div class="tabs-body">
|
||||
<tenant-wrap v-if="activeName === 'tenant'" :infoData="infoData" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="设备列表" name="allDevice">
|
||||
<div class="tabs-body">
|
||||
<device-list-wrap v-if="activeName === 'allDevice'" :sourceId="infoData.projectId" />
|
||||
</div>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getRegion
|
||||
} from "@/api/iot/region";
|
||||
import Info from './Info'
|
||||
import Space from './Space'
|
||||
export default {
|
||||
name: 'DetailsWrap',
|
||||
props: ['sourceKey'],
|
||||
components: {
|
||||
Info,
|
||||
Space
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
infoData: {},
|
||||
activeName: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getInfoByProjectId()
|
||||
this.activeName = 'info'
|
||||
},
|
||||
methods: {
|
||||
getInfoByProjectId() {
|
||||
getRegion(this.sourceKey).then(response => {
|
||||
this.infoData = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style less="scss">
|
||||
.iot-region-details-warp {
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,516 @@
|
|||
<template>
|
||||
<div class="iot-region-table">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="区域编号" prop="regionCode">
|
||||
<el-input
|
||||
v-model="queryParams.regionCode"
|
||||
placeholder="请输入区域编号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域名称" prop="regionName">
|
||||
<el-input
|
||||
v-model="queryParams.regionName"
|
||||
placeholder="请输入区域名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['iot:project:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="tableLoading"
|
||||
:data="list"
|
||||
:default-sort="{ prop: 'createTime', order: 'descending' }"
|
||||
@sort-change="sortChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="indexFormatter"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column label="区域编码" align="left" prop="regionCode" />
|
||||
<el-table-column label="区域名称" align="left" prop="regionName" />
|
||||
<el-table-column label="区域地址" align="left" prop="regionAddr" >
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea" :title="scope.row.regionAddr">
|
||||
{{ scope.row.regionAddr }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center" prop="recordStatus" :formatter="statusFormat" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
sortable="custom"
|
||||
align="center"
|
||||
width="160"
|
||||
prop="createTime"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="200"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-search"
|
||||
@click="handleDetails(scope.row)"
|
||||
v-hasPermi="['system:region:edit']"
|
||||
>详情</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:region:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:region:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改项目对话框 -->
|
||||
<el-dialog
|
||||
class="eldialog-wrap"
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="720px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="区域名称:" prop="regionName">
|
||||
<el-input
|
||||
v-model="form.regionName"
|
||||
placeholder="请输入区域名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="区域编号:" prop="regionCode">
|
||||
<el-input
|
||||
v-model="form.regionCode"
|
||||
placeholder="请输入区域编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态:" prop="recordStatus">
|
||||
<el-radio-group v-model="form.recordStatus" style="width: 100%">
|
||||
<el-radio
|
||||
v-for="dict in regionStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="Number(dict.dictValue)"
|
||||
>{{ dict.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-form-item label="行政区划" prop="regionalismId">
|
||||
<treeselect
|
||||
@select="regionalismChange"
|
||||
:disable-branch-nodes="true"
|
||||
v-model="form.regionalismId"
|
||||
:options="regionalismOption"
|
||||
:normalizer="normalizer"
|
||||
placeholder="请选择上级行政区划"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目经度" prop="longitude">
|
||||
<el-input
|
||||
v-model="form.longitude"
|
||||
disabled
|
||||
placeholder="请输入项目经度"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目纬度" prop="latitude">
|
||||
<el-input
|
||||
v-model="form.latitude"
|
||||
disabled
|
||||
placeholder="请输入项目纬度"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址" prop="regionAddr">
|
||||
<el-input
|
||||
v-model="form.regionAddr"
|
||||
@blur="mapAddressFromPoint"
|
||||
placeholder="请输入详细地址"
|
||||
>
|
||||
<el-popover
|
||||
slot="suffix"
|
||||
placement="left-start"
|
||||
title="地图选择坐标"
|
||||
width="730"
|
||||
trigger="manual"
|
||||
v-model="visible"
|
||||
>
|
||||
<i
|
||||
slot="reference"
|
||||
class="el-icon-map-location"
|
||||
@click="mapClick"
|
||||
></i>
|
||||
<slot>
|
||||
<el-row>
|
||||
<el-col :span="7">
|
||||
<span>经度:{{ mapForm.lng }}</span>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<span>纬度:{{ mapForm.lat }}</span>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span>地址:{{ mapForm.address }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<shop-location
|
||||
v-if="visible === true"
|
||||
style="height: 300px"
|
||||
:mapCenter="mapCenter"
|
||||
:draggable="true"
|
||||
@mapEvent="mapEvent"
|
||||
:zoom="zoom"
|
||||
/>
|
||||
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-top: 5px;
|
||||
"
|
||||
>
|
||||
<el-button type="primary" @click="mapSureClick"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</slot>
|
||||
</el-popover>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-form-item label="总路设备:">
|
||||
<el-input
|
||||
v-model="form.projectDeviceName"
|
||||
suffix-icon="el-icon-caret-bottom"
|
||||
@focus="openTableSelectDialog()"
|
||||
placeholder="请输入总路设备"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" @click="submitForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button size="mini" @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import { initMap, gjzCode } from "@/utils/latlngFromAddress.js";
|
||||
import ShopLocation from "@/components/Amap/components/shopLocation/index";
|
||||
import {
|
||||
listRegion,
|
||||
getRegion,
|
||||
addRegion,
|
||||
updateRegion,
|
||||
delRegion,
|
||||
} from "@/api/iot/region";
|
||||
export default {
|
||||
name: "IotRegionTable",
|
||||
components: {
|
||||
Treeselect,
|
||||
ShopLocation,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
open: false,
|
||||
tableLoading: false,
|
||||
title: "",
|
||||
regionStatusOptions: [],
|
||||
showSearch: true,
|
||||
mapCenter: {
|
||||
lng: 119.459889,
|
||||
lat: 25.98974,
|
||||
},
|
||||
mapForm: {},
|
||||
baiduMapKey: "N05AG95Umzs3fouk6WpFqtGxcDlw0fRn",
|
||||
zoom: 15,
|
||||
BMap: null,
|
||||
map: null,
|
||||
visible: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
total: 0,
|
||||
// 表单校验
|
||||
rules: {
|
||||
recordId: [
|
||||
{ required: true, message: "编号 记录ID不能为空", trigger: "blur" },
|
||||
],
|
||||
recordStatus: [
|
||||
{ required: true, message: "记录状态不能为空", trigger: "blur" },
|
||||
],
|
||||
regionName: [
|
||||
{ required: true, message: "区域名称不能为空", trigger: "blur" },
|
||||
],
|
||||
regionCode: [
|
||||
{ required: true, message: "区域编号不能为空", trigger: "blur" },
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("region_status").then((response) => {
|
||||
this.regionStatusOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 菜单状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.regionStatusOptions, row.regionStatus);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.recordId != null) {
|
||||
updateRegion(this.form).then((response) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRegion(this.form).then((response) => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$confirm("是否删除该选项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return delRegion(row.regionCode);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加区域";
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
recordId: null,
|
||||
recordStatus: 0,
|
||||
regionCode: null,
|
||||
regionName: null,
|
||||
regionAddr: null,
|
||||
latitude: null,
|
||||
longitude: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
sortChange(column) {
|
||||
const sort = {
|
||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||
orderByColumn: column.prop,
|
||||
};
|
||||
this.queryParams = Object.assign(this.queryParams, sort);
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
getList() {
|
||||
this.tableLoading = true;
|
||||
listRegion(this.queryParams).then((response) => {
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.tableLoading = false;
|
||||
});
|
||||
},
|
||||
indexFormatter(val) {
|
||||
return (
|
||||
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
||||
);
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
getRegion(row.regionCode).then(res => {
|
||||
this.form = Object.assign(this.form, res.data)
|
||||
this.open = true;
|
||||
this.title = "编辑区域";
|
||||
})
|
||||
},
|
||||
handleDetails(row) {
|
||||
this.$emit("handleEvent", { event: "linkDetail", value: row });
|
||||
},
|
||||
// 地图方法
|
||||
handler({ BMap, map }) {
|
||||
//地图
|
||||
this.BMap = BMap;
|
||||
this.map = map;
|
||||
this.mapLoading = false;
|
||||
// this.getPointByIp()
|
||||
},
|
||||
mapEvent(data) {
|
||||
this.mapForm.lng = data.lng;
|
||||
this.mapForm.lat = data.lat;
|
||||
this.mapForm.address = data.address;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 使用地图方式定位
|
||||
mapClick() {
|
||||
if (this.form.longitude && this.form.latitude) {
|
||||
this.mapCenter.lng = this.form.longitude;
|
||||
this.mapCenter.lat = this.form.latitude;
|
||||
this.mapForm.lng = this.form.longitude;
|
||||
this.mapForm.lat = this.form.latitude;
|
||||
this.mapForm.address = this.form.regionAddr;
|
||||
} else {
|
||||
this.mapCenter = {
|
||||
lng: 119.459889,
|
||||
lat: 25.98974,
|
||||
};
|
||||
this.mapForm.lng = 119.459889;
|
||||
this.mapForm.lat = 25.98974;
|
||||
this.mapForm.address = "";
|
||||
}
|
||||
this.visible = !this.visible;
|
||||
this.$forceUpdate()
|
||||
},
|
||||
mapSureClick() {
|
||||
// 确认的时候将值赋值给form表单并且关闭地图
|
||||
this.form.regionAddr = this.mapForm.address
|
||||
? this.mapForm.address
|
||||
: this.form.regionAddr;
|
||||
this.form.longitude = this.mapForm.lng;
|
||||
this.form.latitude = this.mapForm.lat;
|
||||
this.visible = false;
|
||||
},
|
||||
mapAddressFromPoint() {
|
||||
if (this.form.regionAddr) {
|
||||
// geoCode(this.form.regionAddr, this, { form: 'form', lat: 'shopLat', lng: 'shopLng' })
|
||||
gjzCode(this.form.regionAddr, this, {
|
||||
form: "form",
|
||||
lat: "shopLat",
|
||||
lng: "shopLng",
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -59,7 +59,7 @@ import InfoWrap from "./info";
|
|||
import DeviceLog from "@/views/profile/DeviceDetailsView/deviceLog";
|
||||
import ChildDevice from "./childDevice";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
props: ["sourceId"],
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import { getDeviceFunList, getDeviceCmdList } from "@/api/iot/device";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import RunStateTable from "./runStateTable";
|
||||
export default {
|
||||
name: "RunStartsWrap",
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
|
||||
<script>
|
||||
import { listChildrenDevice, setSwitchControl } from "@/api/iot/device";
|
||||
import { iotWebSocketBaseUrl, devLiveWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl, devLiveWebSocketBaseUrl } from "@/config/env";
|
||||
import SignalIntensity from "./signalIntensity";
|
||||
export default {
|
||||
name: "DeviceSelectNav",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import DeviceSelect from './deviceSelectNav'
|
||||
export default {
|
||||
name: "StateManagement",
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import { getDeviceFunList, getDeviceCmdList } from "@/api/iot/device";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import RunStateTable from "./table";
|
||||
export default {
|
||||
name: "RunStartsWrap",
|
||||
|
|
|
@ -65,7 +65,7 @@ import InfoWrap from "./info";
|
|||
import DeviceLog from "@/views/profile/DeviceDetailsView/deviceLog";
|
||||
import ChildDevice from "./childDevice";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "/public/js/config";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import TriggerWrap from "@/views/profile/DeviceTrigger/index";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
|
|
|
@ -27,22 +27,22 @@ module.exports = {
|
|||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||
productionSourceMap: false,
|
||||
// webpack-dev-server 相关配置
|
||||
// devServer: {
|
||||
// host: '0.0.0.0',
|
||||
// port: port,
|
||||
// open: true,
|
||||
// proxy: {
|
||||
// // detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
// [process.env.VUE_APP_BASE_API]: {
|
||||
// target: process.env.target,
|
||||
// changeOrigin: true,
|
||||
// pathRewrite: {
|
||||
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// disableHostCheck: true
|
||||
// },
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: port,
|
||||
open: true,
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: process.env.target,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
disableHostCheck: true
|
||||
},
|
||||
configureWebpack: {
|
||||
externals: {
|
||||
AMap: 'AMap'
|
||||
|
|
Loading…
Reference in New Issue