glj-代码提交

This commit is contained in:
glj 2023-05-08 18:30:42 +08:00
parent 87789a672b
commit 469e2b1e58
11 changed files with 886 additions and 140 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -29,3 +29,11 @@ export const getPagesRemoteSensingSourceData = (param) => {
params: param,
});
};
export const approval = (data) => {
return request({
url: '/api/' + moduleName + '/ui/remoteSensing/approval',
method: 'post',
data: data
});
};

View File

@ -72,7 +72,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin', 'chief'],
roles: ['admin'],
icon: 'ele-FolderChecked',
zh: '用户响应管理',
},
@ -104,7 +104,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin', 'chief'],
roles: ['admin'],
icon: 'ele-Tools',
zh: 'tool管理',
},
@ -120,7 +120,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin', 'chief'],
roles: ['admin'],
icon: 'ele-Cellphone',
zh: 'tool管理',
},
@ -224,6 +224,22 @@ export const dynamicRoutes = [
zh: '其他数据服务',
},
},
{
path: '/dataService/disasterPartners',
name: 'disasterPartners',
component: () => import('/@/views/dataService/disasterPartners/index.vue'),
meta: {
title: 'Disaster reduction partners service',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin', 'chief'],
icon: 'ele-Star',
zh: '遥感数据',
},
},
],
},
{

View File

@ -0,0 +1,222 @@
<template>
<el-dialog title="edit picture" v-model="state.isShowDialog" width="700px" :close-on-click-modal="false"
@close="closeDialog">
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="upload picture" prop="img">
<el-upload ref="upFileRef" v-model:file-list="state.fileList" action="#" list-type="picture-card" accept="image/*"
:on-preview="handlePictureCardPreview" :on-remove="handleRemove" :on-change="changeUpload" :limit="1"
:auto-upload="false" :class="{ hide: state.hideUpload }">
<el-icon>
<Plus />
</el-icon>
</el-upload>
<el-dialog v-model="state.dialogVisible">
<img w-full :src="state.dialogImageUrl" alt="Preview Image" />
</el-dialog>
</el-form-item>
<el-form-item prop="title" label="data title">
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3" type="text"
style="width:220px;" />
</el-form-item>
<el-form-item label="Home page show" prop="isMain">
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
<el-option label="show" value="1"></el-option>
<el-option label="not show" value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { Plus } from '@element-plus/icons-vue'
import { reactive, ref } from "vue";
import { updatePicture } from '/@/api/data/pictureInfo.js';
import { ElMessage } from "element-plus";
import { UploadFilled } from '@element-plus/icons-vue'
import { computed } from "@vue/reactivity";
const upFileRef = ref();
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
dialogVisible: false,
dialogImageUrl: '',
disabled: false,
hideUpload: false,
fileList: [],
isShowDialog: false,
isLoading: false,
ruleForm: {
},
tableData: [],
//
dictData: [],
unitData: [],
standardId: '',
detectionData: [],
disasterId: null,
dataForm: new FormData(),
fileArray: [],
id: null,
})
//
const changeUpload = (file, fileList) => {
state.dialogImageUrl = file.url;
state.hideUpload = fileList.length >= 1;
}
//
const validImg = (rule, value, callback) => {
if (state.fileList.length > 0) {
adminAddFormRef.value.clearValidate('img')
callback();
} else {
return callback(new Error('please upload image'));
}
}
//
const rules = reactive({
img: [
{ required: true, trigger: 'change', validator: validImg }
],
isMain: [
{ required: true, message: 'please select home page show', trigger: 'change' }
],
remark: [
{ required: true, message: 'please select data details', trigger: 'blur' }
],
})
//
const handleRemove = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles)
state.hideUpload = state.fileList.length >= 1
}
//
const handlePictureCardPreview = (uploadFile) => {
state.dialogImageUrl = uploadFile.url
state.dialogVisible = true
}
//
const beforeUpload = (file) => {
const isLt1GB = file.size / 1024 / 1024 / 1024 < 1;
if (!isLt1GB) {
ElMessage.warning('The size of the uploaded picture cannot exceed 1GB!');
}
return isLt1GB;
}
//
const uploadPic = (data) => {
state.fileArray.push(data.file);
}
//
const removePic = (data) => {
state.fileArray.splice(state.fileArray.findIndex(item => item.uid === data.raw.uid), 1)
console.log(state.fileArray)
}
//
const resetField = () => {
adminAddFormRef.value.resetFields();
state.fileList = [];
upFileRef.value.clearFiles();
}
//
const openDialog = (row) => {
state.isShowDialog = true;
//
state.fileList.push({ 'name': row.name, 'uid': row.id, 'url': row.link });
state.hideUpload = state.fileList.length >= 1
//state.dialogImageUrl = row.link;
state.ruleForm.isMain = row.isMain + "";
state.ruleForm.title = row.name;
state.id = row.id
};
//
const closeDialog = () => {
state.isShowDialog = false;
//
state.ruleForm.tableData = [];
resetField();
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
adminAddFormRef.value.validate((valid, fields) => {
if (valid) {
console.log(state.fileList);
state.isLoading = true;
state.fileList.forEach(item => {
console.log(item.raw,"item.raw");
if (item.raw) {
console.log(1111111111111);
state.dataForm.append('file', item.raw);
}
})
state.dataForm.append('isMain', state.ruleForm.isMain);
state.dataForm.append('id', state.id);
state.dataForm.append('name', state.ruleForm.title);
for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------');
}
updatePicture(state.dataForm).then(res => {
ElMessage.success("Upload successfully");
emit('callback');
}).finally(() => {
state.isLoading = false;
})
closeDialog();
}
})
};
//
defineExpose({
openDialog,
});
</script>
<style scoped>
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
.hide .el-upload--picture-card {
display: none;
}
</style>

