glj-代码提交
This commit is contained in:
parent
4f7fea6259
commit
105feccee5
|
@ -16,17 +16,35 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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)">
|
||||
<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 :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)">
|
||||
<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 :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" 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 :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
|
||||
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 :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')" 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 :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')"
|
||||
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>
|
||||
|
||||
<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-row>
|
||||
<el-row>
|
||||
|
@ -44,17 +62,35 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<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)">
|
||||
<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 :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)">
|
||||
<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 :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" 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 :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
|
||||
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 :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')" 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 :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')"
|
||||
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>
|
||||
|
||||
<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-row>
|
||||
<template #footer>
|
||||
|
@ -186,10 +222,9 @@ const start = (text)=>{
|
|||
} else {
|
||||
news(ret.disasterId, keywords, page, (text == "baidu"), ret.id).then(res => {
|
||||
getData();
|
||||
ElMessage.success("success")
|
||||
})
|
||||
ElMessage.success("Data is being acquired!")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -198,9 +233,6 @@ defineExpose({
|
|||
})
|
||||
|
||||
</script>
|
||||
<style >
|
||||
.inline-block {
|
||||
<style >.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
</style>
|
||||
}</style>
|
|
@ -1,37 +1,28 @@
|
|||
<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-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 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-option label="show" value="1"></el-option>
|
||||
<el-option label="not show" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -143,6 +134,7 @@ const openDialog = (row) => {
|
|||
state.hideUpload = state.fileList.length >= 1
|
||||
//state.dialogImageUrl = row.link;
|
||||
state.ruleForm.isMain = row.isMain + "";
|
||||
state.ruleForm.title = row.name;
|
||||
state.id = row.id
|
||||
};
|
||||
// 关闭弹窗
|
||||
|
@ -162,11 +154,17 @@ const onSubmit = () => {
|
|||
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, '--------------');
|
||||
}
|
||||
|
|
|
@ -43,29 +43,35 @@
|
|||
<!-- id,卫星类型,生产日期,产品谱段,产品分辨率,云覆盖量,景中心经纬度,元数据下载链接,缩略图 支撑单位 -->
|
||||
<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 prop="satelliteCode" label="Satellite code" width="170" align="center"
|
||||
show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="productTime" label="Product time" width="170" align="center"
|
||||
show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="satelliteCode" label="Satellite code" width="170" align="center" show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="productTime" label="Product time" width="170" align="center" show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="productBandsNum" label="Product bands num" width="200" align="center"
|
||||
show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="productResolution" label="Product resolution(m)" width="220" align="center"
|
||||
show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180"
|
||||
show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180" show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="sourceOrganization" label="Source organization" width="200" align="center"
|
||||
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>
|
||||
<!-- <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-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"
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
style="margin-right: 20px;" :page-sizes="[10, 20, 30]" background
|
||||
v-model:current-page="state.tableData.param.pageNum" 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>
|
||||
<reviseDownloadUrl ref="reviseDownloadUrlRef" @callback="getTableData"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -74,9 +80,10 @@ import { ref, reactive, onMounted } from 'vue';
|
|||
import { getRemoteSensingSourceData, 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 { getList as getDisasterPage } from '/@/api/disasterInfo/index';
|
||||
|
||||
const reviseDownloadUrlRef = ref();
|
||||
const state = reactive({
|
||||
disasterData: {
|
||||
data: [],
|
||||
|
@ -268,6 +275,12 @@ const searchRemoteSensingSourceData = () => {
|
|||
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
|
||||
}
|
||||
|
||||
const reviseDownload = (row) =>{
|
||||
|
||||
console.log(row,"rowrowrow");
|
||||
}
|
||||
|
||||
|
||||
// 根据检索条件检索遥感元数据
|
||||
const getDataByCondition = (current, size, dataNew) => {
|
||||
console.log('传过来的数据:', state.tableData.param.pageNum);
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue