glj-代码提交

This commit is contained in:
管李杰 2024-07-11 14:00:27 +08:00
parent 40581c81d9
commit a3ba1550bd
3 changed files with 108 additions and 29 deletions

View File

@ -146,4 +146,16 @@ export function getTenDisasterInfo() {
url: '/api/' + moduleName + '/ui/disasterInfo/getTenDisasterInfo',
method: 'get',
})
}
export const detailByDisasterInfoId = (id, current, size) => {
return request({
url: '/api/' + moduleName + '/ui/guestApply/detailByDisasterInfoId',
method: 'get',
params: {
id,
current,
size
}
});
}

View File

@ -47,12 +47,6 @@
</el-pagination>
</div>
<el-dialog v-model="state.dialogVisible" title="Approval" width="45%">
<el-container style="margin-top: -2%; margin-bottom: 2%">
<el-radio v-model="state.radio" label="1" @click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio" label="2" @click="mapEvents('2')">Area</el-radio>
<el-radio v-model="state.radio" label="3" @click="mapEvents('3')">Edit</el-radio>
<el-button type="primary" style="margin-left: 5%" @click="ClearSubmit">Clear</el-button>
</el-container>
<el-container style="margin-top: 2%; margin-bottom: 2%" v-if="state.radio === '1' ? true : false">
<span style="line-height: 35px"> Latitude</span>
<el-input placeholder="wait……" style="height: 35px; margin-right: 1%" v-model="state.dislat"> </el-input>

View File

@ -1,10 +1,36 @@
<template>
<div class="system-add-dept-container">
<el-dialog :title="state.title" v-model="state.isShowDialog" width="769px">
<el-card shadow="hover" class="layout-padding-auto">
<el-table :data="state.tableDataNew.data" v-loading="state.tableDataNew.loading" style="width: 100%" @selection-change="selectionChange">
<el-table-column type="selection" width="60" @select="selectRow" />
<el-table-column prop="userName" label="Name" show-overflow-tooltip></el-table-column>
<el-table-column prop="userEmail" label="E-mail" show-overflow-tooltip></el-table-column>
<el-table-column prop="userStatus" label="role" show-overflow-tooltip>
<template #default="scope">
<el-tag type="info" v-if="scope.row.userStatus == 0">B1</el-tag>
<el-tag type="info" v-if="scope.row.userStatus == 1">B2</el-tag>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="onHandleSizeChangeNew"
@current-change="onHandleCurrentChangeNew"
class="mt15"
:pager-count="3"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableDataNew.param.pageNum"
background
v-model:page-size="state.tableDataNew.param.pageSize"
layout="total, sizes, prev, pager, next"
:total="state.tableDataNew.total"
>
</el-pagination>
</el-card>
<el-card shadow="hover" class="layout-padding-auto">
<div class="system-user-search mb15">
<el-input size="default" placeholder="Name" style="max-width: 180px"
v-model="state.tableData.query.name"> </el-input>
<el-input size="default" placeholder="Name" style="max-width: 180px" v-model="state.tableData.query.name"> </el-input>
<el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon>
<ele-Search />
@ -12,24 +38,29 @@
search
</el-button>
</div>
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"
@selection-change="selectionChange">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%" @selection-change="selectionChange">
<el-table-column type="selection" width="60" @select="selectRow" />
<el-table-column prop="name" label="Name" show-overflow-tooltip></el-table-column>
<el-table-column prop="email" label="E-mail" show-overflow-tooltip></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
@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>
</el-card>
<template #footer>
<span class="dialog-footer">
<el-button @click="state.isShowDialog = false">Cancel</el-button>
<el-button type="success" @click="save()">
Send
</el-button>
<el-button type="success" @click="save()"> Send </el-button>
</span>
</template>
</el-dialog>
@ -38,15 +69,14 @@
<script setup>
import { ElMessage } from 'element-plus';
import { getUserList, submitNew } from '/@/api/disasterInfo/index';
import { detailByDisasterInfoId, getUserList, submitNew } from '/@/api/disasterInfo/index';
import { getAdminPage } from '/@/api/response/administrator.js';
import { ref, reactive, onMounted } from 'vue';
import { useThemeConfig } from '/@/stores/themeConfig';
import { storeToRefs } from 'pinia';
const storesThemeConfig = useThemeConfig();
const { website } = storeToRefs(storesThemeConfig);
const { website } = storeToRefs(storesThemeConfig);
const formRef = ref();
const state = reactive({
isShowDialog: false,
@ -54,7 +84,19 @@ const state = reactive({
rowData: {},
tableData: {
query: {
name: ""
name: '',
},
data: [],
total: 0,
loading: false,
param: {
pageNum: 1,
pageSize: 10,
},
},
tableDataNew: {
query: {
name: '',
},
data: [],
total: 0,
@ -74,7 +116,7 @@ const openDialog = (row) => {
state.title = 'Review application';
state.rowData = row;
state.isShowDialog = true;
getTableDataNew();
};
const save = async () => {
//1
@ -89,11 +131,12 @@ const save = async () => {
}
let params = {
id: state.rowData.disasterId,
adminId: state.selectData[0].id,
adminName: state.selectData[0].name,
allocation:"YES"
adminId: state.selectData[0].userId,
adminName: state.selectData[0].userName,
allocation: 'YES',
};
let res = await submitNew(params).then(da=>{
console.log(params,"paramsparamsparamsparams");
let res = await submitNew(params).then((da) => {
ElMessage.success('success');
});
emit('callback');
@ -105,12 +148,33 @@ const closeDialog = () => {
};
const getTableData = async () => {
state.tableData.loading = true;
let res = await getAdminPage(state.tableData.param.pageNum, state.tableData.param.pageSize,
{ name_like: state.tableData.query.name ,roleId: "1123598816738675203" },website.value.tenantId);
let res = await getAdminPage(
state.tableData.param.pageNum,
state.tableData.param.pageSize,
{ name_like: state.tableData.query.name, roleId: '1123598816738675203' },
website.value.tenantId
);
state.tableData.data = res.records;
state.tableData.data.forEach((item) => {
item.userId = item.id;
item.userName = item.name;
});
state.tableData.total = res.total;
state.tableData.loading = false;
};
const getTableDataNew = () => {
state.tableDataNew.loading = true;
detailByDisasterInfoId(state.rowData.disasterId, state.tableDataNew.param.pageNum, state.tableDataNew.param.pageSize).then((da) => {
state.tableDataNew.data = da.records;
state.tableDataNew.data.forEach((item) => {
item.userId = item.adminId;
});
state.tableDataNew.total = da.total;
state.tableDataNew.loading = false;
});
};
//
const onCancel = () => {
closeDialog();
@ -126,6 +190,15 @@ const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val;
getTableData();
};
const onHandleCurrentChangeNew = (val) => {
state.tableData.param.pageNum = val;
getTableDataNew();
};
const onHandleSizeChangeNew = (val) => {
state.tableData.param.pageSize = val;
getTableDataNew();
};
onMounted(() => {
getTableData();
});
@ -140,4 +213,4 @@ defineExpose({
display: flex;
justify-content: end;
}
</style>
</style>