View File

@ -0,0 +1,157 @@
<template>
<el-dialog title="upload" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="upload picture" prop="img">
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
:on-remove="removePic" :before-upload="beforeUpload">
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
Drop file here or <em>click to upload</em>
</div>
<template #tip>
<div class="el-upload__tip">
image files with a size less than 1GB
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item prop="title" label="data title">
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3" type="text"
style="width:220px;" />
</el-form-item>
<el-form-item label="Home page show" prop="isMain">
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
<el-option label="show" value="1"></el-option>
<el-option label="not show" value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { reactive, ref } from "vue";
import { uploadData } from '/@/api/data/pictureInfo.js';
import { ElMessage } from "element-plus";
import { UploadFilled } from '@element-plus/icons-vue'
const upFileRef = ref();
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
isShowDialog: false,
isLoading: false,
ruleForm: {
title:null,
},
tableData: [],
//
dictData: [],
unitData: [],
standardId: '',
detectionData: [],
disasterId: null,
dataForm: new FormData(),
fileArray: [],
})
const validImg = (rule, value, callback) => {
if (state.fileArray.length > 0) {
adminAddFormRef.value.clearValidate('img')
callback();
} else {
return callback(new Error('please upload image'));
}
}
//
const rules = reactive({
img: [
{ required: true, trigger: 'change', validator: validImg }
],
isMain: [
{ required: true, message: 'please select home page show', trigger: 'change' }
],
remark: [
{ required: true, message: 'please select data details', trigger: 'blur' }
],
})
//
const beforeUpload = (file) => {
const isLt1GB = file.size / 1024 / 1024 / 1024 < 1;
if (!isLt1GB) {
ElMessage.warning('The size of the uploaded picture cannot exceed 1GB!');
}
return isLt1GB;
}
//
const uploadPic = (data) => {
state.fileArray.push(data.file);
}
//
const removePic = (data) => {
state.fileArray.splice(state.fileArray.findIndex(item => item.uid === data.raw.uid), 1)
console.log(state.fileArray)
}
//
const resetField = () => {
adminAddFormRef.value.resetFields();
state.fileArray = [];
upFileRef.value.clearFiles();
}
//
const openDialog = (row) => {
state.isShowDialog = true;
state.disasterId = row;
};
//
const closeDialog = () => {
state.isShowDialog = false;
//
state.ruleForm.tableData = [];
resetField();
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
adminAddFormRef.value.validate((valid, fields) => {
if (valid) {
state.isLoading = true;
state.fileArray.forEach(item => {
state.dataForm.append('file', item);
})
state.dataForm.append('disasterId', state.disasterId);
state.dataForm.append('isMain', state.ruleForm.isMain);
state.dataForm.append('title', state.ruleForm.title);
for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------');
}
uploadData(state.dataForm).then(res => {
state.dataForm = new FormData(),
state.fileArray = [];
upFileRef.value.clearFiles();
ElMessage.success("Upload successfully");
emit('callback');
}).finally(() => {
state.isLoading = false;
})
closeDialog();
}
})
};
//
defineExpose({
openDialog,
});
</script>
<style scoped></style>

