glj-代码提交

This commit is contained in:
glj 2023-05-08 09:09:20 +08:00
parent 4f7fea6259
commit 105feccee5
4 changed files with 356 additions and 192 deletions

View File

@ -16,17 +16,35 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3" style="text-align:center ;"> <el-col :span="3" style="text-align:center ;">
<el-icon :size="40" style="cursor:pointer ;" :title="state.baidu.status==0?'Waiting in queue……':'start'" :color="state.baidu.status==0?'#4f4':'blue'" @click="state.baidu.status==0?confirmBox('baidu'):start('baidu')" v-if="state.baiduOption.buttonIs&&(state.baidu.status==0||!state.baidu.status)"> <el-icon :size="40" style="cursor:pointer ;" :title="state.baidu.status == 0 ? 'Waiting in queue……' : 'start'"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg> :color="state.baidu.status == 0 ? '#4f4' : 'blue'"
@click="state.baidu.status == 0 ? confirmBox('baidu') : start('baidu')"
v-if="state.baiduOption.buttonIs && (state.baidu.status == 0 || !state.baidu.status)">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z">
</path>
</svg>
</el-icon> </el-icon>
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.baiduOption.buttonIs&&state.baidu.status==1"> <el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg> color="#131313" v-if="state.baiduOption.buttonIs && state.baidu.status == 1">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z">
</path>
</svg>
</el-icon> </el-icon>
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')" v-if="state.baiduOption.buttonIs&&state.baidu.status==2"> <el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg> v-if="state.baiduOption.buttonIs && state.baidu.status == 2">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z">
</path>
</svg>
</el-icon> </el-icon>
<span v-if="!state.baiduOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.baiduOption.runTitle }}</span> <span v-if="!state.baiduOption.buttonIs" style="height: 40; line-height: 40px;">{{
state.baiduOption.runTitle }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -44,17 +62,35 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3" style="text-align:center ;"> <el-col :span="3" style="text-align:center ;">
<el-icon :size="40" style="cursor:pointer ;" :title="state.bing.status==0?'Waiting in queue……':'start'" :color="state.bing.status==0?'#4f4':'blue'" @click="state.bing.status==0?confirmBox('bing'):start('bing')" v-if="state.bingOption.buttonIs&&(state.bing.status==0||!state.bing.status)"> <el-icon :size="40" style="cursor:pointer ;" :title="state.bing.status == 0 ? 'Waiting in queue……' : 'start'"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg> :color="state.bing.status == 0 ? '#4f4' : 'blue'"
@click="state.bing.status == 0 ? confirmBox('bing') : start('bing')"
v-if="state.bingOption.buttonIs && (state.bing.status == 0 || !state.bing.status)">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z">
</path>
</svg>
</el-icon> </el-icon>
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.buttonIs&&state.bing.status==1"> <el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg> color="#131313" v-if="state.buttonIs && state.bing.status == 1">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z">
</path>
</svg>
</el-icon> </el-icon>
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')" v-if="state.bingOption.buttonIs&&state.bing.status==2"> <el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')"
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg> v-if="state.bingOption.buttonIs && state.bing.status == 2">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
<path fill="currentColor"
d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z">
</path>
</svg>
</el-icon> </el-icon>
<span v-if="!state.bingOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.bingOption.runTitle }}</span> <span v-if="!state.bingOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.bingOption.runTitle
}}</span>
</el-col> </el-col>
</el-row> </el-row>
<template #footer> <template #footer>
@ -186,10 +222,9 @@ const start = (text)=>{
} else { } else {
news(ret.disasterId, keywords, page, (text == "baidu"), ret.id).then(res => { news(ret.disasterId, keywords, page, (text == "baidu"), ret.id).then(res => {
getData(); getData();
ElMessage.success("success")
}) })
ElMessage.success("Data is being acquired!")
} }
}) })
} }
@ -198,9 +233,6 @@ defineExpose({
}) })
</script> </script>
<style > <style >.inline-block {
.inline-block {
display: inline-block; display: inline-block;
} }</style>
</style>

View File

