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