View File

@ -0,0 +1,300 @@
<template>
<div class="system-role-container layout-padding">
<el-config-provider :locale="en">
<el-row :gutter="22">
<el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<disasterTable @childClick="tableClick"></disasterTable>
</div>
</el-col>
<el-col :span="14">
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
clearable></el-input>
<el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon>
<ele-Search/>
</el-icon>
search
</el-button>-->
<el-button size="default" type="success" class="ml10" @click="uploadData">
<el-icon>
<ele-Upload />
</el-icon>
Upload
</el-button>
<el-button size="default" type="danger" class="ml10" @click="batchDel">
<el-icon>
<ele-Delete />
</el-icon>
Batch delete
</el-button>
</div>
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="ID" width="50" />
<el-table-column prop="name" label="Name" show-overflow-tooltip>
<template #default="scope">
{{ formatName(scope.row.name) }}
</template>
</el-table-column>
<el-table-column prop="link" label="Image" show-overflow-tooltip>
<template #default="scope">
<el-popover trigger="hover" placement="right" popper-class="max-h-300px overflow-auto" :width="330">
<!-- table中原本显示的图片 -->
<template #reference>
<img :src="scope.row.link" :alt="scope.row.link" style="max-height: 130px;max-width: 130px">
</template>
<!-- 鼠标移入时弹出的图片 -->
<img :src="scope.row.link" alt="" style="height: 150px;width: 300px">
</el-popover>
</template>
</el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
:total="state.tableData.total">
</el-pagination>
</div>
</el-col>
</el-row>
</el-config-provider>
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
<Upload ref="uploadRef" @callback="getTableData" />
<EditPicture ref="editUploadRef" @callback="getTableData" />
</div>
</template>
<script lang="ts" setup name="systemRole">
import type { TabsPaneContext } from 'element-plus';
import Upload from './component/upload.vue';
import EditPicture from './component/editPicture.vue';
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
import en from 'element-plus/dist/locale/en.mjs';
const activeName = ref('first');
import disasterTable from "/@/components/table/DisasterTable.vue";
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
//
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref();
const uploadRef = ref();
const editUploadRef = ref();
//
const roleDialogRef = ref();
const state = reactive({
multipleSelection: [],
tabVal: 'first',
disasterId: null,
disasterData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
});
const handleSelectionChange = (val) => {
state.multipleSelection = val;
};
//
const formatName = (name) => {
return name;
};
const auditData = (row) => {
let id = row.id;
auditRef.value.openDialog([{ id: id }]);
};
//
const formatSize = (size) => {
var data = '';
if (size < 0.1 * 1024) {
//0.1KBB
data = size.toFixed(2) + 'B';
} else if (size < 0.1 * 1024 * 1024) {
//0.1MBKB
data = (size / 1024).toFixed(2) + 'KB';
} else if (size < 0.1 * 1024 * 1024 * 1024) {
//0.1GBMB
data = (size / (1024 * 1024)).toFixed(2) + 'MB';
} else {
//GB
data = (size / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
}
var sizestr = data + '';
var len = sizestr.indexOf('.');
var dec = sizestr.substr(len + 1, 2);
if (dec == '00') {
//00
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
}
return sizestr;
};
const formatSizeUnits = (size) => {
if (size === 0 || size === -1) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(size) / Math.log(k));
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
};
//
const tableClick = (i) => {
state.disasterId = i.disasterId;
getTableData();
};
//
const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
state.disasterData.data = res.records;
state.disasterData.data.forEach(item => {
let date = item.disasterTime.slice(0, 10);
item.disasterTime = date;
})
state.disasterData.total = res.total;
state.disasterData.loading = false;
});
};
//
const getTableData = () => {
state.tableData.loading = true;
getPicturePage(state.tableData.param.pageNum, state.tableData.param.pageSize, { disasterId_equal: state.disasterId, isDeleted_equal: 0 }).then(
(res) => {
state.tableData.data = res.records;
state.tableData.total = res.total;
}
);
setTimeout(() => {
state.tableData.loading = false;
}, 500);
};
//
const uploadData = () => {
if (state.disasterId == null) {
ElMessage.warning('Please select the disaster first');
return false;
}
uploadRef.value.openDialog(state.disasterId);
};
//
const editData = (row) => {
editUploadRef.value.openDialog(row);
};
//
const batchDel = () => {
if (state.multipleSelection.length == 0) {
ElMessage.warning('Select the data to be operated first');
return false;
}
ElMessageBox.confirm(`This action batch deletes the picture dataWhether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
let id = state.multipleSelection.map((item) => item.id);
delPicture(id.join()).then((res) => {
getTableData();
ElMessage.success('delete successfully');
});
})
.catch(() => { });
};
//
const del = (row) => {
ElMessageBox.confirm(`This action will delete the picture${row.name}Whether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
delPicture(row.id).then((res) => {
getTableData();
ElMessage.success('delete successfully');
});
})
.catch(() => { });
};
//
const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val;
getDisasterData();
};
//
const onHandleDisasterCurrentChange = (val) => {
state.disasterData.param.pageNum = val;
getDisasterData();
};
//
const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val;
getTableData();
};
//
const onHandleCurrentChange = (val) => {
state.tableData.param.pageNum = val;
getTableData();
};
//
onMounted(() => {
getDisasterData();
//getTableData();
});
</script>
<style>
.mt15 {
display: flex;
justify-content: end;
}
.demo-tabs>.el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.system-role-container {
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
}
.demo-tabs>.el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
</style>

