upload project source code
This commit is contained in:
986
后端源码/yifan.action-ai.cn/index/js/index.Crjb_SsD.js
Normal file
986
后端源码/yifan.action-ai.cn/index/js/index.Crjb_SsD.js
Normal file
@@ -0,0 +1,986 @@
|
||||
import { x as ElFormItem, y as ElInput, aq as ElSelect, ar as ElOption, h as ElButton, t as ElLink, i as ElIcon, w as ElForm, U as ElRow, V as ElCol, l as ElTooltip, al as ElTable, am as ElTableColumn, q as ElTag, r as ElText, u as ElEmpty, ao as vLoading, T as ElCard, a3 as ElDescriptions, a4 as ElDescriptionsItem, v as ElDialog, D as ElMessageBox } from "./element-plus.CkEW9frc.js";
|
||||
import { _ as __unplugin_components_19 } from "./index.fgd49PES.js";
|
||||
import { _ as _sfc_main$3 } from "./index.vue_vue_type_script_setup_true_lang.DSV4pgC3.js";
|
||||
import { D as DatePicker } from "./index.Cu5O_6Z1.js";
|
||||
import { J as defineComponent, S as openBlock, _ as createElementBlock, a2 as normalizeStyle, T as createBlock, o as unref, eB as P, aa as toDisplayString, j as computed, t as onMounted, aO as resolveComponent, aP as resolveDirective, a1 as createBaseVNode, $ as createVNode, a0 as withCtx, a8 as createCommentVNode, z as isRef, a6 as withDirectives, a9 as createTextVNode, aw as withModifiers, r as ref, ak as reactive } from "./.pnpm.BW3P1y8f.js";
|
||||
import { l as httpRequest } from "./index.CMd5bD1r.js";
|
||||
import { _ as _sfc_main$2 } from "./UserTableSelect.vue_vue_type_script_setup_true_lang.7Fjc3bJT.js";
|
||||
import { _ as _sfc_main$4 } from "./ExportModal.vue_vue_type_script_setup_true_lang.Bok1HJuH.js";
|
||||
import { _ as _export_sfc } from "./_plugin-vue_export-helper.1tPrXgE0.js";
|
||||
import { f as formatToDateTime } from "./dateUtil.SHphbRyf.js";
|
||||
import "./codemirror.CvJAcn2d.js";
|
||||
import "./exceljs.CkFT-P7Q.js";
|
||||
const API_PATH = "/system/log";
|
||||
const LogAPI = {
|
||||
listLog(query) {
|
||||
return httpRequest({
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
},
|
||||
detailLog(query) {
|
||||
return httpRequest({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get"
|
||||
});
|
||||
},
|
||||
deleteLog(body) {
|
||||
return httpRequest({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body
|
||||
});
|
||||
},
|
||||
exportLog(body) {
|
||||
return httpRequest({
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
};
|
||||
const _hoisted_1$1 = {
|
||||
key: 1,
|
||||
class: "json-pretty-fallback"
|
||||
};
|
||||
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
value: { type: [String, Object, Array, Number, Boolean], default: "" },
|
||||
height: { type: String, default: "240px" }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const parsed = computed(() => {
|
||||
const v = props.value;
|
||||
if (typeof v === "string") {
|
||||
try {
|
||||
return JSON.parse(v);
|
||||
} catch {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
return v;
|
||||
});
|
||||
const isJson = computed(() => typeof parsed.value === "object" && parsed.value !== null);
|
||||
const displayText = computed(() => {
|
||||
const v = props.value;
|
||||
return typeof v === "string" ? v : JSON.stringify(v, null, 2);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
class: "json-pretty-wrapper",
|
||||
style: normalizeStyle({ maxHeight: __props.height })
|
||||
}, [
|
||||
isJson.value ? (openBlock(), createBlock(unref(P), {
|
||||
key: 0,
|
||||
data: parsed.value,
|
||||
"show-line": true,
|
||||
"show-double-quotes": false,
|
||||
"show-length": true,
|
||||
deep: 3
|
||||
}, null, 8, ["data"])) : (openBlock(), createElementBlock("pre", _hoisted_1$1, toDisplayString(displayText.value), 1))
|
||||
], 4);
|
||||
};
|
||||
}
|
||||
});
|
||||
const JsonPretty = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-4e8acb9c"]]);
|
||||
const _hoisted_1 = { class: "app-container" };
|
||||
const _hoisted_2 = { class: "search-container" };
|
||||
const _hoisted_3 = { class: "card-header" };
|
||||
const _hoisted_4 = { class: "data-table__toolbar" };
|
||||
const _hoisted_5 = { class: "data-table__toolbar--left" };
|
||||
const _hoisted_6 = { class: "data-table__toolbar--right" };
|
||||
const _hoisted_7 = { class: "dialog-footer" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
...{
|
||||
name: "Log",
|
||||
inheritAttrs: false
|
||||
},
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const queryFormRef = ref();
|
||||
const dataFormRef = ref();
|
||||
const total = ref(0);
|
||||
const selectIds = ref([]);
|
||||
const loading = ref(false);
|
||||
const isExpand = ref(false);
|
||||
const isExpandable = ref(true);
|
||||
const pageTableData = ref([]);
|
||||
const exportsDialogVisible = ref(false);
|
||||
const selectionRows = ref([]);
|
||||
const formData = ref({});
|
||||
const queryFormData = reactive({
|
||||
page_no: 1,
|
||||
page_size: 10,
|
||||
type: void 0,
|
||||
request_path: void 0,
|
||||
creator_name: void 0,
|
||||
created_time: void 0,
|
||||
created_id: void 0,
|
||||
updated_id: void 0
|
||||
});
|
||||
const dialogVisible = reactive({
|
||||
title: "",
|
||||
visible: false,
|
||||
type: "create"
|
||||
});
|
||||
const dateRange = ref([]);
|
||||
function handleDateRangeChange(range) {
|
||||
dateRange.value = range;
|
||||
if (range && range.length === 2) {
|
||||
queryFormData.created_time = [formatToDateTime(range[0]), formatToDateTime(range[1])];
|
||||
} else {
|
||||
queryFormData.created_time = void 0;
|
||||
}
|
||||
}
|
||||
async function handleRefresh() {
|
||||
await loadingData();
|
||||
}
|
||||
const getStatusCodeType = (code) => {
|
||||
if (code === void 0) {
|
||||
return "info";
|
||||
}
|
||||
if (code >= 200 && code < 300) {
|
||||
return "success";
|
||||
} else if (code >= 300 && code < 400) {
|
||||
return "warning";
|
||||
} else if (code >= 400 && code < 500) {
|
||||
return "danger";
|
||||
} else {
|
||||
return "danger";
|
||||
}
|
||||
};
|
||||
const getMethodType = (method) => {
|
||||
if (method === void 0) {
|
||||
return "info";
|
||||
}
|
||||
if (method === "GET") {
|
||||
return "info";
|
||||
} else if (method === "POST") {
|
||||
return "success";
|
||||
} else if (method === "PUT" || method === "PATCH") {
|
||||
return "warning";
|
||||
} else if (method === "DELETE") {
|
||||
return "danger";
|
||||
} else {
|
||||
return "info";
|
||||
}
|
||||
};
|
||||
async function loadingData() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await LogAPI.listLog(queryFormData);
|
||||
pageTableData.value = response.data.data.items;
|
||||
total.value = response.data.data.total;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
async function handleQuery() {
|
||||
queryFormData.page_no = 1;
|
||||
loadingData();
|
||||
}
|
||||
function handleConfirm() {
|
||||
handleQuery();
|
||||
}
|
||||
async function handleResetQuery() {
|
||||
queryFormRef.value.resetFields();
|
||||
queryFormData.page_no = 1;
|
||||
dateRange.value = [];
|
||||
queryFormData.created_time = void 0;
|
||||
loadingData();
|
||||
}
|
||||
async function resetForm() {
|
||||
if (dataFormRef.value) {
|
||||
dataFormRef.value.resetFields();
|
||||
dataFormRef.value.clearValidate();
|
||||
}
|
||||
formData.value.id = void 0;
|
||||
}
|
||||
async function handleSelectionChange(selection) {
|
||||
selectIds.value = selection.map((item) => item.id);
|
||||
selectionRows.value = selection;
|
||||
}
|
||||
async function handleCloseDialog() {
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
}
|
||||
async function handleOpenDialog(type, id) {
|
||||
dialogVisible.type = type;
|
||||
if (id) {
|
||||
const response = await LogAPI.detailLog(id);
|
||||
{
|
||||
dialogVisible.title = "日志详情";
|
||||
Object.assign(formData.value, response.data.data);
|
||||
}
|
||||
}
|
||||
dialogVisible.visible = true;
|
||||
}
|
||||
async function handleDelete(ids) {
|
||||
ElMessageBox.confirm("确认删除该项数据?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
await LogAPI.deleteLog(ids);
|
||||
handleResetQuery();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
ElMessageBox.close();
|
||||
});
|
||||
}
|
||||
function handleOpenExportsModal() {
|
||||
exportsDialogVisible.value = true;
|
||||
}
|
||||
const exportColumns = [
|
||||
{ prop: "type", label: "日志类型" },
|
||||
{ prop: "request_path", label: "请求路径" },
|
||||
{ prop: "request_method", label: "请求方法" },
|
||||
{ prop: "response_code", label: "状态码" },
|
||||
{ prop: "request_ip", label: "请求IP" },
|
||||
{ prop: "login_location", label: "登录地点" },
|
||||
{ prop: "process_time", label: "处理时间" },
|
||||
{ prop: "request_browser", label: "浏览器" },
|
||||
{ prop: "request_os", label: "系统" },
|
||||
{ prop: "description", label: "描述" },
|
||||
{ prop: "created_time", label: "创建时间" },
|
||||
{ prop: "updated_time", label: "更新时间" }
|
||||
];
|
||||
const curdContentConfig = {
|
||||
permPrefix: "module_system:log",
|
||||
cols: exportColumns,
|
||||
exportsAction: async (params) => {
|
||||
var _a, _b, _c, _d;
|
||||
const query = { ...params };
|
||||
query.page_no = 1;
|
||||
query.page_size = 1e3;
|
||||
const all = [];
|
||||
while (true) {
|
||||
const res = await LogAPI.listLog(query);
|
||||
const items = ((_b = (_a = res.data) == null ? void 0 : _a.data) == null ? void 0 : _b.items) || [];
|
||||
const total2 = ((_d = (_c = res.data) == null ? void 0 : _c.data) == null ? void 0 : _d.total) || 0;
|
||||
all.push(...items);
|
||||
if (all.length >= total2 || items.length === 0) break;
|
||||
query.page_no += 1;
|
||||
}
|
||||
return all;
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
loadingData();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
const _component_el_input = ElInput;
|
||||
const _component_el_form_item = ElFormItem;
|
||||
const _component_el_option = ElOption;
|
||||
const _component_el_select = ElSelect;
|
||||
const _component_DatePicker = DatePicker;
|
||||
const _component_el_button = ElButton;
|
||||
const _component_ArrowUp = resolveComponent("ArrowUp");
|
||||
const _component_ArrowDown = resolveComponent("ArrowDown");
|
||||
const _component_el_icon = ElIcon;
|
||||
const _component_el_link = ElLink;
|
||||
const _component_el_form = ElForm;
|
||||
const _component_QuestionFilled = resolveComponent("QuestionFilled");
|
||||
const _component_el_tooltip = ElTooltip;
|
||||
const _component_el_col = ElCol;
|
||||
const _component_el_row = ElRow;
|
||||
const _component_el_empty = ElEmpty;
|
||||
const _component_el_table_column = ElTableColumn;
|
||||
const _component_el_tag = ElTag;
|
||||
const _component_el_text = ElText;
|
||||
const _component_CopyButton = _sfc_main$3;
|
||||
const _component_el_table = ElTable;
|
||||
const _component_pagination = __unplugin_components_19;
|
||||
const _component_el_card = ElCard;
|
||||
const _component_el_descriptions_item = ElDescriptionsItem;
|
||||
const _component_el_descriptions = ElDescriptions;
|
||||
const _component_el_dialog = ElDialog;
|
||||
const _directive_hasPerm = resolveDirective("hasPerm");
|
||||
const _directive_loading = vLoading;
|
||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||
createBaseVNode("div", _hoisted_2, [
|
||||
createVNode(_component_el_form, {
|
||||
ref_key: "queryFormRef",
|
||||
ref: queryFormRef,
|
||||
model: unref(queryFormData),
|
||||
inline: true,
|
||||
"label-suffix": ":",
|
||||
onSubmit: withModifiers(handleQuery, ["prevent"])
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_form_item, {
|
||||
prop: "request_path",
|
||||
label: "请求路径"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_input, {
|
||||
modelValue: unref(queryFormData).request_path,
|
||||
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(queryFormData).request_path = $event),
|
||||
placeholder: "请输入请求路径",
|
||||
clearable: ""
|
||||
}, null, 8, ["modelValue"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_form_item, {
|
||||
prop: "type",
|
||||
label: "日志类型"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_select, {
|
||||
modelValue: unref(queryFormData).type,
|
||||
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(queryFormData).type = $event),
|
||||
placeholder: "请选择日志类型",
|
||||
style: { "width": "167.5px" },
|
||||
clearable: ""
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_option, {
|
||||
label: "登录日志",
|
||||
value: "1"
|
||||
}),
|
||||
createVNode(_component_el_option, {
|
||||
label: "操作日志",
|
||||
value: "2"
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["modelValue"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
unref(isExpand) ? (openBlock(), createBlock(_component_el_form_item, {
|
||||
key: 0,
|
||||
prop: "created_id",
|
||||
label: "创建人"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_sfc_main$2, {
|
||||
modelValue: unref(queryFormData).created_id,
|
||||
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(queryFormData).created_id = $event),
|
||||
onConfirmClick: handleConfirm,
|
||||
onClearClick: handleQuery
|
||||
}, null, 8, ["modelValue"])
|
||||
]),
|
||||
_: 1
|
||||
})) : createCommentVNode("", true),
|
||||
unref(isExpand) ? (openBlock(), createBlock(_component_el_form_item, {
|
||||
key: 1,
|
||||
prop: "start_time",
|
||||
label: "创建时间"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_DatePicker, {
|
||||
modelValue: unref(dateRange),
|
||||
"onUpdate:modelValue": [
|
||||
_cache[3] || (_cache[3] = ($event) => isRef(dateRange) ? dateRange.value = $event : null),
|
||||
handleDateRangeChange
|
||||
]
|
||||
}, null, 8, ["modelValue"])
|
||||
]),
|
||||
_: 1
|
||||
})) : createCommentVNode("", true),
|
||||
createVNode(_component_el_form_item, { class: "search-buttons" }, {
|
||||
default: withCtx(() => [
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
type: "primary",
|
||||
icon: "search",
|
||||
"native-type": "submit"
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[11] || (_cache[11] = [
|
||||
createTextVNode(" 查询 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
})), [
|
||||
[_directive_hasPerm, ["module_system:log:query"]]
|
||||
]),
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
icon: "refresh",
|
||||
onClick: handleResetQuery
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[12] || (_cache[12] = [
|
||||
createTextVNode(" 重置 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
})), [
|
||||
[_directive_hasPerm, ["module_system:log:query"]]
|
||||
]),
|
||||
unref(isExpandable) ? (openBlock(), createBlock(_component_el_link, {
|
||||
key: 0,
|
||||
class: "ml-3",
|
||||
type: "primary",
|
||||
underline: "never",
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => isExpand.value = !unref(isExpand))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(isExpand) ? "收起" : "展开") + " ", 1),
|
||||
createVNode(_component_el_icon, null, {
|
||||
default: withCtx(() => [
|
||||
unref(isExpand) ? (openBlock(), createBlock(_component_ArrowUp, { key: 0 })) : (openBlock(), createBlock(_component_ArrowDown, { key: 1 }))
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
})) : createCommentVNode("", true)
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["model"])
|
||||
]),
|
||||
createVNode(_component_el_card, { class: "data-table" }, {
|
||||
header: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_3, [
|
||||
createBaseVNode("span", null, [
|
||||
createVNode(_component_el_tooltip, { content: "日志管理维护系统的日志。" }, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_QuestionFilled, { class: "w-4 h-4 mx-1" })
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
_cache[13] || (_cache[13] = createTextVNode(" 日志列表 ", -1))
|
||||
])
|
||||
])
|
||||
]),
|
||||
footer: withCtx(() => [
|
||||
createVNode(_component_pagination, {
|
||||
total: unref(total),
|
||||
"onUpdate:total": _cache[6] || (_cache[6] = ($event) => isRef(total) ? total.value = $event : null),
|
||||
page: unref(queryFormData).page_no,
|
||||
"onUpdate:page": _cache[7] || (_cache[7] = ($event) => unref(queryFormData).page_no = $event),
|
||||
limit: unref(queryFormData).page_size,
|
||||
"onUpdate:limit": _cache[8] || (_cache[8] = ($event) => unref(queryFormData).page_size = $event),
|
||||
onPagination: loadingData
|
||||
}, null, 8, ["total", "page", "limit"])
|
||||
]),
|
||||
default: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_4, [
|
||||
createBaseVNode("div", _hoisted_5, [
|
||||
createVNode(_component_el_row, { gutter: 10 }, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_col, { span: 1.5 }, {
|
||||
default: withCtx(() => [
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
type: "danger",
|
||||
icon: "delete",
|
||||
disabled: unref(selectIds).length === 0,
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => handleDelete(unref(selectIds)))
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[14] || (_cache[14] = [
|
||||
createTextVNode(" 批量删除 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
}, 8, ["disabled"])), [
|
||||
[_directive_hasPerm, ["module_system:log:delete"]]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
createBaseVNode("div", _hoisted_6, [
|
||||
createVNode(_component_el_row, { gutter: 10 }, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_col, { span: 1.5 }, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_tooltip, { content: "导出" }, {
|
||||
default: withCtx(() => [
|
||||
withDirectives(createVNode(_component_el_button, {
|
||||
type: "warning",
|
||||
icon: "download",
|
||||
circle: "",
|
||||
onClick: handleOpenExportsModal
|
||||
}, null, 512), [
|
||||
[_directive_hasPerm, ["module_system:log:export"]]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_col, { span: 1.5 }, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_tooltip, { content: "刷新" }, {
|
||||
default: withCtx(() => [
|
||||
withDirectives(createVNode(_component_el_button, {
|
||||
type: "default",
|
||||
icon: "refresh",
|
||||
circle: "",
|
||||
onClick: handleRefresh
|
||||
}, null, 512), [
|
||||
[_directive_hasPerm, ["module_system:log:query"]]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
])
|
||||
]),
|
||||
withDirectives((openBlock(), createBlock(_component_el_table, {
|
||||
ref: "dataTableRef",
|
||||
data: unref(pageTableData),
|
||||
"highlight-current-row": "",
|
||||
class: "data-table__content",
|
||||
height: "500",
|
||||
"max-height": "500",
|
||||
border: "",
|
||||
stripe: "",
|
||||
onSelectionChange: handleSelectionChange
|
||||
}, {
|
||||
empty: withCtx(() => [
|
||||
createVNode(_component_el_empty, {
|
||||
"image-size": 80,
|
||||
description: "暂无数据"
|
||||
})
|
||||
]),
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_table_column, {
|
||||
prop: "selection",
|
||||
type: "selection",
|
||||
"min-width": "55",
|
||||
align: "center"
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
type: "index",
|
||||
fixed: "",
|
||||
label: "序号",
|
||||
"min-width": "60"
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
createTextVNode(toDisplayString((unref(queryFormData).page_no - 1) * unref(queryFormData).page_size + scope.$index + 1), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "日志类型",
|
||||
prop: "type",
|
||||
"min-width": "100"
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: scope.row.type === 1 ? "success" : "primary"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(scope.row.type === 1 ? "登录日志" : "操作日志"), 1)
|
||||
]),
|
||||
_: 2
|
||||
}, 1032, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "请求路径",
|
||||
prop: "request_path",
|
||||
"min-width": "200",
|
||||
"show-overflow-tooltip": ""
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "请求方法",
|
||||
prop: "request_method",
|
||||
"min-width": "100"
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: getMethodType(scope.row.request_method)
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(scope.row.request_method), 1)
|
||||
]),
|
||||
_: 2
|
||||
}, 1032, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "状态码",
|
||||
prop: "response_code",
|
||||
"min-width": "100"
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: getStatusCodeType(scope.row.response_code)
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(scope.row.response_code), 1)
|
||||
]),
|
||||
_: 2
|
||||
}, 1032, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "请求IP",
|
||||
prop: "request_ip",
|
||||
"min-width": "180",
|
||||
"show-overflow-tooltip": ""
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
createVNode(_component_el_text, null, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(scope.row.request_ip), 1)
|
||||
]),
|
||||
_: 2
|
||||
}, 1024),
|
||||
scope.row.request_ip ? (openBlock(), createBlock(_component_CopyButton, {
|
||||
key: 0,
|
||||
text: scope.row.request_ip,
|
||||
style: { marginLeft: "2px" }
|
||||
}, null, 8, ["text"])) : createCommentVNode("", true)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "处理时间",
|
||||
prop: "process_time",
|
||||
"min-width": "120"
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "浏览器",
|
||||
prop: "request_browser",
|
||||
"min-width": "220",
|
||||
"show-overflow-tooltip": ""
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "系统",
|
||||
prop: "request_os",
|
||||
"min-width": "100"
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "描述",
|
||||
prop: "description",
|
||||
"min-width": "120",
|
||||
"show-overflow-tooltip": ""
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "创建时间",
|
||||
prop: "created_time",
|
||||
"min-width": "200",
|
||||
sortable: ""
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "创建人",
|
||||
prop: "created_id",
|
||||
"min-width": "120"
|
||||
}, {
|
||||
default: withCtx((scope) => {
|
||||
var _a;
|
||||
return [
|
||||
createTextVNode(toDisplayString((_a = scope.row.created_by) == null ? void 0 : _a.name), 1)
|
||||
];
|
||||
}),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "更新人",
|
||||
prop: "updated_id",
|
||||
"min-width": "120"
|
||||
}, {
|
||||
default: withCtx((scope) => {
|
||||
var _a;
|
||||
return [
|
||||
createTextVNode(toDisplayString((_a = scope.row.updated_by) == null ? void 0 : _a.name), 1)
|
||||
];
|
||||
}),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_table_column, {
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
align: "center",
|
||||
"min-width": "150"
|
||||
}, {
|
||||
default: withCtx((scope) => [
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
type: "info",
|
||||
size: "small",
|
||||
link: "",
|
||||
icon: "document",
|
||||
onClick: ($event) => handleOpenDialog("detail", scope.row.id)
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[15] || (_cache[15] = [
|
||||
createTextVNode(" 详情 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])), [
|
||||
[_directive_hasPerm, ["module_system:log:detail"]]
|
||||
]),
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
type: "danger",
|
||||
size: "small",
|
||||
link: "",
|
||||
icon: "delete",
|
||||
onClick: ($event) => handleDelete([scope.row.id])
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[16] || (_cache[16] = [
|
||||
createTextVNode(" 删除 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])), [
|
||||
[_directive_hasPerm, ["module_system:log:delete"]]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["data"])), [
|
||||
[_directive_loading, unref(loading)]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_dialog, {
|
||||
modelValue: unref(dialogVisible).visible,
|
||||
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(dialogVisible).visible = $event),
|
||||
title: unref(dialogVisible).title,
|
||||
onClose: handleCloseDialog
|
||||
}, {
|
||||
footer: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_7, [
|
||||
createVNode(_component_el_button, { onClick: handleCloseDialog }, {
|
||||
default: withCtx(() => [..._cache[17] || (_cache[17] = [
|
||||
createTextVNode("取消", -1)
|
||||
])]),
|
||||
_: 1
|
||||
}),
|
||||
withDirectives((openBlock(), createBlock(_component_el_button, {
|
||||
type: "primary",
|
||||
onClick: handleCloseDialog
|
||||
}, {
|
||||
default: withCtx(() => [..._cache[18] || (_cache[18] = [
|
||||
createTextVNode(" 确定 ", -1)
|
||||
])]),
|
||||
_: 1
|
||||
})), [
|
||||
[_directive_hasPerm, ["module_system:log:detail"]]
|
||||
])
|
||||
])
|
||||
]),
|
||||
default: withCtx(() => [
|
||||
unref(dialogVisible).type === "detail" ? (openBlock(), createBlock(_component_el_descriptions, {
|
||||
key: 0,
|
||||
column: 8,
|
||||
border: "",
|
||||
"label-width": "200px"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "日志类型",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: unref(formData).type === 1 ? "success" : "primary"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).type === 1 ? "登录日志" : "操作日志"), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "请求路径",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).request_path), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "请求方法",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: getMethodType(unref(formData).request_method)
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).request_method), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "响应状态码",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(_component_el_tag, {
|
||||
type: getStatusCodeType(unref(formData).response_code)
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).response_code), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["type"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "请求IP",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).request_ip), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "处理时间",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).process_time), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "浏览器",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).request_browser), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "操作系统",
|
||||
span: 2
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).request_os), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "请求参数",
|
||||
span: 8
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(JsonPretty, {
|
||||
value: unref(formData).request_payload,
|
||||
height: "80px"
|
||||
}, null, 8, ["value"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "响应数据",
|
||||
span: 8
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(JsonPretty, {
|
||||
value: unref(formData).response_json,
|
||||
height: "140px"
|
||||
}, null, 8, ["value"])
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "登录地点",
|
||||
span: 4
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).login_location), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "描述",
|
||||
span: 8
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).description), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "创建人",
|
||||
span: 4
|
||||
}, {
|
||||
default: withCtx(() => {
|
||||
var _a;
|
||||
return [
|
||||
createTextVNode(toDisplayString((_a = unref(formData).created_by) == null ? void 0 : _a.name), 1)
|
||||
];
|
||||
}),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "更新人",
|
||||
span: 4
|
||||
}, {
|
||||
default: withCtx(() => {
|
||||
var _a;
|
||||
return [
|
||||
createTextVNode(toDisplayString((_a = unref(formData).updated_by) == null ? void 0 : _a.name), 1)
|
||||
];
|
||||
}),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "创建时间",
|
||||
span: 4
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).created_time), 1)
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_el_descriptions_item, {
|
||||
label: "更新时间",
|
||||
span: 4
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(formData).updated_time), 1)
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
]),
|
||||
_: 1
|
||||
})) : createCommentVNode("", true)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["modelValue", "title"]),
|
||||
createVNode(_sfc_main$4, {
|
||||
modelValue: unref(exportsDialogVisible),
|
||||
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => isRef(exportsDialogVisible) ? exportsDialogVisible.value = $event : null),
|
||||
"content-config": curdContentConfig,
|
||||
"query-params": unref(queryFormData),
|
||||
"page-data": unref(pageTableData),
|
||||
"selection-data": unref(selectionRows)
|
||||
}, null, 8, ["modelValue", "query-params", "page-data", "selection-data"])
|
||||
]);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
Reference in New Issue
Block a user