Merge branch '2.2-dev' of https://git.drgyen.cn/0017/iot-ui-vue into 2.2-dev
This commit is contained in:
commit
fc3fa617a4
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "jetlinks-vue",
|
||||
"name": "dr-iot",
|
||||
"private": true,
|
||||
"version": "2.2.1",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
<template>
|
||||
<j-advanced-search
|
||||
<j-search
|
||||
:target='target'
|
||||
:type='type'
|
||||
:request='(data) => saveSearchHistory(data, target)'
|
||||
:historyRequest='() => getSearchHistory(target)'
|
||||
:deleteRequest='(_target: string, id: string) => deleteSearchHistory(target, id)'
|
||||
:columns='columns'
|
||||
:columns='processedColumns'
|
||||
:class='props.class'
|
||||
style='padding-top: 18px; padding-bottom: 18px;'
|
||||
@search='searchSubmit'
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang='ts' name='ProSearch'>
|
||||
import { PropType } from 'vue'
|
||||
|
@ -29,7 +25,7 @@ const props = defineProps({
|
|||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'advanced'
|
||||
default: 'terms'
|
||||
},
|
||||
target: {
|
||||
type: String,
|
||||
|
@ -44,10 +40,33 @@ const props = defineProps({
|
|||
|
||||
const emit = defineEmits<Emit>()
|
||||
|
||||
// 处理列配置,为每个带有search的列自动添加defaultValue(如果没有的话)
|
||||
const processedColumns = computed(() => {
|
||||
return props.columns.map(column => {
|
||||
// 如果列有search配置但没有defaultValue,则添加一个空的defaultValue
|
||||
if (column.search && !column.search.hasOwnProperty('defaultValue')) {
|
||||
return {
|
||||
...column,
|
||||
search: {
|
||||
...column.search,
|
||||
defaultValue: null
|
||||
}
|
||||
}
|
||||
}
|
||||
return column
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
const searchSubmit = (data: any) => {
|
||||
console.log("搜索--------",data)
|
||||
data = {
|
||||
terms:[{
|
||||
terms:data
|
||||
}]
|
||||
}
|
||||
emit('search', data)
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ body {
|
|||
|
||||
.ant-pro-basicLayout {
|
||||
.ant-pro-top-nav-header-main {
|
||||
gap: 16px;
|
||||
//gap: 16px;
|
||||
}
|
||||
|
||||
.ant-pro-top-nav-header {
|
||||
|
|
|
@ -144,9 +144,9 @@ const columns = [
|
|||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
scopedSlots: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
|
@ -186,9 +186,9 @@ const columns = [
|
|||
dataIndex: 'requestTime',
|
||||
key: 'requestTime',
|
||||
scopedSlots: true,
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
// search: {
|
||||
// type: 'rangePicker',
|
||||
// },
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -172,9 +172,9 @@ const columns = [
|
|||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
// search: {
|
||||
// type: 'date',
|
||||
// },
|
||||
scopedSlots: true,
|
||||
width: 200,
|
||||
},
|
||||
|
|
|
@ -102,27 +102,27 @@ const query = reactive({
|
|||
type: 'string',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'sortIndex',
|
||||
key: 'sortIndex',
|
||||
search: {
|
||||
type: 'number',
|
||||
componentProps: {
|
||||
precision: 0,
|
||||
min: 1,
|
||||
},
|
||||
},
|
||||
scopedSlots: true,
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
key: 'description',
|
||||
dataIndex: 'description',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// dataIndex: 'sortIndex',
|
||||
// key: 'sortIndex',
|
||||
// search: {
|
||||
// type: 'number',
|
||||
// componentProps: {
|
||||
// precision: 0,
|
||||
// min: 1,
|
||||
// },
|
||||
// },
|
||||
// scopedSlots: true,
|
||||
// },
|
||||
// {
|
||||
// title: '说明',
|
||||
// key: 'description',
|
||||
// dataIndex: 'description',
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
|
|
|
@ -310,9 +310,9 @@ const columns = [
|
|||
key: 'createTime',
|
||||
scopedSlots: true,
|
||||
width: 200,
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
// search: {
|
||||
// type: 'date',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
|
@ -472,9 +472,9 @@ const columns = [
|
|||
dataIndex: 'describe',
|
||||
key: 'describe',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -555,9 +555,9 @@ const query = reactive({
|
|||
title: '说明',
|
||||
key: 'describe',
|
||||
dataIndex: 'describe',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '产品分类',
|
||||
|
|
|
@ -260,9 +260,9 @@ const columns = [
|
|||
title: '说明',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -106,9 +106,9 @@ const columns = [
|
|||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -196,9 +196,9 @@ const columns = [
|
|||
title: '说明',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -261,9 +261,9 @@ const columns = [
|
|||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -267,9 +267,9 @@ const columns = [
|
|||
key: 'description',
|
||||
scopedSlots: true,
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -259,9 +259,9 @@ const columns = [
|
|||
key: 'description',
|
||||
scopedSlots: true,
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -333,9 +333,9 @@ const columns = [
|
|||
title: '说明',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -264,9 +264,9 @@ const columns = [
|
|||
title: '最近告警时间',
|
||||
dataIndex: 'alarmTime',
|
||||
key: 'alarmTime',
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
// search: {
|
||||
// type: 'rangePicker',
|
||||
// },
|
||||
scopedSlots: true,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -217,9 +217,9 @@ const columns = [
|
|||
dataIndex: 'description',
|
||||
title: '说明',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
scopedSlots: true,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -146,9 +146,9 @@ const columns = [
|
|||
dataIndex: 'sortIndex',
|
||||
key: 'sortIndex',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'number',
|
||||
},
|
||||
// search: {
|
||||
// type: 'number',
|
||||
// },
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
|
@ -163,9 +163,9 @@ const columns = [
|
|||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
// search: {
|
||||
// type: 'date',
|
||||
// },
|
||||
width: 180,
|
||||
scopedSlots: true,
|
||||
},
|
||||
|
|
|
@ -146,9 +146,9 @@ const columns = [
|
|||
key: 'description',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -89,9 +89,9 @@ const columns = [
|
|||
key: 'description',
|
||||
ellipsis: true,
|
||||
dataIndex: 'description',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
// search: {
|
||||
// type: 'string',
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
Loading…
Reference in New Issue