提交callfor

This commit is contained in:
yyhouc 2023-04-12 09:06:14 +08:00
parent 9a70fb21dd
commit 293a87ea5f
5 changed files with 172 additions and 192 deletions

View File

@ -0,0 +1,18 @@
import request from '/@/utils/request';
import {moduleName} from '/@/utils/request';
export function getList(params) {
return request({
url: '/api/'+moduleName+'/ui/disasterInfo/list',
method: 'get',
params,
});
}
//review
export function review(id) {
return request({
url: '/api/'+moduleName+'/ui/disasterInfo/review',
method: 'get',
params: { id },
});
}

View File

@ -56,7 +56,7 @@ export const dynamicRoutes = [
isKeepAlive: true, isKeepAlive: true,
isAffix: false, isAffix: false,
isIframe: false, isIframe: false,
roles: ['admin'], roles: ['admin', 'chief'],
// icon: 'iconfont icon-xitongshezhi', // icon: 'iconfont icon-xitongshezhi',
zh: '响应管理', zh: '响应管理',
}, },
@ -72,7 +72,7 @@ export const dynamicRoutes = [
isKeepAlive: true, isKeepAlive: true,
isAffix: false, isAffix: false,
isIframe: false, isIframe: false,
roles: ['admin'], roles: ['admin', 'chief'],
// icon: 'iconfont icon-caidan', // icon: 'iconfont icon-caidan',
zh: '用户响应管理', zh: '用户响应管理',
}, },
@ -88,7 +88,7 @@ export const dynamicRoutes = [
isKeepAlive: true, isKeepAlive: true,
isAffix: false, isAffix: false,
isIframe: false, isIframe: false,
roles: ['admin'], roles: ['admin', 'chief'],
// icon: 'ele-ColdDrink', // icon: 'ele-ColdDrink',
zh: '管理员管理', zh: '管理员管理',
}, },

View File

