fix: 高级检索bug

test
Brian Lee 11 months ago
parent 0aa8adcb37
commit bea6e46bb3

@ -14,7 +14,12 @@ VITE_BASE_URL = /
VITE_DROP_CONSOLE = true
# 跨域代理,可以配置多个,请注意不要换行
VITE_PROXY=[["/api","http://47.93.59.251:8311/jeecg-boot"]]
#VITE_PROXY=[["/api","http://localhost:9090/foodapi"]]
#VITE_PROXY=[["/api","http://81.70.154.131:8311/jeecg-boot"]]
VITE_PROXY=[["/api","http://81.70.154.131:9000/jeecg-boot"]]
#VITE_PROXY=[["/api","http://aiocr-test.prevailcloud.com:8330/jeecg-boot"]]
#VITE_PROXY=[["/api","http://aiocr-uat.prevailcloud.com:8311/jeecg-boot"]]
#VITE_PROXY=[["/api","http://aiocr.prevailcloud.com:8311/jeecg-boot"]]
# API 接口地址
VITE_GLOB_API_URL =
@ -23,7 +28,11 @@ VITE_GLOB_API_URL =
VITE_GLOB_UPLOAD_URL=
# 图片前缀地址
VITE_GLOB_IMG_URL="http://47.93.59.251:8311/jeecg-boot"
#VITE_GLOB_IMG_URL="http://81.70.154.131:8311/jeecg-boot"
VITE_GLOB_IMG_URL="http://81.70.154.131:9000/jeecg-boot"
#VITE_GLOB_IMG_URL="http://aiocr-test.prevailcloud.com:8330/jeecg-boot"
#VITE_GLOB_IMG_URL="http://aiocr-uat.prevailcloud.com:8311/jeecg-boot"
#VITE_GLOB_IMG_URL="http://aiocr.prevailcloud.com:8311/jeecg-boot"
# 接口前缀
VITE_GLOB_API_URL_PREFIX = /api

@ -17,12 +17,16 @@ VITE_GLOB_API_URL =
VITE_GLOB_UPLOAD_URL=
# 图片前缀地址
# 测试环境
#VITE_GLOB_IMG_URL="http://81.70.154.131/api"
VITE_GLOB_IMG_URL="http://81.70.154.131:9000/api"
# 客户uat
#VITE_GLOB_IMG_URL="http://aiocr-uat.prevailcloud.com/api"
# 客户test
#VITE_GLOB_IMG_URL="http://aiocr-test.prevailcloud.com:8330/api"
# 客户生产
#VITE_GLOB_IMG_URL="http://aiocr.prevailcloud.com/api"
# 测试环境
VITE_GLOB_IMG_URL="http://81.70.154.131/api"
# 接口前缀
VITE_GLOB_API_URL_PREFIX = /api

1
components.d.ts vendored

