|
|
@@ -144,6 +144,7 @@
|
|
|
<a-button style="margin-left:8px;" type="primary" icon="download" @click="doDownloadImportTemplate">导入模板下载</a-button>
|
|
|
<a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
|
|
|
<a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
|
|
|
+ <a-button style="margin-left: 8px" type="primary" icon="environment" @click="handleInitPoints">初始化打点</a-button>
|
|
|
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
|
@@ -225,6 +226,107 @@
|
|
|
<import-form-update ref="importModalUpdate" @ok="handleOk"/>
|
|
|
<print-sb-code ref="printSbCode"/>
|
|
|
<print-in-sb-info-batch ref="printInSbInfoBatch" @ok="handleOk"/>
|
|
|
+
|
|
|
+ <!-- 初始化打点弹窗 -->
|
|
|
+ <a-modal
|
|
|
+ title="初始化打点"
|
|
|
+ :visible="initPointsVisible"
|
|
|
+ :confirmLoading="initPointsLoading"
|
|
|
+ @ok="doInitPoints"
|
|
|
+ @cancel="initPointsVisible = false"
|
|
|
+ width="600px"
|
|
|
+ >
|
|
|
+ <a-form :form="initPointsForm" :label-col="{ span: 8 }" :wrapper-col="{ span: 14 }">
|
|
|
+ <a-divider orientation="left">矩形角点坐标</a-divider>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点1 经度">
|
|
|
+ <a-input-number v-model="initPointsData.points[0].longitude" :step="0.000001" style="width: 100%" placeholder="经度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点1 纬度">
|
|
|
+ <a-input-number v-model="initPointsData.points[0].latitude" :step="0.000001" style="width: 100%" placeholder="纬度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点2 经度">
|
|
|
+ <a-input-number v-model="initPointsData.points[1].longitude" :step="0.000001" style="width: 100%" placeholder="经度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点2 纬度">
|
|
|
+ <a-input-number v-model="initPointsData.points[1].latitude" :step="0.000001" style="width: 100%" placeholder="纬度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点3 经度">
|
|
|
+ <a-input-number v-model="initPointsData.points[2].longitude" :step="0.000001" style="width: 100%" placeholder="经度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点3 纬度">
|
|
|
+ <a-input-number v-model="initPointsData.points[2].latitude" :step="0.000001" style="width: 100%" placeholder="纬度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点4 经度">
|
|
|
+ <a-input-number v-model="initPointsData.points[3].longitude" :step="0.000001" style="width: 100%" placeholder="经度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="角点4 纬度">
|
|
|
+ <a-input-number v-model="initPointsData.points[3].latitude" :step="0.000001" style="width: 100%" placeholder="纬度"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-divider orientation="left">选择设备位置</a-divider>
|
|
|
+ <a-form-item label="设备位置" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
|
|
|
+ <a-select
|
|
|
+ v-model="initPointsData.positionIds"
|
|
|
+ mode="multiple"
|
|
|
+ placeholder="请选择设备位置"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in sbPositionData"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ >{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-divider orientation="left">底图与显示</a-divider>
|
|
|
+ <a-form-item label="选择底图" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
|
|
|
+ <a-select
|
|
|
+ v-model="initPointsData.mapName"
|
|
|
+ placeholder="请选择底图"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in mapNameList"
|
|
|
+ :key="item.targetId"
|
|
|
+ :value="item.targetId"
|
|
|
+ >{{ item.targetId }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="是否显示" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
|
|
|
+ <a-select v-model="initPointsData.isShow" placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label, value) in isShowMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="parseInt(value)"
|
|
|
+ >{{ label }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </a-modal>
|
|
|
</a-card>
|
|
|
|
|
|
</template>
|
|
|
@@ -244,7 +346,8 @@ import ImportFormAdd from './modules/ImportFormAdd'
|
|
|
import ImportFormUpdate from './modules/ImportFormUpdate'
|
|
|
import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
|
|
|
import PrintInSbInfoBatch from '@/views/sb/info/modules/PrintInSbInfoBatch'
|
|
|
-import { querySbPosition } from '@/api/sb/position'
|
|
|
+import { querySbPosition, initPoints } from '@/api/sb/position'
|
|
|
+import { queryFile } from '@/api/upms/file'
|
|
|
|
|
|
export default {
|
|
|
name: 'SbInfoList',
|
|
|
@@ -281,6 +384,20 @@ export default {
|
|
|
depreciationTypeMap: {},
|
|
|
visible: true,
|
|
|
sbPositionData: [],
|
|
|
+ initPointsVisible: false,
|
|
|
+ initPointsLoading: false,
|
|
|
+ initPointsData: {
|
|
|
+ points: [
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined }
|
|
|
+ ],
|
|
|
+ positionIds: [],
|
|
|
+ mapName: undefined,
|
|
|
+ isShow: 1
|
|
|
+ },
|
|
|
+ mapNameList: [],
|
|
|
levelMap: {},
|
|
|
unitMap: {},
|
|
|
areaList: {},
|
|
|
@@ -546,6 +663,9 @@ export default {
|
|
|
querySbPosition().then(res => {
|
|
|
this.sbPositionData = res.data
|
|
|
})
|
|
|
+ queryFile({ type: 56 }).then(res => {
|
|
|
+ this.mapNameList = res.data
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
tableOption () {
|
|
|
@@ -763,6 +883,48 @@ export default {
|
|
|
downloadSbInfoImportTemplate().then(file => {
|
|
|
this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
})
|
|
|
+ },
|
|
|
+ handleInitPoints () {
|
|
|
+ this.initPointsData = {
|
|
|
+ points: [
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined },
|
|
|
+ { longitude: undefined, latitude: undefined }
|
|
|
+ ],
|
|
|
+ positionIds: [],
|
|
|
+ mapName: undefined,
|
|
|
+ isShow: 1
|
|
|
+ }
|
|
|
+ this.initPointsVisible = true
|
|
|
+ },
|
|
|
+ doInitPoints () {
|
|
|
+ // 校验坐标是否填写完整
|
|
|
+ const validPoints = this.initPointsData.points.every(
|
|
|
+ p => p.longitude !== undefined && p.longitude !== null && p.latitude !== undefined && p.latitude !== null
|
|
|
+ )
|
|
|
+ if (!validPoints) {
|
|
|
+ this.$message.warning('请填写完整的矩形四角点坐标')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.initPointsData.positionIds || this.initPointsData.positionIds.length === 0) {
|
|
|
+ this.$message.warning('请选择至少一个设备位置')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.initPointsData.mapName) {
|
|
|
+ this.$message.warning('请选择底图')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.initPointsLoading = true
|
|
|
+ initPoints(this.initPointsData).then(res => {
|
|
|
+ this.$message.success('初始化打点成功')
|
|
|
+ this.initPointsVisible = false
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('初始化打点失败')
|
|
|
+ }).finally(() => {
|
|
|
+ this.initPointsLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|