提交 2c2309d8 authored 作者: 刘旭's avatar 刘旭

修改日志同步功能

上级 44a0455a
...@@ -23,7 +23,7 @@ const avatar = store.state.user.userAvatar ...@@ -23,7 +23,7 @@ const avatar = store.state.user.userAvatar
//退出登录 //退出登录
const loginOut = async () => { const loginOut = async () => {
window.location.href = "/login"; window.location.href = "/#/login";
cleanSession(); cleanSession();
// let confirm = await global.$myconfirm('确定退出登录吗?') // let confirm = await global.$myconfirm('确定退出登录吗?')
// if (confirm) { // if (confirm) {
......
import { List } from "echarts";
import { request } from "../../config"; import { request } from "../../config";
// 查询日志 // 查询日志
...@@ -17,11 +18,11 @@ export function getQueryxyunLog( ...@@ -17,11 +18,11 @@ export function getQueryxyunLog(
}); });
} }
export function getSynchroni(id: number) { export function getSynchroni(idList: any) {
return request({ return request({
url: '/api/abnormal/synchronization', url: '/api/abnormal/synchronization',
method: 'get', method: 'post',
params: { id } data: { idList }
}) })
} }
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
</el-space> </el-space>
</el-form> </el-form>
</div> </div>
<el-span>
<el-button type="primary" @click="hanleSynchronis">同步</el-button>
</el-span>
</el-space> </el-space>
<el-divider /> <el-divider />
...@@ -29,8 +32,8 @@ ...@@ -29,8 +32,8 @@
<!-- 表格 --> <!-- 表格 -->
<el-table v-loading="loading" :data="tableList" border stripe style="width: 100%" <el-table v-loading="loading" :data="tableList" border stripe style="width: 100%"
@selection-change="handleSelectionChange" @filter-change="filterChange"> @selection-change="handleSelectionChange" @filter-change="filterChange">
<!-- <el-table-column type="selection" width="55" /> --> <el-table-column type="selection" width="55" />
<el-table-column type="index" :index="indexMethod(1)" /> <!-- <el-table-column type="index" :index="indexMethod(1)" /> -->
<el-table-column prop="flag" label="同步状态" :filters="[ <el-table-column prop="flag" label="同步状态" :filters="[
{ text: '同步成功', value: '1' }, { text: '同步成功', value: '1' },
{ text: '同步失败', value: '0' }, { text: '同步失败', value: '0' },
...@@ -46,7 +49,7 @@ ...@@ -46,7 +49,7 @@
<el-table-column prop="createTime" label="创建时间" align="center" /> <el-table-column prop="createTime" label="创建时间" align="center" />
<el-table-column label="操作" align="center" width="155px"> <el-table-column label="操作" align="center" width="155px">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" size="small" @click="hanleSynchroni(scope.row.id)">同步</el-button> <!-- <el-button link type="primary" size="small" @click="hanleSynchroni(scope.row.id)">同步</el-button> -->
<el-button link type="primary" size="small" @click="handleDetails(scope.row)">详情</el-button> <el-button link type="primary" size="small" @click="handleDetails(scope.row)">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -127,7 +130,7 @@ const indexMethod = (index: number) => { ...@@ -127,7 +130,7 @@ const indexMethod = (index: number) => {
}; };
const visible = ref(false); const visible = ref(false);
// 多选框 // 多选框
const multipleSelection = ref<List[]>([]); const multipleSelection = ref([]);
// 分页 // 分页
const disabled = ref(false); const disabled = ref(false);
const filters = ref(); const filters = ref();
...@@ -135,9 +138,12 @@ const { tableList, total, loading, pageSize, currentPage } = ...@@ -135,9 +138,12 @@ const { tableList, total, loading, pageSize, currentPage } =
useXyunLogTableList(); useXyunLogTableList();
// 同步筛选 // 同步筛选
const filterChange = (value: any) => { const filterChange = (value: any) => {
let i = "";
Object.values(value).forEach((e: any) => {
i = e[0];
});
nextTick(() => { nextTick(() => {
const flag = value["el-table_1_column_2"][0]; filters.value = i;
filters.value = flag;
page( page(
currentPage.value, currentPage.value,
pageSize.value, pageSize.value,
...@@ -154,20 +160,37 @@ const dateChange = (value: any) => { ...@@ -154,20 +160,37 @@ const dateChange = (value: any) => {
filterForm.value.dateTo = moment(value[1]).format("YYYY-MM-DD HH:mm:ss"); filterForm.value.dateTo = moment(value[1]).format("YYYY-MM-DD HH:mm:ss");
}; };
// 选择多选框的数据 // 选择多选框的数据
const handleSelectionChange = (val: List[]) => { const handleSelectionChange = (val: []) => multipleSelection.value = val;
multipleSelection.value = val;
};
// 详情 // 详情
const handleDetails = (scope: any) => { const handleDetails = (scope: any) => {
console.log(filterForm.value);
detailForm.value = scope; detailForm.value = scope;
visible.value = true; visible.value = true;
}; };
// 同步 // 同步
const hanleSynchroni = (id: number) => { // const hanleSynchroni = (id: number) => {
getSynchroni(id).then((res: any) => { // getSynchroni(id).then((res: any) => {
// if (res.code == 200) page(
// currentPage.value,
// pageSize.value,
// filterForm.value.dateFrom,
// filterForm.value.dateTo,
// filterForm.value.name,
// filterForm.value.content,
// filters.value
// );
// })
// }
// 批量同步
const hanleSynchronis = () => {
if (multipleSelection.value.length !== 0) {
let listId = []
for (let s in multipleSelection.value) {
listId.push(multipleSelection.value[s]?.id)
}
getSynchroni(listId).then((res: any) => {
if (res.code == 200) page( if (res.code == 200) page(
currentPage.value, currentPage.value,
pageSize.value, pageSize.value,
...@@ -178,6 +201,8 @@ const hanleSynchroni = (id: number) => { ...@@ -178,6 +201,8 @@ const hanleSynchroni = (id: number) => {
filters.value filters.value
); );
}) })
}
} }
// 对话框取消按钮 // 对话框取消按钮
const cancelVisible1 = () => { const cancelVisible1 = () => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论