Merge branch 'main' of http://123.132.248.154:10000/gitY/LinYeFangHuo
commit
079ec0cbde
|
|
@ -238,14 +238,6 @@
|
||||||
// 是否是编辑状态
|
// 是否是编辑状态
|
||||||
const isEdit = window.location.href.includes('/chart/home/');
|
const isEdit = window.location.href.includes('/chart/home/');
|
||||||
|
|
||||||
watch(
|
|
||||||
() => option.status.hide,
|
|
||||||
() => {
|
|
||||||
if (!option.status.hide) {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// 初始化视频控件
|
// 初始化视频控件
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 用于规避视频id重复
|
// 用于规避视频id重复
|
||||||
|
|
@ -264,10 +256,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
// 显示+非编辑状态下运行
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
watch(
|
||||||
option.dataset = resData;
|
() => option.status.hide,
|
||||||
});
|
(newValue) => {
|
||||||
|
if (!newValue && !isEdit) {
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
|
if (resData) {
|
||||||
|
option.dataset = resData;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
src="@/assets/images/chart/zhichu/component/SheXiangTouModal_Image.png"
|
||||||
/>
|
/>
|
||||||
<MonitorHK
|
<MonitorHK
|
||||||
ref="MonitorHKRef"
|
|
||||||
v-if="!isEdit && !option.status.hide && manufacturer == '海康'"
|
v-if="!isEdit && !option.status.hide && manufacturer == '海康'"
|
||||||
:serialNumberValue="option.dataStyle.serialNumberValue"
|
:serialNumberValue="option.dataStyle.serialNumberValue"
|
||||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||||
|
|
@ -42,7 +41,6 @@
|
||||||
:timestamp="option.dataStyle.timestamp"
|
:timestamp="option.dataStyle.timestamp"
|
||||||
/>
|
/>
|
||||||
<MonitorLC
|
<MonitorLC
|
||||||
ref="MonitorLCRef"
|
|
||||||
v-if="!isEdit && !option.status.hide && manufacturer == '乐橙'"
|
v-if="!isEdit && !option.status.hide && manufacturer == '乐橙'"
|
||||||
:deviceId="option.dataStyle.serialNumberValue"
|
:deviceId="option.dataStyle.serialNumberValue"
|
||||||
:channelId="0"
|
:channelId="0"
|
||||||
|
|
@ -52,7 +50,6 @@
|
||||||
:videoMuted="option.dataStyle.videoMuted"
|
:videoMuted="option.dataStyle.videoMuted"
|
||||||
/>
|
/>
|
||||||
<MonitorTX
|
<MonitorTX
|
||||||
ref="MonitorTXRef"
|
|
||||||
v-if="!isEdit && !option.status.hide && manufacturer == '腾讯'"
|
v-if="!isEdit && !option.status.hide && manufacturer == '腾讯'"
|
||||||
:serialNumberValue="option.dataStyle.serialNumberValue"
|
:serialNumberValue="option.dataStyle.serialNumberValue"
|
||||||
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
:width="`${w - 2 * option.dataStyle.padding - 2 * option.dataStyle.borderWidth}`"
|
||||||
|
|
@ -150,12 +147,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
// 显示+非编辑状态下运行
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
watch(
|
||||||
if (resData) {
|
() => option.status.hide,
|
||||||
option.dataset = resData;
|
(newValue) => {
|
||||||
}
|
if (!newValue && !isEdit) {
|
||||||
});
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
|
if (resData) {
|
||||||
|
option.dataset = resData;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -387,9 +387,20 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
// 数据callback处理(预览时触发)
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
// 显示+非编辑状态下运行
|
||||||
option.dataset = resData;
|
watch(
|
||||||
});
|
() => option.status.hide,
|
||||||
|
(newValue) => {
|
||||||
|
if (!newValue && !isEdit) {
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
|
if (resData) {
|
||||||
|
option.dataset = resData;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => option.dataStyle.closeButtonWidth,
|
() => option.dataStyle.closeButtonWidth,
|
||||||
|
|
|
||||||
|
|
@ -177,10 +177,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
// 显示+非编辑状态下运行
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
watch(
|
||||||
option.dataset = resData;
|
() => option.status.hide,
|
||||||
});
|
(newValue) => {
|
||||||
|
if (!newValue && !isEdit) {
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
|
if (resData) {
|
||||||
|
option.dataset = resData;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => w.value,
|
() => w.value,
|
||||||
|
|
|
||||||
|
|
@ -256,10 +256,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数据callback处理(预览时触发)
|
// 显示+非编辑状态下运行
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
watch(
|
||||||
option.dataset = resData;
|
() => option.status.hide,
|
||||||
});
|
(newValue) => {
|
||||||
|
if (!newValue && !isEdit) {
|
||||||
|
// 数据callback处理(预览时触发)
|
||||||
|
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
|
||||||
|
if (resData) {
|
||||||
|
option.dataset = resData;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="cue-span">检测到以下数据存在冲突:</div>
|
<div class="cue-span">检测到以下数据存在冲突:</div>
|
||||||
<div class="comparison-div">
|
<div class="comparison-div">
|
||||||
<div style="flex: 1;padding-right: 10px;" >
|
<div style="flex: 1;padding-right: 10px;min-width: 0;overflow: hidden;" >
|
||||||
<div class="table-title">原数据</div>
|
<div class="table-title">原数据</div>
|
||||||
<a-table rowKey="Id" ref="oldTable" :row-selection="oldRowSelection" :dataSource="props.originData" :columns="columns"
|
<a-table rowKey="Id" ref="oldTable" :row-selection="oldRowSelection" :dataSource="props.originData" :columns="columns"
|
||||||
:scroll="{ y: 472 }" :footer="null" />
|
:scroll="{ x: 'max-content',y: 500 }" :pagination="false" />
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1;padding-left: 10px;" >
|
<div style="flex: 1;padding-left: 10px;min-width: 0;overflow: hidden;" >
|
||||||
<div class="table-title">新数据</div>
|
<div class="table-title">新数据</div>
|
||||||
<a-table rowKey="Id" ref="newTable" :row-selection="newRowSelection" :dataSource="props.nowData" :columns="columns"
|
<a-table rowKey="Id" ref="newTable" :row-selection="newRowSelection" :dataSource="props.nowData" :columns="columns"
|
||||||
:scroll="{ y: 472 }" :footer="null" />
|
:scroll="{ x: 'max-content',y: 500 }" :pagination="false" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|
@ -159,6 +159,7 @@ onUnmounted(() => {
|
||||||
}
|
}
|
||||||
.comparison-div{
|
.comparison-div{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 30px;
|
||||||
.table-title{
|
.table-title{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,19 @@
|
||||||
:accept="'.xlsx,.csv,.xls,.zip'"
|
:accept="'.xlsx,.csv,.xls,.zip'"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
:custom-request="customRequest"
|
:custom-request="customRequest"
|
||||||
|
:beforeUpload="beforeUpload"
|
||||||
>
|
>
|
||||||
<a-button type="primary" class="upload-button" :icon="h(PlusOutlined)">上传</a-button>
|
<a-button type="primary" class="upload-button" :icon="h(PlusOutlined)">上传</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
|
<a-progress
|
||||||
|
style="margin-bottom: 0px;"
|
||||||
|
v-show="showProgress"
|
||||||
|
:percent="uploadPercent"
|
||||||
|
:status="progresStatus"
|
||||||
|
size="default"
|
||||||
|
/>
|
||||||
|
<div v-show="showProgress">{{ fileName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -55,6 +64,10 @@ import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import MergeSourceModal from './MergeSourceModal/index.vue'
|
import MergeSourceModal from './MergeSourceModal/index.vue'
|
||||||
import { UploadShape1, Upload, UploadExcelInsert } from '@/api/demo/BatchProcessingModal'
|
import { UploadShape1, Upload, UploadExcelInsert } from '@/api/demo/BatchProcessingModal'
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
|
import axios from 'axios';
|
||||||
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
|
|
||||||
const props = defineProps(['tableName','tableColumn'])
|
const props = defineProps(['tableName','tableColumn'])
|
||||||
const emits = defineEmits(['changeBatchProcessingModal'])
|
const emits = defineEmits(['changeBatchProcessingModal'])
|
||||||
|
|
@ -62,53 +75,77 @@ const procedure = ref(0)
|
||||||
const mergeSourceModal = ref(false)
|
const mergeSourceModal = ref(false)
|
||||||
const nowData = ref([])
|
const nowData = ref([])
|
||||||
const originData = ref([])
|
const originData = ref([])
|
||||||
|
const uploadPercent = ref(0);
|
||||||
|
const progresStatus = ref('')
|
||||||
|
const showProgress = ref(false)
|
||||||
|
const fileName = ref('')
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
mergeSourceModal.value = true
|
mergeSourceModal.value = true
|
||||||
}
|
}
|
||||||
const closemergeSourceModal = () => {
|
const closemergeSourceModal = () => {
|
||||||
mergeSourceModal.value = false
|
mergeSourceModal.value = false
|
||||||
}
|
}
|
||||||
const customRequest = (file) => {
|
const beforeUpload = (file) => {
|
||||||
console.log('handleCustomRequest',file)
|
showProgress.value = true
|
||||||
|
fileName.value = file.name
|
||||||
const name = file.file.name.toLowerCase();
|
|
||||||
if (name.endsWith('.zip')){
|
|
||||||
const formData = new FormData()
|
|
||||||
formData.append('files', file.file)
|
|
||||||
Upload(formData).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
const filePath = res[0].filePath
|
|
||||||
let params = {
|
|
||||||
tableName: props.tableName,
|
|
||||||
zipFilePath: filePath
|
|
||||||
}
|
|
||||||
UploadShape1(params).then(result => {
|
|
||||||
if(result.nowData.length > 0){
|
|
||||||
nowData.value = result.nowData
|
|
||||||
originData.value = result.originData
|
|
||||||
mergeSourceModal.value = true
|
|
||||||
}else{
|
|
||||||
message.success('导入成功')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
const formData = new FormData()
|
|
||||||
formData.append('file', file.file)
|
|
||||||
UploadExcelInsert({File: formData, tableName: props.tableName}).then(res => {
|
|
||||||
console.log('res',res)
|
|
||||||
if(res.nowData.length > 0){
|
|
||||||
nowData.value = res.nowData
|
|
||||||
originData.value = res.originData
|
|
||||||
mergeSourceModal.value = true
|
|
||||||
}else{
|
|
||||||
message.success('导入成功')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// procedure.value ++
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
const customRequest = async (file) => {
|
||||||
|
progresStatus.value = ''
|
||||||
|
const name = file.file.name.toLowerCase();
|
||||||
|
const formData = new FormData();
|
||||||
|
let url = '';
|
||||||
|
let params: any = {};
|
||||||
|
|
||||||
|
if (name.endsWith('.zip')) {
|
||||||
|
formData.append('files', file.file);
|
||||||
|
url = VITE_GLOB_API_URL + '/api/Files/Upload';
|
||||||
|
} else {
|
||||||
|
formData.append('file', file.file);
|
||||||
|
url = VITE_GLOB_API_URL + '/api/Layer/UploadExcelInsert';
|
||||||
|
params = { tableName: props.tableName };
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const response = await axios.post(url, formData, {
|
||||||
|
params,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' },
|
||||||
|
onUploadProgress: (progressEvent) => {
|
||||||
|
if (progressEvent.total) {
|
||||||
|
uploadPercent.value = Math.round((progressEvent.loaded / progressEvent.total) * 100);
|
||||||
|
file.onProgress?.({ percent: uploadPercent.value });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const resData = response.data;
|
||||||
|
if (name.endsWith('.zip')) {
|
||||||
|
const filePath = resData.result[0].filePath;
|
||||||
|
const result = await UploadShape1({
|
||||||
|
tableName: props.tableName,
|
||||||
|
zipFilePath: filePath,
|
||||||
|
});
|
||||||
|
|
||||||
|
handleUploadResult(result.result);
|
||||||
|
} else {
|
||||||
|
handleUploadResult(resData.result);
|
||||||
|
}
|
||||||
|
|
||||||
|
file.onSuccess?.('ok');
|
||||||
|
progresStatus.value = 'success'
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error',error)
|
||||||
|
message.error('上传失败');
|
||||||
|
file.onError?.(error);
|
||||||
|
progresStatus.value = 'exception'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleUploadResult = (result: any) => {
|
||||||
|
if (result.nowData && result.nowData.length > 0) {
|
||||||
|
nowData.value = result.nowData;
|
||||||
|
originData.value = result.originData;
|
||||||
|
mergeSourceModal.value = true;
|
||||||
|
} else {
|
||||||
|
message.success('导入成功');
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
@ -140,6 +177,7 @@ const customRequest = (file) => {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
.upload-button-div{
|
.upload-button-div{
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
.upload-button{
|
.upload-button{
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,19 @@
|
||||||
:accept="'.xlsx,.csv,.xls,.zip'"
|
:accept="'.xlsx,.csv,.xls,.zip'"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
:custom-request="customRequest"
|
:custom-request="customRequest"
|
||||||
|
:beforeUpload="beforeUpload"
|
||||||
>
|
>
|
||||||
<a-button type="primary" class="upload-button" :icon="h(PlusOutlined)">上传</a-button>
|
<a-button type="primary" class="upload-button" :icon="h(PlusOutlined)">上传</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
|
<a-progress
|
||||||
|
style="margin-bottom: 0px;"
|
||||||
|
v-show="showProgress"
|
||||||
|
:percent="uploadPercent"
|
||||||
|
:status="progresStatus"
|
||||||
|
size="default"
|
||||||
|
/>
|
||||||
|
<div v-show="showProgress">{{ fileName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -38,42 +47,72 @@ import { ref, h, defineEmits } from "vue"
|
||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import { UploadShape1, Upload, UpdateTableOriginalData, AddUploadExcel } from '@/api/demo/BatchProcessingModal'
|
import { UploadShape1, Upload, UpdateTableOriginalData, AddUploadExcel } from '@/api/demo/BatchProcessingModal'
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
|
import axios from 'axios';
|
||||||
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
const emits = defineEmits(['changeBatchProcessingModal'])
|
const emits = defineEmits(['changeBatchProcessingModal'])
|
||||||
const props = defineProps(['tableName','tableColumn'])
|
const props = defineProps(['tableName','tableColumn'])
|
||||||
const procedure = ref(0)
|
const procedure = ref(0)
|
||||||
const customRequest = (file) => {
|
const uploadPercent = ref(0);
|
||||||
console.log('handleCustomRequest',file)
|
const progresStatus = ref('')
|
||||||
|
const showProgress = ref(false)
|
||||||
|
const fileName = ref('')
|
||||||
|
const beforeUpload = (file) => {
|
||||||
|
showProgress.value = true
|
||||||
|
fileName.value = file.name
|
||||||
|
}
|
||||||
|
const customRequest = async (file) => {
|
||||||
|
progresStatus.value = ''
|
||||||
const name = file.file.name.toLowerCase();
|
const name = file.file.name.toLowerCase();
|
||||||
if (name.endsWith('.zip')){
|
const formData = new FormData();
|
||||||
const formData = new FormData()
|
let url = '';
|
||||||
formData.append('files', file.file)
|
let params: any = {};
|
||||||
Upload(formData).then(res => {
|
if (name.endsWith('.zip')) {
|
||||||
const filePath = res[0].filePath
|
formData.append('files', file.file);
|
||||||
let params = {
|
url = VITE_GLOB_API_URL + '/api/Files/Upload';
|
||||||
tableName: props.tableName,
|
|
||||||
zipFilePath: filePath
|
|
||||||
}
|
|
||||||
UploadShape1(params).then(result => {
|
|
||||||
let resultParams = {
|
|
||||||
tableName: props.tableName,
|
|
||||||
list: []
|
|
||||||
}
|
|
||||||
if(result.nowData.length > 0){
|
|
||||||
resultParams.list = result.nowData
|
|
||||||
}
|
|
||||||
UpdateTableOriginalData(resultParams).then(lastResult => {
|
|
||||||
message.success('更新成功')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}else{
|
}else{
|
||||||
const formData = new FormData()
|
formData.append('file', file.file);
|
||||||
formData.append('file', file.file)
|
url = VITE_GLOB_API_URL + '/api/Layer/AddUploadExcel';
|
||||||
AddUploadExcel({File: formData, tableName: props.tableName}).then(res => {
|
params = { tableName: props.tableName };
|
||||||
message.success('更新成功')
|
}
|
||||||
})
|
try {
|
||||||
|
const response = await axios.post(url, formData, {
|
||||||
|
params,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' },
|
||||||
|
onUploadProgress: (progressEvent) => {
|
||||||
|
if (progressEvent.total) {
|
||||||
|
uploadPercent.value = Math.round((progressEvent.loaded / progressEvent.total) * 100);
|
||||||
|
file.onProgress?.({ percent: uploadPercent.value });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const resData = response.data;
|
||||||
|
if (name.endsWith('.zip')) {
|
||||||
|
const filePath = resData.result[0].filePath;
|
||||||
|
const result = await UploadShape1({
|
||||||
|
tableName: props.tableName,
|
||||||
|
zipFilePath: filePath,
|
||||||
|
});
|
||||||
|
let resultParams = {
|
||||||
|
tableName: props.tableName,
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
if(result.result.nowData.length > 0){
|
||||||
|
resultParams.list = result.result.nowData
|
||||||
|
}
|
||||||
|
const lastResult = await UpdateTableOriginalData(resultParams)
|
||||||
|
progresStatus.value = 'success'
|
||||||
|
message.success('更新成功')
|
||||||
|
}else{
|
||||||
|
progresStatus.value = 'success'
|
||||||
|
message.success('更新成功')
|
||||||
|
}
|
||||||
|
} catch ( error ) {
|
||||||
|
console.log('error',error)
|
||||||
|
message.error('上传失败');
|
||||||
|
progresStatus.value = 'exception'
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
@remove="tableVisible = false"
|
@remove="tableVisible = false"
|
||||||
/>
|
/>
|
||||||
<div class="map-container w-3/4 xl:w-4/5">
|
<div class="map-container w-3/4 xl:w-4/5">
|
||||||
<Map @onLoad="onMapLoad"/>
|
<Map @onLoad="onMapLoad" />
|
||||||
<!-- 数据列表 -->
|
<!-- 数据列表 -->
|
||||||
<div class="table-constainer" v-show="tableVisible">
|
<div class="table-constainer" v-show="tableVisible">
|
||||||
<div class="drawer-title-box">
|
<div class="drawer-title-box">
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
:accept="'.xlsx,.csv,.xls,.zip'"
|
:accept="'.xlsx,.csv,.xls,.zip'"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
:custom-request="customRequest"
|
:custom-request="customRequest"
|
||||||
style="margin-right: 0px;"
|
style="margin-right: 0px"
|
||||||
>
|
>
|
||||||
<a-button type="primary"> 数据导入 </a-button>
|
<a-button type="primary"> 数据导入 </a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
|
@ -71,11 +71,16 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- 详情 -->
|
<!-- 详情 -->
|
||||||
<div class="data-detail" v-if="showTable == 'detail'">
|
<div class="data-detail" v-if="showTable == 'detail'">
|
||||||
<a-descriptions title="详情" :column="columnVal">
|
<div class="detail-content">
|
||||||
<a-descriptions-item v-for="(val, key) in selectVal" :key="key" :label="key">{{
|
<a-descriptions title="详情" :column="columnVal">
|
||||||
val
|
<a-descriptions-item
|
||||||
}}</a-descriptions-item>
|
v-for="(item, index) in detailData"
|
||||||
</a-descriptions>
|
:key="index"
|
||||||
|
:label="item.label"
|
||||||
|
>{{ item.value }}</a-descriptions-item
|
||||||
|
>
|
||||||
|
</a-descriptions>
|
||||||
|
</div>
|
||||||
<div class="detail-button">
|
<div class="detail-button">
|
||||||
<a-button type="primary" @click="showTable = 'edit'"> 编辑 </a-button>
|
<a-button type="primary" @click="showTable = 'edit'"> 编辑 </a-button>
|
||||||
<a-button type="primary" @click="showTable = ''" danger> 关闭 </a-button>
|
<a-button type="primary" @click="showTable = ''" danger> 关闭 </a-button>
|
||||||
|
|
@ -93,11 +98,11 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
v-for="(item, index) in headData"
|
v-for="(item, index) in headData"
|
||||||
:ref="item"
|
:ref="item"
|
||||||
:label="item"
|
:label="item.title"
|
||||||
:name="item"
|
:name="item"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<a-input v-model:value="formState[item]" />
|
<a-input v-model:value="formState[item.dataIndex]" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
<div class="data-button">
|
<div class="data-button">
|
||||||
|
|
@ -171,25 +176,29 @@
|
||||||
import { uploadFile, fun_Delete } from '@/api/demo/files';
|
import { uploadFile, fun_Delete } from '@/api/demo/files';
|
||||||
import { getAppEnvConfig } from '@/utils/env';
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
import BatchProcessingModal from './BatchProcessingModal/index.vue';
|
import BatchProcessingModal from './BatchProcessingModal/index.vue';
|
||||||
import { Upload, UploadShape, UploadExcelAll } from '@/api/demo/BatchProcessingModal'
|
import { Upload, UploadShape, UploadExcelAll } from '@/api/demo/BatchProcessingModal';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { EventBus } from '@/utils/eventBus';
|
import { EventBus } from '@/utils/eventBus';
|
||||||
import {GetGeometryCenter,EditDrawingGeometry,AddDrawingGeometry,DrawingEnd} from "./geometryHandler.ts"
|
import {
|
||||||
|
GetGeometryCenter,
|
||||||
|
EditDrawingGeometry,
|
||||||
|
AddDrawingGeometry,
|
||||||
|
DrawingEnd,
|
||||||
|
} from './geometryHandler.ts';
|
||||||
import * as mars3d from 'mars3d';
|
import * as mars3d from 'mars3d';
|
||||||
|
|
||||||
let globalMap: mars3d.Map;
|
let globalMap: mars3d.Map;
|
||||||
|
|
||||||
const onMapLoad = (map) => {
|
const onMapLoad = (map) => {
|
||||||
globalMap = map;
|
globalMap = map;
|
||||||
}
|
};
|
||||||
|
|
||||||
EventBus.on("editLayerEnd",function(e){
|
|
||||||
|
|
||||||
|
EventBus.on('editLayerEnd', function (e) {
|
||||||
formState.value.geom = e;
|
formState.value.geom = e;
|
||||||
|
|
||||||
console.log("formState",formState.value);
|
console.log('formState', formState.value);
|
||||||
})
|
});
|
||||||
|
|
||||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||||
const { createConfirm, createMessage } = useMessage();
|
const { createConfirm, createMessage } = useMessage();
|
||||||
|
|
@ -244,7 +253,7 @@
|
||||||
|
|
||||||
const formState = ref({});
|
const formState = ref({});
|
||||||
const tableName = ref();
|
const tableName = ref();
|
||||||
const applicationName = ref()
|
const applicationName = ref();
|
||||||
const styleName = ref();
|
const styleName = ref();
|
||||||
const rules = {
|
const rules = {
|
||||||
name: [
|
name: [
|
||||||
|
|
@ -322,18 +331,29 @@
|
||||||
const handleSuccess = () => {
|
const handleSuccess = () => {
|
||||||
treeRef.value.fetch();
|
treeRef.value.fetch();
|
||||||
};
|
};
|
||||||
|
const detailData = ref([]);
|
||||||
const editData = (record) => {
|
const editData = (record) => {
|
||||||
selectVal.value = record;
|
selectVal.value = record;
|
||||||
formState.value = record;
|
formState.value = record;
|
||||||
showTable.value = 'edit';
|
showTable.value = 'edit';
|
||||||
|
|
||||||
EditDrawingGeometry(globalMap,record.geom)
|
EditDrawingGeometry(globalMap, record.geom);
|
||||||
};
|
};
|
||||||
const viewData = (record) => {
|
const viewData = (record) => {
|
||||||
console.log('record', record);
|
|
||||||
selectVal.value = record;
|
selectVal.value = record;
|
||||||
formState.value = record;
|
formState.value = record;
|
||||||
showTable.value = 'detail';
|
showTable.value = 'detail';
|
||||||
|
detailData.value = [];
|
||||||
|
for (const key in record) {
|
||||||
|
for (var i = 0; i < headData.value.length; i++) {
|
||||||
|
if (headData.value[i].dataIndex == key) {
|
||||||
|
detailData.value.push({
|
||||||
|
label: headData.value[i].title,
|
||||||
|
value: record[key],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const delData = (record) => {
|
const delData = (record) => {
|
||||||
createConfirm({
|
createConfirm({
|
||||||
|
|
@ -354,11 +374,9 @@
|
||||||
const fileUrl = ref('');
|
const fileUrl = ref('');
|
||||||
const fileUrlView: any = ref({});
|
const fileUrlView: any = ref({});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const posData = (record) => {
|
const posData = (record) => {
|
||||||
let centerLngLat = GetGeometryCenter(record.geom)
|
let centerLngLat = GetGeometryCenter(record.geom);
|
||||||
globalMap.flyToPoint(centerLngLat,{radius:500})
|
globalMap.flyToPoint(centerLngLat, { radius: 500 });
|
||||||
};
|
};
|
||||||
|
|
||||||
const styleHandle = () => {
|
const styleHandle = () => {
|
||||||
|
|
@ -443,7 +461,6 @@
|
||||||
limit: 10,
|
limit: 10,
|
||||||
});
|
});
|
||||||
const handleTableChange = (values: any) => {
|
const handleTableChange = (values: any) => {
|
||||||
console.log(values);
|
|
||||||
searchData.page = values.current;
|
searchData.page = values.current;
|
||||||
searchData.limit = values.pageSize;
|
searchData.limit = values.pageSize;
|
||||||
getList();
|
getList();
|
||||||
|
|
@ -457,14 +474,14 @@
|
||||||
};
|
};
|
||||||
tableDataByTableName(querys).then((res) => {
|
tableDataByTableName(querys).then((res) => {
|
||||||
setTableData(res.data);
|
setTableData(res.data);
|
||||||
headData.value = res.head;
|
|
||||||
let arr: any = [];
|
let arr: any = [];
|
||||||
res.head.forEach((element) => {
|
res.head.forEach((element, index) => {
|
||||||
arr.push({
|
arr.push({
|
||||||
title: element,
|
title: res.headName[index],
|
||||||
dataIndex: element,
|
dataIndex: element,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
headData.value = arr;
|
||||||
setColumns(arr);
|
setColumns(arr);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -472,35 +489,35 @@
|
||||||
openTempeleteModel(true);
|
openTempeleteModel(true);
|
||||||
};
|
};
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
const customRequest = (file) => {
|
const customRequest = (file) => {
|
||||||
console.log('handleCustomRequest',file)
|
console.log('handleCustomRequest', file);
|
||||||
const name = file.file.name.toLowerCase();
|
const name = file.file.name.toLowerCase();
|
||||||
if (name.endsWith('.zip')){
|
if (name.endsWith('.zip')) {
|
||||||
const formData = new FormData()
|
const formData = new FormData();
|
||||||
formData.append('files', file.file)
|
formData.append('files', file.file);
|
||||||
Upload(formData).then(res => {
|
Upload(formData).then((res) => {
|
||||||
console.log(res)
|
console.log(res);
|
||||||
const filePath = res[0].filePath
|
const filePath = res[0].filePath;
|
||||||
let params = {
|
let params = {
|
||||||
tableName: tableName.value,
|
tableName: tableName.value,
|
||||||
zipFilePath: filePath
|
zipFilePath: filePath,
|
||||||
}
|
};
|
||||||
UploadShape(params).then(result => {
|
UploadShape(params).then((result) => {
|
||||||
message.success('导入成功')
|
message.success('导入成功');
|
||||||
reload()
|
reload();
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}else{
|
} else {
|
||||||
const formData = new FormData()
|
const formData = new FormData();
|
||||||
formData.append('file', file.file)
|
formData.append('file', file.file);
|
||||||
UploadExcelAll({File: formData, tableName: tableName.value}).then(res => {
|
UploadExcelAll({ File: formData, tableName: tableName.value }).then((res) => {
|
||||||
message.success('导入成功')
|
message.success('导入成功');
|
||||||
reload()
|
reload();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// procedure.value ++
|
// procedure.value ++
|
||||||
return false
|
return false;
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
@ -546,10 +563,16 @@ const customRequest = (file) => {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
right: 40px;
|
right: 40px;
|
||||||
|
background-color: @component-background;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.detail-content{
|
||||||
|
overflow-y: scroll;
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.data-edit {
|
.data-edit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -596,8 +619,8 @@ const customRequest = (file) => {
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.batch-modal-wrap .ant-modal {
|
.batch-modal-wrap .ant-modal {
|
||||||
transform: scale(0.75) !important;
|
transform: scale(0.75) !important;
|
||||||
transform-origin: center !important;
|
transform-origin: center !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue