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组件-->
<template>
<div class="search">
<el-select class="form-select" size="default" clearable
placeholder="Disaster Type" v-model="state.search.disasterType">
<el-option v-for="(item,index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue"/>
<el-select class="form-select" size="default" clearable placeholder="Disaster Type"
v-model="state.search.disasterType">
<el-option v-for="(item, index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue" />
</el-select>
<el-input type="text"
class="form-control" size="default" clearable
placeholder="Disaster Country" v-model="state.search.disasterCountry"/>
<el-input type="text" class="form-control" size="default" clearable placeholder="Disaster Country"
v-model="state.search.disasterCountry" />
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
<el-icon>
<ele-Search />
@ -16,25 +15,24 @@
</el-button>
</div>
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" />
highlight-current-row @row-click="tableClick">
<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="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>
<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 @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>
</template>
<script setup name="disasterTable">
import {onMounted, reactive, computed, defineProps, defineEmits} from "vue";
import {getList} from "/@/api/system/dictbiz.js";
import {getPage} from "/@/api/disasterInfo/index.js";
import { onMounted, reactive, computed, defineProps, defineEmits } from "vue";
import { getList } from "/@/api/system/dictbiz.js";
import { getPage } from "/@/api/disasterInfo/index.js";
//
const emit = defineEmits(["click"]);
//
@ -46,11 +44,11 @@ const props = defineProps({
})
const state = reactive({
//
search:{
respondStatus:props.status
search: {
respondStatus: props.status
},
//
dictList:[],
dictList: [],
//
disasterData: {
data: [],
@ -63,13 +61,15 @@ const state = reactive({
},
},
})
//
const tableClick = (row, column, event) => {
emit("click", row.disasterId);
emit("childClick", row);
}
//
const getDictBizData = () => {
getList({code:'disaster'}).then(res =>{
getList({ code: 'disaster' }).then(res => {
state.dictList = res[0].children
})
}
@ -77,6 +77,10 @@ const getDictBizData = () => {
const getDisasterTable = () => {
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => {
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;
})
}
@ -91,7 +95,7 @@ const onHandleDisasterCurrentChange = (val) => {
getDisasterTable();
};
//
onMounted(()=>{
onMounted(() => {
//
getDictBizData();
//
@ -108,12 +112,14 @@ defineExpose({
display: flex;
justify-content: end;
}
.search{
.search {
display: flex;
margin-left: 10px;
margin-top: 10px;
}
.form-control{
.form-control {
margin-left: 10px;
width: 200px;
}

View File

@ -4,7 +4,7 @@ import qs from 'qs';
import { Session } from '/@/utils/storage';
// export const moduleName = 'zqq-biz-vordm';
export const moduleName = 'glj-biz-vordm';
export const moduleName = 'biz-vordm';
export const crawlModule = 'vordm-crawl';
// 配置新建一个 axios 实例
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 as getNewsList, review } from '/@/api/news/index';
import { getDictionary } from '/@/api/system/dictbiz';
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import boot from "./component/boot.vue"
import boot from "./component/boot.vue";
//
const auditRef = ref();
const bootRef = ref();

View File

@ -4,19 +4,7 @@
<el-row :gutter="22">
<el-col :span="10">
<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%"
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>
<disasterTable @childClick="tableClick"></disasterTable>
</div>
</el-col>
<el-col :span="14">
@ -52,7 +40,7 @@
<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="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 ">
<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>
@ -60,7 +48,7 @@
</el-table-column>
<el-table-column prop="title" label="Professional title" show-overflow-tooltip
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">
{{ formatSizeUnits(scope.row.size) }}
</template>
@ -97,6 +85,7 @@ const activeName = ref('first');
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import disasterTable from "/@/components/table/DisasterTable.vue";
//
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref();
@ -163,11 +152,13 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
//
const tableClick = (row, column, event) => {
state.disasterId = row.disasterId;
const tableClick = (i) => {
state.disasterId = i.disasterId;
getTableData();
}
//
const getDisasterData = () => {
state.disasterData.loading = true;

View File

@ -4,19 +4,7 @@
<el-row :gutter="22">
<el-col :span="10">
<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%"
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>
<disasterTable @childClick="tableClick"></disasterTable>
</div>
</el-col>
<el-col :span="14">
@ -73,8 +61,7 @@
</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
: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>
@ -95,7 +82,7 @@ import EditPicture from './component/editPicture.vue';
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
import en from 'element-plus/dist/locale/en.mjs';
const activeName = ref('first');
import disasterTable from "/@/components/table/DisasterTable.vue";
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
@ -177,8 +164,8 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
};
//
const tableClick = (row, column, event) => {
state.disasterId = row.disasterId;
const tableClick = (i) => {
state.disasterId = i.disasterId;
getTableData();
};
//
@ -186,8 +173,8 @@ const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
state.disasterData.data = res.records;
state.disasterData.data.forEach(item=>{
let date = item.disasterTime.slice(0,10);
state.disasterData.data.forEach(item => {
let date = item.disasterTime.slice(0, 10);
item.disasterTime = date;
})
state.disasterData.total = res.total;

View File

@ -4,19 +4,7 @@
<el-row :gutter="22">
<el-col :span="10">
<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%"
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>
<disasterTable @childClick="tableClick"></disasterTable>
</div>
</el-col>
<el-col :span="14">
@ -116,6 +104,7 @@ const editWordCloudsRef = ref();
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import disasterTable from "/@/components/table/DisasterTable.vue";
//
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref();
@ -203,8 +192,8 @@ const formatSizeUnits = (size) => {
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
//
const tableClick = (row, column, event) => {
state.disasterId = row.disasterId;
const tableClick = (i) => {
state.disasterId = i.disasterId;
getTableData();
}
//