glj-代码提交

This commit is contained in:
glj 2023-04-26 11:40:07 +08:00
parent a2ab80af83
commit 0c7d010c53
6 changed files with 51 additions and 79 deletions

View File

@ -1,13 +1,12 @@
<!--灾害列表table组件--> <!--灾害列表table组件-->
<template> <template>
<div class="search"> <div class="search">
<el-select class="form-select" size="default" clearable <el-select class="form-select" size="default" clearable placeholder="Disaster Type"
placeholder="Disaster Type" v-model="state.search.disasterType"> v-model="state.search.disasterType">
<el-option v-for="(item,index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue"/> <el-option v-for="(item, index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue" />
</el-select> </el-select>
<el-input type="text" <el-input type="text" class="form-control" size="default" clearable placeholder="Disaster Country"
class="form-control" size="default" clearable v-model="state.search.disasterCountry" />
placeholder="Disaster Country" v-model="state.search.disasterCountry"/>
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable"> <el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
@ -16,25 +15,24 @@
</el-button> </el-button>
</div> </div>
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="VoRDM ID" width="118" />
<el-table-column prop="dictValue" label="Disaster type" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="dictValue" label="Disaster type" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable></el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange" <el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange" class="mt15"
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]" :pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.disasterData.param.pageNum" background
v-model:current-page="state.disasterData.param.pageNum" background v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next" :total="state.disasterData.total">
:total="state.disasterData.total">
</el-pagination> </el-pagination>
</template> </template>
<script setup name="disasterTable"> <script setup name="disasterTable">
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";
// //
const emit = defineEmits(["click"]); const emit = defineEmits(["click"]);
// //
@ -46,11 +44,11 @@ const props = defineProps({
}) })
const state = reactive({ const state = reactive({
// //
search:{ search: {
respondStatus:props.status respondStatus: props.status
}, },
// //
dictList:[], dictList: [],
// //
disasterData: { disasterData: {
data: [], data: [],
@ -63,13 +61,15 @@ const state = reactive({
}, },
}, },
}) })
// //
const tableClick = (row, column, event) => { const tableClick = (row, column, event) => {
emit("click", row.disasterId); emit("childClick", row);
} }
// //
const getDictBizData = () => { const getDictBizData = () => {
getList({code:'disaster'}).then(res =>{ getList({ code: 'disaster' }).then(res => {
state.dictList = res[0].children state.dictList = res[0].children
}) })
} }
@ -77,6 +77,10 @@ const getDictBizData = () => {
const getDisasterTable = () => { const getDisasterTable = () => {
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 => {
let date = item.disasterTime.slice(0, 10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
}) })
} }
@ -91,7 +95,7 @@ const onHandleDisasterCurrentChange = (val) => {
getDisasterTable(); getDisasterTable();
}; };
// //
onMounted(()=>{ onMounted(() => {
// //
getDictBizData(); getDictBizData();
// //
@ -108,12 +112,14 @@ defineExpose({
display: flex; display: flex;
justify-content: end; justify-content: end;
} }
.search{
.search {
display: flex; display: flex;
margin-left: 10px; margin-left: 10px;
margin-top: 10px; margin-top: 10px;
} }
.form-control{
.form-control {
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;
} }

View File

@ -4,7 +4,7 @@ import qs from 'qs';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
// export const moduleName = 'zqq-biz-vordm'; // export const moduleName = 'zqq-biz-vordm';
export const moduleName = 'glj-biz-vordm'; export const moduleName = 'biz-vordm';
export const crawlModule = 'vordm-crawl'; export const crawlModule = 'vordm-crawl';
// 配置新建一个 axios 实例 // 配置新建一个 axios 实例
const service = axios.create({ const service = axios.create({

View File

@ -146,11 +146,10 @@ import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/other
import { getList } from '/@/api/disasterInfo/index'; import { getList } from '/@/api/disasterInfo/index';
import { getList as getNewsList, review } from '/@/api/news/index'; import { getList as getNewsList, review } from '/@/api/news/index';
import { getDictionary } from '/@/api/system/dictbiz'; import { getDictionary } from '/@/api/system/dictbiz';
// //
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import boot from "./component/boot.vue" import boot from "./component/boot.vue";
// //
const auditRef = ref(); const auditRef = ref();
const bootRef = ref(); const bootRef = ref();

View File

@ -4,19 +4,7 @@
<el-row :gutter="22"> <el-row :gutter="22">
<el-col :span="10"> <el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%" <disasterTable @childClick="tableClick"></disasterTable>
highlight-current-row @row-click="tableClick">
<el-table-column prop="vordmId" label="VoRDM ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
v-model:current-page="state.disasterData.param.pageNum" background
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
:total="state.disasterData.total">
</el-pagination>
</div> </div>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
@ -52,7 +40,7 @@
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="uploaderName" label="Uploader name" width="100" show-overflow-tooltip></el-table-column> <el-table-column prop="uploaderName" label="Uploader name" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column> <el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
<el-table-column prop="isPublish" label="isPublish" width="100" show-overflow-tooltip> <el-table-column prop="isPublish" label="isPublish" width="90" show-overflow-tooltip>
<template #default=" scope "> <template #default=" scope ">
<el-tag type="warning" v-if=" scope.row.isPublish == 0 ">NO</el-tag> <el-tag type="warning" v-if=" scope.row.isPublish == 0 ">NO</el-tag>
<el-tag type="success" v-if=" scope.row.isPublish == 1 ">YES</el-tag> <el-tag type="success" v-if=" scope.row.isPublish == 1 ">YES</el-tag>
@ -60,7 +48,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="title" label="Professional title" show-overflow-tooltip <el-table-column prop="title" label="Professional title" show-overflow-tooltip
width="150"></el-table-column> width="150"></el-table-column>
<el-table-column prop="size" label="Data size" show-overflow-tooltip> <el-table-column prop="size" label="Data size" width="90" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
{{ formatSizeUnits(scope.row.size) }} {{ formatSizeUnits(scope.row.size) }}
</template> </template>
@ -97,6 +85,7 @@ const activeName = ref('first');
// //
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import disasterTable from "/@/components/table/DisasterTable.vue";
// //
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue')); const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref(); const auditRef = ref();
@ -163,11 +152,13 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]; return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
} }
// //
const tableClick = (row, column, event) => { const tableClick = (i) => {
state.disasterId = row.disasterId; state.disasterId = i.disasterId;
getTableData(); getTableData();
} }
// //
const getDisasterData = () => { const getDisasterData = () => {
state.disasterData.loading = true; state.disasterData.loading = true;

View File

@ -4,19 +4,7 @@
<el-row :gutter="22"> <el-row :gutter="22">
<el-col :span="10"> <el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%" <disasterTable @childClick="tableClick"></disasterTable>
highlight-current-row @row-click="tableClick">
<el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
v-model:current-page="state.disasterData.param.pageNum" background
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
:total="state.disasterData.total">
</el-pagination>
</div> </div>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
@ -73,8 +61,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="3" :page-sizes="[10, 20, 30]" :pager-count="3" :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>
@ -95,7 +82,7 @@ import EditPicture from './component/editPicture.vue';
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js'; import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
import en from 'element-plus/dist/locale/en.mjs'; import en from 'element-plus/dist/locale/en.mjs';
const activeName = ref('first'); const activeName = ref('first');
import disasterTable from "/@/components/table/DisasterTable.vue";
// //
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
@ -177,8 +164,8 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]; return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}; };
// //
const tableClick = (row, column, event) => { const tableClick = (i) => {
state.disasterId = row.disasterId; state.disasterId = i.disasterId;
getTableData(); getTableData();
}; };
// //
@ -186,8 +173,8 @@ const getDisasterData = () => {
state.disasterData.loading = true; state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => { getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
state.disasterData.data = res.records; state.disasterData.data = res.records;
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;
}) })
state.disasterData.total = res.total; state.disasterData.total = res.total;

View File

@ -4,19 +4,7 @@
<el-row :gutter="22"> <el-row :gutter="22">
<el-col :span="10"> <el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%" <disasterTable @childClick="tableClick"></disasterTable>
highlight-current-row @row-click="tableClick">
<el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
v-model:current-page="state.disasterData.param.pageNum" background
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
:total="state.disasterData.total">
</el-pagination>
</div> </div>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
@ -116,6 +104,7 @@ const editWordCloudsRef = ref();
// //
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import disasterTable from "/@/components/table/DisasterTable.vue";
// //
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue')); const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref(); const auditRef = ref();
@ -203,8 +192,8 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]; return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
} }
// //
const tableClick = (row, column, event) => { const tableClick = (i) => {
state.disasterId = row.disasterId; state.disasterId = i.disasterId;
getTableData(); getTableData();
} }
// //