glj-代码提交

This commit is contained in:
glj 2023-05-06 15:17:47 +08:00
parent c08ddeb816
commit 6b80bfcaab
1 changed files with 54 additions and 42 deletions

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 = ''">
@ -69,7 +70,7 @@
<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="primary" v-if="scope.row.status == 0" <el-button size="small" text type="primary" v-if="scope.row.status == 0"
@ -262,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;
if (state.searchName == '1') {
console.log(111111111111111111);
state.tableData.data.forEach(item => { state.tableData.data.forEach(item => {
let date = item.createTime.slice(0, 10); let date = item.createTime.slice(0, 10);
item.createTime = date; 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;
@ -368,5 +381,4 @@ onMounted(() => {
display: flex; display: flex;
justify-content: end; justify-content: end;
} }
</style> </style>