@ -29,6 +29,7 @@ declare module 'vue' {
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem']
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput']
NMessageProvider: typeof import('naive-ui')['NMessageProvider']

@ -66,10 +66,10 @@ const rules: FormRules = {
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
// required: true,
},
// conditions: {
// // required: true,
// },
}
const formRef = ref<FormInst | null>(null)
@ -104,6 +104,12 @@ function handleSumbit(e: MouseEvent) {
}
})
for (const index in list) {
console.info(list)
if (list[index].searchvalue == undefined || list[index].searchvalue == '')
return
}
const param: FilterCondition = {
searchname: formValue.name!,
type: 1,
@ -123,7 +129,7 @@ function formatValue(searchfield: string, searchvalue: any) {
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
if (searchfield != 'izyear' && Array.isArray(searchvalue))
if (searchfield != 'izyear' && Array.isArray(searchvalue))
return searchvalue.join(',')
return searchvalue
@ -303,12 +309,12 @@ defineExpose({
maxlength="15"
@keydown.enter.prevent
/>
<template #feedback>
<template #feedback>
<div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/> 请输入标题内容
</div>
</template>
{{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" /> 请输入标题内容
</div>
</template>
</n-form-item>
<n-form-item v-show="false" path="logic" label="逻辑关系">
<n-select
@ -318,116 +324,114 @@ defineExpose({
:options="logicOptions"
/>
</n-form-item>
<div class="sssscroll">
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izyear'">
<n-date-picker
<div class="sssscroll">
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izyear'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
/>
</n-space>
<n-select
v-else
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
:max-tag-count="1"
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
</n-space>
<n-select
v-else
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button
:style="noBorderInput"
icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0;
<n-button
:style="noBorderInput"
icon-placement="right"
style=" padding: 0;
margin-left: 17px;"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
@click="index == 0 ? () => {} : removeCondition(index)"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
-->
<svg
:style="index==0?'cursor: not-allowed':''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
<svg
:style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
</g>
</g>
</g>
</g>
</svg>
</template>
</n-button>
</svg>
</template>
</n-button>
<template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div>
</template>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/>
<span style="margin-left: 8px;">添加筛选条件</span>
</div>
</div>
<div v-if="formValue.conditions[index].type == null || formValue.conditions[index].result == null || formValue.conditions[index].result == ''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" />请选择过滤条件
</div>
</template>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px;">添加筛选条件</span>
</div>
</div>
</n-form>
</div>
</div>
<div class="bottomline"></div>
<div class="bottomline" />
<template #footer>
<div class="wrapper-footer">
<n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit">
@ -522,7 +526,7 @@ margin-bottom: 40px;
}
/* 定义滚动条的宽度及背景颜色 */
::-webkit-scrollbar {
position: fixed;
width: 2px; /* for vertical scrollbars */
height: 10px; /* for horizontal scrollbars */
@ -531,7 +535,7 @@ margin-bottom: 40px;
/* 定义滚动条轨道的样式 */
::-webkit-scrollbar-track {
background-color: #e1e1e1;
border-radius: 10px; /* 圆角 */
}
@ -545,7 +549,7 @@ margin-bottom: 40px;
/* 滑块hover时的样式 */
::-webkit-scrollbar-thumb:hover {
background-color: #555;
}
::v-deep(.n-form-item .n-form-item-label) {

@ -1,6 +1,7 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, defineOptions, onBeforeMount, reactive, ref, unref, watch,h } from 'vue'
import { computed, defineOptions, h, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { forEach } from 'lodash'
import { asideMap } from '@/config/aside'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
@ -11,9 +12,9 @@ import SvgIcon from '@/components/Icon/SvgIcon.vue'
type Status = 'edit' | 'new'
const emit = defineEmits(['onOk','handleOk','select'])
const emit = defineEmits(['onOk', 'handleOk', 'select'])
const show = ref(false)
const editValue=ref({})
const editValue = ref({})
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
@ -29,7 +30,7 @@ const cardStyle = {
}
const noBorderInput = {
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
@ -68,9 +69,11 @@ const rules: FormRules = {
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
},
// conditions: {
// required: true,
// message: '',
// trigger: 'blur',
// },
}
const formRef = ref<FormInst | null>(null)
@ -106,6 +109,12 @@ function handleSumbit(e: MouseEvent) {
}
})
for (const index in list) {
console.info(list)
if (list[index].searchvalue == undefined || list[index].searchvalue == '')
return
}
const param: FilterCondition = {
searchname: formValue.name!,
type: 0,
@ -116,16 +125,15 @@ function handleSumbit(e: MouseEvent) {
addCondition(param)
else updateCondition({ id: currentEditId!, ...param })
console.log(editValue.value)
let obj=editValue.value
if(currentStatus.value != 'new'){
obj.searchname=param.searchname
const obj = editValue.value
if (currentStatus.value != 'new')
obj.searchname = param.searchname
// obj.ocrUsersearchchildList=param.ocrUsersearchchildList
}
emit('handleOk', obj)
if(currentStatus.value != 'new'){
emit('select', currentEditId)
}
emit('handleOk', obj)
if (currentStatus.value != 'new')
emit('select', currentEditId)
closeModal()
})
@ -153,8 +161,9 @@ function unformatValue(searchfield: string, searchvalue: any) {
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
}else if(searchfield !="izsimilarity"){
searchvalue= searchvalue.split(",");
}
else if (searchfield != 'izsimilarity') {
searchvalue = searchvalue.split(',')
}
// 80,90
@ -288,7 +297,7 @@ function leaveHandler() {
function edit(editFilter: any) {
currentStatus.value = 'edit'
console.log(editFilter, 'editFilter')
editValue.value=editFilter
editValue.value = editFilter
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
@ -300,15 +309,14 @@ function edit(editFilter: any) {
}
})
}
function createTimeForNumber (type) {
console.log(formValue.name)
if(formValue.name){
return ``}
else{
return `请输入标题内容`
}
function createTimeForNumber(type) {
console.log(formValue.name)
if (formValue.name)
return ``
else
return `请输入标题内容`
}
let inputNumberFeedback= createTimeForNumber(1)
const inputNumberFeedback = createTimeForNumber(1)
defineExpose({
showModal,
edit,
@ -316,12 +324,12 @@ defineExpose({
watch(
() => formValue.name,
(newVal) => {
console.log(formValue.name)
if(formValue.name){
createTimeForNumber(0)
}else{
createTimeForNumber(1)
}
console.log(formValue.name)
if (formValue.name)
createTimeForNumber(0)
else
createTimeForNumber(1)
},
)
</script>
@ -361,7 +369,7 @@ if(formValue.name){
:rules="rules"
require-mark-placement="left"
>
<n-form-item path="name" label="标题" merged-require-mark-placement="left" >
<n-form-item path="name" label="标题" merged-require-mark-placement="left">
<!-- j -->
<n-input
v-model:value="formValue.name"
@ -370,12 +378,12 @@ if(formValue.name){
placeholder="请输入过滤条件名称"
@keydown.enter.prevent
/>
<template #feedback>
<template #feedback>
<div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}}
<SvgIcon size="16" name="notice" style="margin-top: -2px;"/> {{ inputNumberFeedback }}
</div>
</template>
{{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;" /> {{ inputNumberFeedback }}
</div>
</template>
</n-form-item>
<n-form-item v-show="false" path="logic" label="逻辑关系">
<n-select
@ -385,118 +393,116 @@ if(formValue.name){
:options="logicOptions"
/>
</n-form-item>
<div class="sssscroll">
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izyear'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
<div class="sssscroll">
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
</n-space>
<n-select
v-else
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izyear'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
/>
</n-space>
<n-select
v-else
v-model:value="item.result"
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button
:style="noBorderInput"
icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0;
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button
:style="noBorderInput"
icon-placement="right"
style=" padding: 0;
margin-left: 17px;"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
@click="index == 0 ? () => {} : removeCondition(index)"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
-->
<svg
:style="index==0?'cursor: not-allowed':''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
<svg
:style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
</g>
</g>
</g>
</g>
</svg>
</svg>
</template>
</n-button>
<template #feedback>
<div v-if="formValue.conditions[index].type == null || formValue.conditions[index].result == null || formValue.conditions[index].result == ''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" />请选择过滤条件
</div>
</template>
</n-button>
<template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div>
</template>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/>
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
</n-form>
</div>
</div>
<div class="bottomline"></div>
<div class="bottomline" />
<template #footer>
<div class="wrapper-footer">
<n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit">
@ -617,7 +623,7 @@ if(formValue.name){
}
/* 定义滚动条的宽度及背景颜色 */
::-webkit-scrollbar {
position: fixed;
width: 2px; /* for vertical scrollbars */
height: 10px; /* for horizontal scrollbars */
@ -626,7 +632,7 @@ if(formValue.name){
/* 定义滚动条轨道的样式 */
::-webkit-scrollbar-track {
background-color: #e1e1e1;
border-radius: 10px; /* 圆角 */
}
@ -640,7 +646,7 @@ if(formValue.name){
/* 滑块hover时的样式 */
::-webkit-scrollbar-thumb:hover {
background-color: #555;
}
::v-deep(.n-form-item .n-form-item-label) {

@ -65,9 +65,9 @@ const rules: FormRules = {
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
},
// conditions: {
// },
}
const formRef = ref<FormInst | null>(null)
@ -101,6 +101,11 @@ function handleSumbit(e: MouseEvent) {
orderNum: index + 1,
}
})
for (const index in list) {
console.info(list)
if (list[index].searchvalue == undefined || list[index].searchvalue == '')
return
}
const param: FilterCondition = {
searchname: formValue.name!,
@ -121,7 +126,7 @@ function formatValue(searchfield: string, searchvalue: any) {
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
if (searchfield != 'izyear' && Array.isArray(searchvalue))
if (searchfield != 'izyear' && Array.isArray(searchvalue))
return searchvalue.join(',')
return searchvalue
@ -163,7 +168,7 @@ const operatorOptions = [
label: '等于',
value: 'eq',
},
]
const logicOptions = ref([])
@ -236,13 +241,12 @@ function leaveHandler() {
},
]
}
function createTimeForNumber (type) {
console.log(formValue.name)
if(formValue.name){
return ``}
else{
return `请输入标题内容`
}
function createTimeForNumber(type) {
console.log(formValue.name)
if (formValue.name)
return ``
else
return `请输入标题内容`
}
function edit(editFilter: any) {
currentStatus.value = 'edit'
@ -261,12 +265,12 @@ function edit(editFilter: any) {
watch(
() => formValue.name,
(newVal) => {
console.log(formValue.name)
if(formValue.name){
createTimeForNumber(0)
}else{
createTimeForNumber(1)
}
console.log(formValue.name)
if (formValue.name)
createTimeForNumber(0)
else
createTimeForNumber(1)
},
)
defineExpose({
@ -309,7 +313,6 @@ defineExpose({
:rules="rules"
require-mark-placement="left"
>
<n-form-item path="name" label="标题">
<n-input
v-model:value="formValue.name"
@ -320,10 +323,10 @@ defineExpose({
/>
<template #feedback>
<div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/> 请输入标题内容
</div>
</template>
{{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" /> 请输入标题内容
</div>
</template>
</n-form-item>
<n-form-item v-show="false" path="logic" label="逻辑关系">
<n-select
@ -334,123 +337,123 @@ defineExpose({
/>
</n-form-item>
<div class="sssscroll">
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izuptime'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
<n-form-item
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
</n-space>
<n-select
v-else
<n-select
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izuptime'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
/>
</n-space>
<n-select
v-else
v-model:value="item.result"
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button
:style="noBorderInput"
icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0;
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button
:style="noBorderInput"
icon-placement="right"
style=" padding: 0;
margin-left: 17px;"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
@click="index == 0 ? () => {} : removeCondition(index)"
>
<template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/>
-->
<svg
:style="index==0?'cursor: not-allowed':''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
<svg
:style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px"
height="24px"
viewBox="0 0 64 64"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>清除</title>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
id="页面-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
<g
id="PrevailCloud-Design-图标集"
transform="translate(-3040.000000, -3118.000000)"
fill-rule="nonzero"
>
<g id="清除" transform="translate(3040.000000, 3118.000000)">
<rect
id="矩形"
fill="#000000"
opacity="0"
x="0"
y="0"
width="64"
height="64"
/>
<path
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
/>
</g>
</g>
</g>
</g>
</svg>
</svg>
</template>
</n-button>
<template #feedback>
<div v-if="formValue.conditions[index].type == null || formValue.conditions[index].result == null || formValue.conditions[index].result == ''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" />请选择过滤条件
</div>
</template>
</n-button>
<template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050">
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div>
</template>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/>
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
</n-form-item>
<div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
</n-form>
</div>
</div>
<div class="bottomline"></div>
<div class="bottomline" />
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit" style="width: 72px;height: 38px;
">
<n-button
type="info" style="width: 72px;height: 38px;
" @click="handleSumbit"
>
保存
</n-button>
<n-button secondary style="margin-left: 15px ;width: 72px;height: 38px;background-color: #fff; border:1px solid rgb(202, 210, 221)" @click="closeModal" >
<n-button secondary style="margin-left: 15px ;width: 72px;height: 38px;background-color: #fff; border:1px solid rgb(202, 210, 221)" @click="closeModal">
取消
</n-button>
</div>
@ -545,7 +548,7 @@ defineExpose({
}
/* 定义滚动条的宽度及背景颜色 */
::-webkit-scrollbar {
position: fixed;
width: 2px; /* for vertical scrollbars */
height: 10px; /* for horizontal scrollbars */
@ -554,7 +557,7 @@ defineExpose({
/* 定义滚动条轨道的样式 */
::-webkit-scrollbar-track {
background-color: #e1e1e1;
border-radius: 10px; /* 圆角 */
}
@ -568,7 +571,7 @@ defineExpose({
/* 滑块hover时的样式 */
::-webkit-scrollbar-thumb:hover {
background-color: #555;
}
::v-deep(.n-form-item .n-form-item-label) {

Loading…
Cancel
Save