图斑修改添加上传SHP功能
parent
e32769cb26
commit
350718a2b8
|
|
@ -440,9 +440,9 @@ export function LoadCaseInfoById(params: { id: string }) {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export function UpdateCaseInfo(data) {
|
export function UpdateCaseInfo(data,shppath='') {
|
||||||
return defHttp.post({
|
return defHttp.post({
|
||||||
url: Api.UpdateCaseInfo,
|
url: `${Api.UpdateCaseInfo}?shppath=${shppath}`,
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,21 +127,47 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="item" style="width: 100%;">
|
||||||
|
<div class="label">上传SHP:</div>
|
||||||
|
<div style="flex:9;display:flex;">
|
||||||
|
<a-upload
|
||||||
|
v-model:file-list="shpList"
|
||||||
|
accept=".zip,.rar"
|
||||||
|
:maxCount="1"
|
||||||
|
:custom-request="shpCustomRequest"
|
||||||
|
>
|
||||||
|
<a-button>
|
||||||
|
<upload-outlined></upload-outlined>
|
||||||
|
上传SHP
|
||||||
|
</a-button>
|
||||||
|
<template #itemRender="{ file, actions }">
|
||||||
|
<a-space>
|
||||||
|
<span>{{ file.name }}</span>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</a-upload>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, onMounted, ref, watch } from "vue"
|
import { defineProps, onMounted, ref, watch, defineEmits } from "vue"
|
||||||
import { getChildrenTree } from '@/api/demo/system'
|
import { getChildrenTree } from '@/api/demo/system'
|
||||||
import { getAppEnvConfig } from '@/utils/env';
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Upload } from 'ant-design-vue';
|
import { Upload } from 'ant-design-vue';
|
||||||
import { PlusOutlined, CloseOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined, CloseOutlined, ExclamationCircleOutlined, UploadOutlined } from '@ant-design/icons-vue';
|
||||||
const props = defineProps(['infoData','infoResult'])
|
import { uploadFile } from '@/api/formrender/index';
|
||||||
|
const props = defineProps(['infoData','infoResult','shppath'])
|
||||||
|
const emits = defineEmits(['update:shppath'])
|
||||||
const countyOptions = ref([])
|
const countyOptions = ref([])
|
||||||
const streetOptions = ref([])
|
const streetOptions = ref([])
|
||||||
const communityOptions = ref([])
|
const communityOptions = ref([])
|
||||||
const fileList = ref<any>([])
|
const fileList = ref<any>([])
|
||||||
|
const shpList = ref([])
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const { id, case_no, case_description, countyid,
|
const { id, case_no, case_description, countyid,
|
||||||
countyname, streetid, streetname,communityid, communityname, address, drone_no, lng, lat,
|
countyname, streetid, streetname,communityid, communityname, address, drone_no, lng, lat,
|
||||||
|
|
@ -277,6 +303,13 @@ const changeStreet = (val) => {
|
||||||
const changeCommunity = (val) => {
|
const changeCommunity = (val) => {
|
||||||
props.infoResult.communityname = communityOptions.value.find(item => item.value == val)?.label
|
props.infoResult.communityname = communityOptions.value.find(item => item.value == val)?.label
|
||||||
}
|
}
|
||||||
|
const shpCustomRequest = (file) => {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('files', file.file)
|
||||||
|
uploadFile(formData).then(res => {
|
||||||
|
emits('update:shppath',res[0].filePath)
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content{
|
.content{
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
:destroyOnClose="true"
|
:destroyOnClose="true"
|
||||||
@ok="submit"
|
@ok="submit"
|
||||||
@cancel="closeInfoModal">
|
@cancel="closeInfoModal">
|
||||||
<InfoModal :infoData="infoData" :infoResult="infoResult"/>
|
<InfoModal :infoData="infoData" :infoResult="infoResult" v-model:shppath="shppath"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<a-modal
|
<a-modal
|
||||||
width="50%"
|
width="50%"
|
||||||
|
|
@ -59,6 +59,7 @@ const historyModal = ref(false)
|
||||||
const historyCaseId = ref()
|
const historyCaseId = ref()
|
||||||
const infoData = ref({})
|
const infoData = ref({})
|
||||||
const infoResult = ref({})
|
const infoResult = ref({})
|
||||||
|
const shppath = ref()
|
||||||
const [registerTable, { setTableData, reload, clearSelectedRowKeys, setPagination, setLoading }] =
|
const [registerTable, { setTableData, reload, clearSelectedRowKeys, setPagination, setLoading }] =
|
||||||
useTable({
|
useTable({
|
||||||
title: '图斑汇总',
|
title: '图斑汇总',
|
||||||
|
|
@ -98,8 +99,7 @@ const getHistoryList = (record) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
console.log('submit',infoResult.value)
|
UpdateCaseInfo(infoResult.value,shppath.value).then(res => {
|
||||||
UpdateCaseInfo(infoResult.value).then(res => {
|
|
||||||
console.log(res)
|
console.log(res)
|
||||||
message.success('修改成功')
|
message.success('修改成功')
|
||||||
closeInfoModal()
|
closeInfoModal()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue