Compare commits

..

2 Commits

@ -2,13 +2,13 @@
* @Author: 王文杰
* @Date: 2024-02-02 14:19:40
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-05-21 09:35:25
* @LastEditTime: 2024-05-21 16:23:01
* @FilePath: /jnpf-web/src/utils/apiUrl.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
module.exports = {
// 开发环境接口配置
// APIURl: 'http://127.0.0.1:30000'
APIURl: 'http://127.0.0.1:30000'
// 测试环境接口配置
APIURl: 'http://192.168.0.23:30000'
// APIURl: 'http://192.168.0.23:30000'
}

@ -31,9 +31,9 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="站点编号"
prop="stationCode" tip-label="绑定站点编码" >
<p>{{dataForm.stationCode}}</p>
<jnpf-form-tip-item label="绑定商户"
prop="companyId" tip-label="绑定商户" >
<p>{{dataForm.companyId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
@ -87,7 +87,7 @@
areaName : '',
areaType : "",
status : "1",
stationCode : "",
companyId : [],
areaMapInfo : '',
areaDesc : '',
creatorUserId : "",

@ -8,7 +8,7 @@
</div>
<div id="mapFencecontainer" class="mapBox">
<div class="mapBtn">
<!-- <el-button size="small" type="danger" @click="delpolygon()"></el-button> -->
<el-button size="small" type="danger" @click="delpolygon()"></el-button>
<el-button size="small" type="danger" @click="clearOverlays()"></el-button>
<el-button size="small" type="primary" @click="sendLngLat"></el-button>
<!-- <el-button size="small" type="primary" @click="sendMsg"></el-button> -->
@ -77,12 +77,15 @@ export default {
},
//
init() {
const lat = this.position.lat
const lng = this.position.lng
const lat = '34.81098454894641' || this.position.lat
const lng = '113.64789962768555' || this.position.lng
map = new qq.maps.Map(document.getElementById('mapFencecontainer'), {
center: new qq.maps.LatLng(lat, lng), //
zoom: 22
});
qq.maps.event.addListener(map, "click", function (event) {
console.log('您点击的位置为: [' + event.latLng.getLat() + ', ' + event.latLng.getLng() + ']');
});
//
// 便
// path4 = [];
@ -93,7 +96,7 @@ export default {
console.log(path4);
this.showpolygon(path4);
//
// ,
this.addpolygon();
},
/**
@ -136,6 +139,7 @@ export default {
drawingManager.setMap(map);
qq.maps.event.addListener(drawingManager, 'overlaycomplete', function (event) {
// clearOverlays(overlaysArray)
console.log('event',event); //
lngLat = [];
overlaysArray.push(event.overlay);
for (const item of event.overlay.getPath().elems) {
@ -147,9 +151,14 @@ export default {
lng: lng
});
}
console.log('overlaycomplete',lngLat, overlaysArray); //
});
console.log('overlaycomplete',lngLat); //
qq.maps.event.addListener(drawingManager, 'markercomplete', function (event) {
console.log('markercomplete', event); //
});
},
//
showpolygon(path3) {

File diff suppressed because one or more lines are too long

@ -1,8 +1,12 @@
<template>
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<el-page-header @back="goBack"
:content="!dataForm.id ? '新建':'编辑'"/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
@ -11,59 +15,58 @@
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{ '上一条' }}
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{ '下一条' }}
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading"
:disabled='btnLoading'>
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'>
</el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> </el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<jnpf-form-tip-item label="区域名称" tipLabel="围栏区域名称" prop="areaName">
<JnpfInput v-model="dataForm.areaName" @change="changeData('areaName', -1)" placeholder="电子围栏名称"
clearable :style='{ "width": "100%" }'>
<el-col :span="24" >
<jnpf-form-tip-item
label="区域名称" tipLabel="围栏区域名称" prop="areaName" >
<JnpfInput v-model="dataForm.areaName" @change="changeData('areaName',-1)"
placeholder="电子围栏名称" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="区域类型" tipLabel="请选择围栏类型" prop="areaType">
<JnpfSelect v-model="dataForm.areaType" @change="changeData('areaType', -1)" placeholder="请选择围栏类型"
clearable :style='{ "width": "100%" }' :options="areaTypeOptions" :props="areaTypeProps">
<el-col :span="24" >
<jnpf-form-tip-item
label="区域类型" tipLabel="请选择围栏类型" prop="areaType" >
<JnpfSelect v-model="dataForm.areaType" @change="changeData('areaType',-1)"
placeholder="请选择围栏类型" clearable :style='{"width":"100%"}' :options="areaTypeOptions" :props="areaTypeProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="是否启用" prop="status">
<JnpfRadio v-model="dataForm.status" @change="changeData('status', -1)" optionType="default"
direction="horizontal" size="small" :options="statusOptions" :props="statusProps">
<el-col :span="24" >
<jnpf-form-tip-item
label="是否启用" prop="status" >
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
optionType="default" direction="horizontal" size="small" :options="statusOptions" :props="statusProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="站点编号" tipLabel="绑定站点编码" prop="stationCode">
<JnpfPopupSelect v-model="dataForm.stationCode" @change="changeData('stationCode', -1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.stationCode" placeholder="请选择为那个站点绘制区域" hasPage
propsValue="station_code" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='station_name' field='stationCode' interfaceId="520259300875047493" :pageSize="20"
:columnOptions="stationCodecolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
<el-col :span="24" >
<jnpf-form-tip-item
label="绑定商户" tipLabel="绑定商户" prop="companyId" >
<JnpfOrganizeSelect v-model="dataForm.companyId" @change="changeData('companyId',-1)"
placeholder="请选择商户" selectType="all" :ableIds="ableAll.companyIdableIds" clearable :style='{"width":"100%"}'>
</JnpfOrganizeSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<el-col :span="24" >
<jnpf-form-tip-item label="电子围栏" tipLabel="在地图上绘制电子围栏" prop="areaMapInfo">
<JnpfInput @focus="handLeArea" placeholder="点击绘制电子围栏"
:maxlength="65539" readonly prefix-icon='el-icon-map-location' :style='{ "width": "100%" }'
@ -71,61 +74,59 @@
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="区域描述" tipLabel="请输入区域描述" prop="areaDesc">
<JnpfTextarea v-model="dataForm.areaDesc" @change="changeData('areaDesc', -1)"
placeholder="请输入不超过两百字的区域描述" :style='{ "width": "100%" }' true type="textarea"
:autosize='{ "minRows": 4, "maxRows": 4 }'>
<el-col :span="24" >
<jnpf-form-tip-item
label="区域描述" tipLabel="请输入区域描述" prop="areaDesc" >
<JnpfTextarea v-model="dataForm.areaDesc" @change="changeData('areaDesc',-1)"
placeholder="请输入不超过两百字的区域描述" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="修改用户" prop="lastModifyUserId">
<JnpfInput v-model="dataForm.lastModifyUserId" @change="changeData('lastModifyUserId', -1)"
placeholder="系统自动生成" readonly :style='{ "width": "100%" }'>
<el-col :span="24" >
<jnpf-form-tip-item
label="修改用户" prop="lastModifyUserId" >
<JnpfInput v-model="dataForm.lastModifyUserId" @change="changeData('lastModifyUserId',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="修改时间" prop="lastModifyTime">
<JnpfInput v-model="dataForm.lastModifyTime" @change="changeData('lastModifyTime', -1)"
placeholder="系统自动生成" readonly :style='{ "width": "100%" }'>
<el-col :span="24" >
<jnpf-form-tip-item
label="修改时间" prop="lastModifyTime" >
<JnpfInput v-model="dataForm.lastModifyTime" @change="changeData('lastModifyTime',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<area-dialog :position="position" :areaMapInfo="dataForm.areaMapInfo" v-if="areaVisible" @areaVisibleChange="handleAreaVisibleChange"
ref="JNPFForm" />
<area-dialog :position="position" :areaMapInfo="dataForm.areaMapInfo" v-if="areaVisible" @areaVisibleChange="handleAreaVisibleChange" />
<!-- <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> -->
</el-row>
</div>
</transition>
</template>
</template>
<script>
import areaDialog from './areaDialog'
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: {
areaDialog
},
import areaDialog from './areaDialog'
import request from '@/utils/request'
import {mapGetters} from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { areaDialog },
props: [],
data() {
return {
areaVisible: false,
position: {},
areaVisible: false,
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
@ -136,32 +137,32 @@ export default {
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
setting:{},
eventType: '',
userBoxVisible: false,
userBoxVisible:false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
currTableConf:{},
dataValueAll:{},
addTableConf:{
},
//
ableAll: {
ableAll:{
},
tableRows: {
tableRows:{
},
Vmodel: "",
currVmodel: "",
Vmodel:"",
currVmodel:"",
dataForm: {
areaName: undefined,
areaType: undefined,
status: "1",
stationCode: undefined,
areaMapInfo: undefined,
areaDesc: undefined,
creatorUserId: undefined,
deleteTime: undefined,
lastModifyUserId: undefined,
lastModifyTime: undefined,
areaName : undefined,
areaType : undefined,
status : "1",
companyId : [],
areaMapInfo : undefined,
areaDesc : undefined,
creatorUserId : undefined,
deleteTime : undefined,
lastModifyUserId : undefined,
lastModifyTime : undefined,
},
tableRequiredData: {},
dataRule:
@ -187,10 +188,10 @@ export default {
trigger: 'change'
},
],
stationCode: [
companyId: [
{
required: true,
message: '请选择为那个站点绘制区域',
message: '请至少选择一个',
trigger: 'change'
},
],
@ -202,26 +203,24 @@ export default {
},
],
},
areaTypeOptions: [],
areaTypeProps: { "label": "fullName", "value": "enCode" },
statusOptions: [],
statusProps: { "label": "fullName", "value": "enCode" },
stationCodecolumnOptions: [{ "label": "站点编码", "value": "station_code" }, { "label": "站点名称", "value": "station_name" },],
childIndex: -1,
isEdit: false,
areaTypeOptions:[],
areaTypeProps:{"label":"fullName","value":"enCode" },
statusOptions:[],
statusProps:{"label":"fullName","value":"enCode" },
childIndex:-1,
isEdit:false,
interfaceRes: {
areaName: [],
areaType: [],
status: [],
stationCode: [],
areaMapInfo: [],
areaDesc: [],
creatorUserId: [],
deleteTime: [],
lastModifyUserId: [],
lastModifyTime: [],
areaName:[] ,
areaType:[] ,
status:[] ,
companyId:[] ,
areaMapInfo:[] ,
areaDesc:[] ,
creatorUserId:[] ,
deleteTime:[] ,
lastModifyUserId:[] ,
lastModifyTime:[] ,
},
}
},
computed: {
@ -233,7 +232,7 @@ export default {
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
mounted() {},
methods: {
//
showPosition(position){
@ -256,11 +255,8 @@ export default {
handLeArea() {
this.getPosition()
},
handleAreaVisibleChange(areaVisible, areaMapInfo) {
handleAreaVisibleChange(areaVisible) {
this.areaVisible = areaVisible
if (areaMapInfo) {
this.dataForm.areaMapInfo = areaMapInfo
}
},
prev() {
this.index--
@ -290,7 +286,7 @@ export default {
},
getInfo(id) {
request({
url: '/api/scm/StationArea/' + id,
url: '/api/scm/StationArea/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
@ -314,7 +310,7 @@ export default {
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
if(this[options]){
this[options]()
}
this.changeData(key, index)
@ -323,8 +319,8 @@ export default {
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
@ -338,7 +334,7 @@ export default {
}
}
},
dataAll() {
dataAll(){
this.getareaTypeOptions();
this.getstatusOptions();
},
@ -355,10 +351,10 @@ export default {
goBack() {
this.$emit('refresh')
},
clearData() {
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
@ -377,16 +373,16 @@ export default {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/StationArea/' + this.dataForm.id,
url: '/api/scm/StationArea/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
}else{
this.clearData()
this.initDefaultData()
}
@ -407,7 +403,7 @@ export default {
})
},
request() {
let _data = this.dataList()
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
@ -437,13 +433,13 @@ export default {
this.$emit('refresh', true)
}
})
}).catch(() => {
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
}else{
request({
url: '/api/scm/StationArea/' + this.dataForm.id,
url: '/api/scm/StationArea/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
@ -458,15 +454,15 @@ export default {
this.$emit('refresh', true)
}
})
}).catch(() => {
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
@ -475,8 +471,8 @@ export default {
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
}
}
},
@ -543,18 +539,18 @@ export default {
}
return timeDataValue;
},
dataList() {
dataList(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
this.childIndex=-1
},
},
}
}
</script>

Loading…
Cancel
Save