hgwms-2098 fix alert修改
parent
e0d6edfd58
commit
67d68d29a8
|
|
@ -1,13 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<a-list-layout
|
<a-list-layout ref="pageRef">
|
||||||
ref="pageRef"
|
|
||||||
>
|
|
||||||
<template #search>
|
<template #search>
|
||||||
<!-- 查询参数 -->
|
<!-- 查询参数 -->
|
||||||
<pro-query
|
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
||||||
:searchParam="searchParam"
|
|
||||||
@on-search ="search"
|
|
||||||
></pro-query>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<pro-table
|
<pro-table
|
||||||
|
|
@ -17,47 +12,141 @@
|
||||||
:param="state.param"
|
:param="state.param"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:operate="operate"
|
:operate="operate"
|
||||||
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
|
:row-selection="{
|
||||||
|
selectedRowKeys: state.selectedRowKeys,
|
||||||
|
onChange: onSelectChange,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<!-- 继承至 a-table 的默认插槽 -->
|
<!-- 继承至 a-table 的默认插槽 -->
|
||||||
</pro-table>
|
</pro-table>
|
||||||
</a-list-layout>
|
</a-list-layout>
|
||||||
|
<a-modal v-model:open="visible" :footer="null" title="查看详情">{{
|
||||||
|
text
|
||||||
|
}}</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { message , Modal as modal} from '@hwork/ant-design-vue';
|
import { message, Modal as modal } from "@hwork/ant-design-vue";
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||||
import { page, clean } from "@/api/module/log";
|
import { page, clean } from "@/api/module/log";
|
||||||
import { reactive, createVNode } from 'vue';
|
import { reactive, createVNode, ref } from "vue";
|
||||||
|
|
||||||
const cleanKey = "clean";
|
const cleanKey = "clean";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const text = ref("");
|
||||||
|
const visible = ref(false);
|
||||||
/// 文本
|
/// 文本
|
||||||
const converFormat = [{label:"成功", value:true},{label:"失败", value:false}];
|
const converFormat = [
|
||||||
|
{ label: "成功", value: true },
|
||||||
|
{ label: "失败", value: false },
|
||||||
|
];
|
||||||
|
|
||||||
/// 列配置
|
/// 列配置
|
||||||
const columns = [
|
const columns = [
|
||||||
{ dataIndex: "title", key: "title", title: "标题" ,width:120,showSearch: true},
|
{
|
||||||
{ dataIndex: "describe", key: "describe", title: "描述" ,width:120,showSearch: true},
|
dataIndex: "title",
|
||||||
{ dataIndex: "action", key: "action", title: "动作",width:100},
|
key: "title",
|
||||||
{ dataIndex: "type", key: "type", title: "方式",width:120},
|
title: "标题",
|
||||||
{ dataIndex: "browser", key: "browser", title: "浏览器" ,width:120,ellipsis: true},
|
width: 120,
|
||||||
{ dataIndex: "system", key: "system", title: "系统" ,width:120,ellipsis: true},
|
showSearch: true,
|
||||||
{ dataIndex: "address", key: "address", title: "操作地" ,width:120,showSearch: true,ellipsis: true},
|
},
|
||||||
{ dataIndex: "createBy", key: "createBy", title: "创建人" ,width:120,ellipsis: true,showSearch: true},
|
{
|
||||||
{ dataIndex: "createUsername", key: "createUsername", title: "创建人" ,width:120,ellipsis: true,showSearch: true},
|
dataIndex: "describe",
|
||||||
{ dataIndex: "createNickname", key: "createNickname", title: "创建人昵称" ,width:120,ellipsis: true},
|
key: "describe",
|
||||||
{ dataIndex: "createTime", key: "createTime", title: "操作时间" ,width:180,ellipsis: true},
|
title: "描述",
|
||||||
{ dataIndex: "state", key: "state", title: "状态", conver: converFormat ,width:120,ellipsis: true},
|
width: 120,
|
||||||
{ dataIndex: "params", key: "params", title: "参数",showSearch: true ,width:300,ellipsis: true},
|
showSearch: true,
|
||||||
{ dataIndex: "result", key: "result", title: "返回结果", showSearch: true ,width:300,ellipsis: true},
|
},
|
||||||
|
{ dataIndex: "action", key: "action", title: "动作", width: 100 },
|
||||||
|
{ dataIndex: "type", key: "type", title: "方式", width: 120 },
|
||||||
|
{
|
||||||
|
dataIndex: "browser",
|
||||||
|
key: "browser",
|
||||||
|
title: "浏览器",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "system",
|
||||||
|
key: "system",
|
||||||
|
title: "系统",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "address",
|
||||||
|
key: "address",
|
||||||
|
title: "操作地",
|
||||||
|
width: 120,
|
||||||
|
showSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createBy",
|
||||||
|
key: "createBy",
|
||||||
|
title: "创建人",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createUsername",
|
||||||
|
key: "createUsername",
|
||||||
|
title: "创建人",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createNickname",
|
||||||
|
key: "createNickname",
|
||||||
|
title: "创建人昵称",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createTime",
|
||||||
|
key: "createTime",
|
||||||
|
title: "操作时间",
|
||||||
|
width: 180,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "state",
|
||||||
|
key: "state",
|
||||||
|
title: "状态",
|
||||||
|
conver: converFormat,
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "params",
|
||||||
|
key: "params",
|
||||||
|
title: "参数",
|
||||||
|
showSearch: true,
|
||||||
|
width: 300,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "result",
|
||||||
|
key: "result",
|
||||||
|
title: "返回结果",
|
||||||
|
showSearch: true,
|
||||||
|
width: 300,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const operate = [
|
const operate = [
|
||||||
{ label: "查看", event: function (record) { alert("查看详情:" + JSON.stringify(record))}},
|
{
|
||||||
|
label: "查看",
|
||||||
|
event: function (record) {
|
||||||
|
text.value = JSON.stringify(record);
|
||||||
|
visible.value = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/// 数据来源 [模拟]
|
/// 数据来源 [模拟]
|
||||||
|
|
@ -72,59 +161,76 @@ export default {
|
||||||
/// 删除配置
|
/// 删除配置
|
||||||
const cleanMethod = (record) => {
|
const cleanMethod = (record) => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: '您是否确定要清空日志?',
|
title: "您是否确定要清空日志?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({ content: "提交中...", key: cleanKey });
|
message.loading({ content: "提交中...", key: cleanKey });
|
||||||
clean({"isAuth":true}).then((response) => {
|
clean({ isAuth: true }).then((response) => {
|
||||||
if(response.success){
|
if (response.success) {
|
||||||
message.success({content: "清空成功", key: cleanKey, duration: 1})
|
message.success({
|
||||||
}else{
|
content: "清空成功",
|
||||||
message.error({content: "清空失败", key: cleanKey, duration: 1})
|
key: cleanKey,
|
||||||
}
|
duration: 1,
|
||||||
})
|
});
|
||||||
}
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: "清空失败",
|
||||||
|
key: cleanKey,
|
||||||
|
duration: 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/// 工具栏
|
/// 工具栏
|
||||||
const toolbar = [
|
const toolbar = [
|
||||||
{ label: "备份", event: function () { }},
|
{ label: "备份", event: function () {} },
|
||||||
{ label: "清空", event: function () { cleanMethod(); }},
|
{
|
||||||
|
label: "清空",
|
||||||
|
event: function () {
|
||||||
|
cleanMethod();
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/// 分页参数
|
/// 分页参数
|
||||||
const pagination = {
|
const pagination = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
}
|
};
|
||||||
|
|
||||||
/// 外置参数 - 当参数改变时, 重新触发 fetch 函数
|
/// 外置参数 - 当参数改变时, 重新触发 fetch 函数
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
param: { name: "", code: "", isAuth: true }
|
param: { name: "", code: "", isAuth: true },
|
||||||
})
|
});
|
||||||
|
|
||||||
/// 查询参数
|
/// 查询参数
|
||||||
const searchParam = [
|
const searchParam = [
|
||||||
{ key: "title", type: "input", label: "标题"},
|
{ key: "title", type: "input", label: "标题" },
|
||||||
{ key: "state", type: "select", label: "状态", value: "",
|
{
|
||||||
|
key: "state",
|
||||||
|
type: "select",
|
||||||
|
label: "状态",
|
||||||
|
value: "",
|
||||||
options: [
|
options: [
|
||||||
{ text: "全部", value: ""},
|
{ text: "全部", value: "" },
|
||||||
{ text: "成功", value: true},
|
{ text: "成功", value: true },
|
||||||
{ text: "失败", value: false}
|
{ text: "失败", value: false },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
/// 查询操作
|
/// 查询操作
|
||||||
const search = function(value) {
|
const search = function (value) {
|
||||||
state.param.title = value.title
|
state.param.title = value.title;
|
||||||
state.param.state = value.state
|
state.param.state = value.state;
|
||||||
}
|
};
|
||||||
|
|
||||||
const onSelectChange = selectedRowKeys => {
|
const onSelectChange = (selectedRowKeys) => {
|
||||||
state.selectedRowKeys = selectedRowKeys;
|
state.selectedRowKeys = selectedRowKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -135,10 +241,10 @@ export default {
|
||||||
columns,
|
columns,
|
||||||
operate,
|
operate,
|
||||||
pagination,
|
pagination,
|
||||||
|
visible,
|
||||||
search,
|
search,
|
||||||
searchParam,
|
searchParam,
|
||||||
|
text,
|
||||||
onSelectChange,
|
onSelectChange,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,51 +5,152 @@
|
||||||
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
||||||
</template>
|
</template>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<pro-table ref="tableRef" :fetch="fetch" :columns="columns" :operate="operater" :toolbar="toolbar"
|
<pro-table
|
||||||
:param="state.param" :pagination="pagination"
|
ref="tableRef"
|
||||||
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
|
:fetch="fetch"
|
||||||
|
:columns="columns"
|
||||||
|
:operate="operater"
|
||||||
|
:toolbar="toolbar"
|
||||||
|
:param="state.param"
|
||||||
|
:pagination="pagination"
|
||||||
|
:row-selection="{
|
||||||
|
selectedRowKeys: state.selectedRowKeys,
|
||||||
|
onChange: onSelectChange,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<!-- 继承至 a-table 的默认插槽 -->
|
<!-- 继承至 a-table 的默认插槽 -->
|
||||||
</pro-table>
|
</pro-table>
|
||||||
</a-list-layout>
|
</a-list-layout>
|
||||||
|
<a-modal v-model:open="visible" :footer="null" title="查看详情">{{
|
||||||
|
text
|
||||||
|
}}</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { message, Modal as modal } from '@hwork/ant-design-vue';
|
import { message, Modal as modal } from "@hwork/ant-design-vue";
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||||
import { page, clean, exportExcel } from "@/api/module/log";
|
import { page, clean, exportExcel } from "@/api/module/log";
|
||||||
import { reactive, createVNode, ref } from 'vue';
|
import { reactive, createVNode, ref } from "vue";
|
||||||
|
|
||||||
const cleanKey = "clean";
|
const cleanKey = "clean";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
|
const text = ref("");
|
||||||
const tableRef = ref()
|
const visible = ref(false);
|
||||||
|
const tableRef = ref();
|
||||||
|
|
||||||
/// 文本
|
/// 文本
|
||||||
const converFormat = [{ label: "成功", value: true }, { label: "失败", value: false }];
|
const converFormat = [
|
||||||
|
{ label: "成功", value: true },
|
||||||
|
{ label: "失败", value: false },
|
||||||
|
];
|
||||||
|
|
||||||
/// 列配置
|
/// 列配置
|
||||||
const columns = [
|
const columns = [
|
||||||
{ dataIndex: "title", key: "title", title: "标题", width: 120, showSearch: true },
|
{
|
||||||
{ dataIndex: "describe", key: "describe", title: "描述", width: 120, showSearch: true },
|
dataIndex: "title",
|
||||||
|
key: "title",
|
||||||
|
title: "标题",
|
||||||
|
width: 120,
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "describe",
|
||||||
|
key: "describe",
|
||||||
|
title: "描述",
|
||||||
|
width: 120,
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
{ dataIndex: "action", key: "action", title: "动作", width: 100 },
|
{ dataIndex: "action", key: "action", title: "动作", width: 100 },
|
||||||
{ dataIndex: "type", key: "type", title: "方式", width: 120 },
|
{ dataIndex: "type", key: "type", title: "方式", width: 120 },
|
||||||
{ dataIndex: "browser", key: "browser", title: "浏览器", width: 120, ellipsis: true },
|
{
|
||||||
{ dataIndex: "system", key: "system", title: "系统", width: 120, ellipsis: true },
|
dataIndex: "browser",
|
||||||
{ dataIndex: "address", key: "address", title: "操作地", width: 120, showSearch: true, ellipsis: true },
|
key: "browser",
|
||||||
|
title: "浏览器",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "system",
|
||||||
|
key: "system",
|
||||||
|
title: "系统",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "address",
|
||||||
|
key: "address",
|
||||||
|
title: "操作地",
|
||||||
|
width: 120,
|
||||||
|
showSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
{ dataIndex: "operator", key: "operator", title: "操作人", width: 100 },
|
{ dataIndex: "operator", key: "operator", title: "操作人", width: 100 },
|
||||||
{ dataIndex: "createBy", key: "createBy", title: "创建人", width: 120, ellipsis: true, showSearch: true },
|
{
|
||||||
{ dataIndex: "createUsername", key: "createUsername", title: "创建人", width: 120, ellipsis: true, showSearch: true },
|
dataIndex: "createBy",
|
||||||
{ dataIndex: "createNickname", key: "createNickname", title: "创建人昵称", width: 120, ellipsis: true },
|
key: "createBy",
|
||||||
{ dataIndex: "createTime", key: "createTime", title: "操作时间", width: 180, ellipsis: true },
|
title: "创建人",
|
||||||
{ dataIndex: "state", key: "state", title: "状态", conver: converFormat, width: 120, ellipsis: true },
|
width: 120,
|
||||||
{ dataIndex: "params", key: "params", title: "参数", showSearch: true, width: 300, ellipsis: true },
|
ellipsis: true,
|
||||||
{ dataIndex: "result", key: "result", title: "返回结果", showSearch: true, width: 300, ellipsis: true },
|
showSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createUsername",
|
||||||
|
key: "createUsername",
|
||||||
|
title: "创建人",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createNickname",
|
||||||
|
key: "createNickname",
|
||||||
|
title: "创建人昵称",
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "createTime",
|
||||||
|
key: "createTime",
|
||||||
|
title: "操作时间",
|
||||||
|
width: 180,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "state",
|
||||||
|
key: "state",
|
||||||
|
title: "状态",
|
||||||
|
conver: converFormat,
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "params",
|
||||||
|
key: "params",
|
||||||
|
title: "参数",
|
||||||
|
showSearch: true,
|
||||||
|
width: 300,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: "result",
|
||||||
|
key: "result",
|
||||||
|
title: "返回结果",
|
||||||
|
showSearch: true,
|
||||||
|
width: 300,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const operater = [
|
const operater = [
|
||||||
{ label: "查看", event: function (record) { alert("查看详情:" + JSON.stringify(record)) } },
|
{
|
||||||
|
label: "查看",
|
||||||
|
event: function (record) {
|
||||||
|
text.value = JSON.stringify(record);
|
||||||
|
visible.value = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/// 数据来源 [模拟]
|
/// 数据来源 [模拟]
|
||||||
|
|
@ -64,62 +165,83 @@ export default {
|
||||||
/// 删除配置
|
/// 删除配置
|
||||||
const cleanMethod = (record) => {
|
const cleanMethod = (record) => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: '您是否确定要清空日志?',
|
title: "您是否确定要清空日志?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({ content: "提交中...", key: cleanKey });
|
message.loading({ content: "提交中...", key: cleanKey });
|
||||||
clean({ "isAuth": false }).then((response) => {
|
clean({ isAuth: false }).then((response) => {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
message.success({ content: "清空成功", key: cleanKey, duration: 1 })
|
message.success({
|
||||||
tableRef.value.reload()
|
content: "清空成功",
|
||||||
|
key: cleanKey,
|
||||||
|
duration: 1,
|
||||||
|
});
|
||||||
|
tableRef.value.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error({ content: "清空失败", key: cleanKey, duration: 1 })
|
message.error({
|
||||||
}
|
content: "清空失败",
|
||||||
})
|
key: cleanKey,
|
||||||
}
|
duration: 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/// 工具栏
|
/// 工具栏
|
||||||
const toolbar = [
|
const toolbar = [
|
||||||
{ label: "备份", event: function () { exportExcel(); } },
|
{
|
||||||
{ label: "清空", event: function () { cleanMethod(); } },
|
label: "备份",
|
||||||
|
event: function () {
|
||||||
|
exportExcel();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "清空",
|
||||||
|
event: function () {
|
||||||
|
cleanMethod();
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/// 分页参数
|
/// 分页参数
|
||||||
const pagination = {
|
const pagination = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
}
|
};
|
||||||
|
|
||||||
/// 外置参数 - 当参数改变时, 重新触发 fetch 函数
|
/// 外置参数 - 当参数改变时, 重新触发 fetch 函数
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
param: { isAuth: false }
|
param: { isAuth: false },
|
||||||
})
|
});
|
||||||
|
|
||||||
/// 查询参数
|
/// 查询参数
|
||||||
const searchParam = [
|
const searchParam = [
|
||||||
{ key: "title", type: "input", label: "标题" },
|
{ key: "title", type: "input", label: "标题" },
|
||||||
{
|
{
|
||||||
key: "state", type: "select", label: "状态", value: "",
|
key: "state",
|
||||||
|
type: "select",
|
||||||
|
label: "状态",
|
||||||
|
value: "",
|
||||||
options: [
|
options: [
|
||||||
{ text: "全部", value: "" },
|
{ text: "全部", value: "" },
|
||||||
{ text: "成功", value: true },
|
{ text: "成功", value: true },
|
||||||
{ text: "失败", value: false }
|
{ text: "失败", value: false },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
/// 查询操作
|
/// 查询操作
|
||||||
const search = function (value) {
|
const search = function (value) {
|
||||||
state.param.title = value.title
|
state.param.title = value.title;
|
||||||
state.param.state = value.state
|
state.param.state = value.state;
|
||||||
}
|
};
|
||||||
|
|
||||||
const onSelectChange = selectedRowKeys => {
|
const onSelectChange = (selectedRowKeys) => {
|
||||||
state.selectedRowKeys = selectedRowKeys;
|
state.selectedRowKeys = selectedRowKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -131,12 +253,12 @@ export default {
|
||||||
columns,
|
columns,
|
||||||
operater,
|
operater,
|
||||||
pagination,
|
pagination,
|
||||||
|
visible,
|
||||||
search,
|
search,
|
||||||
searchParam,
|
searchParam,
|
||||||
|
text,
|
||||||
onSelectChange,
|
onSelectChange,
|
||||||
tableRef
|
tableRef,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,46 +3,51 @@
|
||||||
<template #search>
|
<template #search>
|
||||||
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
||||||
</template>
|
</template>
|
||||||
<pro-table style="margin-top: 10px" rowKey="id" ref="tableRef" :fetch="fetch" :columns="columns" :toolbar="toolbar"
|
<pro-table
|
||||||
:operate="operate" :param="state.param" :pagination="pagination"
|
style="margin-top: 10px"
|
||||||
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
|
rowKey="id"
|
||||||
|
ref="tableRef"
|
||||||
|
:fetch="fetch"
|
||||||
|
:columns="columns"
|
||||||
|
:toolbar="toolbar"
|
||||||
|
:operate="operate"
|
||||||
|
:param="state.param"
|
||||||
|
:pagination="pagination"
|
||||||
|
:row-selection="{
|
||||||
|
selectedRowKeys: state.selectedRowKeys,
|
||||||
|
onChange: onSelectChange,
|
||||||
|
}"
|
||||||
|
>
|
||||||
</pro-table>
|
</pro-table>
|
||||||
</a-list-layout>
|
</a-list-layout>
|
||||||
|
<a-modal v-model:open="visible" :footer="null" title="查看详情">{{text}}</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { message, Modal as modal } from "@hwork/ant-design-vue";
|
||||||
message,
|
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||||
Modal as modal
|
|
||||||
} from '@hwork/ant-design-vue';
|
|
||||||
import {
|
|
||||||
ExclamationCircleOutlined
|
|
||||||
} from '@ant-design/icons-vue';
|
|
||||||
import {
|
import {
|
||||||
reActivate,
|
reActivate,
|
||||||
page,
|
page,
|
||||||
remove,
|
remove,
|
||||||
cancel,
|
cancel,
|
||||||
removeBatch
|
removeBatch,
|
||||||
} from "@/api/wms/request";
|
} from "@/api/wms/request";
|
||||||
import {
|
import { reactive, createVNode, ref } from "vue";
|
||||||
reactive,
|
|
||||||
createVNode,
|
|
||||||
ref,
|
|
||||||
} from 'vue';
|
|
||||||
const reActivateKey = "reActivate";
|
const reActivateKey = "reActivate";
|
||||||
const removeKey = "remove";
|
const removeKey = "remove";
|
||||||
const cancelKey = "cancel";
|
const cancelKey = "cancel";
|
||||||
const removeBatchKey = "removeBatch";
|
const removeBatchKey = "removeBatch";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WmsRequestIndex',
|
name: "WmsRequestIndex",
|
||||||
components: {},
|
components: {},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
const tableRef = ref();
|
||||||
const tableRef = ref()
|
const text = ref('')
|
||||||
|
const visible = ref(false)
|
||||||
const columns = [{
|
const columns = [
|
||||||
|
{
|
||||||
dataIndex: "requestCode",
|
dataIndex: "requestCode",
|
||||||
key: "requestCode",
|
key: "requestCode",
|
||||||
title: "请求编号",
|
title: "请求编号",
|
||||||
|
|
@ -55,10 +60,10 @@ export default {
|
||||||
title: "状态",
|
title: "状态",
|
||||||
width: 100,
|
width: 100,
|
||||||
dictionary: {
|
dictionary: {
|
||||||
type: 'tag',
|
type: "tag",
|
||||||
code: 'TaskStatus'
|
code: "TaskStatus",
|
||||||
},
|
},
|
||||||
showSearch: true
|
showSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: "paramType",
|
dataIndex: "paramType",
|
||||||
|
|
@ -136,9 +141,9 @@ export default {
|
||||||
title: "优先级",
|
title: "优先级",
|
||||||
width: 120,
|
width: 120,
|
||||||
dictionary: {
|
dictionary: {
|
||||||
type: 'tag',
|
type: "tag",
|
||||||
code: 'priority'
|
code: "priority",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: "remark",
|
dataIndex: "remark",
|
||||||
|
|
@ -148,11 +153,10 @@ export default {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
/// 数据来源 [模拟]
|
/// 数据来源 [模拟]
|
||||||
const fetch = async (param) => {
|
const fetch = async (param) => {
|
||||||
var response = await page(param);
|
var response = await page(param);
|
||||||
console.log("response", response)
|
console.log("response", response);
|
||||||
return {
|
return {
|
||||||
total: response.data.total,
|
total: response.data.total,
|
||||||
data: response.data.record,
|
data: response.data.record,
|
||||||
|
|
@ -162,17 +166,17 @@ export default {
|
||||||
//重置配置
|
//重置配置
|
||||||
const reActivateMethod = (record) => {
|
const reActivateMethod = (record) => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: '您是否确认重置该请求?',
|
title: "您是否确认重置该请求?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({
|
message.loading({
|
||||||
content: "重置中...",
|
content: "重置中...",
|
||||||
key: reActivateKey
|
key: reActivateKey,
|
||||||
});
|
});
|
||||||
reActivate({
|
reActivate({
|
||||||
'id': record.id,
|
id: record.id,
|
||||||
//"status": record.status,
|
//"status": record.status,
|
||||||
// "processClass": record.processClass,
|
// "processClass": record.processClass,
|
||||||
//data: record.data,
|
//data: record.data,
|
||||||
|
|
@ -181,166 +185,174 @@ export default {
|
||||||
message.success({
|
message.success({
|
||||||
content: "重置成功",
|
content: "重置成功",
|
||||||
key: reActivateKey,
|
key: reActivateKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
})
|
});
|
||||||
tableRef.value.reload()
|
tableRef.value.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message.error({
|
||||||
content: "重置失败:" + response.msg,
|
content: "重置失败:" + response.msg,
|
||||||
key: reActivateKey,
|
key: reActivateKey,
|
||||||
duration: 3
|
duration: 3,
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//取消配置
|
//取消配置
|
||||||
const cancelMethod = (record) => {
|
const cancelMethod = (record) => {
|
||||||
const confirmMsg = modal.confirm({
|
const confirmMsg = modal.confirm({
|
||||||
title: '您是否确认取消该请求?',
|
title: "您是否确认取消该请求?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({
|
message.loading({
|
||||||
content: "取消中...",
|
content: "取消中...",
|
||||||
key: cancelKey
|
key: cancelKey,
|
||||||
});
|
});
|
||||||
cancel({
|
cancel({
|
||||||
'id': record.id,
|
id: record.id,
|
||||||
'status': record.status,
|
status: record.status,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
message.success({
|
message.success({
|
||||||
content: "取消成功",
|
content: "取消成功",
|
||||||
key: cancelKey,
|
key: cancelKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
})
|
});
|
||||||
tableRef.value.reload()
|
tableRef.value.reload();
|
||||||
} else {
|
} else {
|
||||||
message.destroy()
|
message.destroy();
|
||||||
message.error({
|
message.error({
|
||||||
message: '请求取消失败',
|
message: "请求取消失败",
|
||||||
description: response.msg
|
description: response.msg,
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
confirmMsg.destroy()
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
confirmMsg.destroy();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
// 删除数据
|
// 删除数据
|
||||||
const removeMethod = (record) => {
|
const removeMethod = (record) => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: '您是否确定要删除?',
|
title: "您是否确定要删除?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({
|
message.loading({
|
||||||
content: "提交中...",
|
content: "提交中...",
|
||||||
key: removeKey
|
key: removeKey,
|
||||||
});
|
});
|
||||||
remove({
|
remove({
|
||||||
"id": record.id,
|
id: record.id,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
message.success({
|
message
|
||||||
|
.success({
|
||||||
content: "删除成功",
|
content: "删除成功",
|
||||||
key: removeKey,
|
key: removeKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
|
||||||
tableRef.value.reload()
|
|
||||||
})
|
})
|
||||||
|
.then(() => {
|
||||||
|
tableRef.value.reload();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message.error({
|
||||||
content: response.msg,
|
content: response.msg,
|
||||||
key: removeKey,
|
key: removeKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 批量删除
|
// 批量删除
|
||||||
const removeBatchMethod = (ids) => {
|
const removeBatchMethod = (ids) => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: '您是否确定要删除?',
|
title: "您是否确定要删除?",
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: '确定',
|
okText: "确定",
|
||||||
cancelText: '取消',
|
cancelText: "取消",
|
||||||
onOk() {
|
onOk() {
|
||||||
message.loading({
|
message.loading({
|
||||||
content: "提交中...",
|
content: "提交中...",
|
||||||
key: removeBatchKey
|
key: removeBatchKey,
|
||||||
});
|
});
|
||||||
removeBatch({
|
removeBatch({
|
||||||
"ids": ids
|
ids: ids,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
message.success({
|
message
|
||||||
|
.success({
|
||||||
content: "删除成功",
|
content: "删除成功",
|
||||||
key: removeBatchKey,
|
key: removeBatchKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
}).then(() => {
|
|
||||||
tableRef.value.reload()
|
|
||||||
})
|
})
|
||||||
|
.then(() => {
|
||||||
|
tableRef.value.reload();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message.error({
|
||||||
content: "删除失败",
|
content: "删除失败",
|
||||||
key: removeBatchKey,
|
key: removeBatchKey,
|
||||||
duration: 1
|
duration: 1,
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/// 工具栏
|
/// 工具栏
|
||||||
const toolbar = [{
|
const toolbar = [
|
||||||
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
code: 'wms:request:delete',
|
code: "wms:request:delete",
|
||||||
event: function () {
|
event: function () {
|
||||||
removeBatchMethod(state.selectedRowKeys)
|
removeBatchMethod(state.selectedRowKeys);
|
||||||
},
|
},
|
||||||
type: 'danger'
|
type: "danger",
|
||||||
},];
|
},
|
||||||
|
];
|
||||||
|
|
||||||
/// 行操作
|
/// 行操作
|
||||||
const operate = [{
|
const operate = [
|
||||||
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
code: 'wms:request:delete',
|
code: "wms:request:delete",
|
||||||
event: function (record) {
|
event: function (record) {
|
||||||
removeMethod(record)
|
removeMethod(record);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "重置",
|
label: "重置",
|
||||||
code: 'wms:request:reactivate',
|
code: "wms:request:reactivate",
|
||||||
isRes: true,
|
isRes: true,
|
||||||
event: function (record) {
|
event: function (record) {
|
||||||
reActivateMethod(record)
|
reActivateMethod(record);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "取消",
|
label: "取消",
|
||||||
code: 'wms:request:cancel',
|
code: "wms:request:cancel",
|
||||||
isRes: true,
|
isRes: true,
|
||||||
event: function (record) {
|
event: function (record) {
|
||||||
cancelMethod(record)
|
cancelMethod(record);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "查看",
|
label: "查看",
|
||||||
event: function (record) {
|
event: function (record) {
|
||||||
alert("查看详情:" + JSON.stringify(record))
|
// alert("查看详情:" + JSON.stringify(record));
|
||||||
}
|
text.value = JSON.stringify(record)
|
||||||
|
visible.value = true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -349,8 +361,8 @@ export default {
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
showSizeChanger: true, // 显示可改变每页条数
|
showSizeChanger: true, // 显示可改变每页条数
|
||||||
pageSizeOptions: ["10", "20", "50", "100"], // 每页条数选项设置
|
pageSizeOptions: ["10", "20", "50", "100"], // 每页条数选项设置
|
||||||
showTotal: total => `共 ${total} 条记录`, // 显示总条数
|
showTotal: (total) => `共 ${total} 条记录`, // 显示总条数
|
||||||
showSizeChange: (current, pageSize) => (this.pageSize = pageSize) // 改变每页条数时更新显示
|
showSizeChange: (current, pageSize) => (this.pageSize = pageSize), // 改变每页条数时更新显示
|
||||||
};
|
};
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
|
@ -358,33 +370,35 @@ export default {
|
||||||
param: {},
|
param: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchParam = [{
|
const searchParam = [
|
||||||
|
{
|
||||||
key: "request",
|
key: "request",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "请求消息"
|
label: "请求消息",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "response",
|
key: "response",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "响应消息"
|
label: "响应消息",
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
key: "requestCode",
|
key: "requestCode",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "请求编号"
|
label: "请求编号",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "preRequestCode",
|
key: "preRequestCode",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "前置请求编号"
|
label: "前置请求编号",
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
const search = function (value) {
|
const search = function (value) {
|
||||||
console.log("search", value)
|
console.log("search", value);
|
||||||
state.param = value
|
state.param = value;
|
||||||
}
|
};
|
||||||
|
|
||||||
const onSelectChange = selectedRowKeys => {
|
const onSelectChange = (selectedRowKeys) => {
|
||||||
state.selectedRowKeys = selectedRowKeys;
|
state.selectedRowKeys = selectedRowKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -399,8 +413,9 @@ export default {
|
||||||
searchParam,
|
searchParam,
|
||||||
onSelectChange,
|
onSelectChange,
|
||||||
tableRef,
|
tableRef,
|
||||||
|
visible,
|
||||||
|
text
|
||||||
};
|
};
|
||||||
|
},
|
||||||
}
|
};
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue