Commit 03d1a603 by weix

站点功能

parent f7dfd171
...@@ -616,6 +616,11 @@ export default { ...@@ -616,6 +616,11 @@ export default {
return '优惠券' return '优惠券'
default: default:
} }
},
specialSymbol(str) {
// 验证是否包含特殊字符,包含则返回true
let p = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im;
return p.test(str);
} }
} }
} }
import {get, post, put, deletes} from '@/request/http'
export function addSite(data) {
const url = process.env.VUE_APP_BASE_API8+'/site/info';
return post(url, data)
}
export function editSite(data) {
const url = process.env.VUE_APP_BASE_API8+'/site/info';
return put(url, data)
}
export function delSite(data) {
const url = process.env.VUE_APP_BASE_API8+'/site/info';
return deletes(url, data)
}
...@@ -17,6 +17,24 @@ export const currencyRoutes = [{ ...@@ -17,6 +17,24 @@ export const currencyRoutes = [{
hidden: true hidden: true
}, },
{ {
path: '/Real',
component: () =>
import('@/views/components/newReal.vue'),
meta: {
title: '实名认证'
},
hidden: true
},
{
path: '/JoiningEnterprise',
component: () =>
import('@/views/components/newJoiningEnterprise.vue'),
meta: {
title: '加入企业'
},
hidden: true
},
{
path: '/401', path: '/401',
name: '401', name: '401',
component: () => component: () =>
......
import Vue from 'vue';
// 使用 Event Bus
const bus = new Vue();
export default bus;
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="title" :title="title"
width="40%" width="60%"
class="form-dialog" class="form-dialog"
@close="clearInfo" @close="clearInfo"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -12,19 +12,19 @@ ...@@ -12,19 +12,19 @@
<el-form-item label="站点区域名称:" prop="siteName"> <el-form-item label="站点区域名称:" prop="siteName">
<el-input style="width: 220px;" size="mini" v-model="form.siteName"></el-input> <el-input style="width: 220px;" size="mini" v-model="form.siteName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="站点区域类型:" prop="siteTypeList"> <el-form-item label="站点区域类型:" prop="siteType">
<el-select multiple v-model="form.siteTypeList"> <el-select v-model="form.siteType">
<el-option label="飞机场" value="1"></el-option> <el-option label="飞机场" :value="1"></el-option>
<el-option label="火车站" value="2"></el-option> <el-option label="火车站" :value="2"></el-option>
<el-option label="高铁站" value="3"></el-option> <el-option label="高铁站" :value="3"></el-option>
<el-option label="客车站" value="4"></el-option> <el-option label="客车站" :value="4"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站点所属区域:" prop="penCity"> <el-form-item label="站点所属区域:" prop="penCity">
<el-cascader v-model="form.penCity" :show-all-levels="false" :props="props"></el-cascader> <el-cascader v-model="form.penCity" :show-all-levels="false" :props="props"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="关联电子围栏:" prop="polygonId"> <el-form-item label="关联电子围栏:" prop="polygonInfo">
<el-select v-model="form.polygonId"> <el-select v-model="form.polygonInfo">
<el-option <el-option
v-for="(item, index) in polygonData" v-for="(item, index) in polygonData"
:label="item.name" :label="item.name"
...@@ -35,9 +35,48 @@ ...@@ -35,9 +35,48 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站点专线:" prop="stationList"> <el-form-item label="站点专线:" prop="stationList">
<el-table
:data="form.stationList"
border
class="table-row"
:row-style="tableRowStyle"
:header-cell-style="tableHeaderColor"
>
<el-table-column align="center" label="站点名称">
<template slot-scope="scope">
<el-input size="mini" v-model="scope.row.pointsName"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="纬度">
<template slot-scope="scope">
<el-input size="mini" v-model="scope.row.pointLat"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="经度">
<template slot-scope="scope">
<el-input size="mini" v-model="scope.row.pointLng"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="55">
<template slot-scope="scope">
<el-button @click="delStation(scope.$index)" v-if="scope.$index > 0" type="text" style="color: red;cursor:pointer;">
删除
</el-button>
<span v-else>
/
</span>
</template>
</el-table-column>
</el-table>
<el-row class="table-bottom-row" type="flex" justify="center" align="center" @click.native="addStation">
新增
</el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="clearInfo">取 消</el-button>
<el-button :loading="saveLoading" size="small" type="primary" @click="confirmBtn">确 定</el-button>
</span>
</el-dialog> </el-dialog>
</template> </template>
...@@ -47,11 +86,22 @@ import { ...@@ -47,11 +86,22 @@ import {
getAllFenceList getAllFenceList
} from "@/port/set-request"; } from "@/port/set-request";
import {addSite, editSite} from "@/port/site/site";
import JudgeType from "@/mixins/judgeType";
export default { export default {
name: "addDialog", name: "addDialog",
mixins: [JudgeType],
data() { data() {
const checkSiteName = (rule, value, callback) => {
if (!value) return callback(new Error('站点区域名称不能为空'));
if (this.specialSymbol(value)) return callback(new Error('站点区域名称不能包含特殊字符'));
if (value.length > 50) return callback(new Error('站点区域名称不能大于五十个字'))
return callback()
}
return { return {
dialogVisible: false, dialogVisible: false,
saveLoading: false,
props: { props: {
lazy: true, lazy: true,
lazyLoad(node, resolve) { lazyLoad(node, resolve) {
...@@ -63,12 +113,12 @@ export default { ...@@ -63,12 +113,12 @@ export default {
} else { } else {
parent = node.value parent = node.value
} }
getAllprovinceAndCity(parent).then(res => { getAllprovinceAndCity(JSON.parse(parent).id).then(res => {
if (res.status == 200) { if (res.status == 200) {
let list = res.data let list = res.data
const nodes = list.map(item => { const nodes = list.map(item => {
return { return {
value: item.id, value: JSON.stringify({id: item.id, name: item.fullname}),
label: item.fullname, label: item.fullname,
leaf: level >= 1 leaf: level >= 1
} }
...@@ -80,26 +130,26 @@ export default { ...@@ -80,26 +130,26 @@ export default {
}, },
form: { form: {
siteName: '', siteName: '',
siteTypeList: [], siteType: '',
penCity: [], penCity: [],
polygonId: '', polygonInfo: '',
stationList: [] stationList: []
}, },
rules: { rules: {
siteName: [ siteName: [
{required: true, message: "请输入站点区域名称", trigger: "blur"}, {required: true, validator: checkSiteName, trigger: "blur"},
], ],
siteTypeList: [ siteType: [
{required: true, message: "请选择站点区域类型", trigger: "change"}, {required: true, message: "请选择站点区域类型", trigger: "change"},
], ],
penCity: [ penCity: [
{required: true, message: "请选择站点所属区域", trigger: "change"}, {required: true, message: "请选择站点所属区域", trigger: "change"},
], ],
polygonId: [ polygonInfo: [
{required: true, message: "请选择关联电子围栏", trigger: "change"}, {required: true, message: "请选择关联电子围栏", trigger: "change"},
], ],
stationList: [ stationList: [
{message: "请输入参加次数", trigger: "blur"}, {required: true, message: "请输入参加次数"},
], ],
}, },
title: '添加站点区域', title: '添加站点区域',
...@@ -121,7 +171,7 @@ export default { ...@@ -121,7 +171,7 @@ export default {
let data = []; let data = [];
res.data.content.forEach((item) => { res.data.content.forEach((item) => {
data.push({ data.push({
id: item.traceId, id: JSON.stringify({id: item.id, name: item.polygonName}),
name: item.polygonName name: item.polygonName
}) })
}) })
...@@ -134,21 +184,127 @@ export default { ...@@ -134,21 +184,127 @@ export default {
}) })
}, },
methods: { methods: {
delStation(index) {
this.form.stationList.splice(index, 1);
},
addStation() {
let station = this.form.stationList[this.form.stationList.length-1];
if(station.pointLat === '' || station.pointLng === '' || station.pointsName === '') {
return this.$message.error('请先输入最后一行信息');
}
this.form.stationList.push({pointLat: "", pointLng: "", pointsName: ""});
},
confirmBtn() {
this.$refs.form.validate((valid) => {
if(valid) {
let stationList = this.form.stationList;
for (let i = 0; i < stationList.length; i++) {
if(stationList[i].pointsName === '') return this.$message.error(`第${(i+1)}条专线,专线名称不能为空`);
if(this.specialSymbol(stationList[i].pointsName)) return this.$message.error(`第${(i+1)}条专线,站点名称不能包含特殊字`);
if(stationList[i].pointsName.length > 40) return this.$message.error(`第${(i+1)}条专线,站点名称不能大于四十个`);
if(stationList[i].pointLat === '') return this.$message.error(`第${(i+1)}条专线,纬度不能为空`);
if(stationList[i].pointLng === '') return this.$message.error(`第${(i+1)}条专线,经度不能为空`);
}
let form = this.form;
form['provinceCode'] = JSON.parse(form.penCity[0]).id;
form['provinceName'] = JSON.parse(form.penCity[0]).name;
form['areaCode'] = JSON.parse(form.penCity[1]).id;
form['areaName'] = JSON.parse(form.penCity[1]).name;
form['polygonId'] = JSON.parse(form.polygonInfo).id;
form['polygonName'] = JSON.parse(form.polygonInfo).name;
console.log(form)
this.saveLoading = true;
if(form.hasOwnProperty('id')) {
editSite(form)
.then((res) => {
if(res.status === 200) {
this.$message.success('修改成功');
this.clearInfo();
}else {
this.$message.error(res.msg);
}
this.saveLoading = false;
})
.catch(() => {
this.saveLoading = false;
})
}else {
form['id'] = '';
addSite(form)
.then((res) => {
if(res.status === 200) {
this.$message.success('新增成功');
this.clearInfo();
}else {
this.$message.error(res.msg);
}
this.saveLoading = false;
})
.catch(() => {
this.saveLoading = false;
})
}
}
})
},
clearInfo() { clearInfo() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.dialogVisible = false; this.dialogVisible = false;
this.$emit('backInitTable');
}, },
showDialog(row) { showDialog(row) {
if (Object.keys(row).length > 0) { if (Object.keys(row).length > 0) {
this.title = '修改站点区域' this.title = '修改站点区域'
this.form = {
siteName: row.siteName,
siteType: row.siteType,
penCity: [
JSON.stringify({id: row.provinceCode,name: row.provinceName}),
JSON.stringify({id: row.areaCode, name: row.areaName})
],
polygonInfo: JSON.stringify({id: row.polygonId, name: row.polygonName}),
stationList: JSON.parse(row.stationList),
id: row.id
}
}else {
this.form.stationList = [
{pointLat: "", pointLng: "", pointsName: ""}
];
} }
this.dialogVisible = true; this.dialogVisible = true;
},
// table变色,行
tableRowStyle({row, rowIndex}) {
if (rowIndex % 2 !== 0) {
return {'background-color': '#e3f4ff'};
} }
},
// table变色,头
tableHeaderColor({row, column, rowIndex, columnIndex}) {
return {'background-color': '#0099ff', color: '#ffffff'};
},
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
::v-deep.table-row {
th {
padding: 3px 0 !important;
font-weight: normal;
height: auto;
line-height: normal;
}
}
.table-bottom-row {
border: 1px solid #EBEEF5;
border-top: none;
color: #3C6CF1;
cursor: pointer;
}
</style> </style>
<template xmlns="http://www.w3.org/1999/html"> <template xmlns="http://www.w3.org/1999/html">
<el-card class="enclosureItemBox"> <el-card class="enclosureItemBox">
<el-row>
<div class="title-left" style="padding-left: 10px;font-weight: 800;">
围栏管理
</div>
</el-row>
<div class="mapBox"> <div class="mapBox">
<div <div
:style="{ :style="{
...@@ -549,9 +554,9 @@ export default { ...@@ -549,9 +554,9 @@ export default {
rows: this.size, rows: this.size,
}, },
polygonName: this.searchStr, polygonName: this.searchStr,
// platformId: this.$store.getters.platformId "61fdff1d455c4ab8a2efc564c245b90d", platformId: this.$store.getters.platformId,
//TODO 临时使用 //TODO 临时使用
platformId: "61fdff1d455c4ab8a2efc564c245b90d", // platformId: "61fdff1d455c4ab8a2efc564c245b90d",
}; };
if (!!cityCode) { if (!!cityCode) {
json.cityCode = cityCode; json.cityCode = cityCode;
...@@ -571,9 +576,9 @@ export default { ...@@ -571,9 +576,9 @@ export default {
rows: 999, rows: 999,
}, },
polygonName: this.searchStr, polygonName: this.searchStr,
// platformId: this.$store.getters.platformId, platformId: this.$store.getters.platformId,
//TODO 临时使用 //TODO 临时使用
platformId: "61fdff1d455c4ab8a2efc564c245b90d", // platformId: "61fdff1d455c4ab8a2efc564c245b90d",
cityCode: cityCode, cityCode: cityCode,
}; };
getAllFenceList(json).then((res) => { getAllFenceList(json).then((res) => {
...@@ -841,7 +846,8 @@ export default { ...@@ -841,7 +846,8 @@ export default {
polygonType: this.EnclosureForm.type, polygonType: this.EnclosureForm.type,
// platformId: this.$store.getters.platformId, // platformId: this.$store.getters.platformId,
//TODO 临时使用 //TODO 临时使用
platformId: "61fdff1d455c4ab8a2efc564c245b90d", // platformId: "61fdff1d455c4ab8a2efc564c245b90d",
platformId: this.$store.getters.platformId,
polygonAttribute: "1", polygonAttribute: "1",
traceId: this.EnclosureForm.traceId, traceId: this.EnclosureForm.traceId,
polygonTypeValue: this.EnclosureForm.fenceTypeName, polygonTypeValue: this.EnclosureForm.fenceTypeName,
...@@ -1047,4 +1053,13 @@ export default { ...@@ -1047,4 +1053,13 @@ export default {
.amap-box { .amap-box {
position: relative; position: relative;
} }
.title-left::before {
content: '';
position: absolute;
left: 0;
top: 10%;
width: 5px;
height: 80%;
background-color: #0099ff;
}
</style> </style>
<template> <template>
<el-card type="flex" justify="end"> <el-card type="flex" justify="end">
<el-row>
<div class="title-left" style="padding-left: 10px;font-weight: 800;">
站点管理
</div>
</el-row>
<el-form class="form-row"> <el-form class="form-row">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
...@@ -69,11 +74,11 @@ ...@@ -69,11 +74,11 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="120"> <el-table-column label="操作" align="center" fixed="right" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="text"> <el-button size="small" type="text" @click="() => $refs.addDialog.showDialog(scope.row)">
管理 编辑
</el-button> </el-button>
<el-button size="small" type="text" style="color: red;"> <el-button size="small" type="text" style="color: red;" @click="delSite(scope.row.id)">
关闭 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -89,7 +94,7 @@ ...@@ -89,7 +94,7 @@
</el-pagination> </el-pagination>
</div> </div>
<addDialog ref="addDialog"></addDialog> <addDialog ref="addDialog" @backInitTable="backInitTable"></addDialog>
</el-card> </el-card>
</template> </template>
...@@ -98,6 +103,7 @@ import { ...@@ -98,6 +103,7 @@ import {
selectHotAreaList, selectHotAreaList,
getAllprovinceAndCity getAllprovinceAndCity
} from "@/port/set-request"; } from "@/port/set-request";
import {delSite} from "@/port/site/site";
import Selects from '@/components/Selects' import Selects from '@/components/Selects'
import dataSource from "@/libs/screen"; import dataSource from "@/libs/screen";
import JudgeType from "@/mixins/judgeType"; import JudgeType from "@/mixins/judgeType";
...@@ -155,6 +161,34 @@ export default { ...@@ -155,6 +161,34 @@ export default {
this.initTable(); this.initTable();
}, },
methods: { methods: {
delSite(id) {
this.$confirm('是否确认删除', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
delSite({sId: id})
.then((res) => {
if(res.status === 200) {
this.$message.success('删除成功');
this.initTable();
}else {
this.$message.error(res.msg);
}
})
.catch(() => {
})
})
.catch(() => {
})
},
backInitTable() {
this.initTable();
},
handlechangeList(val) { handlechangeList(val) {
let source = JSON.parse(JSON.stringify(val)); let source = JSON.parse(JSON.stringify(val));
this.form.siteTypeList = this.filftersFun(source.data); this.form.siteTypeList = this.filftersFun(source.data);
...@@ -226,4 +260,14 @@ export default { ...@@ -226,4 +260,14 @@ export default {
margin-top: 16px; margin-top: 16px;
text-align: right; text-align: right;
} }
.title-left::before {
content: '';
position: absolute;
left: 0;
top: 10%;
width: 5px;
height: 80%;
background-color: #0099ff;
}
</style> </style>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
</el-row> </el-row>
<el-row style="padding-top: 10px;"> <el-row style="padding-top: 10px;">
{{ platformForm ? platformForm.org.orgInfo.info : ''}} {{ platformForm ? platformForm.org.orgInfo ? platformForm.org.orgInfo.info : platformForm.org.scode : ''}}
</el-row> </el-row>
</el-card> </el-card>
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
imageUrl: j.org.logoUrl, imageUrl: j.org.logoUrl,
enterpriseDescribe: j.org.orgForShort, enterpriseDescribe: j.org.orgForShort,
address: j.org.address, address: j.org.address,
companyDescribe: j.org.orgInfo.info, companyDescribe: j.org.orgInfo ? j.org.orgInfo.info : j.org.scode,
opername: j.org.opername, opername: j.org.opername,
operIdcard: j.org.operIdcard, operIdcard: j.org.operIdcard,
} }
......
...@@ -470,9 +470,17 @@ export default { ...@@ -470,9 +470,17 @@ export default {
// 运营组织商 // 运营组织商
async operatorPrivilegesLogin(userId) { async operatorPrivilegesLogin(userId) {
// 运营组织商信息接口 // 运营组织商信息接口
let {data} = await operatorPrivileges(userId) let {data, status} = await operatorPrivileges(userId)
console.log(data,"看看") console.log(data,"看看")
if(data) { if(data) {
if(status === 205) {
this.$router.push({
path: '/JoiningEnterprise',
query: {
type: 1
}
})
}
if (data.roleType == 1) { if (data.roleType == 1) {
// 品牌方路由 // 品牌方路由
this.$store.commit('user/ROLE_TYPE', data.roleType) this.$store.commit('user/ROLE_TYPE', data.roleType)
......
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