@ -1,37 +1,28 @@
<template> <template>
<el-dialog title="edit picture" v-model="state.isShowDialog" width="700px" :close-on-click-modal="false" @close="closeDialog"> <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 :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="upload picture" prop="img"> <el-form-item label="upload picture" prop="img">
<el-upload <el-upload ref="upFileRef" v-model:file-list="state.fileList" action="#" list-type="picture-card" accept="image/*"
ref="upFileRef" :on-preview="handlePictureCardPreview" :on-remove="handleRemove" :on-change="changeUpload" :limit="1"
v-model:file-list="state.fileList" :auto-upload="false" :class="{ hide: state.hideUpload }">
action="#" <el-icon>
list-type="picture-card" <Plus />
accept="image/*" </el-icon>
: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-upload>
<el-dialog v-model="state.dialogVisible"> <el-dialog v-model="state.dialogVisible">
<img w-full :src="state.dialogImageUrl" alt="Preview Image" /> <img w-full :src="state.dialogImageUrl" alt="Preview Image" />
</el-dialog> </el-dialog>
</el-form-item> </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-form-item label="Home page show" prop="isMain">
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show"> <el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
<el-option <el-option label="show" value="1"></el-option>
label="show" <el-option label="not show" value="0"></el-option>
value="1"
></el-option>
<el-option
label="not show"
value="0"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -143,6 +134,7 @@ const openDialog = (row) => {
state.hideUpload = state.fileList.length >= 1 state.hideUpload = state.fileList.length >= 1
//state.dialogImageUrl = row.link; //state.dialogImageUrl = row.link;
state.ruleForm.isMain = row.isMain + ""; state.ruleForm.isMain = row.isMain + "";
state.ruleForm.title = row.name;
state.id = row.id state.id = row.id
}; };
// //
@ -162,11 +154,17 @@ const onSubmit = () => {
if (valid) { if (valid) {
console.log(state.fileList); console.log(state.fileList);
state.isLoading = true; state.isLoading = true;
state.fileList.forEach(item => { 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('file', item.raw);
}
}) })
state.dataForm.append('isMain', state.ruleForm.isMain); state.dataForm.append('isMain', state.ruleForm.isMain);
state.dataForm.append('id', state.id); state.dataForm.append('id', state.id);
state.dataForm.append('name', state.ruleForm.title);
for (let [a, b] of state.dataForm.entries()) { for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------'); console.log(a, b, '--------------');
} }

View File

@ -43,29 +43,35 @@
<!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 --> <!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 -->
<el-table :data="state.requestData" style="width: 1000Px;"> <el-table :data="state.requestData" style="width: 1000Px;">
<el-table-column type="index" label="Index" align="center" width="80"></el-table-column> <el-table-column type="index" label="Index" align="center" width="80"></el-table-column>
<el-table-column prop="satelliteCode" label="Satellite code" width="170" align="center" <el-table-column prop="satelliteCode" label="Satellite code" width="170" align="center" show-overflow-tooltip
show-overflow-tooltip sortable></el-table-column> sortable></el-table-column>
<el-table-column prop="productTime" label="Product time" width="170" align="center" <el-table-column prop="productTime" label="Product time" width="170" align="center" show-overflow-tooltip
show-overflow-tooltip sortable></el-table-column> sortable></el-table-column>
<el-table-column prop="productBandsNum" label="Product bands num" width="200" align="center" <el-table-column prop="productBandsNum" label="Product bands num" width="200" align="center"
show-overflow-tooltip sortable></el-table-column> show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="productResolution" label="Product resolution(m)" width="220" align="center" <el-table-column prop="productResolution" label="Product resolution(m)" width="220" align="center"
show-overflow-tooltip sortable></el-table-column> show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180" <el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180" show-overflow-tooltip
show-overflow-tooltip sortable></el-table-column> sortable></el-table-column>
<el-table-column prop="sourceOrganization" label="Source organization" width="200" align="center" <el-table-column prop="sourceOrganization" label="Source organization" width="200" align="center"
show-overflow-tooltip sortable></el-table-column> show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="downloadUrl" label="Download url" align="center" width="200" show-overflow-tooltip> <el-table-column prop="downloadUrl" label="Download url" align="center" width="200" show-overflow-tooltip>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="Operate" label="Operate" align="center" width="200" show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="reviseDownload(scope.row)">start</el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
style="margin-right: 20px;" :page-sizes="[10, 20, 30]" background v-model:current-page="state.tableData.param.pageNum" style="margin-right: 20px;" :page-sizes="[10, 20, 30]" background
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next" v-model:current-page="state.tableData.param.pageNum" v-model:page-size="state.tableData.param.pageSize"
:total="state.tableData.total"> layout="total, sizes, prev, pager, next" :total="state.tableData.total">
</el-pagination> </el-pagination>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<reviseDownloadUrl ref="reviseDownloadUrlRef" @callback="getTableData"/>
</div> </div>
</template> </template>
@ -74,9 +80,10 @@ import { ref, reactive, onMounted } from 'vue';
import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js"; import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getDisasterPage } from '/@/api/data/otherData.js' import { getDisasterPage } from '/@/api/data/otherData.js'
import disasterTable from "/@/components/table/DisasterTable.vue"; import disasterTable from "/@/components/table/DisasterTable.vue";
import reviseDownloadUrl from "./reviseDownloadUrl.vue";
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index'; // import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
const reviseDownloadUrlRef = ref();
const state = reactive({ const state = reactive({
disasterData: { disasterData: {
data: [], data: [],
@ -268,6 +275,12 @@ const searchRemoteSensingSourceData = () => {
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew) getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
} }
const reviseDownload = (row) =>{
console.log(row,"rowrowrow");
}
// //
const getDataByCondition = (current, size, dataNew) => { const getDataByCondition = (current, size, dataNew) => {
console.log('传过来的数据:', state.tableData.param.pageNum); console.log('传过来的数据:', state.tableData.param.pageNum);

View File

@ -0,0 +1,121 @@
<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>