提交Data数据审核
This commit is contained in:
parent
50e319c45c
commit
ed94dcf10b
|
@ -0,0 +1,26 @@
|
||||||
|
import request from '/@/utils/request';
|
||||||
|
import {moduleName} from '/@/utils/request';
|
||||||
|
export const getList = (current, size, param ,type) => {
|
||||||
|
let params = {
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
};
|
||||||
|
if(param){
|
||||||
|
params = Object.assign(params, param);
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/api/'+moduleName+'/ui/'+(type?'news':'socialMedia')+'/list',
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const review = (ids,status,type) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/'+moduleName+'/ui/'+(type?'news':'socialMedia')+'/review',
|
||||||
|
method: 'post',
|
||||||
|
params:{
|
||||||
|
ids,
|
||||||
|
status
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,192 +1,180 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-role-container layout-padding">
|
<div class="system-role-container layout-padding">
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<el-config-provider :locale="en">
|
||||||
<div class="system-user-search mb15">
|
<el-row :gutter="22">
|
||||||
<!-- 选择灾害类型下拉框 -->
|
<el-col :span="10">
|
||||||
<el-select v-model="value_disastertype"
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
size="default"
|
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||||
placeholder="Select disaster type">
|
highlight-current-row @row-click="tableClick">
|
||||||
<el-option v-for="item in options_disastertype"
|
<el-table-column type="index" label="ID" width="50" />
|
||||||
:key="item.value"
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
||||||
:label="item.label"
|
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||||
:value="item.value" />
|
<template #default="scope">
|
||||||
</el-select>
|
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||||
<!-- 选择灾害时间下拉框 -->
|
</template>
|
||||||
<el-date-picker v-model="value_disastertime"
|
</el-table-column>
|
||||||
type="date"
|
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
||||||
placeholder="Select disaster time"
|
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||||
class="ml10"
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
size="default" />
|
<template #default="scope">
|
||||||
<!-- 选择灾害事件下拉框 -->
|
<el-button size="small" text type="primary" v-if="scope.row.respondStatus == 2"
|
||||||
<el-select v-model="value_disasterevent"
|
@click="ElMessage.info('start')">start</el-button>
|
||||||
size="default"
|
<el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag>
|
||||||
placeholder="Select disaster event"
|
</template>
|
||||||
class="ml10">
|
</el-table-column>
|
||||||
<el-option v-for="item in options_disasterevent"
|
</el-table>
|
||||||
:key="item.value"
|
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||||
:label="item.label"
|
class="mt15" :pager-count="5" :page-sizes="[10, 20, 30]"
|
||||||
:value="item.value" />
|
v-model:current-page="state.disasterData.param.pageNum" background
|
||||||
</el-select>
|
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="state.disasterData.total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="14">
|
||||||
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
|
<el-form-item label="type" label-width="100px">
|
||||||
|
<el-select v-model="state.searchName" placeholder="please select data type" style="max-width: 200px"
|
||||||
|
size="default" clearable>
|
||||||
|
<el-option value="1" label="news"></el-option>
|
||||||
|
<el-option value="2" label="socialMedia"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="stateus" label-width="100px">
|
||||||
|
<el-select v-model="state.srarchType" placeholder="please select data type" style="max-width: 200px"
|
||||||
|
size="default" clearable>
|
||||||
|
<el-option value="0" label="No review"></el-option>
|
||||||
|
<el-option value="1" label="reserve"></el-option>
|
||||||
|
<el-option value="2" label="not retain"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||||
|
<el-icon>
|
||||||
|
<ele-Search />
|
||||||
|
</el-icon>
|
||||||
|
search
|
||||||
|
</el-button>
|
||||||
|
<el-button size="default" type="success" class="ml10" @click="openDialog">
|
||||||
|
<el-icon>
|
||||||
|
<ele-Upload />
|
||||||
|
</el-icon>
|
||||||
|
review
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||||
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column type="index" label="ID" width="50" />
|
||||||
|
<el-table-column prop="content" label="content" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="type" label="type" show-overflow-tooltip >
|
||||||
|
<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 == 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 == 1">weibo</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="content" label="link" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<a :href="scope.row.link" target="_blank">goto link</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<!-- 选择爬虫类型下拉框 -->
|
<!-- <el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||||
<el-select v-model="value_crawlertype"
|
<el-table-column prop="title" label="Professional title" show-overflow-tooltip></el-table-column>
|
||||||
size="default"
|
<el-table-column prop="size" label="Data size" show-overflow-tooltip>
|
||||||
placeholder="Select crawler type"
|
<template #default="scope">
|
||||||
class="ml10">
|
{{ formatSizeUnits(scope.row.size) }}
|
||||||
<el-option v-for="item in options_crawlertype"
|
</template>
|
||||||
:key="item.value"
|
</el-table-column>
|
||||||
:label="item.label"
|
<el-table-column prop="uploadTime" label="Upload time" show-overflow-tooltip></el-table-column> -->
|
||||||
:value="item.value" />
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
</el-select>
|
<template #default="scope">
|
||||||
<!-- 选择爬虫状态下拉框 -->
|
<el-button size="small" text type="info" v-if="scope.row.status == 0" @click="openDialog(scope.row,true)">review</el-button>
|
||||||
<!-- <el-select v-model="value_crawlerstatus" size="default" placeholder="Select crawler status" class="ml10">
|
<el-button size="small" text type="success" v-if="scope.row.status == 1" @click="openDialog(scope.row,false)">review</el-button>
|
||||||
<el-option v-for="item in options_crawlerstatus" :key="item.value" :label="item.label" :value="item.value" />
|
<el-button size="small" text type="danger" v-if="scope.row.status == 2" @click="openDialog(scope.row,false)">review</el-button>
|
||||||
</el-select> -->
|
</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.pageNum" background
|
||||||
|
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="state.tableData.total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" :before-close="handleClose">
|
||||||
|
<!-- <el-form-item label="status">
|
||||||
|
<el-select v-model="state.edit.status" placeholder="please select data type" style="max-width: 200px"
|
||||||
|
size="default" clearable>
|
||||||
|
<el-option value="1" label="reserve"></el-option>
|
||||||
|
<el-option value="2" label="not reserve"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
Do you want to keep this data as response data?
|
||||||
|
|
||||||
<!-- <el-input v-model="state.tableData.param.search" size="default" placeholder="请输入角色名称" style="max-width: 180px"> </el-input> -->
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
<el-button size="default"
|
<el-button @click="state.dialogVisible = false">Cancel</el-button>
|
||||||
type="primary"
|
<el-button type=" primary" @click="reviews(1)">
|
||||||
class="ml10">
|
reserve
|
||||||
<el-icon>
|
</el-button>
|
||||||
<ele-Search />
|
<el-button type="danger" @click="reviews(2)">
|
||||||
</el-icon>
|
not retain
|
||||||
Search
|
</el-button>
|
||||||
</el-button>
|
</span>
|
||||||
|
</template>
|
||||||
<el-button size="default"
|
</el-dialog>
|
||||||
type="success"
|
</el-config-provider>
|
||||||
class="ml10">
|
<Upload ref="uploadRef" @callback="getTableData" />
|
||||||
<el-icon>
|
|
||||||
<ele-Search />
|
|
||||||
</el-icon>
|
|
||||||
Start crawling
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-button size="default"
|
|
||||||
type="warning"
|
|
||||||
class="ml10">
|
|
||||||
<el-icon>
|
|
||||||
<ele-Search />
|
|
||||||
</el-icon>
|
|
||||||
Stop crawling
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<!-- <el-button size="default" type="success" class="ml10" @click="onOpenAddRole('add')">
|
|
||||||
<el-icon>
|
|
||||||
<ele-FolderAdd />
|
|
||||||
</el-icon>
|
|
||||||
新增角色
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
|
||||||
<!-- <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
|
||||||
<el-table-column type="vordmId" label="VoRDM ID" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="crawlertype" label="Crawler type" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="crawlerStatus" label="Crawler status" show-overflow-tooltip></el-table-column> -->
|
|
||||||
|
|
||||||
<!-- 需修改弹出框页面 -->
|
|
||||||
<!-- <el-table-column label="Crawler operation" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)">Start</el-button>
|
|
||||||
<el-button size="small" text type="primary" @click="onRowDel(scope.row)">Stop</el-button>
|
|
||||||
</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.pageNum"
|
|
||||||
background
|
|
||||||
v-model:page-size="state.tableData.param.pageSize"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="state.tableData.total"
|
|
||||||
>
|
|
||||||
</el-pagination> -->
|
|
||||||
</div>
|
|
||||||
<RoleDialog ref="roleDialogRef"
|
|
||||||
@refresh="getTableData()" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="systemRole">
|
<script lang="ts" setup name="systemRole">
|
||||||
|
import en from 'element-plus/dist/locale/en.mjs'
|
||||||
|
import type { TabsPaneContext } from 'element-plus';
|
||||||
|
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
||||||
|
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 { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
const auditRef = ref();
|
||||||
const value_disastertype = ref('');
|
const uploadRef = ref();
|
||||||
const value_disastertime = ref('');
|
|
||||||
const value_crawlertype = ref('');
|
|
||||||
// const value_crawlerstatus = ref('');
|
|
||||||
|
|
||||||
//选择灾害类型下拉框
|
|
||||||
const options_disastertype = [
|
|
||||||
{
|
|
||||||
value: 'Earthquake',
|
|
||||||
label: 'Earthquake',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Hurricane',
|
|
||||||
label: 'Hurricane',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Flood',
|
|
||||||
label: 'Flood',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Volcano',
|
|
||||||
label: 'Volcano',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Drought',
|
|
||||||
label: 'Drought',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Landslide',
|
|
||||||
label: 'Landslide',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//选择爬虫类型下拉框
|
|
||||||
|
|
||||||
const options_crawlertype = [
|
|
||||||
{
|
|
||||||
value: 'Bing',
|
|
||||||
label: 'Bing',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Twitter',
|
|
||||||
label: 'Twitter',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Baidu',
|
|
||||||
label: 'Baidu',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Weibo',
|
|
||||||
label: 'Weibo',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
//选择爬虫状态下拉框
|
|
||||||
// const options_crawlerstatus = [
|
|
||||||
// {
|
|
||||||
// value: 'Not crawled',
|
|
||||||
// label: 'Not crawled',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: 'Crawled',
|
|
||||||
// label: 'Crawled',
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const roleDialogRef = ref();
|
const roleDialogRef = ref();
|
||||||
|
|
||||||
|
const getValue = (key) => {
|
||||||
|
//返回state.disasterTypeLis 对应的value
|
||||||
|
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
|
||||||
|
};
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
dialogVisible: false,
|
||||||
|
multipleSelection: [],
|
||||||
|
searchName: '1',
|
||||||
|
disasterId: null,
|
||||||
|
edit: {
|
||||||
|
status: 0,
|
||||||
|
},
|
||||||
|
srarchType:"0",
|
||||||
|
disasterData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
search: '',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
disasterTypeList: [],
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
|
@ -197,47 +185,158 @@ const state = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
selectList :[],
|
||||||
});
|
});
|
||||||
|
const openDialog = async (row,bool) => {
|
||||||
|
if(bool){
|
||||||
|
state.selectList = [row]
|
||||||
|
}else{
|
||||||
|
state.selectList = state.multipleSelection
|
||||||
|
}
|
||||||
|
state.dialogVisible = true;
|
||||||
|
};
|
||||||
|
const reviews = async (status) => {
|
||||||
|
let ids = state.selectList.map((item) => item.id);
|
||||||
|
//将ids 转为字符串 使用逗号分隔
|
||||||
|
ids = ids.join(',');
|
||||||
|
let res = await review(ids,status,state.searchName=='1'?true:false);
|
||||||
|
if (res) {
|
||||||
|
state.dialogVisible = false;
|
||||||
|
ElMessage.success('success');
|
||||||
|
getTableData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
state.multipleSelection = val
|
||||||
|
}
|
||||||
|
const auditData = (row) => {
|
||||||
|
let id = row.id
|
||||||
|
auditRef.value.openDialog([{ "id": id }]);
|
||||||
|
}
|
||||||
|
//格式化字节
|
||||||
|
const formatSize = (size) => {
|
||||||
|
var data = "";
|
||||||
|
if (size < 0.1 * 1024) { //如果小于0.1KB转化成B
|
||||||
|
data = size.toFixed(2) + "B";
|
||||||
|
} else if (size < 0.1 * 1024 * 1024) {//如果小于0.1MB转化成KB
|
||||||
|
data = (size / 1024).toFixed(2) + "KB";
|
||||||
|
} else if (size < 0.1 * 1024 * 1024 * 1024) { //如果小于0.1GB转化成MB
|
||||||
|
data = (size / (1024 * 1024)).toFixed(2) + "MB";
|
||||||
|
} else { //其他转化成GB
|
||||||
|
data = (size / (1024 * 1024 * 1024)).toFixed(2) + "GB";
|
||||||
|
}
|
||||||
|
var sizestr = data + "";
|
||||||
|
var len = sizestr.indexOf("\.");
|
||||||
|
var dec = sizestr.substr(len + 1, 2);
|
||||||
|
if (dec == "00") {//当小数点后为00时 去掉小数部分
|
||||||
|
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
|
||||||
|
}
|
||||||
|
return sizestr;
|
||||||
|
}
|
||||||
|
const formatSizeUnits = (size) => {
|
||||||
|
if (size === 0) return '0 B';
|
||||||
|
var k = 1000, // or 1024
|
||||||
|
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||||
|
i = Math.floor(Math.log(size) / Math.log(k));
|
||||||
|
|
||||||
|
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
|
}
|
||||||
|
//灾害表格点击事件
|
||||||
|
const tableClick = (row, column, event) => {
|
||||||
|
state.disasterId = row.id;
|
||||||
|
getTableData();
|
||||||
|
}
|
||||||
|
// 初始化灾害表格数据
|
||||||
|
const getDisasterData = () => {
|
||||||
|
state.disasterData.loading = true;
|
||||||
|
// param: {
|
||||||
|
// search: '',
|
||||||
|
// current: 1,
|
||||||
|
// size: 10,
|
||||||
|
// respondStatus: 0,
|
||||||
|
// },
|
||||||
|
let param = {
|
||||||
|
"search": state.disasterData.param.search,
|
||||||
|
"current": state.disasterData.param.pageNum,
|
||||||
|
"size": state.disasterData.param.pageSize,
|
||||||
|
"respondStatus": 3,
|
||||||
|
}
|
||||||
|
getList(param).then(res => {
|
||||||
|
state.disasterData.data = res.records;
|
||||||
|
state.disasterData.total = res.total;
|
||||||
|
state.disasterData.loading = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化表格数据
|
// 初始化表格数据
|
||||||
const getTableData = () => {
|
const getTableData = () => {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
const data = [];
|
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0,status :state.srarchType }, state.searchName == '1' ? true : false).then(res => {
|
||||||
for (let i = 0; i < 20; i++) {
|
state.tableData.data = res.records;
|
||||||
data.push({
|
state.tableData.total = res.total;
|
||||||
roleName: i === 0 ? '超级管理员' : '主要管理员',
|
})
|
||||||
roleSign: i === 0 ? 'admin' : 'chief',
|
/* state.tableData.data = data;
|
||||||
describe: `测试角色${i + 1}`,
|
state.tableData.total = state.tableData.data.length;*/
|
||||||
sort: i,
|
|
||||||
status: true,
|
|
||||||
createTime: new Date().toLocaleString(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
state.tableData.data = data;
|
|
||||||
state.tableData.total = state.tableData.data.length;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
// 打开新增角色弹窗
|
// 打开上传弹窗
|
||||||
const onOpenAddRole = (type) => {
|
const uploadData = () => {
|
||||||
roleDialogRef.value.openDialog(type);
|
if (state.disasterId == null) {
|
||||||
|
ElMessage.warning("Please select the disaster first")
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uploadRef.value.openDialog(state.disasterId);
|
||||||
};
|
};
|
||||||
// 打开修改角色弹窗
|
// 打开修改角色弹窗
|
||||||
const onOpenEditRole = (type, row) => {
|
const onOpenEditRole = (type, row) => {
|
||||||
roleDialogRef.value.openDialog(type, row);
|
roleDialogRef.value.openDialog(type, row);
|
||||||
};
|
};
|
||||||
// 删除角色
|
//批量删除其他数据
|
||||||
const onRowDel = (row) => {
|
const batchDel = () => {
|
||||||
ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
if (state.multipleSelection.length == 0) {
|
||||||
confirmButtonText: '确认',
|
ElMessage.warning("Select the data to be operated first");
|
||||||
cancelButtonText: '取消',
|
return false;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', {
|
||||||
|
confirmButtonText: 'confirm',
|
||||||
|
cancelButtonText: 'cancel',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getTableData();
|
let id = state.multipleSelection.map(item => item.id)
|
||||||
ElMessage.success('删除成功');
|
deleteData(id.join()).then(res => {
|
||||||
|
getTableData();
|
||||||
|
ElMessage.success('delete successfully');
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => { });
|
||||||
|
}
|
||||||
|
// 删除其他数据
|
||||||
|
const del = (row) => {
|
||||||
|
ElMessageBox.confirm(`This action deletes the other data:“${row.title}”,Whether to continue?`, 'tip', {
|
||||||
|
confirmButtonText: 'confirm',
|
||||||
|
cancelButtonText: 'cancel',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteData(row.id).then(res => {
|
||||||
|
getTableData();
|
||||||
|
ElMessage.success('delete successfully');
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
};
|
||||||
|
// 分页改变
|
||||||
|
const onHandleDisasterSizeChange = (val) => {
|
||||||
|
state.disasterData.param.pageSize = val;
|
||||||
|
getDisasterData();
|
||||||
|
};
|
||||||
|
// 分页改变
|
||||||
|
const onHandleDisasterCurrentChange = (val) => {
|
||||||
|
state.disasterData.param.pageNum = val;
|
||||||
|
getDisasterData();
|
||||||
};
|
};
|
||||||
// 分页改变
|
// 分页改变
|
||||||
const onHandleSizeChange = (val) => {
|
const onHandleSizeChange = (val) => {
|
||||||
|
@ -251,17 +350,28 @@ const onHandleCurrentChange = (val) => {
|
||||||
};
|
};
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getDisasterData();
|
||||||
getTableData();
|
getTableData();
|
||||||
|
getDictionary({ code: 'disaster' }).then((res) => {
|
||||||
|
state.disasterTypeList = res;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
.demo-tabs>.el-tabs__content {
|
||||||
|
padding: 32px;
|
||||||
|
color: #6b778c;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.system-role-container {
|
.system-role-container {
|
||||||
.system-role-padding {
|
.system-role-padding {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
.el-table {
|
|
||||||
flex: 1;
|
.el-table {
|
||||||
}
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||||
|
<el-config-provider :locale="en">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
|
@ -87,6 +88,7 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-role-container layout-padding">
|
<div class="system-role-container layout-padding">
|
||||||
|
<el-config-provider :locale="en">
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
|
||||||
<el-tab-pane label="unchecked" name="first">
|
<el-tab-pane label="unchecked" name="first">
|
||||||
|
@ -152,10 +153,12 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="userResponse">
|
<script setup name="userResponse">
|
||||||
|
import en from 'element-plus/dist/locale/en.mjs'
|
||||||
import { reactive, onMounted, ref, nextTick,watchEffect } from 'vue';
|
import { reactive, onMounted, ref, nextTick,watchEffect } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { getList, review } from '/@/api/disasterInfo/index';
|
import { getList, review } from '/@/api/disasterInfo/index';
|
||||||
|
|
Loading…
Reference in New Issue