Commit f678957f authored by “yiyousong”'s avatar “yiyousong”

pref:测试接口变量

parent db627bbe
......@@ -2,14 +2,14 @@
NODE_ENV = production
# 地址
VUE_APP_BASE_API = http://192.168.2.144:11091/m
VUE_APP_BASE_API = /basics_api/m
# websocket地址
VUE_APP_WEBSOCKET_API =192.168.2.144:18222/m
VUE_APP_WEBSOCKET_API =192.168.0.98:18222/m
# 门户登录地址
VUE_APP_PORTAL_URL = /portal_home
VUE_APP_PORTAL_URL =/portal_home
# 站点请求地址
VUE_APP_SITETREE_URL = http://192.168.2.144:11078/base/site/siteTree
\ No newline at end of file
VUE_APP_SITETREE_URL = /basics_api/base/site/siteTree
\ No newline at end of file
......@@ -35,6 +35,7 @@ instance.interceptors.request.use(
// console.log("sessionStorage",window.sessionStorage)
config.headers.Authorization = window.sessionStorage.getItem("token") || "";
//console.log("request config and session",config,window.sessionStorage);
// config.baseURL = "";
console.log(">>>", config);
return config;
},
......
<template>
<el-breadcrumb separator="/">
<el-breadcrumb-item
:to='item.path'
:key='index'
:to="item.path"
:key="index"
v-for="(item, index) in breadcrumb"
>
{{item.name}}
{{ item.name }}
</el-breadcrumb-item>
</el-breadcrumb>
</template>
......@@ -13,83 +13,83 @@
<script>
// 获取多级菜单
const types = {
list: '列表',
add: '新增',
edit: '编辑',
view: '查看',
importView: '导入',
resetPwdView:'重置密码',
list: "列表",
add: "新增",
edit: "编辑",
view: "查看",
importView: "导入",
resetPwdView: "重置密码",
};
const findEntity = (list, value, key) => {
let data = {};
list.forEach((item, i)=>{
if(item[key] === value) {
list.forEach((item, i) => {
if (item[key] === value) {
data = item;
return;
}
})
});
return data;
};
const find = (list, path, arr) => {
// 获取二级菜单
let newList = JSON.parse(JSON.stringify(list));
let data = findEntity(newList, path, 'path');
let data = findEntity(newList, path, "path");
let parentId = data.parentId;
arr.push(data);
// 获取一级菜单
if(parentId){
let parent = findEntity(newList, parentId, 'id');
if (parentId) {
let parent = findEntity(newList, parentId, "id");
arr.unshift(parent);
}
return arr
}
return arr;
};
export default {
props: {
list: {
type: Array,
default: () => []
}
default: () => [],
},
},
watch: {
'$route'(route) {
$route(route) {
this.query = route.query;
}
},
},
computed: {
breadcrumb() {
// 如果用户指定面包屑,则使用用户配置
if(this.list.length) {
if (this.list.length) {
return this.list;
}
const path = this.$route.path.replace(/\/(list|add|edit|importView|view|resetPwdView)$/, '/list');
const path = this.$route.path.replace(
/\/(list|add|edit|importView|view|resetPwdView)$/,
"/list"
);
const group = find(this.menu, path, []);
let urlArray = this.$route.path.split('/');
let urlArray = this.$route.path.split("/");
const type = urlArray.pop();
if(types[type]) {
if (types[type]) {
group.push({
name: types[type]
})
name: types[type],
});
}
console.log("group",group)
return group
return group;
},
menu() {
return this.$store.state.userData.flat || [];
},
},
data() {
return {
}
}
}
return {};
},
};
</script>
<style lang="less">
.el-breadcrumb{
.el-breadcrumb {
font-size: 12px;
}
</style>
......
......@@ -65,7 +65,6 @@ export default {
return (
<div>
{this.tableData.map((item, index) => {
console.log(item);
let arrs = this.columns
.filter((i) => !i.type)
.filter((i) => !i.title)
......
<template>
<span>
<span>
<!-- 开启confirm时,操作之前会先调动确认窗口 -->
<el-popover
v-if='confirm'
placement="top"
width="160"
v-model="visible">
<el-popover v-if="confirm" placement="top" width="160" v-model="visible">
<p>确认操作?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="statusClick">确定</el-button>
<el-button size="mini" type="text" @click="visible = false"
>取消</el-button
>
<el-button type="primary" size="mini" @click="statusClick"
>确定</el-button
>
</div>
<label slot="reference" class="my-compontent-switch"
:checked='checked'>
<span>{{text}}</span>
<label slot="reference" class="my-compontent-switch" :checked="checked">
<span>{{ text }}</span>
</label>
</el-popover>
......@@ -21,12 +20,12 @@
<label
v-else
class="my-compontent-switch"
:checked='checked'
@click='statusClick'
:checked="checked"
@click="statusClick"
>
<span>{{text}}</span>
<span>{{ text }}</span>
</label>
</span>
</span>
</template>
<script>
......@@ -37,18 +36,22 @@ export default {
confirm: Boolean,
on: {
type: Object,
default: ()=> {return {value: 1, text: '启用'}}
default: () => {
return { value: 1, text: "启用" };
},
},
off: {
type: Object,
default: ()=> {return {value: 0, text: '停用'}}
default: () => {
return { value: 0, text: "停用" };
},
},
url: String,
},
methods: {
async statusClick() {
console.log("value",this.value)
const enabled = this.row.enabled === this.on.value ? this.off.value : this.on.value;
const enabled =
this.row.enabled === this.on.value ? this.off.value : this.on.value;
const id = this.row.id;
//const getTokenUrl = this.url.replace('/save', '/edit');
// await this.$post(getTokenUrl, {id});
......@@ -56,37 +59,36 @@ export default {
enabled,
id,
})
.then(res=>{
.then((res) => {
// 更新数据
let table = JSON.parse(JSON.stringify(this.value))
console.log("table",table)
let {index, data} = this.find(table, id);
let table = JSON.parse(JSON.stringify(this.value));
let { index, data } = this.find(table, id);
data.enabled = enabled;
table.splice(index, 1, data);
this.$emit("input", table);
this.$emit("change");
})
.catch(error=>{
.catch((error) => {
this.$message.error(error.message);
})
.then(data=>{
.then((data) => {
this.visible = false;
})
});
},
find(list, id) {
let index = -1;
let data = null;
list.forEach((item, i)=>{
if(item.id === id){
list.forEach((item, i) => {
if (item.id === id) {
index = i;
data = Object.assign({}, item);
return;
}
})
});
return {
index,
data,
}
};
},
},
computed: {
......@@ -100,13 +102,13 @@ export default {
data() {
return {
visible: false,
}
}
}
};
},
};
</script>
<style lang="less">
.my-compontent-switch{
.my-compontent-switch {
display: inline-flex;
align-items: center;
position: relative;
......@@ -114,16 +116,16 @@ export default {
line-height: 19px;
height: 20px;
vertical-align: middle;
&[checked] span{
&[checked] span {
border-color: #409eff;
background-color: #409eff;
padding:0 23px 0 10px;
&::after{
padding: 0 23px 0 10px;
&::after {
left: 100%;
margin-left: -17px;
}
}
span{
span {
margin: 0;
display: inline-block;
position: relative;
......@@ -131,20 +133,20 @@ export default {
border: 1px solid #dcdfe6;
outline: none;
color: #fff;
padding:0 10px 0 23px;
padding: 0 10px 0 23px;
border-radius: 10px;
box-sizing: border-box;
background: #dcdfe6;
cursor: pointer;
transition: border-color .3s,background-color .3s;
transition: border-color 0.3s, background-color 0.3s;
vertical-align: middle;
&::after{
&::after {
content: "";
position: absolute;
top: 1px;
left: 1px;
border-radius: 100%;
transition: all .3s;
transition: all 0.3s;
width: 16px;
height: 16px;
background-color: #fff;
......
......@@ -123,7 +123,6 @@ export default {
},
},
beforeDestroy() {
console.log("beforeDestroy");
//window.removeEventListener("message", this.getsocketData, false);
},
mounted() {
......
......@@ -107,13 +107,11 @@ export default {
// this.getwaitedListdata(id);
},
getwaitedListdata() {
let url=process.env.VUE_APP_SITETREE_URL=='undefined'?'http://192.168.0.98:11078/base/site/siteTree':process.env.VUE_APP_SITETREE_URL
console.log("url:"+url)
console.log("url:"+process.env.VUE_APP_SITETREE_URL)
let url =
process.env.VUE_APP_SITETREE_URL == "undefined"
? "http://192.168.0.98:11078/base/site/siteTree"
: process.env.VUE_APP_SITETREE_URL;
this.$get(url).then((res) => {
console.log(res.data);
const { siteTree } = res.data;
this.sitelist = siteTree;
let arr = [];
......
......@@ -74,15 +74,12 @@ export default {
contentRender(h, params) {
//console.log(params.extData.extData.productId)
let value = params.extData.extData.productName;
console.log(">>>", params);
return <img src={require(`../assets/images/${value}.png`)} />;
},
getDeviceDetial() {
//获取设备列表
console.log("device siteId", this.info.siteId);
},
refresh(data) {
console.log("刷新数据", data);
// this.markersGroupData = data;
//this.$refs.map.clear();
let map = this.amapManager.getMap();
......@@ -125,8 +122,6 @@ export default {
this.$emit("input", false);
this.$emit("choose", JSON.parse(JSON.stringify(this.mapData)), (val) => {
//data = val;
console.log("callback:" + val);
});
},
},
......
......@@ -9,7 +9,8 @@
:page-size="currSize"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, total, prev, pager, next, jumper"
:total="total">
:total="total"
>
</el-pagination>
</div>
</template>
......@@ -27,49 +28,46 @@ export default {
},
},
watch: {
'$route'(route) {
$route(route) {
this.initPage(route.query);
}
},
},
created() {
this.initPage(this.$route.query);
},
methods: {
initPage(query) {
console.log("query",query)
this.currPage = parseInt(query['page']) || 1;
this.currSize = parseInt(query['size']) || this.prePageResult;
this.currPage = parseInt(query["page"]) || 1;
this.currSize = parseInt(query["size"]) || this.prePageResult;
},
changeHash(key, val) {
let {path, query} = this.$route;
let { path, query } = this.$route;
this.$router.push({
path: path,
query: Object.assign({}, query, {[`${key}`]: val})
})
query: Object.assign({}, query, { [`${key}`]: val }),
});
},
handleSizeChange(currSize) {
console.log("currsize"+currSize)
this.changeHash('size', currSize);
this.changeHash("size", currSize);
},
handleCurrentChange(currPage) {
this.changeHash('page', currPage);
this.changeHash("page", currPage);
},
},
data() {
return {
currPage: 1,
currSize: 10,
}
}
}
};
},
};
</script>
<style lang="less">
.pagination-wapper{
.pagination-wapper {
background: #fff;
margin-top: 10px;
.el-pagination{
.el-pagination {
margin-left: auto;
}
}
......
......@@ -202,7 +202,6 @@ export default {
methods: {
remoteMethod(query, searchType) {
if (query == "") {
console.log("查询参数为空!");
return;
}
this.loading = true;
......@@ -283,7 +282,6 @@ export default {
encode(data, formTemp) {
let newData = {};
Object.keys(Qs.parse(data)).forEach((item) => {
console.log(item);
if (/^query\./.test(item)) {
let val = data[item];
let key = item.replace(/^query\./, "");
......@@ -325,13 +323,12 @@ export default {
) {
//支持模糊查询,收尾增加百分号
val = val.trim();
if(val.charAt(0)!='%'){
val = "%" + val
if (val.charAt(0) != "%") {
val = "%" + val;
}
if(val.charAt(val.length-1)!='%'){
val =val + "%";
if (val.charAt(val.length - 1) != "%") {
val = val + "%";
}
}
});
newData[item] = this.decodeVal(val);
......
<template>
<span>
<span>
<!-- 开启confirm时,操作之前会先调动确认窗口 -->
<el-popover
v-if='confirm'
placement="top"
width="160"
v-model="visible">
<el-popover v-if="confirm" placement="top" width="160" v-model="visible">
<p>确认操作?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="statusClick">确定</el-button>
<el-button size="mini" type="text" @click="visible = false"
>取消</el-button
>
<el-button type="primary" size="mini" @click="statusClick"
>确定</el-button
>
</div>
<label slot="reference" class="my-compontent-switch"
:checked='checked'>
<span>{{text}}</span>
<label slot="reference" class="my-compontent-switch" :checked="checked">
<span>{{ text }}</span>
</label>
</el-popover>
......@@ -21,12 +20,12 @@
<label
v-else
class="my-compontent-switch"
:checked='checked'
@click='statusClick'
:checked="checked"
@click="statusClick"
>
<span>{{text}}</span>
<span>{{ text }}</span>
</label>
</span>
</span>
</template>
<script>
......@@ -37,59 +36,58 @@ export default {
confirm: Boolean,
on: {
type: Object,
default: ()=> {return {value: 1, text: ''}}
default: () => {
return { value: 1, text: "" };
},
},
off: {
type: Object,
default: ()=> {return {value: 0, text: ''}}
default: () => {
return { value: 0, text: "" };
},
},
url: String,
},
methods: {
async statusClick() {
const status = this.row.status === this.on.value ? this.off.value : this.on.value;
const status =
this.row.status === this.on.value ? this.off.value : this.on.value;
const id = this.row.id;
this.$post(this.url, {
status,
id,
})
.then(res=>{
.then((res) => {
// 更新数据
console.log("table",this.value)
let table = JSON.parse(JSON.stringify(this.value))
let {index, data} = this.find(table, id);
console.log("data",data)
let table = JSON.parse(JSON.stringify(this.value));
let { index, data } = this.find(table, id);
data.status = res.data.entity.status;
table.splice(index, 1, data);
this.$emit("input", table);
this.$emit("change");
})
.catch(error=>{
.catch((error) => {
this.$message.error(error.message);
})
.then(data=>{
.then((data) => {
this.visible = false;
})
});
},
find(list, id) {
let index = -1;
let data = null;
list.forEach((item, i)=>{
if(item.id === id){
list.forEach((item, i) => {
if (item.id === id) {
index = i;
data = Object.assign({}, item);
return;
}
})
});
return {
index,
data,
}
};
},
},
computed: {
......@@ -103,13 +101,13 @@ export default {
data() {
return {
visible: false,
}
}
}
};
},
};
</script>
<style lang="less">
.my-compontent-switch{
.my-compontent-switch {
display: inline-flex;
align-items: center;
position: relative;
......@@ -117,16 +115,16 @@ export default {
line-height: 19px;
height: 20px;
vertical-align: middle;
&[checked] span{
&[checked] span {
border-color: #409eff;
background-color: #409eff;
padding:0 23px 0 10px;
&::after{
padding: 0 23px 0 10px;
&::after {
left: 100%;
margin-left: -17px;
}
}
span{
span {
margin: 0;
display: inline-block;
position: relative;
......@@ -134,20 +132,20 @@ export default {
border: 1px solid #dcdfe6;
outline: none;
color: #fff;
padding:0 10px 0 23px;
padding: 0 10px 0 23px;
border-radius: 10px;
box-sizing: border-box;
background: #dcdfe6;
cursor: pointer;
transition: border-color .3s,background-color .3s;
transition: border-color 0.3s, background-color 0.3s;
vertical-align: middle;
&::after{
&::after {
content: "";
position: absolute;
top: 1px;
left: 1px;
border-radius: 100%;
transition: all .3s;
transition: all 0.3s;
width: 16px;
height: 16px;
background-color: #fff;
......
......@@ -3,15 +3,22 @@
<template>
<div class="my-upload">
<label>
<el-button icon='el-icon-upload' size='mini' :loading='loading'>{{loading ? '上传中...' : tip}}</el-button>
<input type="file" @change='chooseFile' :disabled="loading" ref="referenceUpload">
<el-button icon="el-icon-upload" size="mini" :loading="loading">{{
loading ? "上传中..." : tip
}}</el-button>
<input
type="file"
@change="chooseFile"
:disabled="loading"
ref="referenceUpload"
/>
</label>
<div v-if='value' class='flex'>
<div v-if="value" class="flex">
<div style="margin-right: 20px">
<div v-if='type === "thumb"' class='thumb' :style="imgCover"></div>
<div v-else>文件名: {{value}}</div>
<div v-if="type === 'thumb'" class="thumb" :style="imgCover"></div>
<div v-else>文件名: {{ value }}</div>
</div>
<!-- <div>
<!-- <div>
<el-button icon="el-icon-delete" size='mini' plain @click='del'>删除</el-button>
</div>-->
</div>
......@@ -23,37 +30,38 @@ export default {
props: {
value: {
type: String,
default: '',
default: "",
},
type: { // 展示类型,文件名或缩略图 filename | thumb
type: {
// 展示类型,文件名或缩略图 filename | thumb
type: String,
default: 'filename',
default: "filename",
},
tip: { // 按钮文字
tip: {
// 按钮文字
type: String,
default: '上传文件',
default: "上传文件",
},
prePath: {
type: String,
default: '',
}
default: "",
},
},
methods: {
del() {
this.$emit("input", "")
this.$emit("input", "");
},
async chooseFile(e) {
this.loading = true;
console.log(e);
try {
const {code, url} = await this.$upload('file/upload', {
const { code, url } = await this.$upload("file/upload", {
uploadFile: e.target.files[0],
prePath: this.prePath
prePath: this.prePath,
});
if(code === 1) {
this.$emit('input', url)
}else{
this.$message.error('上传文件失败');
if (code === 1) {
this.$emit("input", url);
} else {
this.$message.error("上传文件失败");
}
} catch (error) {
this.$message.error(error.message);
......@@ -65,21 +73,21 @@ export default {
computed: {
imgCover() {
return `background-image: url(${this.value})`;
}
},
},
data() {
return {
loading: false,
}
}
}
};
},
};
</script>
<style lang="less">
.my-upload{
label{
.my-upload {
label {
position: relative;
input{
input {
display: block;
position: absolute;
width: 100%;
......@@ -89,7 +97,7 @@ export default {
opacity: 0;
}
}
.thumb{
.thumb {
width: 80px;
height: 80px;
background-size: contain;
......@@ -99,7 +107,7 @@ export default {
border-radius: 5px;
overflow: hidden;
}
p{
p {
color: #666;
font-size: 14px;
}
......
<template>
<div id="dropMenu"
<div
id="dropMenu"
:style="style"
style="display: block;"
style="display: block"
v-show="show"
@mousedown.stop
@contextmenu.prevent><!--阻止冒泡事件 阻止右键的默认事件-->
@contextmenu.prevent
>
<!--阻止冒泡事件 阻止右键的默认事件-->
<slot></slot>
</div>
</template>
......@@ -17,82 +20,78 @@ export default {
x: null,
y: null,
style: {},
binded: false
}
binded: false,
};
},
props: {
target: null,
show: Boolean
show: Boolean,
},
mounted() {
this.bindEvents()
this.bindEvents();
},
watch: {
show(show) {
if (show) {
this.bindHideEvents()
this.bindHideEvents();
} else {
this.unbindHideEvents()
this.unbindHideEvents();
}
},
target(target) {
this.bindEvents()
}
this.bindEvents();
},
},
methods: {
// 初始化事件
bindEvents() {
this.$nextTick(() => {
var that = this
if (!this.target || this.binded) return
console.log(this);
this.triggerShowFn = this.contextMenuHandler.bind(this)
this.target.addEventListener('contextmenu', this.triggerShowFn)
//this.binded = true
})
if (!this.target || this.binded) return;
this.triggerShowFn = this.contextMenuHandler.bind(this);
this.target.addEventListener("contextmenu", this.triggerShowFn);
});
},
// 取消绑定事件
unbindEvents() {
if (!this.target) return
this.target.removeEventListener('contextmenu', this.triggerShowFn)
if (!this.target) return;
this.target.removeEventListener("contextmenu", this.triggerShowFn);
},
// 绑定隐藏菜单事件
bindHideEvents() {
this.triggerHideFn = this.clickDocumentHandler.bind(this)
document.addEventListener('mousedown', this.triggerHideFn)
document.addEventListener('mousewheel', this.triggerHideFn)
this.triggerHideFn = this.clickDocumentHandler.bind(this);
document.addEventListener("mousedown", this.triggerHideFn);
document.addEventListener("mousewheel", this.triggerHideFn);
},
// 取消绑定隐藏菜单事件
unbindHideEvents() {
document.removeEventListener('mousedown', this.triggerHideFn)
document.removeEventListener('mousewheel', this.triggerHideFn)
document.removeEventListener("mousedown", this.triggerHideFn);
document.removeEventListener("mousewheel", this.triggerHideFn);
},
// 鼠标按压事件处理器
clickDocumentHandler(e) {
this.$emit('update:show', false) //隐藏
this.$emit("update:show", false); //隐藏
},
// 右键事件事件处理
contextMenuHandler(e) {
e.target.click(); //这个是因为我需要获取tree节点的数据,所以我通过点击事件去获取数据
this.x = e.clientX;
this.y = e.clientY - 110;
this.layout();
this.$emit("update:show", true); //显示
e.preventDefault();
e.stopPropagation();
e.target.click()//这个是因为我需要获取tree节点的数据,所以我通过点击事件去获取数据
this.x = e.clientX
this.y = e.clientY - 110
this.layout()
this.$emit('update:show', true) //显示
e.preventDefault()
e.stopPropagation()
this.$emit('targetElement', e.target) //我还要获取右键的DOM元素进行操作
this.$emit("targetElement", e.target); //我还要获取右键的DOM元素进行操作
},
// 布局
layout() {
this.style = {
left: this.x + 'px',
top: this.y + 'px'
}
}
}
}
left: this.x + "px",
top: this.y + "px",
};
},
},
};
</script>
<style lang="scss">
#dropMenu {
......@@ -114,7 +113,7 @@ export default {
line-height: 30px;
background: #fff;
margin-bottom: 1px;
font-size:16px;
font-size: 16px;
cursor: pointer;
......@@ -123,7 +122,6 @@ export default {
text-decoration: underline;
}
}
}
}
</style>
\ No newline at end of file
......@@ -471,7 +471,6 @@ export default {
created() {
// this.siteId = window.sessionStorage.getItem("siteid") || null
this.siteId = session.getSession("siteid") || null;
console.log("cur siteId"+this.siteId)
let today = new Date();
let query = {
year: today.getFullYear(),
......@@ -510,9 +509,7 @@ export default {
this.pushChart.resize();
},
syncDeviceStat() {
this.$post("/device/stat/syncDeviceStat", {siteId:this.siteId})
this.$post("/device/stat/syncDeviceStat", { siteId: this.siteId })
.then((res) => {
if (res.code == 1) {
this.statData = res.data.data[0];
......@@ -529,11 +526,9 @@ export default {
let query = { createTimeStart: this.formatterDate(beforeday) };
//当前选择站点id
query.siteId = this.siteId;
console.log(query);
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
console.log("res", res);
this.statArrayData = res.data.data;
this.beforeday = this.statArrayData.map((i) => {
let daystr = i.month + "-" + i.day;
......
......@@ -59,15 +59,13 @@ export default {
components: { dialogShow },
mixins: [table],
created() {
console.log("queryIn:", this.queryIn);
if (this.queryIn && this.queryIn.alarmDevice) {
this.query = {};
this.query["alarmDevice"] = this.queryIn.alarmDevice;
}
this.changePath("/device/alarm/info");
this.query= Object.assign({}, this.query, {siteId:1});
this.query = Object.assign({}, this.query, { siteId: 1 });
},
methods: {
/** 重写新增方法 */
......
......@@ -77,7 +77,11 @@
prop="skinId"
v-model="form.skinId"
@change="skinSelect"
:enumData="!form.productCode?{0:'无'}:dict.skinProductCodeMap[form.productCode]"
:enumData="
!form.productCode
? { 0: '无' }
: dict.skinProductCodeMap[form.productCode]
"
type="select"
placeholder="选择首页"
/>
......@@ -186,7 +190,7 @@ export default {
open: false,
direction: "rtl",
urls: {
saveUrl: '/device/save',
saveUrl: "/device/save",
},
toString: [
"deviceFirmId",
......@@ -225,9 +229,8 @@ export default {
},
methods: {
changeProduct(val){
console.log("val",val)
this.form.productCode= this.dict.productCode[val];
changeProduct(val) {
this.form.productCode = this.dict.productCode[val];
},
skinSelect(val) {
this.form.skinName =
......@@ -252,7 +255,6 @@ export default {
this.form.siteId = row.siteId;
this.siteName = row.siteName;
this.siteCode = row.siteCode;
console.log("row", row);
this.getData();
this.title = "新增设备";
},
......@@ -271,7 +273,6 @@ export default {
},
/**获取数据后弹框 */
afterRender(data) {
console.log(data)
this.open = true;
if (this.pageInfo.type == "add" || this.pageInfo.type == "edit") {
this.form.siteName = this.siteName;
......@@ -294,9 +295,7 @@ export default {
this.$refs[refName].resetFields();
}
},
handleClose() {
console.log("关闭");
},
handleClose() {},
},
};
</script>
......@@ -62,7 +62,7 @@ export default {
"deviceStatus",
"enabled",
"deviceFirmId",
"source"
"source",
],
// 表单校验
rules: {
......@@ -87,7 +87,6 @@ export default {
this.getData();
this.pageInfo.type = "edit";
this.title = "修改设备";
},
/** 新增 */
add(row) {
......@@ -112,15 +111,13 @@ export default {
},
deleteDevice() {
console.log("删除设备信息");
this.$get("/device/delete", {
id: this.form.id,
})
.then((res) => {
if (res.code == 1) {
this.$message.success("删除成功!");
this.open=false;
this.open = false;
//this.getData();
}
})
......@@ -132,16 +129,12 @@ export default {
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
console.log("form:", this.form);
Object.assign(this.viewInfo, this.form);
console.log("viewInfo", this.viewInfo);
if(this.pageInfo.type=='add'){
if (this.pageInfo.type == "add") {
this.form.siteId = this.siteId;
this.form.siteName = this.siteName;
this.form.siteCode = this.siteCode;
}
console.log("form:", this.form);
},
afterSubmit(data) {
......@@ -159,9 +152,7 @@ export default {
this.$refs[refName].resetFields();
}
},
handleClose() {
console.log("关闭");
},
handleClose() {},
},
};
</script>
......@@ -201,7 +201,6 @@ export default {
components: { drawerShow, drawerView },
mixins: [table, tree],
created() {
console.log(this.$route);
this.siteId = this.$route.query.siteId;
this.info = this.$route.query;
this.query = { siteId: this.siteId };
......@@ -267,7 +266,6 @@ export default {
/** 导出Excel */
doExport() {
this.isExport = true;
console.log("ids", this.selection);
this.$download(
"/device/exportExcel",
{
......@@ -363,8 +361,6 @@ export default {
},
updateSite(row) {
console.log("update site");
this.$get("/sitestat/siteTree", {}).then(({ data }) => {
this.areaData = data.siteTree;
this.tree.open = true;
......@@ -373,7 +369,6 @@ export default {
},
handleNodeClick(node) {
console.log("click node", node);
this.currentNode = node;
},
......
......@@ -28,8 +28,6 @@ export default {
components: { dialogShow },
mixins: [table],
created() {
console.log("queryIn:", this.queryIn);
//this.config.addQuery = { deviceId, deviceType };
if (this.queryIn.deviceId) {
......@@ -37,8 +35,6 @@ export default {
this.query["deviceId"] = this.queryIn.deviceId;
}
console.log("pageInfo--before", this.pageInfo);
// this.changePath("/device/alarm/info")
this.pageInfo.list = "/device/module/use/list";
......@@ -46,8 +42,6 @@ export default {
this.pageInfo.add = "/device/module/use/add";
this.pageInfo.edit = "/device/module/use/edit";
this.pageInfo.view = "/device/module/use/view";
console.log("pageInfo", this.pageInfo);
},
methods: {
/** 重写新增方法 */
......
......@@ -155,9 +155,7 @@
label-class-name="labelClass"
content-class-name="contentClass"
>
<ImagePreview :src="form.devicePhotoPath" />
</el-descriptions-item>
<el-descriptions-item
......@@ -218,11 +216,10 @@
>
{{ util_formatterDate(form.offlineTime) }}
</el-descriptions-item>
</el-descriptions>
<br/>
<br />
<el-descriptions
<el-descriptions
:title="title"
:column="column"
:size="size"
......@@ -233,10 +230,8 @@
<i class="el-icon-tickets"></i>
设备位置
</template>
</el-descriptions>
<Map></Map>
</layout-view>
</template>
......@@ -255,16 +250,13 @@ export default {
},
},
components: {},
created() {
console.log(this.form,this.dict);
},
created() {},
methods: {
util_formatterDate(time) {
if(time==null){
return ''
if (time == null) {
return "";
}
let date = new Date(Number(time));
let Y = date.getFullYear() + "-";
let M =
......
......@@ -23,19 +23,10 @@ export default {
loginFail(error) {
this.$message.error(error.message || "请登录");
console.log("href:" + process.env.VUE_APP_PORTAL_URL);
window.location.href =
process.env.VUE_APP_PORTAL_URL == "undefined"
? "http://192.168.0.98:11072"
: process.env.VUE_APP_PORTAL_URL;
// window.location.href=process.env.VUE_APP_PORTAL_URL
// this.$router.replace({
// path: '/login',
// query: {
// redirect: this.redirect,
// }
// });
// window.location.href =
// process.env.VUE_APP_PORTAL_URL == "undefined"
// ? "http://192.168.0.98:11072"
// : process.env.VUE_APP_PORTAL_URL;
},
},
computed: {
......
......@@ -3,16 +3,28 @@
<template>
<div class="page page-login flex flex-v">
<div class="form-wrap flex flex-1">
<el-form @submit.prevent='onSubmit' ref="form" :model="form" label-width="80px" size="small">
<el-form
@submit.prevent="onSubmit"
ref="form"
:model="form"
label-width="80px"
size="small"
>
<h1>设备管理平台</h1>
<el-form-item label="用户名">
<el-input v-model="form.loginName"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" type='password'></el-input>
<el-input v-model="form.password" type="password"></el-input>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" native-type='submit' :loading='loading' @click='onSubmit'>登录</el-button>
<el-button
type="primary"
native-type="submit"
:loading="loading"
@click="onSubmit"
>登录</el-button
>
</el-form-item>
</el-form>
</div>
......@@ -20,7 +32,6 @@
<div class="footer">
登陆 &copy; <a href="">信宏翔网络科技有限公司</a> 出品
</div>
</div>
</template>
......@@ -30,20 +41,15 @@ import { createSocket } from "@/assets/utils/websocket";
export default {
name: "login",
created() {
console.log("url:"+process.env.VUE_APP_PORTAL_URL)
// let obj = {};
// obj.lng = 104.21;
// obj.lat = 30.56;
// obj.address = "测试站点";
// obj.siteId = 2;
// this.originData.push(obj);
// this.$nextTick(() => {
// this.$refs.map1.refresh(this.originData);
// });
// window.location.href=process.env.VUE_APP_PORTAL_URL=='undefined'?'http://192.168.0.98:11072':process.env.VUE_APP_PORTAL_URL
},
methods: {
......@@ -54,14 +60,12 @@ console.log("url:"+process.env.VUE_APP_PORTAL_URL)
.catch(this.loginFail);
},
loginSuccess({ data }) {
console.log("userData", data);
this.$store.commit("setUserData", data);
this.$router.replace({
path: this.redirect,
});
//成功 创建websocket连接 process.env.VUE_WEBSOCKET_BASE_API +
console.log("process", process.env);
// createSocket("ws://"+process.env.VUE_APP_BASE_API +"/ws?accessToken="+data.id)
},
loginFail(error) {
......
......@@ -4,38 +4,77 @@
:title="title"
:visible.sync="open"
:direction="direction"
size="50%">
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field
:span="22"
label="所属平台"
prop="platformId"
v-model="form.platformId"
:enumData="dict.platformId"
type="select"
placeholder="请输入产品名称,名称唯一"
/>
<Field :span="22" label="所属平台" prop="platformId" v-model="form.platformId" :enumData="dict.platformId" type="select" placeholder="请输入产品名称,名称唯一"/>
<Field
:span="22"
label="产品名称"
prop="productName"
v-model="form.productName"
placeholder="请输入产品名称,名称唯一"
/>
<Field
:span="22"
label="产品编码"
prop="productCode"
v-model="form.productCode"
placeholder="请输入产品编码"
/>
<Field :span="22" label="产品名称" prop="productName" v-model="form.productName" placeholder="请输入产品名称,名称唯一"/>
<Field :span="22" label="产品编码" prop="productCode" v-model="form.productCode" placeholder="请输入产品编码"/>
<Field :span="22" label="默认首页" prop="skinId" v-model="form.skinId" @change="skinSelect" :enumData="dict.skinProductCodeMap[form.productCode]" type="select" placeholder="请输入产品名称,名称唯一"/>
<Field :span="22" v-if="form.productCode=='pjq'" label="事件地址" prop="eventUrl" v-model="form.eventUrl" placeholder="请输入事件地址"/>
<Field :span="22" label="备注" prop="productRemark" v-model="form.productRemark" type="textarea" placeholder="请输入备注"/>
<Field
:span="22"
label="默认首页"
prop="skinId"
v-model="form.skinId"
@change="skinSelect"
:enumData="dict.skinProductCodeMap[form.productCode]"
type="select"
placeholder="请输入产品名称,名称唯一"
/>
<Field
:span="22"
v-if="form.productCode == 'pjq'"
label="事件地址"
prop="eventUrl"
v-model="form.eventUrl"
placeholder="请输入事件地址"
/>
<Field
:span="22"
label="备注"
prop="productRemark"
v-model="form.productRemark"
type="textarea"
placeholder="请输入备注"
/>
</el-row>
<form-buttons @submit='submitForm' noCancelBtn />
<form-buttons @submit="submitForm" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
import form from "@/assets/mixins/formdialog";
export default {
name: "ProductDetail",
mixins: [form],
components: {
},
components: {},
created() {
this.changePath("product")
this.changePath("product");
},
data() {
return {
......@@ -45,60 +84,60 @@
title: "产品",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:['platformId','skinId'
],
toDate:[
],
direction: "rtl",
toString: ["platformId", "skinId"],
toDate: [],
// 表单校验
rules: {
productName: [
{required: true,message: "请输入产品名称,名称唯一", trigger: "blur" },
{max: 20,message: "最多只能录入20个字符",trigger: "blur",},
{
required: true,
message: "请输入产品名称,名称唯一",
trigger: "blur",
},
{ max: 20, message: "最多只能录入20个字符", trigger: "blur" },
],
productCode: [
{required: true,message: "请输入产品编码", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
{ required: true, message: "请输入产品编码", trigger: "blur" },
{ max: 256, message: "最多只能录入256个字符", trigger: "blur" },
],
homeUrl: [
{required: true,message: "请输入首页地址", trigger: "blur" },
{max: 512,message: "最多只能录入512个字符",trigger: "blur",},
]
}
{ required: true, message: "请输入首页地址", trigger: "blur" },
{ max: 512, message: "最多只能录入512个字符", trigger: "blur" },
],
},
};
},
methods: {
skinSelect(val){
console.log("val:"+val)
console.log("label:"+this.dict.skinProductCodeMap[this.form.productCode][val])
this.form.skinName=this.dict.skinProductCodeMap[this.form.productCode][val]
skinSelect(val) {
this.form.skinName =
this.dict.skinProductCodeMap[this.form.productCode][val];
},
/** 编辑 */
edit(row) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl ="product/edit";
this.urls.currUrl = "product/edit";
this.getData();
this.pageInfo.type="edit"
this.pageInfo.type = "edit";
this.title = "修改产品";
},
/** 新增 */
add(row) {
this.reset()
this.reset();
this.urls.currUrl = "product/add";
this.getData();
this.pageInfo.type="add"
this.pageInfo.type = "add";
this.title = "新增产品";
},
/** 查看*/
view(row) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl ="product/view";
this.urls.currUrl = "product/view";
this.getData();
this.pageInfo.type="view"
this.pageInfo.type = "view";
this.title = "产品详细";
},
/**取消按钮 */
......@@ -118,10 +157,10 @@
// 表单重置
reset() {
this.form = {
platformId : null,
productName : "",
productCode : "",
productRemark : "",
platformId: null,
productName: "",
productCode: "",
productRemark: "",
};
this.resetForm("form");
},
......@@ -131,5 +170,5 @@
}
},
},
};
};
</script>
......@@ -122,24 +122,19 @@ export default {
},
switchStat() {
console.log("切换地图页面");
this.$router.push({
path: "/sitestat/maplist",
});
},
handleNodeClick(node) {
console.log("click node", node);
this.currentNode = node;
if (node.type === "site") {
//分页查询站点业务列表
// this.siteMatterTable.siteId = node.id;
//this.getSiteMatterTableData();
console.log(node.id.search(",") > -1);
if (node.id.search(",") > -1) {
console.log(node.id);
//this.query = { siteId: node.id.split(",")[0] ,siteIdList:node.id.split(",")}
this.query = {
......@@ -150,12 +145,12 @@ export default {
}
this.getData();
}else if(node.type==='area'){
} else if (node.type === "area") {
this.query = { areaCode: node.areaCode };
this.getData();
}
}
},
},
data() {
return {
......
......@@ -174,13 +174,11 @@ export default {
components: { drawerShow, drawerView },
mixins: [table],
created() {
console.log("route", this.$route);
let { siteId } = this.$route.query;
let { sitestatId } = this.$route.query;
this.$get("/sitestat/info", { id: sitestatId })
.then(({ data }) => {
console.log(data);
this.info = data;
this.$nextTick(() => {
this.$refs.map.relocate(this.info);
......@@ -237,7 +235,6 @@ export default {
switchChange(val) {
let arr = [];
for (let item in this.items) {
console.log(this.items[item]);
if (this.items[item] && this.items[item] != 0)
arr.push(this.items[item]);
}
......@@ -248,7 +245,6 @@ export default {
this.getData();
},
afterRender(data) {
console.log("tableData", data);
if (!this.sync) {
this.$nextTick(() => {
var count = 0;
......
......@@ -43,7 +43,6 @@ export default {
components: { dialogShow },
mixins: [table, tree],
mounted() {
console.log(this.pageInfo);
this.pageInfo.list = "/sitestat/list";
},
......@@ -89,7 +88,6 @@ export default {
},
getDetailData(info, callback) {
console.log("info:", info);
this.$router.push({
path: "/sitestat/mapDetail",
// query: info,
......@@ -117,14 +115,12 @@ export default {
},
switchStat() {
console.log("切换列表页面");
this.$router.push({
path: "/sitestat/list",
});
},
handleNodeClick(node) {
console.log("click node", node);
this.currentNode = node;
if (node.type === "site") {
let obj = {};
......
......@@ -108,7 +108,6 @@ export default {
return this.$message.warning("请先完成上一个地址的填写");
}
urls.push({ value: "" });
console.log("urls", urls);
},
isRepeat(value) {
return this.form.urls.filter((i) => value == i.value).length > 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment