|
|
@@ -0,0 +1,55 @@
|
|
|
+<template>
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns" :tools="false"
|
|
|
+ :bodyStyle="{ padding: 0 }" />
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, reactive, watch } from 'vue';
|
|
|
+import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
+
|
|
|
+defineOptions({ name: 'SearchLog' });
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ row: {
|
|
|
+ type: Object,
|
|
|
+ default() {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
+/** 页面组件实例 */
|
|
|
+const pageRef = ref(null);
|
|
|
+
|
|
|
+const pageConfig = reactive({
|
|
|
+ fileName: '搜索记录',
|
|
|
+ cacheKey: 'searchLogTable'
|
|
|
+});
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.row,
|
|
|
+ (row) => {
|
|
|
+ if (!row || (row && !row.id)) return;
|
|
|
+ pageConfig.pageUrl = `/user/userSearchLog/getUserSearchLogList/${row.id}`;
|
|
|
+ pageRef.value?.reload();
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+/** 表格列配置 */
|
|
|
+const columns = ref([
|
|
|
+ { label: '序号', type: 'index', align: 'center', width: 60 },
|
|
|
+ { label: '搜索词', prop: 'keyword', align: 'center' },
|
|
|
+ { label: '点击商品', prop: 'bookName', align: 'center' },
|
|
|
+ { label: '搜索时间', prop: 'createTime', align: 'center' },
|
|
|
+ { label: '是否加购', prop: 'isAddCart', align: 'center' },
|
|
|
+ { label: '是否下单', prop: 'isOrdered', align: 'center' }
|
|
|
+]);
|
|
|
+
|
|
|
+//刷新表格
|
|
|
+function reload(where) {
|
|
|
+ pageRef.value?.reload(where);
|
|
|
+}
|
|
|
+</script>
|