feat(search): 调整搜索组件j-advanced-search 组件改为 j-search 组件并调整搜索配置,应用名称改为dr-iot,去除头部菜单logo右侧间距

This commit is contained in:
fhysy 2025-04-08 15:18:36 +08:00
parent 99f450eed3
commit e7bfb4084e
20 changed files with 107 additions and 88 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "jetlinks-vue", "name": "dr-iot",
"private": true, "private": true,
"version": "2.2.1", "version": "2.2.1",
"scripts": { "scripts": {

View File

@ -1,11 +1,7 @@
<template> <template>
<j-advanced-search <j-search
:target='target' :target='target'
:type='type' :columns='processedColumns'
:request='(data) => saveSearchHistory(data, target)'
:historyRequest='() => getSearchHistory(target)'
:deleteRequest='(_target: string, id: string) => deleteSearchHistory(target, id)'
:columns='columns'
:class='props.class' :class='props.class'
style='padding-top: 18px; padding-bottom: 18px;' style='padding-top: 18px; padding-bottom: 18px;'
@search='searchSubmit' @search='searchSubmit'
@ -29,7 +25,7 @@ const props = defineProps({
}, },
type: { type: {
type: String, type: String,
default: 'advanced' default: 'terms'
}, },
target: { target: {
type: String, type: String,
@ -44,10 +40,33 @@ const props = defineProps({
const emit = defineEmits<Emit>() const emit = defineEmits<Emit>()
// searchdefaultValue
const processedColumns = computed(() => {
return props.columns.map(column => {
// searchdefaultValuedefaultValue
if (column.search && !column.search.hasOwnProperty('defaultValue')) {
return {
...column,
search: {
...column.search,
defaultValue: null
}
}
}
return column
})
})
/** /**
* 提交 * 提交
*/ */
const searchSubmit = (data: any) => { const searchSubmit = (data: any) => {
console.log("搜索--------",data)
data = {
terms:[{
terms:data
}]
}
emit('search', data) emit('search', data)
} }

View File

@ -25,7 +25,7 @@ body {
.ant-pro-basicLayout { .ant-pro-basicLayout {
.ant-pro-top-nav-header-main { .ant-pro-top-nav-header-main {
gap: 16px; //gap: 16px;
} }
.ant-pro-top-nav-header { .ant-pro-top-nav-header {

View File

@ -144,9 +144,9 @@ const columns = [
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
scopedSlots: true, scopedSlots: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
ellipsis: true, ellipsis: true,
}, },
{ {
@ -186,9 +186,9 @@ const columns = [
dataIndex: 'requestTime', dataIndex: 'requestTime',
key: 'requestTime', key: 'requestTime',
scopedSlots: true, scopedSlots: true,
search: { // search: {
type: 'date', // type: 'rangePicker',
}, // },
width: 200, width: 200,
}, },
{ {

View File

@ -172,9 +172,9 @@ const columns = [
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
search: { // search: {
type: 'date', // type: 'date',
}, // },
scopedSlots: true, scopedSlots: true,
width: 200, width: 200,
}, },

View File

@ -102,27 +102,27 @@ const query = reactive({
type: 'string', type: 'string',
}, },
}, },
{ // {
title: '排序', // title: '',
dataIndex: 'sortIndex', // dataIndex: 'sortIndex',
key: 'sortIndex', // key: 'sortIndex',
search: { // search: {
type: 'number', // type: 'number',
componentProps: { // componentProps: {
precision: 0, // precision: 0,
min: 1, // min: 1,
}, // },
}, // },
scopedSlots: true, // scopedSlots: true,
}, // },
{ // {
title: '说明', // title: '',
key: 'description', // key: 'description',
dataIndex: 'description', // dataIndex: 'description',
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, // },
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',

View File

@ -310,9 +310,9 @@ const columns = [
key: 'createTime', key: 'createTime',
scopedSlots: true, scopedSlots: true,
width: 200, width: 200,
search: { // search: {
type: 'date', // type: 'date',
}, // },
}, },
{ {
title: '状态', title: '状态',
@ -472,9 +472,9 @@ const columns = [
dataIndex: 'describe', dataIndex: 'describe',
key: 'describe', key: 'describe',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -555,9 +555,9 @@ const query = reactive({
title: '说明', title: '说明',
key: 'describe', key: 'describe',
dataIndex: 'describe', dataIndex: 'describe',
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '产品分类', title: '产品分类',

View File

@ -260,9 +260,9 @@ const columns = [
title: '说明', title: '说明',
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -106,9 +106,9 @@ const columns = [
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -196,9 +196,9 @@ const columns = [
title: '说明', title: '说明',
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
search: { // search: {
type: 'string', // type: 'string',
}, // },
ellipsis: true, ellipsis: true,
}, },
{ {

View File

@ -261,9 +261,9 @@ const columns = [
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -267,9 +267,9 @@ const columns = [
key: 'description', key: 'description',
scopedSlots: true, scopedSlots: true,
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -259,9 +259,9 @@ const columns = [
key: 'description', key: 'description',
scopedSlots: true, scopedSlots: true,
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -333,9 +333,9 @@ const columns = [
title: '说明', title: '说明',
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
search: { // search: {
type: 'string', // type: 'string',
}, // },
ellipsis: true, ellipsis: true,
}, },
{ {

View File

@ -264,9 +264,9 @@ const columns = [
title: '最近告警时间', title: '最近告警时间',
dataIndex: 'alarmTime', dataIndex: 'alarmTime',
key: 'alarmTime', key: 'alarmTime',
search: { // search: {
type: 'date', // type: 'rangePicker',
}, // },
scopedSlots: true, scopedSlots: true,
}, },
{ {

View File

@ -217,9 +217,9 @@ const columns = [
dataIndex: 'description', dataIndex: 'description',
title: '说明', title: '说明',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'string', // type: 'string',
}, // },
scopedSlots: true, scopedSlots: true,
}, },
{ {

View File

@ -146,9 +146,9 @@ const columns = [
dataIndex: 'sortIndex', dataIndex: 'sortIndex',
key: 'sortIndex', key: 'sortIndex',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'number', // type: 'number',
}, // },
width: 80, width: 80,
}, },
{ {
@ -163,9 +163,9 @@ const columns = [
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
ellipsis: true, ellipsis: true,
search: { // search: {
type: 'date', // type: 'date',
}, // },
width: 180, width: 180,
scopedSlots: true, scopedSlots: true,
}, },

View File

@ -146,9 +146,9 @@ const columns = [
key: 'description', key: 'description',
ellipsis: true, ellipsis: true,
fixed: 'left', fixed: 'left',
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',

View File

@ -89,9 +89,9 @@ const columns = [
key: 'description', key: 'description',
ellipsis: true, ellipsis: true,
dataIndex: 'description', dataIndex: 'description',
search: { // search: {
type: 'string', // type: 'string',
}, // },
}, },
{ {
title: '操作', title: '操作',