添加tool contact基础列表。完成callforhelp审核页面
This commit is contained in:
parent
db34dd3980
commit
6a09af20c4
|
@ -1543,6 +1543,14 @@
|
|||
"resolved": "https://registry.npmjs.org/leaflet-draw/-/leaflet-draw-1.0.4.tgz",
|
||||
"integrity": "sha512-rsQ6saQO5ST5Aj6XRFylr5zvarWgzWnrg46zQ1MEOEIHsppdC/8hnN8qMoFvACsPvTioAuysya/TVtog15tyAQ=="
|
||||
},
|
||||
"leaflet-imageoverlay-rotated": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/leaflet-imageoverlay-rotated/-/leaflet-imageoverlay-rotated-0.2.1.tgz",
|
||||
"integrity": "sha512-8MsrIuW/aXI0EjDXgJSJJ67nqVNQJsP/glmND9g6yc6t+zQgdPUbTRHC65jSs/IBwzwyhggnDgDuydalcEX+ew==",
|
||||
"requires": {
|
||||
"leaflet": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"levn": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
import request from '/@/utils/request';
|
||||
import {moduleName} from '/@/utils/request';
|
||||
export const getList = (current, size, param) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/contact/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
current,
|
||||
size,
|
||||
param,
|
||||
},
|
||||
});
|
||||
}
|
||||
export const submit = (row) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/contact/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/contact/remove',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const detail = (id) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/contact/data',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
|
@ -9,10 +9,10 @@ export function getList(params) {
|
|||
});
|
||||
}
|
||||
//review
|
||||
export function review(id) {
|
||||
export function review(data) {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/disasterInfo/review',
|
||||
method: 'post',
|
||||
params: { id },
|
||||
data: data,
|
||||
});
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
import request from '/@/utils/request';
|
||||
import {moduleName} from '/@/utils/request';
|
||||
export const getList = (current, size, param) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/tool/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
current,
|
||||
size,
|
||||
param,
|
||||
},
|
||||
});
|
||||
}
|
||||
export const submit = (row) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/tool/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/tool/remove',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const detail = (id) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/tool/data',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
|
@ -109,6 +109,38 @@ export const dynamicRoutes = [
|
|||
zh: '数据上传管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/responseManagement/tool',
|
||||
name: 'tool-management',
|
||||
component: () => import('/@/views/responseManagement/tool/index.vue'),
|
||||
meta: {
|
||||
title: 'Tool Management',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-icon-',
|
||||
zh: 'tool管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/responseManagement/contact',
|
||||
name: 'contact-management',
|
||||
component: () => import('/@/views/responseManagement/contact/index.vue'),
|
||||
meta: {
|
||||
title: 'Contact Management',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-icon-',
|
||||
zh: 'tool管理',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
<template>
|
||||
<div class="system-add-dept-container">
|
||||
<el-dialog :title="state.title" v-model="state.isShowDialog" width="769px">
|
||||
<el-form :model="state.ruleForm" size="default" label-width="90px" ref="formRef" :rules="rules">
|
||||
<el-row :gutter="35">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="用户姓名" prop="userName">
|
||||
<el-input v-model="state.ruleForm.userName" placeholder="请输入用户姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="电子邮件" prop="email">
|
||||
<el-input v-model="state.ruleForm.email" placeholder="请输入电子邮件" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="组织" prop="organization">
|
||||
<el-input v-model="state.ruleForm.organization" placeholder="请输入组织" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="意见建议" prop="message">
|
||||
<el-input v-model="state.ruleForm.message" placeholder="请输入意见建议" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="数据自增列" prop="id">
|
||||
<el-input v-model="state.ruleForm.id" placeholder="请输入数据自增列" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit(formRef)" size="default">{{state.title}}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { submit } from '/@/api/contact/index';
|
||||
import { ref,reactive,onMounted,nextTick } from 'vue';
|
||||
const formRef =ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
ruleForm: {
|
||||
},
|
||||
deptData: [], // 部门数据
|
||||
deptCategory:[],
|
||||
title: '新增',
|
||||
});
|
||||
const rules = reactive({
|
||||
userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }],
|
||||
email: [{ required: true, message: '请输入电子邮件', trigger: 'blur' }],
|
||||
organization: [{ required: true, message: '请输入组织', trigger: 'blur' }],
|
||||
message: [{ required: true, message: '请输入意见建议', trigger: 'blur' }],
|
||||
id: [{ required: true, message: '请输入数据自增列', trigger: 'blur' }],
|
||||
})
|
||||
// 打开弹窗
|
||||
const openDialog = (row) => {
|
||||
if(row) {
|
||||
state.title = '编辑';
|
||||
state.ruleForm = row;
|
||||
} else {
|
||||
state.title = '新增';
|
||||
state.ruleForm = {};
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
formRef.value.resetFields();
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
const emit = defineEmits(['callback']);
|
||||
// 新增
|
||||
const onSubmit = async (el) => {
|
||||
await el.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
submit(state.ruleForm).then((res) => {
|
||||
emit('callback');
|
||||
ElMessage.success('操作成功');
|
||||
closeDialog();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,140 @@
|
|||
<template>
|
||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||
<el-row :gutter="10" >
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-row>
|
||||
<span class="label-span">名称:</span><el-input size="default" placeholder="请输入名称" style="max-width: 180px" v-model="state.query.name" clearable> </el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="initTableData" >
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px; margin-left: -10px;">
|
||||
<el-button size="default" type="success" class="ml10" @click="onOpenAdd" >
|
||||
<el-icon>
|
||||
<ele-FolderAdd />
|
||||
</el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="userName" label="用户姓名" > </el-table-column>
|
||||
<el-table-column prop="email" label="电子邮件" > </el-table-column>
|
||||
<el-table-column prop="organization" label="组织" > </el-table-column>
|
||||
<el-table-column prop="message" label="意见建议" > </el-table-column>
|
||||
<el-table-column prop="id" label="数据自增列" > </el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<Add ref = 'AddRef' @callback="initTableData"></Add>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="contact">
|
||||
import { getList ,remove} from '/@/api/contact/index'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { ref,reactive,onMounted,nextTick } from 'vue';
|
||||
import Add from '/@/views/responseManagement/contact/component/add.vue';
|
||||
const AddRef = ref();
|
||||
const state = reactive({
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param:{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
//请求条件
|
||||
query: {
|
||||
},
|
||||
selected: [],
|
||||
//字典数据
|
||||
});
|
||||
// 初始化表格数据
|
||||
const initTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getList(state.tableData.param.pageNum,state.tableData.param.pageSize,state.query).then(res=>{
|
||||
state.tableData = {
|
||||
data: res.records,
|
||||
total: res.total,
|
||||
loading :false,
|
||||
param: {
|
||||
pageNum: res.current,
|
||||
pageSize: res.size,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
};
|
||||
// 打开新增
|
||||
const onOpenAdd = () => {
|
||||
AddRef.value.openDialog();
|
||||
};
|
||||
// 打开修改用户弹窗
|
||||
const onOpenEdit = (row) => {
|
||||
AddRef.value.openDialog(row);
|
||||
};
|
||||
// 删除用户
|
||||
const onRowDel = (row) => {
|
||||
ElMessageBox.confirm(`此操作将永久此参数:“${row.name}”,是否继续?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
remove(row.id).then(res=>{
|
||||
ElMessage.success('删除成功');
|
||||
initTableData();
|
||||
})
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
initTableData();
|
||||
};
|
||||
// 多选
|
||||
const handleSelectionChange = (val) => {
|
||||
state.selected = val;
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
initTableData();
|
||||
};
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
initTableData();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,153 @@
|
|||
<template>
|
||||
<div class="system-add-dept-container">
|
||||
<el-dialog :title="state.title" v-model="state.isShowDialog" width="769px">
|
||||
<el-form :model="state.ruleForm" size="default" label-width="90px" ref="formRef" :rules="rules">
|
||||
<el-row :gutter="35">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="数据自增列" prop="id">
|
||||
<el-input v-model="state.ruleForm.id" placeholder="请输入数据自增列" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="工具名称" prop="toolName">
|
||||
<el-input v-model="state.ruleForm.toolName" placeholder="请输入工具名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="数据标签" prop="label">
|
||||
<el-input v-model="state.ruleForm.label" placeholder="请输入数据标签" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="导论" prop="introduction">
|
||||
<el-input v-model="state.ruleForm.introduction" placeholder="请输入导论" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="工具链接" prop="link">
|
||||
<el-input v-model="state.ruleForm.link" placeholder="请输入工具链接" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="对模型的进一步描述" prop="detail">
|
||||
<el-input v-model="state.ruleForm.detail" placeholder="请输入对模型的进一步描述" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="数据条目创建时间" prop="createTime">
|
||||
<el-input v-model="state.ruleForm.createTime" placeholder="请输入数据条目创建时间" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="用户上传者" prop="uploadId">
|
||||
<el-input v-model="state.ruleForm.uploadId" placeholder="请输入用户上传者" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="管理者/审核者" prop="managerId">
|
||||
<el-input v-model="state.ruleForm.managerId" placeholder="请输入管理者/审核者" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="审核时间" prop="reviewTime">
|
||||
<el-input v-model="state.ruleForm.reviewTime" placeholder="请输入审核时间" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="分类" prop="type">
|
||||
<el-input v-model="state.ruleForm.type" placeholder="请输入分类" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="是否由志愿者上传(0-不是;1-是)" prop="voluntaryFlag">
|
||||
<el-input v-model="state.ruleForm.voluntaryFlag" placeholder="请输入是否由志愿者上传(0-不是;1-是)" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="上传人" prop="uploader">
|
||||
<el-input v-model="state.ruleForm.uploader" placeholder="请输入上传人" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="用户名展示" prop="showName">
|
||||
<el-input v-model="state.ruleForm.showName" placeholder="请输入用户名展示" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit(formRef)" size="default">{{state.title}}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { submit } from '/@/api/tool/index';
|
||||
import { ref, reactive } from 'vue';
|
||||
const formRef =ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
ruleForm: {
|
||||
},
|
||||
deptData: [], // 部门数据
|
||||
deptCategory:[],
|
||||
title: '新增',
|
||||
});
|
||||
const rules = reactive({
|
||||
id: [{ required: true, message: '请输入数据自增列', trigger: 'blur' }],
|
||||
toolName: [{ required: true, message: '请输入工具名称', trigger: 'blur' }],
|
||||
label: [{ required: true, message: '请输入数据标签', trigger: 'blur' }],
|
||||
introduction: [{ required: true, message: '请输入导论', trigger: 'blur' }],
|
||||
link: [{ required: true, message: '请输入工具链接', trigger: 'blur' }],
|
||||
detail: [{ required: true, message: '请输入对模型的进一步描述', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请输入数据条目创建时间', trigger: 'blur' }],
|
||||
uploadId: [{ required: true, message: '请输入用户上传者', trigger: 'blur' }],
|
||||
managerId: [{ required: true, message: '请输入管理者/审核者', trigger: 'blur' }],
|
||||
reviewTime: [{ required: true, message: '请输入审核时间', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请输入分类', trigger: 'blur' }],
|
||||
voluntaryFlag: [{ required: true, message: '请输入是否由志愿者上传(0-不是;1-是)', trigger: 'blur' }],
|
||||
uploader: [{ required: true, message: '请输入上传人', trigger: 'blur' }],
|
||||
showName: [{ required: true, message: '请输入用户名展示', trigger: 'blur' }],
|
||||
})
|
||||
// 打开弹窗
|
||||
const openDialog = (row) => {
|
||||
if(row) {
|
||||
state.title = '编辑';
|
||||
state.ruleForm = row;
|
||||
} else {
|
||||
state.title = '新增';
|
||||
state.ruleForm = {};
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
formRef.value.resetFields();
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
const emit = defineEmits(['callback']);
|
||||
// 新增
|
||||
const onSubmit = async (el) => {
|
||||
await el.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
submit(state.ruleForm).then((res) => {
|
||||
emit('callback');
|
||||
ElMessage.success('操作成功');
|
||||
closeDialog();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,142 @@
|
|||
<template>
|
||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||
<el-row :gutter="10" >
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-row>
|
||||
<span class="label-span">名称:</span><el-input size="default" placeholder="请输入名称" style="max-width: 180px" v-model="state.query.name" clearable> </el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="initTableData" >
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px; margin-left: -10px;">
|
||||
<el-button size="default" type="success" class="ml10" @click="onOpenAdd" >
|
||||
<el-icon>
|
||||
<ele-FolderAdd />
|
||||
</el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading" @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="toolName" label="Tool Name" >
|
||||
<template #default="scope">
|
||||
<a :href="scope.row.link" target="_blank">{{scope.row.toolName}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="label" label="label" > </el-table-column>
|
||||
<el-table-column prop="introduction" label="introduction" > </el-table-column>
|
||||
<el-table-column prop="showName" label="Show Name" ></el-table-column>
|
||||
<el-table-column label="Operate" width="100">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<Add ref = 'AddRef' @callback="initTableData"></Add>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="systemUser">
|
||||
import { getList ,remove} from '/@/api/tool/index'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { reactive, ref,onMounted,nextTick } from 'vue';
|
||||
import Add from '/@/views/responseManagement/tool/component/add.vue';
|
||||
const AddRef = ref();
|
||||
const state = reactive({
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param:{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
//请求条件
|
||||
query: {
|
||||
},
|
||||
selected: [],
|
||||
//字典数据
|
||||
});
|
||||
// 初始化表格数据
|
||||
const initTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getList(state.tableData.param.pageNum,state.tableData.param.pageSize,state.query).then(res=>{
|
||||
state.tableData = {
|
||||
data: res.records,
|
||||
total: res.total,
|
||||
loading :false,
|
||||
param: {
|
||||
pageNum: res.current,
|
||||
pageSize: res.size,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
};
|
||||
// 打开新增
|
||||
const onOpenAdd = () => {
|
||||
AddRef.value.openDialog();
|
||||
};
|
||||
// 打开修改用户弹窗
|
||||
const onOpenEdit = (row) => {
|
||||
AddRef.value.openDialog(row);
|
||||
};
|
||||
// 删除用户
|
||||
const onRowDel = (row) => {
|
||||
ElMessageBox.confirm(`此操作将永久此参数:“${row.name}”,是否继续?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
remove(row.id).then(res=>{
|
||||
ElMessage.success('删除成功');
|
||||
initTableData();
|
||||
})
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
initTableData();
|
||||
};
|
||||
// 多选
|
||||
const handleSelectionChange = (val) => {
|
||||
state.selected = val;
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
initTableData();
|
||||
};
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
initTableData();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -17,11 +17,17 @@
|
|||
<!-- <el-table-column prop="affectedCountry" label="Affected country" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- 格式化去除时分秒 -->
|
||||
{{ dateFormat(scope.row.disasterTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="scope.row.respondStatus===0">Not reviewed</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.respondStatus===1">Failed</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
|
@ -74,7 +80,12 @@
|
|||
<!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- 格式化去除时分秒 -->
|
||||
{{ dateFormat(scope.row.disasterTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
|
||||
|
@ -115,16 +126,28 @@
|
|||
</div>
|
||||
<el-dialog
|
||||
v-model="state.dialogVisible"
|
||||
title="Tips"
|
||||
title="Review"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<Map style="height:400px ; width:600px"></Map>
|
||||
<Map style="height:350px ; width:100% ;margin-bottom: 10px;" ref="map"></Map>
|
||||
<el-form-item label ="Disaster Time">
|
||||
<el-date-picker
|
||||
v-model="state.edit.disasterTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="Select date and time"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">
|
||||
Confirm
|
||||
<el-button type="danger" @click="reviews(1)">
|
||||
Not Review
|
||||
</el-button>
|
||||
<el-button type="primary" @click="reviews(2)">
|
||||
Review
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
@ -133,21 +156,24 @@
|
|||
</template>
|
||||
|
||||
<script setup name="userResponse">
|
||||
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
||||
import { reactive, onMounted, ref,nextTick } from 'vue';
|
||||
import { ElMessageBox, ElMessage} from 'element-plus';
|
||||
import {getList ,review } from '/@/api/disasterInfo/index';
|
||||
import { getDictionary } from '/@/api/system/dictbiz';
|
||||
//引入地图
|
||||
import Map from '/@/components/Map.vue';
|
||||
import { useDateFormat } from '@vueuse/shared';
|
||||
|
||||
|
||||
const map = ref(null);
|
||||
const activeName = ref('first');
|
||||
|
||||
const handleClick = (tab ,event) => {
|
||||
state.selectName=tab.props.name;
|
||||
getTableData();
|
||||
};
|
||||
|
||||
const dateFormat = (date) =>{
|
||||
return useDateFormat(date, 'YYYY-MM-DD').value;
|
||||
}
|
||||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
|
@ -165,6 +191,7 @@ const state = reactive({
|
|||
},
|
||||
disasterTypeList: [],
|
||||
selectName: 'first',
|
||||
edit:{} ,
|
||||
});
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
|
@ -187,32 +214,35 @@ const onHandleSizeChange = (val) => {
|
|||
getTableData();
|
||||
};
|
||||
const onOpenEditRole = (type, row) => {
|
||||
//使用英语提示用户是否进行审核
|
||||
// ElMessageBox.confirm('Are you sure you want to review this data ?', 'Tips', {
|
||||
// confirmButtonText: 'OK',
|
||||
// cancelButtonText: 'Cancel',
|
||||
// type: 'warning',
|
||||
// })
|
||||
// .then(() => {
|
||||
// //审核通过
|
||||
// review(row.id,state.tableData.loading).then(() => {
|
||||
// ElMessage({
|
||||
// type: 'success',
|
||||
// message: 'Review success!',
|
||||
// });
|
||||
// getTableData();
|
||||
// });
|
||||
// })
|
||||
// .catch(() => {
|
||||
// //审核不通过
|
||||
// ElMessage({
|
||||
// type: 'info',
|
||||
// message: 'Review failed!',
|
||||
// });
|
||||
// });
|
||||
//深拷贝
|
||||
state.edit = JSON.parse(JSON.stringify(row));
|
||||
nextTick(() => {
|
||||
console.log(map.value);
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
//TODO
|
||||
map.mapOperations.wktParseToMap(row.geometry)
|
||||
});
|
||||
state.dialogVisible = true;
|
||||
|
||||
};
|
||||
const reviews = (index) =>{
|
||||
//将修改后的地图位置赋值到state.edit.geometry
|
||||
//TODO 修改地图赋值
|
||||
//state.edit.geometry = map.mapOperations.getWkt();
|
||||
|
||||
//判断index的值来判断是审核通过还是不通过
|
||||
if(index === 1){
|
||||
state.edit.respondStatus = 1;
|
||||
}else{
|
||||
state.edit.respondStatus = 2;
|
||||
}
|
||||
//时间格式化
|
||||
state.edit.disasterTime = useDateFormat(state.edit.disasterTime, 'YYYY-MM-DD').value+" 00:00:00";
|
||||
review(state.edit).then((res) => {
|
||||
ElMessage.success('操作成功');
|
||||
state.dialogVisible = false;
|
||||
getTableData();
|
||||
});
|
||||
}
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
console.log(val);
|
||||
|
|
Loading…
Reference in New Issue