修改清空表格选项-liyuchen
This commit is contained in:
parent
7ef200e879
commit
933ed73ed7
|
@ -11,7 +11,7 @@
|
|||
search
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" :row-key="getRowKeys" @selection-change="handleSelectionChange">
|
||||
<el-table :data="state.tableData.data" :row-key="getRowKeys" @selection-change="handleSelectionChange" ref="tableRef">
|
||||
<el-table-column type="selection" width="55" :reserve-selection="true"/>
|
||||
<el-table-column property="dictValue" label="DisasterType" width="150" />
|
||||
<el-table-column property="disasterCountry" label="DisasterCountry" width="200" />
|
||||
|
@ -43,9 +43,10 @@
|
|||
<script setup>
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import {getPage,updateDisasterManage} from '/@/api/disasterInfo/index.js';
|
||||
import {reactive} from "vue";
|
||||
import {reactive, ref} from "vue";
|
||||
import {ElMessage} from "element-plus";
|
||||
const emit = defineEmits(['callback']);
|
||||
const tableRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog:false,
|
||||
table:false,
|
||||
|
@ -86,11 +87,17 @@ const getDisaterInfo = () => {
|
|||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
state.multipleSelection = [];
|
||||
tableRef.value.clearSelection();
|
||||
};
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
}
|
||||
const onSubmit = () => {
|
||||
if(state.multipleSelection.length == 0){
|
||||
ElMessage.warning("Please check the data first");
|
||||
return false;
|
||||
}
|
||||
//将选中的灾害转为{"id":"","chiefId":""}格式
|
||||
const saveRes = state.multipleSelection.map(item=> ({id:item.id,chiefId:state.chiefId}))
|
||||
updateDisasterManage(saveRes).then(res=>{
|
||||
|
|
Loading…
Reference in New Issue