Merge branch 'main' of http://47.92.168.204:3000/VoRDM/vordm-admin into zqq
This commit is contained in:
commit
4f37f7ba42
BIN
public/home.jpg
BIN
public/home.jpg
Binary file not shown.
Before Width: | Height: | Size: 384 KiB |
BIN
public/home.png
BIN
public/home.png
Binary file not shown.
Before Width: | Height: | Size: 2.2 MiB |
|
@ -24,3 +24,11 @@ export const review = (ids,status,type) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const importTemplate = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/'+moduleName+'/ui/news/importTemplate',
|
||||||
|
headers:{'Content-Type': 'multipart/form-data'},
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -29,3 +29,11 @@ export const getPagesRemoteSensingSourceData = (param) => {
|
||||||
params: param,
|
params: param,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const approval = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/remoteSensing/approval',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
|
@ -0,0 +1,50 @@
|
||||||
|
import request from '/@/utils/request';
|
||||||
|
import { moduleName } from '/@/utils/request';
|
||||||
|
|
||||||
|
export function websitesPage(current, size, params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/websites/websitesPage',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
...params
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export function saveWebsites(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/websites/saveWebsites',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export function updateWebsites(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/websites/updateWebsites',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const delWebsites = (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/websites/remove',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getWebsitesById = (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/websites/getWebsitesById',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
|
@ -7,7 +7,7 @@
|
||||||
@command="onComponentSizeChange">
|
@command="onComponentSizeChange">
|
||||||
<div class="layout-navbars-breadcrumb-user-icon">
|
<div class="layout-navbars-breadcrumb-user-icon">
|
||||||
<i class="iconfont icon-ziti"
|
<i class="iconfont icon-ziti"
|
||||||
title="组件大小"></i>
|
title="component size"></i>
|
||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
|
|
|
@ -52,11 +52,11 @@ const emit = defineEmits(['currentContextmenuClick']);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
isShow: false,
|
isShow: false,
|
||||||
dropdownList: [
|
dropdownList: [
|
||||||
{ contextMenuClickId: 0, txt: '刷新', affix: false, icon: 'ele-RefreshRight' },
|
{ contextMenuClickId: 0, txt: 'Refresh', affix: false, icon: 'ele-RefreshRight' },
|
||||||
{ contextMenuClickId: 1, txt: '关闭', affix: false, icon: 'ele-Close' },
|
{ contextMenuClickId: 1, txt: 'Close', affix: false, icon: 'ele-Close' },
|
||||||
{ contextMenuClickId: 2, txt: '关闭其它', affix: false, icon: 'ele-CircleClose' },
|
{ contextMenuClickId: 2, txt: 'Close other', affix: false, icon: 'ele-CircleClose' },
|
||||||
{ contextMenuClickId: 3, txt: '全部关闭', affix: false, icon: 'ele-FolderDelete' },
|
{ contextMenuClickId: 3, txt: 'Close all', affix: false, icon: 'ele-FolderDelete' },
|
||||||
{ contextMenuClickId: 4, txt: '当前页全屏', affix: false, icon: 'iconfont icon-fullscreen' },
|
{ contextMenuClickId: 4, txt: 'The current page full screen', affix: false, icon: 'iconfont icon-fullscreen' },
|
||||||
],
|
],
|
||||||
item: {},
|
item: {},
|
||||||
arrowLeft: 10,
|
arrowLeft: 10,
|
||||||
|
|
|
@ -50,7 +50,7 @@ export const dynamicRoutes = [
|
||||||
component: () => import('/@/views/responseManagement/index.vue'),
|
component: () => import('/@/views/responseManagement/index.vue'),
|
||||||
redirect: '/responseManagement/userResponse',
|
redirect: '/responseManagement/userResponse',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Response management',
|
title: 'Response',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -66,13 +66,13 @@ export const dynamicRoutes = [
|
||||||
name: 'userResponseManagement',
|
name: 'userResponseManagement',
|
||||||
component: () => import('/@/views/responseManagement/userResponse/index.vue'),
|
component: () => import('/@/views/responseManagement/userResponse/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'User response management',
|
title: 'User response',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
isAffix: false,
|
isAffix: false,
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin'],
|
||||||
icon: 'ele-FolderChecked',
|
icon: 'ele-FolderChecked',
|
||||||
zh: '用户响应管理',
|
zh: '用户响应管理',
|
||||||
},
|
},
|
||||||
|
@ -82,7 +82,7 @@ export const dynamicRoutes = [
|
||||||
name: 'data-upload-management',
|
name: 'data-upload-management',
|
||||||
component: () => import('/@/views/responseManagement/dataUpload/index.vue'),
|
component: () => import('/@/views/responseManagement/dataUpload/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Data upload management',
|
title: 'Data upload',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -98,13 +98,13 @@ export const dynamicRoutes = [
|
||||||
name: 'tool-management',
|
name: 'tool-management',
|
||||||
component: () => import('/@/views/responseManagement/tool/index.vue'),
|
component: () => import('/@/views/responseManagement/tool/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Tool Management',
|
title: 'Tool',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
isAffix: false,
|
isAffix: false,
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin'],
|
||||||
icon: 'ele-Tools',
|
icon: 'ele-Tools',
|
||||||
zh: 'tool管理',
|
zh: 'tool管理',
|
||||||
},
|
},
|
||||||
|
@ -114,13 +114,13 @@ export const dynamicRoutes = [
|
||||||
name: 'contact-management',
|
name: 'contact-management',
|
||||||
component: () => import('/@/views/responseManagement/contact/index.vue'),
|
component: () => import('/@/views/responseManagement/contact/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Contact Management',
|
title: 'Contact',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
isAffix: false,
|
isAffix: false,
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin'],
|
||||||
icon: 'ele-Cellphone',
|
icon: 'ele-Cellphone',
|
||||||
zh: 'tool管理',
|
zh: 'tool管理',
|
||||||
},
|
},
|
||||||
|
@ -149,7 +149,7 @@ export const dynamicRoutes = [
|
||||||
name: 'multimediaData',
|
name: 'multimediaData',
|
||||||
component: () => import('/@/views/dataService/multimediaData/index.vue'),
|
component: () => import('/@/views/dataService/multimediaData/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Multimedia data service',
|
title: 'Multimedia data',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -165,7 +165,7 @@ export const dynamicRoutes = [
|
||||||
name: 'remoteSensingData',
|
name: 'remoteSensingData',
|
||||||
component: () => import('/@/views/dataService/remoteSensingData/index.vue'),
|
component: () => import('/@/views/dataService/remoteSensingData/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Remote sensing data service',
|
title: 'Remote sensing data',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -181,7 +181,7 @@ export const dynamicRoutes = [
|
||||||
name: 'otherData',
|
name: 'otherData',
|
||||||
component: () => import('/@/views/dataService/otherData/index.vue'),
|
component: () => import('/@/views/dataService/otherData/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Other data service',
|
title: 'Other data',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -197,7 +197,7 @@ export const dynamicRoutes = [
|
||||||
name: 'visualData',
|
name: 'visualData',
|
||||||
component: () => import('/@/views/dataService/visualData/index.vue'),
|
component: () => import('/@/views/dataService/visualData/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Visual data service',
|
title: 'Visual data',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -213,7 +213,7 @@ export const dynamicRoutes = [
|
||||||
name: 'pictureInfo',
|
name: 'pictureInfo',
|
||||||
component: () => import('/@/views/dataService/pictureInfo/index.vue'),
|
component: () => import('/@/views/dataService/pictureInfo/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Picture info service',
|
title: 'Picture info',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -224,6 +224,22 @@ export const dynamicRoutes = [
|
||||||
zh: '其他数据服务',
|
zh: '其他数据服务',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/dataService/disasterPartners',
|
||||||
|
name: 'disasterPartners',
|
||||||
|
component: () => import('/@/views/dataService/disasterPartners/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: 'Disaster Website',
|
||||||
|
isLink: '',
|
||||||
|
isHide: false,
|
||||||
|
isKeepAlive: true,
|
||||||
|
isAffix: false,
|
||||||
|
isIframe: false,
|
||||||
|
roles: ['admin', 'chief'],
|
||||||
|
icon: 'ele-Star',
|
||||||
|
zh: '遥感数据',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -248,7 +264,7 @@ export const dynamicRoutes = [
|
||||||
name: 'chief-administrator-management',
|
name: 'chief-administrator-management',
|
||||||
component: () => import('/@/views/systemManagement/chiefAdministrator/index.vue'),
|
component: () => import('/@/views/systemManagement/chiefAdministrator/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Chief Administrator management',
|
title: 'Chief Administrator',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -264,7 +280,7 @@ export const dynamicRoutes = [
|
||||||
name: 'administratorManagement',
|
name: 'administratorManagement',
|
||||||
component: () => import('/@/views/systemManagement/administrator/index.vue'),
|
component: () => import('/@/views/systemManagement/administrator/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Administrator management',
|
title: 'Administrator',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
@ -280,7 +296,7 @@ export const dynamicRoutes = [
|
||||||
name: 'systemDic',
|
name: 'systemDic',
|
||||||
component: () => import('/@/views/system/dic/index.vue'),
|
component: () => import('/@/views/system/dic/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Dictionary management',
|
title: 'Dictionary',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
|
|
|
@ -131,7 +131,7 @@ body,
|
||||||
}
|
}
|
||||||
// pc端左侧导航样式
|
// pc端左侧导航样式
|
||||||
.layout-aside-pc-220 {
|
.layout-aside-pc-220 {
|
||||||
width: 220px !important;
|
width: 250px !important;
|
||||||
transition: width 0.3s ease;
|
transition: width 0.3s ease;
|
||||||
}
|
}
|
||||||
.layout-aside-pc-64 {
|
.layout-aside-pc-64 {
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
// 默认样式修改
|
// 默认样式修改
|
||||||
.el-menu {
|
.el-menu {
|
||||||
border-right: none !important;
|
border-right: none !important;
|
||||||
width: 220px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
height: 56px !important;
|
height: 56px !important;
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="edit" v-model="state.isShowDialog" width="550px">
|
||||||
|
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
||||||
|
<el-form-item prop="title" label="name">
|
||||||
|
<el-select v-model="state.ruleForm.title" class="m-2" placeholder="please enter name">
|
||||||
|
<el-option label="GDACS" value="GDACS"></el-option>
|
||||||
|
<el-option label="Charter" value="Charter"></el-option>
|
||||||
|
<el-option label="USGS" value="USGS"></el-option>
|
||||||
|
<el-option label="INGV" value="INGV"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="link" label="link">
|
||||||
|
<el-input v-model="state.ruleForm.link" class="m-2" placeholder="please enter link" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="websiteId" label="websiteid">
|
||||||
|
<el-input v-model="state.ruleForm.websiteId" class="m-2" placeholder="please enter websiteid" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { getWebsitesById, updateWebsites } from '/@/api/websites/websites.js';
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
const emit = defineEmits(['callback']);
|
||||||
|
const adminAddFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
isShowDialog: false,
|
||||||
|
isLoading: false,
|
||||||
|
ruleForm: {
|
||||||
|
title: null,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
//校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
title: [
|
||||||
|
{ required: true, message: 'please enter name', trigger: 'change' }
|
||||||
|
],
|
||||||
|
link: [
|
||||||
|
{ required: true, message: 'please enter link', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
websiteId: [
|
||||||
|
{ required: true, message: 'please enter websiteid', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
//重置表单
|
||||||
|
const resetField = () => {
|
||||||
|
adminAddFormRef.value.resetFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
state.ruleForm.id = row.id;
|
||||||
|
getWebsitesById(row.id).then(da=>{
|
||||||
|
state.ruleForm.title = da.title;
|
||||||
|
state.ruleForm.link = da.link;
|
||||||
|
state.ruleForm.websiteId = da.websiteId;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
resetField();
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 新增
|
||||||
|
const onSubmit = () => {
|
||||||
|
adminAddFormRef.value.validate((valid, fields) => {
|
||||||
|
if (valid) {
|
||||||
|
state.isLoading = true;
|
||||||
|
updateWebsites(state.ruleForm).then(da => {
|
||||||
|
ElMessage.success("success");
|
||||||
|
emit('callback');
|
||||||
|
}).finally(() => {
|
||||||
|
state.isLoading = false;
|
||||||
|
})
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -0,0 +1,102 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="upload" v-model="state.isShowDialog" width="550px">
|
||||||
|
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
||||||
|
<el-form-item prop="title" label="name">
|
||||||
|
<el-select v-model="state.ruleForm.title" class="m-2" placeholder="please enter name">
|
||||||
|
<el-option label="GDACS" value="GDACS"></el-option>
|
||||||
|
<el-option label="Charter" value="Charter"></el-option>
|
||||||
|
<el-option label="USGS" value="USGS"></el-option>
|
||||||
|
<el-option label="INGV" value="INGV"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="link" label="link">
|
||||||
|
<el-input v-model="state.ruleForm.link" class="m-2" placeholder="please enter link" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="websiteId" label="websiteid">
|
||||||
|
<el-input v-model="state.ruleForm.websiteId" class="m-2" placeholder="please enter websiteid" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { saveWebsites } from '/@/api/websites/websites.js';
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
const upFileRef = ref();
|
||||||
|
const emit = defineEmits(['callback']);
|
||||||
|
const adminAddFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
isShowDialog: false,
|
||||||
|
isLoading: false,
|
||||||
|
ruleForm: {
|
||||||
|
title: null,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
//校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
title: [
|
||||||
|
{ required: true, message: 'please enter name', trigger: 'change' }
|
||||||
|
],
|
||||||
|
link: [
|
||||||
|
{ required: true, message: 'please enter link', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
websiteId: [
|
||||||
|
{ required: true, message: 'please enter websiteid', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
//重置表单
|
||||||
|
const resetField = () => {
|
||||||
|
adminAddFormRef.value.resetFields();
|
||||||
|
state.fileArray = [];
|
||||||
|
upFileRef.value.clearFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
state.ruleForm.disasterId = row;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
resetField();
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 新增
|
||||||
|
const onSubmit = () => {
|
||||||
|
adminAddFormRef.value.validate((valid, fields) => {
|
||||||
|
if (valid) {
|
||||||
|
state.isLoading = true;
|
||||||
|
saveWebsites(state.ruleForm).then(da => {
|
||||||
|
ElMessage.success("success");
|
||||||
|
emit('callback');
|
||||||
|
}).finally(() => {
|
||||||
|
state.isLoading = false;
|
||||||
|
})
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -0,0 +1,280 @@
|
||||||
|
<template>
|
||||||
|
<div class="system-role-container layout-padding">
|
||||||
|
<el-config-provider :locale="en">
|
||||||
|
<el-row :gutter="22">
|
||||||
|
<el-col :span="10">
|
||||||
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="14">
|
||||||
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
|
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||||
|
<el-icon>
|
||||||
|
<ele-Upload />
|
||||||
|
</el-icon>
|
||||||
|
Upload
|
||||||
|
</el-button>
|
||||||
|
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||||
|
<el-icon>
|
||||||
|
<ele-Delete />
|
||||||
|
</el-icon>
|
||||||
|
Batch delete
|
||||||
|
</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="title" label="Name" width="120" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatName(scope.row.title) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="link" label="Link" width="450" show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
|
||||||
|
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
|
||||||
|
</template>
|
||||||
|
</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
|
||||||
|
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||||
|
:total="state.tableData.total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-config-provider>
|
||||||
|
<Upload ref="uploadRef" @callback="getTableData" />
|
||||||
|
<EditPicture ref="editUploadRef" @callback="getTableData" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="systemRole">
|
||||||
|
import type { TabsPaneContext } from 'element-plus';
|
||||||
|
import Upload from './component/upload.vue';
|
||||||
|
import EditPicture from './component/editPicture.vue';
|
||||||
|
import { getDisasterPage } from '/@/api/data/pictureInfo.js';
|
||||||
|
import { websitesPage, delWebsites } from '/@/api/websites/websites.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';
|
||||||
|
// 引入组件
|
||||||
|
const auditRef = ref();
|
||||||
|
const uploadRef = ref();
|
||||||
|
const editUploadRef = ref();
|
||||||
|
// 定义变量内容
|
||||||
|
const state = reactive({
|
||||||
|
multipleSelection: [],
|
||||||
|
tabVal: 'first',
|
||||||
|
disasterId: null,
|
||||||
|
disasterData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
search: '',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
search: '',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
state.multipleSelection = val;
|
||||||
|
};
|
||||||
|
//格式化图片名称
|
||||||
|
const formatName = (name) => {
|
||||||
|
return name;
|
||||||
|
};
|
||||||
|
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 || size === -1) 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 = (i) => {
|
||||||
|
state.disasterId = i.disasterId;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
// 初始化灾害表格数据
|
||||||
|
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);
|
||||||
|
item.disasterTime = date;
|
||||||
|
})
|
||||||
|
state.disasterData.total = res.total;
|
||||||
|
state.disasterData.loading = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 初始化表格数据
|
||||||
|
const getTableData = () => {
|
||||||
|
state.tableData.loading = true;
|
||||||
|
|
||||||
|
websitesPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { disasterId: state.disasterId}).then(
|
||||||
|
(res) => {
|
||||||
|
state.tableData.data = res.records;
|
||||||
|
state.tableData.total = res.total;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
setTimeout(() => {
|
||||||
|
state.tableData.loading = false;
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
// 打开上传弹窗
|
||||||
|
const uploadData = () => {
|
||||||
|
if (state.disasterId == null) {
|
||||||
|
ElMessage.warning('Please select the disaster first');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uploadRef.value.openDialog(state.disasterId);
|
||||||
|
};
|
||||||
|
// 打开修改角色弹窗
|
||||||
|
const editData = (row) => {
|
||||||
|
editUploadRef.value.openDialog(row);
|
||||||
|
};
|
||||||
|
//批量删除图片数据
|
||||||
|
const batchDel = () => {
|
||||||
|
if (state.multipleSelection.length == 0) {
|
||||||
|
ElMessage.warning('Select the data to be operated first');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(`This action batch deletes the data,Whether to continue?`, 'tip', {
|
||||||
|
confirmButtonText: 'confirm',
|
||||||
|
cancelButtonText: 'cancel',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
let id = state.multipleSelection.map((item) => item.id);
|
||||||
|
delWebsites(id.join()).then((res) => {
|
||||||
|
getTableData();
|
||||||
|
ElMessage.success('delete successfully');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
};
|
||||||
|
// 删除图片信息
|
||||||
|
const del = (row) => {
|
||||||
|
ElMessageBox.confirm(`This action will delete the picture:“${row.title}”,,Whether to continue?`, 'tip', {
|
||||||
|
confirmButtonText: 'confirm',
|
||||||
|
cancelButtonText: 'cancel',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delWebsites(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) => {
|
||||||
|
state.tableData.param.pageSize = val;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
// 分页改变
|
||||||
|
const onHandleCurrentChange = (val) => {
|
||||||
|
state.tableData.param.pageNum = val;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
// 页面加载时
|
||||||
|
onMounted(() => {
|
||||||
|
getDisasterData();
|
||||||
|
//getTableData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.mt15 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-tabs>.el-tabs__content {
|
||||||
|
padding: 32px;
|
||||||
|
color: #6b778c;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.system-role-container {
|
||||||
|
.system-role-padding {
|
||||||
|
padding: 15px;
|
||||||
|
|
||||||
|
.el-table {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-tabs>.el-tabs__content {
|
||||||
|
padding: 32px;
|
||||||
|
color: #6b778c;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -5,191 +5,226 @@
|
||||||
<el-image style="height:40px ; width:100px!" src="/baidu.jpg"></el-image>
|
<el-image style="height:40px ; width:100px!" src="/baidu.jpg"></el-image>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="Confirm keywords" style="text-align:center;">
|
<el-form-item label="Confirm keywords" style="text-align:center;">
|
||||||
<el-input v-model="state.baidu.keywords">
|
<el-input v-model="state.baidu.keywords">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-form-item label="page" style="text-align:center ; margin-left: 10px;">
|
<el-form-item label="page" style="text-align:center ; margin-left: 10px;">
|
||||||
<el-input v-model="state.baidu.page" type="number" style="width: 70px ;"></el-input>
|
<el-input v-model="state.baidu.page" type="number" style="width: 70px ;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3" style="text-align:center ;">
|
<el-col :span="3" style="text-align:center ;">
|
||||||
<el-icon :size="40" style="cursor:pointer ;" :title="state.baidu.status==0?'Waiting in queue……':'start'" :color="state.baidu.status==0?'#4f4':'blue'" @click="state.baidu.status==0?confirmBox('baidu'):start('baidu')" v-if="state.baiduOption.buttonIs&&(state.baidu.status==0||!state.baidu.status)">
|
<el-icon :size="40" style="cursor:pointer ;" :title="state.baidu.status == 0 ? 'Waiting in queue……' : 'start'"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg>
|
:color="state.baidu.status == 0 ? '#4f4' : 'blue'"
|
||||||
|
@click="state.baidu.status == 0 ? confirmBox('baidu') : start('baidu')"
|
||||||
|
v-if="state.baiduOption.buttonIs && (state.baidu.status == 0 || !state.baidu.status)">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.baiduOption.buttonIs&&state.baidu.status==1">
|
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>
|
color="#131313" v-if="state.baiduOption.buttonIs && state.baidu.status == 1">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')" v-if="state.baiduOption.buttonIs&&state.baidu.status==2">
|
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg>
|
v-if="state.baiduOption.buttonIs && state.baidu.status == 2">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
|
||||||
<span v-if="!state.baiduOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.baiduOption.runTitle }}</span>
|
<span v-if="!state.baiduOption.buttonIs" style="height: 40; line-height: 40px;">{{
|
||||||
|
state.baiduOption.runTitle }}</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="3" style="text-align:center ;">
|
<el-col :span="3" style="text-align:center ;">
|
||||||
<el-image style="height:40px ; width:100px!" src="/bing.webp"></el-image>
|
<el-image style="height:40px ; width:100px!" src="/bing.webp"></el-image>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" >
|
<el-col :span="12">
|
||||||
<el-form-item label="Confirm keywords" style="text-align:center ;">
|
<el-form-item label="Confirm keywords" style="text-align:center ;">
|
||||||
<el-input v-model="state.bing.keywords"></el-input>
|
<el-input v-model="state.bing.keywords"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3" >
|
<el-col :span="3">
|
||||||
<el-form-item label="page" style="text-align:center; margin-left: 10px;">
|
<el-form-item label="page" style="text-align:center; margin-left: 10px;">
|
||||||
<el-input v-model="state.bing.page" type="number" style="width: 70px ;"></el-input>
|
<el-input v-model="state.bing.page" type="number" style="width: 70px ;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3" style="text-align:center ;">
|
<el-col :span="3" style="text-align:center ;">
|
||||||
<el-icon :size="40" style="cursor:pointer ;" :title="state.bing.status==0?'Waiting in queue……':'start'" :color="state.bing.status==0?'#4f4':'blue'" @click="state.bing.status==0?confirmBox('bing'):start('bing')" v-if="state.bingOption.buttonIs&&(state.bing.status==0||!state.bing.status)">
|
<el-icon :size="40" style="cursor:pointer ;" :title="state.bing.status == 0 ? 'Waiting in queue……' : 'start'"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg>
|
:color="state.bing.status == 0 ? '#4f4' : 'blue'"
|
||||||
|
@click="state.bing.status == 0 ? confirmBox('bing') : start('bing')"
|
||||||
|
v-if="state.bingOption.buttonIs && (state.bing.status == 0 || !state.bing.status)">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.buttonIs&&state.bing.status==1">
|
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>
|
color="#131313" v-if="state.buttonIs && state.bing.status == 1">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')" v-if="state.bingOption.buttonIs&&state.bing.status==2">
|
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')"
|
||||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg>
|
v-if="state.bingOption.buttonIs && state.bing.status == 2">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
|
||||||
<span v-if="!state.bingOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.bingOption.runTitle }}</span>
|
<span v-if="!state.bingOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.bingOption.runTitle
|
||||||
|
}}</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="state.isShowDialog=false" size="default">close</el-button>
|
<el-button @click="state.isShowDialog = false" size="default">close</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup >
|
<script setup >
|
||||||
import { ElMessage,ElMessageBox} from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import {reactive,defineExpose} from 'vue';
|
import { reactive, defineExpose } from 'vue';
|
||||||
import {news,submit,getList} from '/@/api/crawl/index';
|
import { news, submit, getList } from '/@/api/crawl/index';
|
||||||
import { useUserInfo } from '/@/stores/userInfo';
|
import { useUserInfo } from '/@/stores/userInfo';
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
isShowDialog:false,
|
isShowDialog: false,
|
||||||
data:{},
|
data: {},
|
||||||
table:[],
|
table: [],
|
||||||
baidu:{
|
baidu: {
|
||||||
keywords:"",
|
keywords: "",
|
||||||
page:5,
|
page: 5,
|
||||||
disaster_id:undefined
|
disaster_id: undefined
|
||||||
},
|
},
|
||||||
bing:{
|
bing: {
|
||||||
keywords:"",
|
keywords: "",
|
||||||
page:10,
|
page: 10,
|
||||||
disaster_id:undefined
|
disaster_id: undefined
|
||||||
},
|
},
|
||||||
baiduOption:{
|
baiduOption: {
|
||||||
buttonIs:true,
|
buttonIs: true,
|
||||||
runTitle:""
|
runTitle: ""
|
||||||
},
|
},
|
||||||
bingOption:{
|
bingOption: {
|
||||||
buttonIs:true,
|
buttonIs: true,
|
||||||
runTitle:""
|
runTitle: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
const confirmBox = (text)=>{
|
const confirmBox = (text) => {
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
'Already in queue, continue to start?',
|
'Already in queue, continue to start?',
|
||||||
'Warning',
|
'Warning',
|
||||||
{
|
{
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
start(text)
|
start(text)
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: 'restart success',
|
message: 'restart success',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: 'Cancel restart',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
ElMessage({
|
|
||||||
type: 'info',
|
|
||||||
message: 'Cancel restart',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const openDialog = (row) => {
|
const openDialog = (row) => {
|
||||||
state.baidu={};
|
state.baidu = {};
|
||||||
state.bing={};
|
state.bing = {};
|
||||||
state.data = row;
|
state.data = row;
|
||||||
state.baidu.keywords = row.disasterKeyword;
|
state.baidu.keywords = row.disasterKeyword;
|
||||||
state.baidu.disaster_id = row.id
|
state.baidu.disaster_id = row.disasterId
|
||||||
state.bing.keywords=row.disasterKeyword;
|
state.bing.keywords = row.disasterKeyword;
|
||||||
state.bing.disaster_id = row.id
|
state.bing.disaster_id = row.disasterId
|
||||||
getDate();
|
getDate();
|
||||||
state.isShowDialog = true;
|
state.isShowDialog = true;
|
||||||
}
|
}
|
||||||
const getDate = ()=>{
|
const getDate = () => {
|
||||||
getList(1,10,{disasterId:state.data.id}).then(res=>{
|
getList(1, 10, { disasterId: state.data.disasterId }).then(res => {
|
||||||
let data = res.records;
|
let data = res.records;
|
||||||
for (let index = 0; index < data.length; index++) {
|
for (let index = 0; index < data.length; index++) {
|
||||||
const element = data[index];
|
const element = data[index];
|
||||||
if(element.type == 2){
|
if (element.type == 2) {
|
||||||
state.baidu = element;
|
state.baidu = element;
|
||||||
}
|
}
|
||||||
if(element.type == 1){
|
if (element.type == 1) {
|
||||||
state.bing = element;
|
state.bing = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
state.baidu.page=10;
|
state.baidu.page = 10;
|
||||||
state.bing.page=10;
|
state.bing.page = 10;
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
const start = (text)=>{
|
const start = (text) => {
|
||||||
state.baiduOption.runTitle="start(5s)";
|
state.baiduOption.runTitle = "start(5s)";
|
||||||
let count = 4;
|
let count = 4;
|
||||||
const countdown = setInterval(function() {
|
const countdown = setInterval(function () {
|
||||||
if(text=='baidu'){
|
if (text == 'baidu') {
|
||||||
state.baiduOption.runTitle="start("+count+"s)";
|
state.baiduOption.runTitle = "start(" + count + "s)";
|
||||||
}else{
|
} else {
|
||||||
state.bingOption.runTitle="start("+count+"s)";
|
state.bingOption.runTitle = "start(" + count + "s)";
|
||||||
}
|
}
|
||||||
|
|
||||||
count -= 1;
|
count -= 1;
|
||||||
if (count < 0) {
|
if (count < 0) {
|
||||||
if(text=='baidu'){
|
if (text == 'baidu') {
|
||||||
state.baiduOption.buttonIs= true ;
|
state.baiduOption.buttonIs = true;
|
||||||
}else{
|
} else {
|
||||||
state.bingOption.buttonIs= true ;
|
state.bingOption.buttonIs = true;
|
||||||
}
|
}
|
||||||
clearInterval(countdown);
|
clearInterval(countdown);
|
||||||
console.log('倒计时结束');
|
console.log('倒计时结束');
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
let keywords = (text=='baidu'?state.baidu.keywords:state.bing.keywords);
|
let keywords = (text == 'baidu' ? state.baidu.keywords : state.bing.keywords);
|
||||||
let page = (text=='baidu'?state.baidu.page:state.bing.page);
|
let page = (text == 'baidu' ? state.baidu.page : state.bing.page);
|
||||||
let id = (text=='baidu'?state.baidu.id:state.bing.id);
|
let id = (text == 'baidu' ? state.baidu.id : state.bing.id);
|
||||||
submit(
|
submit(
|
||||||
{
|
{
|
||||||
type:text=='baidu'?2:1,
|
type: text == 'baidu' ? 2 : 1,
|
||||||
manageId:userInfo.userInfos.id,
|
manageId: userInfo.userInfos.id,
|
||||||
status:0,
|
status: 0,
|
||||||
disasterId:state.data.id,
|
disasterId: state.data.disasterId,
|
||||||
keywords:keywords,
|
keywords: keywords,
|
||||||
id:(id?id:null)
|
id: (id ? id : null)
|
||||||
}
|
}
|
||||||
).then(ret=>{
|
).then(ret => {
|
||||||
if(ret == 1042){
|
if (ret == 1042) {
|
||||||
ElMessage.error("error")
|
ElMessage.error("error")
|
||||||
}else{
|
} else {
|
||||||
news(ret.disasterId, keywords, page,(text=="baidu"),ret.id).then(res=>{
|
news(ret.disasterId, keywords, page, (text == "baidu"), ret.id).then(res => {
|
||||||
getData();
|
getData();
|
||||||
ElMessage.success("success")
|
|
||||||
})
|
})
|
||||||
|
ElMessage.success("Data is being acquired!")
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,9 +233,6 @@ defineExpose({
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style >
|
<style >.inline-block {
|
||||||
.inline-block {
|
display: inline-block;
|
||||||
display: inline-block;
|
}</style>
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="upload" v-model="state.isShowDialog" width="550px">
|
||||||
|
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
||||||
|
<el-form-item label="file:" style="margin-top: 30px;">
|
||||||
|
<el-upload ref="upFileRef" class="upload-demo" :accept="'.xls,.xlsx'" :file-list="state.fileData" :auto-upload="false" :on-change="handleChange">
|
||||||
|
<template #trigger>
|
||||||
|
<el-button type="primary">select file</el-button>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item prop="title" label="type:" style="margin-top: 30px;">
|
||||||
|
<el-select v-model="state.ruleForm.title" class="m-2" placeholder="please enter name">
|
||||||
|
<el-option label="bing" value="1"></el-option>
|
||||||
|
<el-option label="baidu" value="0"></el-option>
|
||||||
|
<el-option label="twitter" value="2"></el-option>
|
||||||
|
<el-option label="weibo" value="3"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
|
<el-button type="primary" @click="uploadHandler()" size="default"
|
||||||
|
:loading="state.isLoading">upload</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { importTemplate } from '/@/api/news/index.js';
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
const upFileRef = ref();
|
||||||
|
const emit = defineEmits(['callback']);
|
||||||
|
const adminAddFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
fileList: [],
|
||||||
|
isShowDialog: false,
|
||||||
|
isLoading: false,
|
||||||
|
ruleForm: {
|
||||||
|
title: null,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
//通过onchanne触发方法获得文件列表
|
||||||
|
const handleChange = (file, fileList) => {
|
||||||
|
state.fileList = fileList;
|
||||||
|
console.log(state.fileList)
|
||||||
|
};
|
||||||
|
|
||||||
|
//上传处理
|
||||||
|
const uploadHandler = () => {
|
||||||
|
const form = new FormData();
|
||||||
|
form.append("fileData", state.fileList[0].raw);
|
||||||
|
form.append("type", state.ruleForm.title);
|
||||||
|
form.append("disasterId", state.ruleForm.disasterId);
|
||||||
|
state.isLoading = true;
|
||||||
|
importTemplate(form).then(da => {
|
||||||
|
ElMessage.success("success");
|
||||||
|
emit('callback');
|
||||||
|
}).finally(() => {
|
||||||
|
state.isLoading = false;
|
||||||
|
})
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
|
||||||
|
//校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
title: [
|
||||||
|
{ required: true, message: 'please enter type', trigger: 'change' }
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
//重置表单
|
||||||
|
const resetField = () => {
|
||||||
|
adminAddFormRef.value.resetFields();
|
||||||
|
state.fileArray = [];
|
||||||
|
upFileRef.value.clearFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
state.ruleForm.disasterId = row;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
resetField();
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
</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: 85vh;">
|
||||||
<div class="system-user-search "
|
<div class="system-user-search "
|
||||||
style="display: flex;margin-left: 10px;margin-top: 10px;margin-bottom:-15px ">
|
style="display: flex;margin-left: 10px;margin-top: 10px;margin-bottom:-15px ">
|
||||||
<el-form-item label="Type">
|
<el-form-item label="Type">
|
||||||
|
@ -44,12 +44,21 @@
|
||||||
Search
|
Search
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button size="default" type="success" class="ml10" @click="openDialog">
|
<div>
|
||||||
<el-icon>
|
<el-button size="default" type="success" class="ml10" @click="openDialog">
|
||||||
<ele-Upload />
|
<el-icon>
|
||||||
</el-icon>
|
<ele-Upload />
|
||||||
Batch operation
|
</el-icon>
|
||||||
</el-button>
|
Batch operation
|
||||||
|
</el-button>
|
||||||
|
<el-button size="default" type="success" class="ml10" @click="OpenuploadDataRef()">
|
||||||
|
<el-icon>
|
||||||
|
<ele-Upload />
|
||||||
|
</el-icon>
|
||||||
|
Upload
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<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" />
|
||||||
|
@ -107,33 +116,28 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
<boot ref="bootRef" @callback="getTableData" />
|
<boot ref="bootRef" @callback="getTableData" />
|
||||||
|
<uploadData ref="uploadDataRef" @callback="getTableData" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="dataMultimediaData">
|
<script lang="ts" setup name="dataMultimediaData">
|
||||||
import en from 'element-plus/dist/locale/en.mjs'
|
import en from 'element-plus/dist/locale/en.mjs'
|
||||||
import type { TabsPaneContext } from 'element-plus';
|
import type { TabsPaneContext } from 'element-plus';
|
||||||
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
|
||||||
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 { reactive, onMounted, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import boot from "./component/boot.vue";
|
import boot from "./component/boot.vue";
|
||||||
|
import uploadData from "./component/uploadData.vue";
|
||||||
import disasterTable from "/@/components/table/DisasterTable.vue";
|
import disasterTable from "/@/components/table/DisasterTable.vue";
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const auditRef = ref();
|
|
||||||
const bootRef = ref();
|
const bootRef = ref();
|
||||||
|
const uploadDataRef = 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,
|
dialogVisible: false,
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
|
@ -167,6 +171,7 @@ const state = reactive({
|
||||||
},
|
},
|
||||||
selectList: [],
|
selectList: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const openDialog = async (row, bool) => {
|
const openDialog = async (row, bool) => {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
state.selectList = [row]
|
state.selectList = [row]
|
||||||
|
@ -175,6 +180,7 @@ const openDialog = async (row, bool) => {
|
||||||
}
|
}
|
||||||
state.dialogVisible = true;
|
state.dialogVisible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const reviews = async (status) => {
|
const reviews = async (status) => {
|
||||||
let ids = state.selectList.map((item) => item.id);
|
let ids = state.selectList.map((item) => item.id);
|
||||||
//将ids 转为字符串 使用逗号分隔
|
//将ids 转为字符串 使用逗号分隔
|
||||||
|
@ -186,41 +192,11 @@ const reviews = async (status) => {
|
||||||
getTableData();
|
getTableData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
state.multipleSelection = 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 = (i) => {
|
const tableClick = (i) => {
|
||||||
state.disasterId = i.disasterId;
|
state.disasterId = i.disasterId;
|
||||||
|
@ -229,12 +205,6 @@ const tableClick = (i) => {
|
||||||
// 初始化灾害表格数据
|
// 初始化灾害表格数据
|
||||||
const getDisasterData = () => {
|
const getDisasterData = () => {
|
||||||
state.disasterData.loading = true;
|
state.disasterData.loading = true;
|
||||||
// param: {
|
|
||||||
// search: '',
|
|
||||||
// current: 1,
|
|
||||||
// size: 10,
|
|
||||||
// respondStatus: 0,
|
|
||||||
// },
|
|
||||||
let param = {
|
let param = {
|
||||||
"search": state.disasterData.param.search,
|
"search": state.disasterData.param.search,
|
||||||
"current": state.disasterData.param.pageNum,
|
"current": state.disasterData.param.pageNum,
|
||||||
|
@ -265,82 +235,39 @@ const getTableData = () => {
|
||||||
state.tableData.data = res.records;
|
state.tableData.data = res.records;
|
||||||
|
|
||||||
if (state.searchName == '1') {
|
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.time = date;
|
item.time = date;
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
state.tableData.data.forEach(item => {
|
state.tableData.data.forEach(item => {
|
||||||
let date = item.time.slice(0, 10);
|
let date = item.time.slice(0, 10);
|
||||||
item.time = date;
|
item.time = date;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
state.tableData.total = res.total;
|
state.tableData.total = res.total;
|
||||||
})
|
})
|
||||||
/* state.tableData.data = data;
|
|
||||||
state.tableData.total = state.tableData.data.length;*/
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开上传弹窗
|
// 打开上传弹窗
|
||||||
const startBot = (row: any) => {
|
const startBot = (row: any) => {
|
||||||
bootRef.value.openDialog(row);
|
bootRef.value.openDialog(row);
|
||||||
|
|
||||||
};
|
};
|
||||||
// 打开修改角色弹窗
|
|
||||||
const onOpenEditRole = (type, row) => {
|
// 打开上传弹窗
|
||||||
roleDialogRef.value.openDialog(type, row);
|
const OpenuploadDataRef = () => {
|
||||||
};
|
if (state.disasterId == null) {
|
||||||
//批量删除其他数据
|
ElMessage.warning('Please select the disaster first');
|
||||||
const batchDel = () => {
|
|
||||||
if (state.multipleSelection.length == 0) {
|
|
||||||
ElMessage.warning("Select the data to be operated first");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', {
|
uploadDataRef.value.openDialog(state.disasterId);
|
||||||
confirmButtonText: 'confirm',
|
|
||||||
cancelButtonText: 'cancel',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
let id = state.multipleSelection.map(item => item.id)
|
|
||||||
deleteData(id.join()).then(res => {
|
|
||||||
getTableData();
|
|
||||||
ElMessage.success('delete successfully');
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.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) => {
|
||||||
state.tableData.param.pageSize = val;
|
state.tableData.param.pageSize = val;
|
||||||
|
@ -351,6 +278,7 @@ const onHandleCurrentChange = (val) => {
|
||||||
state.tableData.param.pageNum = val;
|
state.tableData.param.pageNum = val;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDisasterData();
|
getDisasterData();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<el-dialog title="upload" v-model="state.isShowDialog" width="500px">
|
<el-dialog title="upload" v-model="state.isShowDialog" width="500px">
|
||||||
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef"
|
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef"
|
||||||
style="margin-left: 6%;">
|
style="margin-left: 6%;">
|
||||||
<el-form-item label="upload picture" prop="img">
|
<el-form-item label="upload" prop="img">
|
||||||
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
|
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
|
||||||
:on-remove="removePic" :before-upload="beforeUpload">
|
:on-remove="removePic" :before-upload="beforeUpload">
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<el-config-provider :locale="en">
|
<el-config-provider :locale="en">
|
||||||
<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" style="height: 90vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
<disasterTable @childClick="tableClick"></disasterTable>
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
</div>
|
</div>
|
||||||
</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: 85vh;">
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
<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>
|
size="default" clearable>
|
||||||
|
@ -38,9 +38,9 @@
|
||||||
<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%">
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="uploaderName" label="Uploader name" width="100"
|
<el-table-column prop="uploaderName" label="Uploader name" width="150"
|
||||||
show-overflow-tooltip></el-table-column>
|
show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="isPublish" label="isPublish" width="90" show-overflow-tooltip>
|
<el-table-column prop="isPublish" label="isPublish" width="110" 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>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="title" label="Title" show-overflow-tooltip
|
<el-table-column prop="title" label="Title" show-overflow-tooltip
|
||||||
width="150"></el-table-column>
|
width="150"></el-table-column>
|
||||||
<el-table-column prop="size" label="Data size" width="90" show-overflow-tooltip>
|
<el-table-column prop="size" label="Data size" width="110" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatSizeUnits(scope.row.size) }}
|
{{ formatSizeUnits(scope.row.size) }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -262,6 +262,7 @@ const pub = (row) => {
|
||||||
}
|
}
|
||||||
updateEntityData(daNew)
|
updateEntityData(daNew)
|
||||||
ElMessage.success('success');
|
ElMessage.success('success');
|
||||||
|
getTableData()
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,79 +1,70 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog title="edit picture" v-model="state.isShowDialog" width="700px" :close-on-click-modal="false" @close="closeDialog">
|
<el-dialog title="edit picture" v-model="state.isShowDialog" width="700px" :close-on-click-modal="false"
|
||||||
|
@close="closeDialog">
|
||||||
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
||||||
<el-form-item label="upload picture" prop="img">
|
<el-form-item label="upload picture" prop="img">
|
||||||
<el-upload
|
<el-upload ref="upFileRef" v-model:file-list="state.fileList" action="#" list-type="picture-card" accept="image/*"
|
||||||
ref="upFileRef"
|
:on-preview="handlePictureCardPreview" :on-remove="handleRemove" :on-change="changeUpload" :limit="1"
|
||||||
v-model:file-list="state.fileList"
|
:auto-upload="false" :class="{ hide: state.hideUpload }">
|
||||||
action="#"
|
<el-icon>
|
||||||
list-type="picture-card"
|
<Plus />
|
||||||
accept="image/*"
|
</el-icon>
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:on-remove="handleRemove"
|
|
||||||
:on-change="changeUpload"
|
|
||||||
:limit="1"
|
|
||||||
:auto-upload="false"
|
|
||||||
:class="{hide: state.hideUpload }"
|
|
||||||
>
|
|
||||||
<el-icon><Plus /></el-icon>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<el-dialog v-model="state.dialogVisible">
|
<el-dialog v-model="state.dialogVisible">
|
||||||
<img w-full :src="state.dialogImageUrl" alt="Preview Image" />
|
<img w-full :src="state.dialogImageUrl" alt="Preview Image" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item prop="title" label="data title">
|
||||||
|
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="Home page show" prop="isMain">
|
<el-form-item label="Home page show" prop="isMain">
|
||||||
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
|
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
|
||||||
<el-option
|
<el-option label="show" value="1"></el-option>
|
||||||
label="show"
|
<el-option label="not show" value="0"></el-option>
|
||||||
value="1"
|
|
||||||
></el-option>
|
|
||||||
<el-option
|
|
||||||
label="not show"
|
|
||||||
value="0"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="onCancel" size="default">cancel</el-button>
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
|
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import {reactive, ref} from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import {updatePicture} from '/@/api/data/pictureInfo.js';
|
import { updatePicture } from '/@/api/data/pictureInfo.js';
|
||||||
import {ElMessage} from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { UploadFilled } from '@element-plus/icons-vue'
|
import { UploadFilled } from '@element-plus/icons-vue'
|
||||||
import {computed} from "@vue/reactivity";
|
import { computed } from "@vue/reactivity";
|
||||||
const upFileRef = ref();
|
const upFileRef = ref();
|
||||||
const emit = defineEmits(['callback']);
|
const emit = defineEmits(['callback']);
|
||||||
const adminAddFormRef = ref();
|
const adminAddFormRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
dialogVisible:false,
|
dialogVisible: false,
|
||||||
dialogImageUrl:'',
|
dialogImageUrl: '',
|
||||||
disabled:false,
|
disabled: false,
|
||||||
hideUpload:false,
|
hideUpload: false,
|
||||||
fileList:[],
|
fileList: [],
|
||||||
isShowDialog: false,
|
isShowDialog: false,
|
||||||
isLoading:false,
|
isLoading: false,
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
//字典值
|
//字典值
|
||||||
dictData: [],
|
dictData: [],
|
||||||
unitData:[],
|
unitData: [],
|
||||||
standardId: '',
|
standardId: '',
|
||||||
detectionData: [],
|
detectionData: [],
|
||||||
disasterId:null,
|
disasterId: null,
|
||||||
dataForm:new FormData(),
|
dataForm: new FormData(),
|
||||||
fileArray:[],
|
fileArray: [],
|
||||||
id:null,
|
id: null,
|
||||||
})
|
})
|
||||||
//上传图片改变时
|
//上传图片改变时
|
||||||
const changeUpload = (file, fileList) => {
|
const changeUpload = (file, fileList) => {
|
||||||
|
@ -82,28 +73,27 @@ const changeUpload = (file, fileList) => {
|
||||||
}
|
}
|
||||||
//验证图片
|
//验证图片
|
||||||
const validImg = (rule, value, callback) => {
|
const validImg = (rule, value, callback) => {
|
||||||
if(state.fileList.length>0){
|
if (state.fileList.length > 0) {
|
||||||
adminAddFormRef.value.clearValidate('img')
|
adminAddFormRef.value.clearValidate('img')
|
||||||
callback();
|
callback();
|
||||||
}else{
|
} else {
|
||||||
return callback(new Error('please upload image'));
|
return callback(new Error('please upload image'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//校验规则
|
//校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
img: [
|
img: [
|
||||||
{required: true,trigger: 'change',validator:validImg}
|
{ required: true, trigger: 'change', validator: validImg }
|
||||||
],
|
],
|
||||||
isMain: [
|
isMain: [
|
||||||
{required: true, message: 'please select home page show', trigger: 'change'}
|
{ required: true, message: 'please select home page show', trigger: 'change' }
|
||||||
],
|
],
|
||||||
remark:[
|
remark: [
|
||||||
{required: true, message: 'please select data details', trigger: 'blur'}
|
{ required: true, message: 'please select data details', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
//图片删除
|
//图片删除
|
||||||
const handleRemove = (uploadFile, uploadFiles) => {
|
const handleRemove = (uploadFile, uploadFiles) => {
|
||||||
console.log(uploadFile, uploadFiles)
|
|
||||||
state.hideUpload = state.fileList.length >= 1
|
state.hideUpload = state.fileList.length >= 1
|
||||||
}
|
}
|
||||||
//图片预览
|
//图片预览
|
||||||
|
@ -125,7 +115,7 @@ const uploadPic = (data) => {
|
||||||
}
|
}
|
||||||
//移除时
|
//移除时
|
||||||
const removePic = (data) => {
|
const removePic = (data) => {
|
||||||
state.fileArray.splice(state.fileArray.findIndex(item=>item.uid===data.raw.uid), 1)
|
state.fileArray.splice(state.fileArray.findIndex(item => item.uid === data.raw.uid), 1)
|
||||||
console.log(state.fileArray)
|
console.log(state.fileArray)
|
||||||
}
|
}
|
||||||
//重置表单
|
//重置表单
|
||||||
|
@ -139,10 +129,11 @@ const resetField = () => {
|
||||||
const openDialog = (row) => {
|
const openDialog = (row) => {
|
||||||
state.isShowDialog = true;
|
state.isShowDialog = true;
|
||||||
//回显图片
|
//回显图片
|
||||||
state.fileList.push({'name':row.name,'uid':row.id,'url':row.link});
|
state.fileList.push({ 'name': row.name, 'uid': row.id, 'url': row.link });
|
||||||
state.hideUpload = state.fileList.length >= 1
|
state.hideUpload = state.fileList.length >= 1
|
||||||
//state.dialogImageUrl = row.link;
|
//state.dialogImageUrl = row.link;
|
||||||
state.ruleForm.isMain = row.isMain+"";
|
state.ruleForm.isMain = row.isMain + "";
|
||||||
|
state.ruleForm.title = row.name;
|
||||||
state.id = row.id
|
state.id = row.id
|
||||||
};
|
};
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
|
@ -162,18 +153,22 @@ const onSubmit = () => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log(state.fileList);
|
console.log(state.fileList);
|
||||||
state.isLoading = true;
|
state.isLoading = true;
|
||||||
state.fileList.forEach(item=>{
|
|
||||||
state.dataForm.append('file',item.raw);
|
state.fileList.forEach(item => {
|
||||||
|
console.log(item.raw,"item.raw");
|
||||||
|
if (item.raw) {
|
||||||
|
console.log(1111111111111);
|
||||||
|
state.dataForm.append('file', item.raw);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
state.dataForm.append('isMain',state.ruleForm.isMain);
|
state.dataForm.append('isMain', state.ruleForm.isMain);
|
||||||
state.dataForm.append('id',state.id);
|
state.dataForm.append('id', state.id);
|
||||||
for(let [a, b] of state.dataForm.entries()){
|
state.dataForm.append('name', state.ruleForm.title);
|
||||||
console.log(a, b, '--------------');
|
|
||||||
}
|
|
||||||
updatePicture(state.dataForm).then(res => {
|
updatePicture(state.dataForm).then(res => {
|
||||||
|
state.dataForm = new FormData(),
|
||||||
ElMessage.success("Upload successfully");
|
ElMessage.success("Upload successfully");
|
||||||
emit('callback');
|
emit('callback');
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
})
|
})
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<el-config-provider :locale="en">
|
<el-config-provider :locale="en">
|
||||||
<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" style="height: 90vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
<disasterTable @childClick="tableClick"></disasterTable>
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
</div>
|
</div>
|
||||||
</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: 85vh;">
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||||
clearable></el-input>
|
clearable></el-input>
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="address" v-model="state.isShowDialog" width="700px">
|
||||||
|
<el-form :model="state.ruleForm" size="default" label-width="190px" :rules="rules" ref="adminAddFormRef">
|
||||||
|
<el-form-item prop="downloadurl" label="data downloadUrl">
|
||||||
|
<el-input v-model="state.ruleForm.downloadUrl" placeholder="please data downloadurl"
|
||||||
|
type="text" style="width:320px; height: 40px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">confirm</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { approval } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
|
||||||
|
|
||||||
|
const emit = defineEmits(['callback']);
|
||||||
|
const adminAddFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
isShowDialog: false,
|
||||||
|
isLoading: false,
|
||||||
|
ruleForm: {
|
||||||
|
},
|
||||||
|
disasterId: null,
|
||||||
|
})
|
||||||
|
|
||||||
|
//校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
downloadurl: [
|
||||||
|
{ required: true, message: 'please data downloadurl', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
})
|
||||||
|
//重置表单
|
||||||
|
const resetField = () => {
|
||||||
|
adminAddFormRef.value.resetFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
state.ruleForm.id = row.id;
|
||||||
|
if (row.downloadUrl) {
|
||||||
|
state.ruleForm.downloadUrl = row.downloadUrl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
resetField();
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 新增
|
||||||
|
const onSubmit = () => {
|
||||||
|
if (!state.ruleForm.downloadUrl) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.ruleForm.status = 3;
|
||||||
|
approval(state.ruleForm).then(da => {
|
||||||
|
ElMessage.success('success!');
|
||||||
|
closeDialog();
|
||||||
|
emit("callback");
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="approval" v-model="state.isShowDialog" width="700px">
|
||||||
|
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
|
||||||
|
<el-form-item label="pass or not" prop="status">
|
||||||
|
<el-radio-group v-model="state.ruleForm.status">
|
||||||
|
<el-radio :label="2">pass</el-radio>
|
||||||
|
<el-radio :label="4">no pass</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">confirm</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { approval } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
|
||||||
|
|
||||||
|
const emit = defineEmits(['callback']);
|
||||||
|
const adminAddFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
isShowDialog: false,
|
||||||
|
isLoading: false,
|
||||||
|
ruleForm: {
|
||||||
|
},
|
||||||
|
disasterId: null,
|
||||||
|
})
|
||||||
|
|
||||||
|
//校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
status: [
|
||||||
|
{ required: true, message: 'please check pass or not', trigger: 'change' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
//重置表单
|
||||||
|
const resetField = () => {
|
||||||
|
adminAddFormRef.value.resetFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
state.ruleForm.id = row.id;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
resetField();
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 新增
|
||||||
|
const onSubmit = () => {
|
||||||
|
approval(state.ruleForm).then(da=>{
|
||||||
|
ElMessage.success('success!');
|
||||||
|
closeDialog();
|
||||||
|
emit("callback");
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -2,33 +2,40 @@
|
||||||
<div>
|
<div>
|
||||||
<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" style="height: 80vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
|
|
||||||
<disasterTable @childClick="tableClick">
|
<disasterTable @childClick="tableClick">
|
||||||
<el-table-column prop="Operate" label="Operate" width="85" show-overflow-tooltip>
|
<el-table-column prop="Operate" label="Operate" width="85" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button>
|
<el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button>
|
||||||
<!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> -->
|
<!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</disasterTable>
|
</disasterTable>
|
||||||
</div>
|
</div>
|
||||||
</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:80vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height:85vh;">
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
<!-- 选择灾害类型 -->
|
<!-- 选择灾害类型 -->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-tree-select v-model="state.value_satelliteType" :data="state.options_satelliteType" multiple
|
<el-tree-select v-model="state.value_satelliteType" :data="state.options_satelliteType" multiple
|
||||||
collapse-tags collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
|
collapse-tags collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
|
||||||
placeholder="Select satellite type" />
|
placeholder="Select satellite type" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" style="padding-left:1%;">
|
<el-col :span="6" style="margin-left: 1%;">
|
||||||
<el-tree-select v-model="state.value_resolution" :data="state.options_resolution" multiple collapse-tags
|
<el-tree-select v-model="state.value_resolution" :data="state.options_resolution" multiple collapse-tags
|
||||||
collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
|
collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
|
||||||
placeholder="Select resolution" />
|
placeholder="Select resolution" />
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6" style="margin-left: 1%;">
|
||||||
|
<el-select class="form-select" size="default" clearable placeholder="Select status"
|
||||||
|
v-model="state.status">
|
||||||
|
<el-option v-for="(item, index) in state.options_status" :value="item.value" :key="index"
|
||||||
|
:label="item.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-button size="default" type="primary" class="ml10" @click="searchRemoteSensingSourceData">
|
<el-button size="default" type="primary" class="ml10" @click="searchRemoteSensingSourceData">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
|
@ -43,40 +50,51 @@
|
||||||
<!-- id,卫星类型,生产日期,产品谱段,产品分辨率,云覆盖量,景中心经纬度,元数据下载链接,缩略图 支撑单位 -->
|
<!-- id,卫星类型,生产日期,产品谱段,产品分辨率,云覆盖量,景中心经纬度,元数据下载链接,缩略图 支撑单位 -->
|
||||||
<el-table :data="state.requestData" style="width: 1000Px;">
|
<el-table :data="state.requestData" style="width: 1000Px;">
|
||||||
<el-table-column type="index" label="Index" align="center" width="80"></el-table-column>
|
<el-table-column type="index" label="Index" align="center" width="80"></el-table-column>
|
||||||
<el-table-column prop="satelliteCode" label="Satellite code" width="170" align="center"
|
<el-table-column prop="satelliteCode" label="Satellite code" width="170" align="center" show-overflow-tooltip
|
||||||
|
sortable></el-table-column>
|
||||||
|
<el-table-column prop="productTime" label="Product time" width="170" align="center" show-overflow-tooltip
|
||||||
|
sortable></el-table-column>
|
||||||
|
<el-table-column prop="productBandsNum" label="Product bands num" width="200" align="center"
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="productTime" label="Product time" width="170" align="center"
|
<el-table-column prop="productResolution" label="Product resolution(m)" width="220" align="center"
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="productBandsNum" label="Product bands num" width="200" align="center"
|
<el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180" show-overflow-tooltip
|
||||||
|
sortable></el-table-column>
|
||||||
|
<el-table-column prop="sourceOrganization" label="Source organization" width="200" align="center"
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="productResolution" label="Product resolution(m)" width="220" align="center"
|
<el-table-column prop="downloadUrl" label="Download url" align="center" width="200" show-overflow-tooltip>
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="cloudCover" label="Cloud cover(%)" align="center" width="180"
|
<el-table-column prop="Operate" label="Operate" align="center" width="200" show-overflow-tooltip>
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
<template #default="scope">
|
||||||
<el-table-column prop="sourceOrganization" label="Source organization" width="200" align="center"
|
<el-button v-if="scope.row.status === 1" size="small" text type="primary" @click="approvalDataOpen(scope.row)">start</el-button>
|
||||||
show-overflow-tooltip sortable></el-table-column>
|
<el-button v-if="scope.row.status === 2 || scope.row.status === 3" size="small" text type="primary" @click="addAddressOpen(scope.row)">add_address</el-button>
|
||||||
<el-table-column prop="downloadUrl" label="Download url" align="center" width="200" show-overflow-tooltip>
|
</template>
|
||||||
</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"
|
||||||
style="margin-right: 20px;" :page-sizes="[10, 20, 30]" background v-model:current-page="state.tableData.param.pageNum"
|
style="margin-right: 20px;" :page-sizes="[10, 20, 30]" background
|
||||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
v-model:current-page="state.tableData.param.pageNum" v-model:page-size="state.tableData.param.pageSize"
|
||||||
:total="state.tableData.total">
|
layout="total, sizes, prev, pager, next" :total="state.tableData.total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<approvalData ref="approvalDataRef" @callback="getData()" />
|
||||||
|
<addAddress ref="addAddressRef" @callback="getData()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
|
import { getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
|
||||||
import { getDisasterPage } from '/@/api/data/otherData.js'
|
import { getDisasterPage } from '/@/api/data/otherData.js'
|
||||||
import disasterTable from "/@/components/table/DisasterTable.vue";
|
import disasterTable from "/@/components/table/DisasterTable.vue";
|
||||||
|
import approvalData from "./approvalData.vue";
|
||||||
|
import addAddress from "./addAddress.vue";
|
||||||
|
|
||||||
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
|
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
|
||||||
|
const approvalDataRef = ref();
|
||||||
|
const addAddressRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
disasterData: {
|
disasterData: {
|
||||||
data: [],
|
data: [],
|
||||||
|
@ -107,6 +125,29 @@ const state = reactive({
|
||||||
// value_disasterDate: '',
|
// value_disasterDate: '',
|
||||||
// options_disasterCountry: [],
|
// options_disasterCountry: [],
|
||||||
// value_disasterCountry: [],
|
// value_disasterCountry: [],
|
||||||
|
//0-爬虫获取,1-未审核,2-,已审核,上传源数据未补充下载 链接,3-已审核上传源数据已补充下载链接
|
||||||
|
options_status: [
|
||||||
|
{
|
||||||
|
label: 'Crawler acquisition',
|
||||||
|
value: '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Unapproved',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Approved',
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Finish',
|
||||||
|
value: '3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'No pass',
|
||||||
|
value: '4'
|
||||||
|
},
|
||||||
|
],
|
||||||
options_resolution: [{
|
options_resolution: [{
|
||||||
label: '<0.8m',
|
label: '<0.8m',
|
||||||
value: '<0.8m'
|
value: '<0.8m'
|
||||||
|
@ -146,7 +187,7 @@ const state = reactive({
|
||||||
requestSatellite: []
|
requestSatellite: []
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['response']);
|
const emit = defineEmits(['response']);
|
||||||
const startBot=(row)=>{
|
const startBot = (row) => {
|
||||||
emit('response', row);
|
emit('response', row);
|
||||||
}
|
}
|
||||||
// 初始化灾害表格数据
|
// 初始化灾害表格数据
|
||||||
|
@ -165,6 +206,16 @@ const tableClick = (i) => {
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开审批
|
||||||
|
const approvalDataOpen = (row) => {
|
||||||
|
approvalDataRef.value.openDialog(row);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开审批
|
||||||
|
const addAddressOpen = (row) => {
|
||||||
|
addAddressRef.value.openDialog(row);
|
||||||
|
};
|
||||||
|
|
||||||
// 获取遥感影像元数据
|
// 获取遥感影像元数据
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
@ -172,20 +223,9 @@ const getData = () => {
|
||||||
}
|
}
|
||||||
getPagesRemoteSensingSourceData(data).then(
|
getPagesRemoteSensingSourceData(data).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
console.log(res.records);
|
|
||||||
state.requestData = res.records;
|
state.requestData = res.records;
|
||||||
state.tableData.total = res.total;
|
state.tableData.total = res.total;
|
||||||
})
|
})
|
||||||
// getRemoteSensingSourceDataByCondition(1, 1000, JSON.stringify(data)).then(
|
|
||||||
// (res) => {
|
|
||||||
// state.requestData = res.records;
|
|
||||||
// for (let index = 0; index < res.records.length; index++) {
|
|
||||||
// state.requestResolution[index] = state.requestData[index].productResolution
|
|
||||||
// state.requestSatellite[index] = state.requestData[index].satelliteCode
|
|
||||||
// }
|
|
||||||
// state.requestResolution = new Set(state.requestResolution)
|
|
||||||
// state.requestSatellite = new Set(state.requestSatellite)
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询遥感元数据
|
// 查询遥感元数据
|
||||||
|
@ -256,18 +296,26 @@ const searchRemoteSensingSourceData = () => {
|
||||||
dataNew = {
|
dataNew = {
|
||||||
disasterId: state.disasterId,
|
disasterId: state.disasterId,
|
||||||
satelliteCodeList: state.satelliteCodeList.join(","),
|
satelliteCodeList: state.satelliteCodeList.join(","),
|
||||||
productResolutionVos: state.listData
|
productResolutionVos: state.listData,
|
||||||
|
status: state.status
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dataNew = {
|
dataNew = {
|
||||||
disasterId: state.disasterId,
|
disasterId: state.disasterId,
|
||||||
productResolutionVos: state.listData
|
productResolutionVos: state.listData,
|
||||||
|
status: state.status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
|
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reviseDownload = (row) => {
|
||||||
|
|
||||||
|
console.log(row, "rowrowrow");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据检索条件检索遥感元数据
|
// 根据检索条件检索遥感元数据
|
||||||
const getDataByCondition = (current, size, dataNew) => {
|
const getDataByCondition = (current, size, dataNew) => {
|
||||||
console.log('传过来的数据:', state.tableData.param.pageNum);
|
console.log('传过来的数据:', state.tableData.param.pageNum);
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<el-config-provider :locale="en">
|
<el-config-provider :locale="en">
|
||||||
<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" style="height: 90vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
<disasterTable @childClick="tableClick"></disasterTable>
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
</div>
|
</div>
|
||||||
</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: 85vh;">
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||||
clearable></el-input>
|
clearable></el-input>
|
||||||
|
|
|
@ -252,6 +252,9 @@ const initLineChart = (xData,data1, data2) => {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: 'initiate',
|
name: 'initiate',
|
||||||
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
|
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
|
||||||
|
nameTextStyle: {
|
||||||
|
padding: [0, 40, 0, 0] // 上右下左
|
||||||
|
},
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
|
@ -318,6 +321,9 @@ const initLineVandDChart = (xData,data1, data2) => {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: 'download',
|
name: 'download',
|
||||||
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
|
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
|
||||||
|
nameTextStyle: {
|
||||||
|
padding: [0, 40, 0, 0] // 上右下左
|
||||||
|
},
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<el-config-provider :locale="en">
|
<el-config-provider :locale="en">
|
||||||
<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" style="height: 90vh;">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
<disasterTable @childClick="tableClick"></disasterTable>
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 85vh;">
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||||
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
|
|
|
@ -86,7 +86,9 @@ const save = async () => {
|
||||||
chiefId: state.selectData[0].id,
|
chiefId: state.selectData[0].id,
|
||||||
chiefName: state.selectData[0].name,
|
chiefName: state.selectData[0].name,
|
||||||
};
|
};
|
||||||
let res = await submit(params);
|
let res = await submit(params).then(da=>{
|
||||||
|
ElMessage.success('Save success');
|
||||||
|
});
|
||||||
emit('callback');
|
emit('callback');
|
||||||
closeDialog();
|
closeDialog();
|
||||||
};
|
};
|
||||||
|
|
|
@ -280,7 +280,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="state.dialogVisible"
|
<el-dialog v-model="state.dialogVisible"
|
||||||
title="Approval"
|
title="Approval"
|
||||||
width="35%">
|
width="45%">
|
||||||
<el-container style="margin-top: -2%;margin-bottom: 2%;">
|
<el-container style="margin-top: -2%;margin-bottom: 2%;">
|
||||||
<el-radio v-model="state.radio"
|
<el-radio v-model="state.radio"
|
||||||
label='1'
|
label='1'
|
||||||
|
@ -338,6 +338,8 @@
|
||||||
<div class="latLon-div"> {{ state.popupLat }} , {{ state.popupLon }} </div>
|
<div class="latLon-div"> {{ state.popupLat }} , {{ state.popupLon }} </div>
|
||||||
|
|
||||||
<el-form :inline="true"
|
<el-form :inline="true"
|
||||||
|
label-width="auto"
|
||||||
|
:label-position="labelPosition"
|
||||||
:model="formInline"
|
:model="formInline"
|
||||||
class="demo-form-inline">
|
class="demo-form-inline">
|
||||||
|
|
||||||
|
@ -348,6 +350,7 @@
|
||||||
value-format="YYYY-MM-DD"
|
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 style="width: 200px; height: 40px;"
|
<el-select style="width: 200px; height: 40px;"
|
||||||
class="form-select"
|
class="form-select"
|
||||||
|
@ -378,7 +381,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="cancelApporval">Cancel</el-button>
|
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||||
<el-button type="danger"
|
<el-button type="danger"
|
||||||
@click="reviews(1)">
|
@click="reviews(1)">
|
||||||
Reject
|
Reject
|
||||||
|
@ -777,6 +780,7 @@ const getValue = (key) => {
|
||||||
float: right;
|
float: right;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.latLon-div {
|
.latLon-div {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 60%;
|
top: 60%;
|
||||||
|
@ -785,4 +789,10 @@ const getValue = (key) => {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-select {
|
||||||
|
.el-input__wrapper {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -65,9 +65,10 @@ let checkPhone = (rule, value, callback) => {
|
||||||
} else {
|
} else {
|
||||||
//验证手机号
|
//验证手机号
|
||||||
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
|
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
|
||||||
|
const regNew = /^\+?[1-9]\d{1,14}$/
|
||||||
//验证区号
|
//验证区号
|
||||||
const phoneReg = /^\d{3}-\d{8}|\d{4}-\d{7}$/
|
const phoneReg = /^\d{3}-\d{8}|\d{4}-\d{7}$/
|
||||||
if (reg.test(value)||phoneReg.test(value)) {
|
if (regNew.test(value)) {
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
return callback(new Error('Please enter the correct contact number'));
|
return callback(new Error('Please enter the correct contact number'));
|
||||||
|
|
|
@ -86,7 +86,7 @@ const batchDelete = () => {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let id = state.multipleSelection.map(item => ({ id: item.id, chiefId: null }))
|
let id = state.multipleSelection.map(item => ({ id: item.disasterId, chiefId: null }))
|
||||||
removeManage(id).then(res => {
|
removeManage(id).then(res => {
|
||||||
getTableData();
|
getTableData();
|
||||||
ElMessage.success('delete successfully');
|
ElMessage.success('delete successfully');
|
||||||
|
@ -101,7 +101,7 @@ const deleteDisaster = (row) => {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let delData = [{ "id": row.id, "cheif": null }]
|
let delData = [{ "id": row.disasterId, "cheif": null }]
|
||||||
removeManage(delData).then(res => {
|
removeManage(delData).then(res => {
|
||||||
getTableData();
|
getTableData();
|
||||||
ElMessage.success('Deleted successfully');
|
ElMessage.success('Deleted successfully');
|
||||||
|
|
Loading…
Reference in New Issue