View File

@ -0,0 +1,81 @@
<template>
<el-dialog title="address" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="190px" :rules="rules" ref="adminAddFormRef">
<el-form-item prop="downloadurl" label="data downloadUrl">
<el-input v-model="state.ruleForm.downloadUrl" placeholder="please data downloadurl"
type="text" style="width:320px; height: 40px;" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">confirm</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { reactive, ref } from "vue";
import { ElMessage } from "element-plus";
import { approval } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
isShowDialog: false,
isLoading: false,
ruleForm: {
},
disasterId: null,
})
//
const rules = reactive({
downloadurl: [
{ required: true, message: 'please data downloadurl', trigger: 'blur' }
],
})
//
const resetField = () => {
adminAddFormRef.value.resetFields();
}
//
const openDialog = (row) => {
state.isShowDialog = true;
state.ruleForm.id = row.id;
if (row.downloadUrl) {
state.ruleForm.downloadUrl = row.downloadUrl;
}
};
//
const closeDialog = () => {
state.isShowDialog = false;
resetField();
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
if (!state.ruleForm.downloadUrl) {
return;
}
state.ruleForm.status = 3;
approval(state.ruleForm).then(da => {
ElMessage.success('success!');
closeDialog();
emit("callback");
})
};
//
defineExpose({
openDialog,
});
</script>
<style scoped></style>

View File

@ -0,0 +1,76 @@
<template>
<el-dialog title="approval" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="pass or not" prop="status">
<el-radio-group v-model="state.ruleForm.status">
<el-radio :label="2">pass</el-radio>
<el-radio :label="4">no pass</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">confirm</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { reactive, ref } from "vue";
import { ElMessage } from "element-plus";
import { approval } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
isShowDialog: false,
isLoading: false,
ruleForm: {
},
disasterId: null,
})
//
const rules = reactive({
status: [
{ required: true, message: 'please check pass or not', trigger: 'change' }
]
})
//
const resetField = () => {
adminAddFormRef.value.resetFields();
}
//
const openDialog = (row) => {
state.isShowDialog = true;
state.ruleForm.id = row.id;
};
//
const closeDialog = () => {
state.isShowDialog = false;
resetField();
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
approval(state.ruleForm).then(da=>{
ElMessage.success('success!');
closeDialog();
emit("callback");
})
};
//
defineExpose({
openDialog,
});
</script>
<style scoped></style>

View File

