修改地图
This commit is contained in:
@@ -35,10 +35,10 @@ const setupAll = async () => {
|
||||
const app = createApp(App)
|
||||
|
||||
//开启离线地图
|
||||
app.use(BaiduMapOffline, {
|
||||
offline: true,
|
||||
offlineUrl:'http://sjzx:8088/map/' //window.location.origin + '/map/'
|
||||
})
|
||||
// app.use(BaiduMapOffline, {
|
||||
// offline: true,
|
||||
// offlineUrl:'http://sjzx:8088/map/' //window.location.origin + '/map/'
|
||||
// })
|
||||
app.use(BaiduMap, {
|
||||
ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
||||
v: '3.0'
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-Download" @click="exportTemplate">导出模板</el-button>
|
||||
<el-upload action="" :show-file-list="false" :auto-upload="false" :on-change="choose">
|
||||
<el-upload action="" accept=".xlsx" :show-file-list="false" :auto-upload="false" :on-change="choose">
|
||||
<el-button type="primary" class="ml10" icon="el-icon-Upload">离线导入</el-button>
|
||||
</el-upload>
|
||||
<!-- <el-button type="primary" class="ml10" icon="el-icon-Ticket" @click="modelTrain">
|
||||
@@ -491,6 +491,9 @@ const choose = (e: any) => {
|
||||
lineId: dotList.value.id,
|
||||
startTime: datePickerRef.value.timeValue[0]
|
||||
}
|
||||
if (e.raw.type != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
|
||||
return ElMessage.warning('请选择Excel文件!')
|
||||
}
|
||||
|
||||
uploadExcel(e.raw, form).then(res => {
|
||||
ElMessage.success('导入成功')
|
||||
|
||||
@@ -2,31 +2,22 @@
|
||||
<div class="default-main" :style="height">
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<PointTree
|
||||
:default-expand-all="false"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
></PointTree>
|
||||
<PointTree :default-expand-all="false" @node-click="handleNodeClick" @init="handleNodeClick">
|
||||
</PointTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="模板策略">
|
||||
<el-input v-model="tableStore.table.params.crmName" placeholder="请输入客户名称" />
|
||||
<el-input v-model="tableStore.table.params.crmName" placeholder="请输入模板策略" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报表类型:">
|
||||
<el-input v-model="tableStore.table.params.reportNumber" placeholder="请输入报告编号" />
|
||||
<el-input v-model="tableStore.table.params.reportNumber" placeholder="请输入报表类型" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload
|
||||
:show-file-list="false"
|
||||
ref="uploadRef"
|
||||
action=""
|
||||
accept=".png,.jpg"
|
||||
:on-change="choose"
|
||||
:auto-upload="false"
|
||||
>
|
||||
<el-upload :show-file-list="false" ref="uploadRef" action="" accept=".png,.jpg"
|
||||
:on-change="choose" :auto-upload="false">
|
||||
<template #trigger>
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||
</template>
|
||||
@@ -36,11 +27,8 @@
|
||||
</TableHeader>
|
||||
<div class="box">
|
||||
<div id="luckysheet">
|
||||
<img
|
||||
width="100%"
|
||||
:style="`height: calc(${tableStore.table.height} + 40px)`"
|
||||
src="@/assets/img/jss.png"
|
||||
/>
|
||||
<img width="100%" :style="`height: calc(${tableStore.table.height} + 40px)`"
|
||||
src="@/assets/img/jss.png" />
|
||||
</div>
|
||||
</div>
|
||||
</pane>
|
||||
@@ -59,8 +47,9 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportModel } from '@/api/process-boot/reportForms'
|
||||
import { genFileId, ElMessage } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/report/word'
|
||||
// name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
@@ -74,8 +63,8 @@ const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {}
|
||||
beforeSearchFun: () => { },
|
||||
loadCallback: () => { }
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
@@ -84,16 +73,24 @@ onMounted(() => {
|
||||
|
||||
|
||||
if (dom) {
|
||||
console.log("🚀 ~ onMounted ~ dom.offsetHeight:", dom.offsetHeight)
|
||||
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
const isJPG = files.raw.type === 'image/jpg';
|
||||
const isPNG = files.raw.type === 'image/png';
|
||||
if (!isJPG && !isPNG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
@@ -106,15 +103,15 @@ const exportEvent = () => {
|
||||
let form = new FormData()
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('name', dotList.value.name)
|
||||
form.append('crmName', tableStore.table.params.crmName||'')
|
||||
form.append('reportNumber', tableStore.table.params.reportNumber||'')
|
||||
form.append('crmName', tableStore.table.params.crmName || '')
|
||||
form.append('reportNumber', tableStore.table.params.reportNumber || '')
|
||||
form.append('type', '0')
|
||||
form.append('startTime', tableStore.table.params.startTime)
|
||||
form.append('endTime', tableStore.table.params.endTime)
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
console.log("🚀 ~ exportEvent ~ uploadList.value:", uploadList.value?.raw)
|
||||
|
||||
// uploadList.value.forEach(item => {
|
||||
// form.append('file', uploadList.value?.raw)
|
||||
// })
|
||||
|
||||
form.append('file', uploadList.value?.raw ||'')
|
||||
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
|
||||
@@ -241,10 +241,21 @@ defineExpose({ open })
|
||||
|
||||
let uploadName = ref('')
|
||||
const choose = (e: any) => {
|
||||
uploadFile(e.raw, '/supervision/').then(res => {
|
||||
reportFilePath.value = res.data.name
|
||||
// form.value.reportPath = res.data.name
|
||||
})
|
||||
const fileExtension = e.name.split('.')[1];
|
||||
if (fileExtension === 'doc' || fileExtension === 'docx' || fileExtension === 'pdf') {
|
||||
// 文件类型不符合要求,提示用户
|
||||
uploadFile(e.raw, '/supervision/').then(res => {
|
||||
reportFilePath.value = res.data.name
|
||||
ElMessage.success('上传成功!');
|
||||
// form.value.reportPath = res.data.name
|
||||
})
|
||||
} else {
|
||||
uploadRef.value!.clearFiles()
|
||||
ElMessage.error('请选择 .doc 或 .docx 或 .pdf 格式的文件!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const handleExceed: UploadProps['onExceed'] = files => {
|
||||
|
||||
@@ -221,8 +221,10 @@ const handler = async ({ BMap, map }: any) => {
|
||||
() => monitoringPoint.state.lineId,
|
||||
(newLineId, oldLineId) => {
|
||||
let value = areaLineInfo.value.find((item: any) => item.lineId == newLineId)
|
||||
center.value.lng = value.lng
|
||||
center.value.lat = value.lat
|
||||
if(value==undefined) return
|
||||
|
||||
center.value.lng = value.lng || 0
|
||||
center.value.lat = value.lat || 0
|
||||
infoWindowPoint.value = value
|
||||
infoWindowPoint.value.show = true
|
||||
monitoringPoint.setValue('lineName', value.manufacturer + '>' + value.gdName + '>' + value.subName + '>' + value.lineName)
|
||||
|
||||
Reference in New Issue
Block a user