提交 a8757360 authored 作者: 龙菲's avatar 龙菲

日志管理增加查询功能

上级 73b9875f
......@@ -11,22 +11,37 @@
:placeholder="`请输入${item.placeholder || item.label}`"
@keyup.enter.native="handleSearch"
clearable
@input="handleInputChange"
></el-input>
<!-- @input="handleInputChange" -->
<el-select
v-if="item.type == 'select'"
v-model="searchData[item.prop]"
:placeholder="`请选择${item.placeholder || item.label}`"
@change="handleSelectChange"
clearable
filterable
allow-create
>
<el-option
:label="option.label"
:value="option.value"
v-for="option in item.selectOptions"
:key="option.value"
></el-option>
</el-select>
<!-- @change="handleSelectChange" -->
<el-date-picker
v-if="item.type == 'dateTimeRange'"
v-model="searchData[item.prop]"
type="datetimerange"
align="right"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
:picker-options="pickerOptions"
:value-format="'yyyy-MM-dd HH:mm:ss'"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
......@@ -108,6 +123,37 @@ export default {
data() {
return {
searchData: {},
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
......@@ -121,7 +167,7 @@ export default {
handleSelectChange() {
this.handleSearch();
},
handleInputChange: Debounce(function(e) {
handleInputChange: Debounce(function (e) {
this.handleSearch();
}, 600),
},
......
......@@ -75,8 +75,7 @@
v-if="
$getFullUrl(data.scope.faceImagePressUrl || data.scope.faceImageUrl)
"
style="cursor: pointer"
width="100px"
style="cursor: pointer;width: 80px;height: 80px;object-fit: contain;"
@click="handelPreviewImages(data.scope.faceImageUrl)"
/>
</template>
......
<template>
<div class="app-container">
<div class="top-bar">
<!-- <SearchBar :config="searchConfig" @search="search" @reset="reset" /> -->
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
</div>
<TablePage
:data="list.records"
:tableTitle="tableTitle"
>
</TablePage>
<TablePage :data="list.records" :tableTitle="tableTitle"> </TablePage>
<el-pagination
@size-change="handleSizeChange"
......@@ -50,31 +46,115 @@ export default {
status: "",
},
searchConfig: [
{ prop: "sourceName", type: "input", label: "资源名称" },
{
prop: "name",
type: "input",
label: "文献名称",
prop: "sourceType",
type: "select",
label: "资源类型",
selectOptions: [
{
label: "文物",
value: "文物",
},
{
prop: "authors",
type: "input",
label: "作者",
label: "布展",
value: "布展",
},
{
prop: "status",
label: "虚拟展",
value: "虚拟展",
},
{
label: "博物馆",
value: "博物馆",
},
{
label: "文创",
value: "文创",
},
{
label: "角色",
value: "角色",
},
{
label: "用户",
value: "用户",
},
],
},
{
prop: "optType",
type: "select",
label: "状态",
label: "操作类型",
selectOptions: [
{
label: "已上架",
value: "1",
label: "删除",
value: "删除",
},
{
label: "修改",
value: "修改",
},
{
label: "新增",
value: "新增",
},
{
label: "上架",
value: "上架",
},
{
label: "已下架",
value: "0",
label: "下架",
value: "下架",
},
{
label: "点赞",
value: "点赞",
},
{
label: "收藏",
value: "收藏",
},
{
label: "分享",
value: "分享",
},
{
label: "取消点赞",
value: "取消点赞",
},
{
label: "取消收藏",
value: "取消收藏",
},
{
label: "浏览",
value: "浏览",
},
],
},
{
prop: "createTime",
type: "dateTimeRange",
label: "操作日期",
},
{
prop: "ip",
type: "input",
label: "用户IP地址",
},
// {
// prop: "userId",
// type: "input",
// label: "用户ID",
// },
{
prop: "username",
type: "input",
label: "用户名",
},
],
};
},
......@@ -101,15 +181,21 @@ export default {
},
methods: {
async search(form) {
this.list.current = 1;
var params = {
page: this.list.current,
limit: this.list.size,
...form,
};
if (params.status == "") {
delete params.status;
if (params.createTime && params.createTime.length > 0) {
params.startTime = params.createTime[0];
params.endTime = params.createTime[1];
}
console.log("params", params);
if (params.createTime) {
delete params.createTime;
}
let res = await getLogList(params);
if (res.code == 0) {
this.list = res.data;
......
......@@ -153,7 +153,6 @@ export default {
permissions,
remark,
};
console.log(params);
if (this.dialogForm.id) {
params.id = this.dialogForm.id;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论