@ -66,7 +66,8 @@
</el-table-column>
<el-table-column prop="Operate" label="Operate" align="center" width="200" show-overflow-tooltip>
<template #default="scope">
<el-button v-if="scope.row.status === 2" size="small" text type="primary" @click="reviseDownload(scope.row)">start</el-button>
<el-button v-if="scope.row.status === 1" size="small" text type="primary" @click="approvalDataOpen(scope.row)">start</el-button>
<el-button v-if="scope.row.status === 2 || scope.row.status === 3" size="small" text type="primary" @click="addAddressOpen(scope.row)">add_address</el-button>
</template>
</el-table-column>
</el-table>
@ -78,19 +79,22 @@
</div>
</el-col>
</el-row>
<reviseDownloadUrl ref="reviseDownloadUrlRef" @callback="getTableData" />
<approvalData ref="approvalDataRef" @callback="getData()" />
<addAddress ref="addAddressRef" @callback="getData()" />
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getDisasterPage } from '/@/api/data/otherData.js'
import disasterTable from "/@/components/table/DisasterTable.vue";
import reviseDownloadUrl from "./reviseDownloadUrl.vue";
import approvalData from "./approvalData.vue";
import addAddress from "./addAddress.vue";
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
const reviseDownloadUrlRef = ref();
const approvalDataRef = ref();
const addAddressRef = ref();
const state = reactive({
disasterData: {
data: [],
@ -139,6 +143,10 @@ const state = reactive({
label: 'Finish',
value: '3'
},
{
label: 'No pass',
value: '4'
},
],
options_resolution: [{
label: '<0.8m',
@ -198,6 +206,16 @@ const tableClick = (i) => {
getData()
}
//
const approvalDataOpen = (row) => {
approvalDataRef.value.openDialog(row);
};
//
const addAddressOpen = (row) => {
addAddressRef.value.openDialog(row);
};
//
const getData = () => {
let data = {
@ -205,20 +223,9 @@ const getData = () => {
}
getPagesRemoteSensingSourceData(data).then(
(res) => {
console.log(res.records);
state.requestData = res.records;
state.tableData.total = res.total;
})
// getRemoteSensingSourceDataByCondition(1, 1000, JSON.stringify(data)).then(
// (res) => {
// state.requestData = res.records;
// for (let index = 0; index < res.records.length; index++) {
// state.requestResolution[index] = state.requestData[index].productResolution
// state.requestSatellite[index] = state.requestData[index].satelliteCode
// }
// state.requestResolution = new Set(state.requestResolution)
// state.requestSatellite = new Set(state.requestSatellite)
// })
}
//

View File

@ -1,121 +0,0 @@
<template>
<el-dialog title="upload" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="area cn" prop="areaCn">
<el-input v-model="state.ruleForm.areaCn" placeholder="please enter area cn" style="width: 300px"/>
</el-form-item>
<el-form-item prop="areaEn" label="area en">
<el-input v-model="state.ruleForm.areaEn" placeholder="please enter area en" style="width: 300px"/>
</el-form-item>
<el-form-item prop="frequency" label="frequency">
<el-input v-model="state.ruleForm.frequency" placeholder="please enter frequency" style="width: 300px"/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">submit</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import {reactive, ref} from "vue";
import {uploadData} from '/@/api/data/visualData.js';
import {ElMessage} from "element-plus";
import { UploadFilled } from '@element-plus/icons-vue'
const options = [
{
value: '0',
label: 'basic data',
},
{
value: '1',
label: 'responded report',
},
{
value: '2',
label: 'cartographic product',
}
]
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
isShowDialog: false,
isLoading:false,
ruleForm: {
},
tableData: [],
//
dictData: [],
unitData:[],
standardId: '',
detectionData: [],
disasterId:null,
dataForm:new FormData(),
fileArray:[],
})
const uploadPic = (data) => {
state.fileArray.push(data.file);
}
//
const removePic = (data) => {
state.fileArray.splice(state.fileArray.findIndex(item=>item.uid===data.raw.uid), 1)
console.log(state.fileArray)
}
//
const rules = reactive({
status: [
{required: true, message: 'please check pass or not', trigger: 'change'}
]
})
//
const resetField = () => {
adminAddFormRef.value.resetFields();
}
//
const openDialog = (row) => {
state.isShowDialog = true;
state.disasterId = row;
};
//
const closeDialog = () => {
state.isShowDialog = false;
//
state.ruleForm.tableData = [];
resetField();
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
adminAddFormRef.value.validate((valid, fields) => {
if (valid) {
state.isLoading = true;
state.ruleForm.type = 2;
state.ruleForm.disasterId = state.disasterId;
uploadData(state.ruleForm).then(res => {
ElMessage.success("Submit successfully");
emit('callback');
}).finally(()=>{
state.isLoading = false;
})
closeDialog();
}
})
};
//
defineExpose({
openDialog,
});
</script>
<style scoped>
</style>