@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import qs from 'qs'; import qs from 'qs';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
export const moduleName = 'zqq-biz-vordm'; export const moduleName = 'yyhouc-biz-vordm';
// 配置新建一个 axios 实例 // 配置新建一个 axios 实例
const service = axios.create({ const service = axios.create({

View File

@ -1,51 +1,36 @@
<template> <template>
<div class="system-role-container layout-padding"> <div class="system-role-container layout-padding">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-tabs v-model="activeName" <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
class="demo-tabs" <el-tab-pane label="Not reviewed" name="first">
@tab-click="handleClick" <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
style="margin-left: 20px"> <el-table-column type="index" label="ID" width="50" />
<el-tab-pane label="Not reviewed" <el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
name="first"> <el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
<el-table :data="state.tableData.data" <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
v-loading="state.tableData.loading" <!-- 在disasterType中获取dictKey 对应的dictValue -->
style="width: 100%"> <template #default="scope">
<el-table-column type="index" <el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
label="ID" </template>
width="50" /> </el-table-column>
<el-table-column prop="userName" <el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
label="User name" <!-- <el-table-column prop="affectedCountry" label="Affected country" show-overflow-tooltip></el-table-column> -->
show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
<el-table-column prop="Organization" <el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
label="Organization" <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterType" <el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
label="Disaster type" <template #default="scope">
show-overflow-tooltip></el-table-column> <el-tag type="info" v-if="scope.row.respondStatus===0">Not reviewed</el-tag>
<el-table-column prop="disasterKeyword" </template>
label="Disaster keyword" </el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<el-table-column prop="affectedCountry" <template #default="scope">
label="Affected country" <el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)"
show-overflow-tooltip></el-table-column> >Review</el-button
<el-table-column prop="Longitude" >
label="Longitude" </template>
show-overflow-tooltip></el-table-column> </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="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="responseStatus"
label="Response status"
show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> --> <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> -->
@ -66,65 +51,39 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
@current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
class="mt15" v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
: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"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Reviewed" <el-tab-pane label="Reviewed" name="second">
name="second"> <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table :data="state.tableData.data" <el-table-column type="index" label="ID" width="50" />
v-loading="state.tableData.loading" <el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
style="width: 100%"> <!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
<el-table-column type="index" <el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
label="ID" <el-table-column prop="email" label="Email" show-overflow-tooltip></el-table-column>
width="50" /> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
<el-table-column prop="userName" <!-- 在disasterType中获取dictKey 对应的dictValue -->
label="User name" <template #default="scope">
show-overflow-tooltip></el-table-column> <el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
<el-table-column prop="Administrator" </template>
label="Administrator" </el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
<el-table-column prop="Email" <!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> -->
label="Email" <!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="Organization" <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
label="Organization" <!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="Disaster type" <el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
label="Disaster type"
show-overflow-tooltip></el-table-column> <template #default="scope">
<el-table-column prop="Disaster keyword" <el-tag type="info" v-if="scope.row.respondStatus!==0">reviewed</el-tag>
label="Disaster keyword" </template>
show-overflow-tooltip></el-table-column>
<el-table-column prop="Affected country" </el-table-column>
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="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="responseStatus"
label="Response status"
show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> --> <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> -->
@ -145,38 +104,30 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
@current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
class="mt15" v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
: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"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<RoleDialog ref="roleDialogRef" <RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
@refresh="getTableData()" />
</div> </div>
</template> </template>
<script lang="ts" setup name="systemRole"> <script setup name="userResponse">
import type { TabsPaneContext } from 'element-plus'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage} from 'element-plus';
import {getList ,review } from '/@/api/disasterInfo/index';
import { getDictionary } from '/@/api/system/dictbiz';
const activeName = ref('first'); const activeName = ref('first');
const handleClick = (tab: TabsPaneContext, event: Event) => { const handleClick = (tab ,event) => {
console.log(tab, event); console.log(activeName,tab, event);
// getTableData();
}; };
//
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
// //
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue')); const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
@ -189,69 +140,78 @@ const state = reactive({
loading: false, loading: false,
param: { param: {
search: '', search: '',
pageNum: 1, current: 1,
pageSize: 10, size: 10,
respondStatus:0,
}, },
}, },
disasterTypeList: [],
}); });
// //
const getTableData = () => { const getTableData = () => {
state.tableData.loading = true; state.tableData.loading = true;
const data = []; //activeNametab
for (let i = 0; i < 10; i++) { if(activeName.value === 'first'){
data.push({ state.tableData.param.respondStatus = 0;
roleName: i === 0 ? '超级管理员' : '主要管理员', }else{
roleSign: i === 0 ? 'admin' : 'chief', state.tableData.param.respondStatus = 1;
describe: `测试角色${i + 1}`,
sort: i,
status: true,
createTime: new Date().toLocaleString(),
});
} }
state.tableData.data = data; getList(state.tableData.param).then((res) => {
state.tableData.total = state.tableData.data.length; state.tableData.data = res.records;
setTimeout(() => { state.tableData.total = res.total;
state.tableData.loading = false; state.tableData.loading = false;
}, 500); });
}; };
//
// const onOpenAddRole = (type) => {
// roleDialogRef.value.openDialog(type);
// };
//
// const onOpenEditRole = (type, row) => {
// roleDialogRef.value.openDialog(type, row);
// };
//
// const onRowDel = (row) => {
// ElMessageBox.confirm(`${row.roleName}?`, '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// })
// .then(() => {
// getTableData();
// ElMessage.success('');
// })
// .catch(() => {});
// };
//
const onHandleSizeChange = (val) => { const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val; state.tableData.param.size = val;
getTableData(); 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).then(() => {
ElMessage({
type: 'success',
message: 'Review success!',
});
getTableData();
});
})
.catch(() => {
//
ElMessage({
type: 'info',
message: 'Review failed!',
});
});
};
// //
const onHandleCurrentChange = (val) => { const onHandleCurrentChange = (val) => {
console.log(val);
state.tableData.param.pageNum = val; state.tableData.param.pageNum = val;
getTableData(); getTableData();
}; };
// //
onMounted(() => { onMounted(() => {
getTableData(); getTableData();
getDictionary({code:'disaster'}).then((res) => {
state.disasterTypeList = res;
});
}); });
const getValue = (key) => {
//state.disasterTypeLis value
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
};
</script> </script>
<style> <style>
.demo-tabs > .el-tabs__content { .demo-tabs>.el-tabs__content {
padding: 0px; padding: 0px;
color: #6b778c; color: #6b778c;
font-size: 32px; font-size: 32px;
@ -261,6 +221,7 @@ onMounted(() => {
.system-role-container { .system-role-container {
.system-role-padding { .system-role-padding {
padding: 15px; padding: 15px;
.el-table { .el-table {
flex: 1; flex: 1;
} }

View File

@ -134,6 +134,7 @@ const onSubmit = () => {
}); });
//statustrue01 //statustrue01
state.ruleForm.isSealed = state.ruleForm.status ? 0 : 1; state.ruleForm.isSealed = state.ruleForm.status ? 0 : 1;
state.ruleForm.CODE = state.ruleForm.dictKey;
update(state.ruleForm).then((res) => { update(state.ruleForm).then((res) => {
closeDialog(); closeDialog();
emit('refresh'); emit('refresh');