This commit is contained in:
qqGroup0 2023-05-06 21:56:43 +08:00
commit 467117ffc3
5 changed files with 136 additions and 119 deletions

View File

@ -39,6 +39,7 @@
import { onMounted, reactive, computed, defineProps, defineEmits } from "vue"; import { onMounted, reactive, computed, defineProps, defineEmits } from "vue";
import { getList } from "/@/api/system/dictbiz.js"; import { getList } from "/@/api/system/dictbiz.js";
import { getPage } from "/@/api/disasterInfo/index.js"; import { getPage } from "/@/api/disasterInfo/index.js";
import { Session } from '/@/utils/storage';
// //
const emit = defineEmits(["click"]); const emit = defineEmits(["click"]);
// //
@ -52,7 +53,8 @@ const props = defineProps({
const state = reactive({ const state = reactive({
// //
search: { search: {
respondStatus: props.status respondStatus: props.status,
disasterStatus:"3"
}, },
// //
dictList: [], dictList: [],
@ -83,6 +85,10 @@ const getDictBizData = () => {
// //
const getDisasterTable = () => { const getDisasterTable = () => {
convert(); convert();
let userData = Session.get('userInfo');
console.log(userData,"userDatauserData");
state.search.chiefIdEquals = userData.id;
state.search.roleName = userData.roles[0];
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => { getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => {
state.disasterData.data = res.records; state.disasterData.data = res.records;
state.disasterData.data.forEach(item => { state.disasterData.data.forEach(item => {

View File

@ -17,7 +17,8 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;"> <div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<div class="system-user-search " style="display: flex;margin-left: 10px;margin-top: 10px;margin-bottom:-15px "> <div class="system-user-search "
style="display: flex;margin-left: 10px;margin-top: 10px;margin-bottom:-15px ">
<el-form-item label="Type"> <el-form-item label="Type">
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px" <el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
size="default" clearable @change="getTableData(); state.queryTitle = ''"> size="default" clearable @change="getTableData(); state.queryTitle = ''">
@ -26,86 +27,86 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="Review status"> <el-form-item label="Review status">
<el-select v-model=" state.srarchType " placeholder="Please select data type" style="max-width: 200px" <el-select v-model="state.srarchType" placeholder="Please select data type" style="max-width: 200px"
size="default" clearable> size="default" clearable>
<el-option value="0" label="Awaiting approval"></el-option> <el-option value="0" label="Awaiting approval"></el-option>
<el-option value="1" label="Approved"></el-option> <el-option value="1" label="Approved"></el-option>
<el-option value="2" label="Rejected"></el-option> <el-option value="2" label="Rejected"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="Title" v-if=" state.searchName == '1' "> <el-form-item label="Title" v-if="state.searchName == '1'">
<el-input v-model=" state.queryTitle " placeholder="Please enter a title"></el-input> <el-input v-model="state.queryTitle" placeholder="Please enter a title"></el-input>
</el-form-item> </el-form-item>
<el-button size="default" type="primary" class="ml10" @click=" getTableData "> <el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
Search Search
</el-button> </el-button>
</div> </div>
<el-button size="default" type="success" class="ml10" @click=" openDialog "> <el-button size="default" type="success" class="ml10" @click="openDialog">
<el-icon> <el-icon>
<ele-Upload /> <ele-Upload />
</el-icon> </el-icon>
Batch operation Batch operation
</el-button> </el-button>
<el-table :data=" state.tableData.data " v-loading=" state.tableData.loading " <el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change=" handleSelectionChange " style="width: 100%; height: 600px;"> @selection-change="handleSelectionChange" style="width: 100%; height: 600px;">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column type="index" label="ID" width="50" /> <el-table-column type="index" label="ID" width="50" />
<!-- <el-table-column v-if=" state.searchName == '1' " prop="title" label="Title" <!-- <el-table-column v-if=" state.searchName == '1' " prop="title" label="Title"
show-overflow-tooltip></el-table-column> --> show-overflow-tooltip></el-table-column> -->
<el-table-column prop="content" label="Content" show-overflow-tooltip></el-table-column> <el-table-column prop="content" label="Content" show-overflow-tooltip></el-table-column>
<el-table-column prop="type" label="Type" show-overflow-tooltip> <el-table-column prop="type" label="Type" show-overflow-tooltip>
<template #default=" scope "> <template #default="scope">
<el-tag type="info" v-if=" state.searchName == '1' && scope.row.type == 0 ">baidu</el-tag> <el-tag type="info" v-if="state.searchName == '1' && scope.row.type == 0">baidu</el-tag>
<el-tag type="info" v-if=" state.searchName == '1' && scope.row.type == 1 ">bing</el-tag> <el-tag type="info" v-if="state.searchName == '1' && scope.row.type == 1">bing</el-tag>
<el-tag type="info" v-if=" state.searchName == '2' && scope.row.type == 0 ">twitter</el-tag> <el-tag type="info" v-if="state.searchName == '2' && scope.row.type == 0">twitter</el-tag>
<el-tag type="info" v-if=" state.searchName == '2' && scope.row.type == 1 ">weibo</el-tag> <el-tag type="info" v-if="state.searchName == '2' && scope.row.type == 1">weibo</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="content" label="Link" show-overflow-tooltip> <el-table-column prop="content" label="Link" show-overflow-tooltip>
<template #default=" scope "> <template #default="scope">
<a :href=" scope.row.link " target="_blank">Read more</a> <a :href="scope.row.link" target="_blank">Read more</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="Create Time" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="time" label="Time" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default=" scope "> <template #default="scope">
<el-button size="small" text type="info" v-if=" scope.row.status == 0 " <el-button size="small" text type="primary" v-if="scope.row.status == 0"
@click=" openDialog(scope.row, true) ">Awaiting approval</el-button> @click=" openDialog(scope.row, true)">Awaiting approval</el-button>
<el-button size="small" text type="success" v-if=" scope.row.status == 1 " <el-button size="small" text type="success" v-if="scope.row.status == 1"
@click=" openDialog(scope.row, false) ">Approved</el-button> @click=" openDialog(scope.row, false)">Approved</el-button>
<el-button size="small" text type="danger" v-if=" scope.row.status == 2 " <el-button size="small" text type="danger" v-if="scope.row.status == 2"
@click=" openDialog(scope.row, false) ">Rejected</el-button> @click=" openDialog(scope.row, false)">Rejected</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination style="margin-left: 20px;" @size-change=" onHandleSizeChange " <el-pagination style="margin-left: 20px;" @size-change="onHandleSizeChange"
@current-change=" onHandleCurrentChange " class="mt15" :page-sizes=" [10, 20, 30] " @current-change="onHandleCurrentChange" class="mt15" :page-sizes="[10, 20, 30]"
v-model:current-page=" state.tableData.param.pageNum " background v-model:current-page="state.tableData.param.pageNum" background
v-model:page-size=" state.tableData.param.pageSize " layout="total, sizes, prev, pager, next" v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
:total=" state.tableData.total "> :total="state.tableData.total">
</el-pagination> </el-pagination>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-dialog v-model=" state.dialogVisible " title="Review" width="30%"> <el-dialog v-model="state.dialogVisible" title="Review" width="30%">
Do you want to keep this data as response data? Do you want to keep this data as response data?
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click=" state.dialogVisible = false ">Cancel</el-button> <el-button @click=" state.dialogVisible = false">Cancel</el-button>
<el-button type=" primary" @click=" reviews(1) "> <el-button type="primary" @click=" reviews(1)">
reserve reserve
</el-button> </el-button>
<el-button type="danger" @click=" reviews(2) "> <el-button type="danger" @click=" reviews(2)">
not retain not retain
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</el-config-provider> </el-config-provider>
<boot ref="bootRef" @callback=" getTableData " /> <boot ref="bootRef" @callback="getTableData" />
</div> </div>
</template> </template>
@ -242,6 +243,12 @@ const getDisasterData = () => {
} }
getList(param).then(res => { getList(param).then(res => {
state.disasterData.data = res.records; state.disasterData.data = res.records;
console.log(state.disasterData.data[0], "state.disasterData.data[0]");
state.disasterId = state.disasterData.data[0].disasterId;
console.log(state.disasterId, "state.disasterId ");
getTableData()
state.disasterData.data.forEach(item => { state.disasterData.data.forEach(item => {
let date = item.disasterTime.slice(0, 10); let date = item.disasterTime.slice(0, 10);
item.disasterTime = date; item.disasterTime = date;
@ -256,10 +263,22 @@ const getTableData = () => {
state.tableData.loading = true; state.tableData.loading = true;
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0, status: state.srarchType, title: state.queryTitle }, state.searchName == '1' ? true : false).then(res => { getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0, status: state.srarchType, title: state.queryTitle }, state.searchName == '1' ? true : false).then(res => {
state.tableData.data = res.records; state.tableData.data = res.records;
state.tableData.data.forEach(item => {
let date = item.createTime.slice(0, 10); if (state.searchName == '1') {
item.createTime = date; console.log(111111111111111111);
})
state.tableData.data.forEach(item => {
let date = item.createTime.slice(0, 10);
item.time = date;
})
}else{
state.tableData.data.forEach(item => {
let date = item.time.slice(0, 10);
item.time = date;
})
}
state.tableData.total = res.total; state.tableData.total = res.total;
}) })
/* state.tableData.data = data; /* state.tableData.data = data;
@ -335,7 +354,6 @@ const onHandleCurrentChange = (val) => {
// //
onMounted(() => { onMounted(() => {
getDisasterData(); getDisasterData();
getTableData();
getDictionary({ code: 'disaster' }).then((res) => { getDictionary({ code: 'disaster' }).then((res) => {
state.disasterTypeList = res; state.disasterTypeList = res;
}); });
@ -363,5 +381,4 @@ onMounted(() => {
display: flex; display: flex;
justify-content: end; justify-content: end;
} }
</style> </style>

View File

@ -82,7 +82,7 @@ const save = async () => {
return; return;
} }
let params = { let params = {
id: state.rowData.id, id: state.rowData.disasterId,
chiefId: state.selectData[0].id, chiefId: state.selectData[0].id,
chiefName: state.selectData[0].name, chiefName: state.selectData[0].name,
}; };

View File

@ -78,6 +78,55 @@
</el-pagination> </el-pagination>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Rejected"
name="firstNew">
<el-table :data="state.tableData.data"
v-loading="state.tableData.loading"
style="width: 100%">
<el-table-column prop="username"
label="User name"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="organization"
label="Organization"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="disasterType"
label="Disaster type"
show-overflow-tooltip
sortable>
<!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope">
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="disasterKeyword"
label="Disaster keyword"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="disasterTime"
label="Disaster time"
show-overflow-tooltip
sortable>
<template #default="scope">
<!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }}
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange"
@current-change="onHandleCurrentChange"
class="mt15"
:pager-count="5"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.current"
background
v-model:page-size="state.tableData.param.size"
layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
<el-tab-pane label="Approved" <el-tab-pane label="Approved"
name="second"> name="second">
<el-table :data="state.tableData.data" <el-table :data="state.tableData.data"
@ -170,54 +219,6 @@
</el-pagination> </el-pagination>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Rejected"
name="firstNew">
<el-table :data="state.tableData.data"
v-loading="state.tableData.loading"
style="width: 100%">
<el-table-column prop="username"
label="User name"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="organization"
label="Organization"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="disasterType"
label="Disaster type"
show-overflow-tooltip
sortable>
<!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope">
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="disasterKeyword"
label="Disaster keyword"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="disasterTime"
label="Disaster time"
show-overflow-tooltip
sortable>
<template #default="scope">
<!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }}
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange"
@current-change="onHandleCurrentChange"
class="mt15"
:pager-count="5"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.current"
background
v-model:page-size="state.tableData.param.size"
layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
<el-tab-pane label="Finish" <el-tab-pane label="Finish"
name="firstNewOne"> name="firstNewOne">
@ -337,34 +338,28 @@
</MapPage> </MapPage>
<div class="latLon-div"> {{ state.popupLat }} , {{ state.popupLon }} </div> <div class="latLon-div"> {{ state.popupLat }} , {{ state.popupLon }} </div>
<el-form-item label="Disaster Time"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-date-picker v-model="state.edit.disasterTime"
type="date" <el-form-item label="Disaster Time">
value-format="YYYY-MM-DD" <el-date-picker style="width: 200px;" v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
placeholder="Select date and time" /> placeholder="Select date and time" />
</el-form-item> </el-form-item>
<el-form-item label="Disaster type"> <el-form-item label="Disaster type">
<el-select class="form-select" <el-select style="width: 200px; height: 40px;" class="form-select" size="default" clearable placeholder="Disaster Type"
size="default" v-model="state.edit.disasterType">
clearable <el-option v-for="(item, index) in state.dictList" :value="item.dictKey" :key="index"
placeholder="Disaster Type" :label="item.dictValue" />
v-model="state.edit.disasterType"> </el-select>
<el-option v-for="(item, index) in state.dictList" </el-form-item>
:value="item.dictKey"
:key="index" <el-form-item label="Disaster country">
:label="item.dictValue" /> <el-input style="width: 200px;" v-model="state.edit.disasterCountry" placeholder="please Disaster country" clearable></el-input>
</el-select> </el-form-item>
</el-form-item> <el-form-item label="Theme keywords">
<el-form-item label="Disaster country"> <el-input style="width: 200px;" v-model="state.edit.disasterKeyword" placeholder="please Theme keywords" clearable></el-input>
<el-input v-model="state.edit.disasterCountry" </el-form-item>
placeholder="please Disaster country"
clearable></el-input> </el-form>
</el-form-item>
<el-form-item label="Theme keywords">
<el-input v-model="state.edit.disasterKeyword"
placeholder="please Theme keywords"
clearable></el-input>
</el-form-item>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button> <el-button @click="dialogVisible = false">Cancel</el-button>

View File

@ -19,7 +19,6 @@
<script setup> <script setup>
import {reactive, ref} from "vue"; import {reactive, ref} from "vue";
import {addAdmin} from '/@/api/response/administrator.js';
import {auditData} from '/@/api/response/adminManager.js'; import {auditData} from '/@/api/response/adminManager.js';
import {ElMessage} from "element-plus"; import {ElMessage} from "element-plus";
const adminAddFormRef = ref(); const adminAddFormRef = ref();