fix: 高级检索bug

test
Brian Lee 11 months ago
parent 0aa8adcb37
commit bea6e46bb3

@ -14,7 +14,12 @@ VITE_BASE_URL = /
VITE_DROP_CONSOLE = true 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 接口地址 # API 接口地址
VITE_GLOB_API_URL = VITE_GLOB_API_URL =
@ -23,7 +28,11 @@ VITE_GLOB_API_URL =
VITE_GLOB_UPLOAD_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 VITE_GLOB_API_URL_PREFIX = /api

@ -17,12 +17,16 @@ VITE_GLOB_API_URL =
VITE_GLOB_UPLOAD_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 # 客户uat
#VITE_GLOB_IMG_URL="http://aiocr-uat.prevailcloud.com/api" #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://aiocr.prevailcloud.com/api"
# 测试环境
VITE_GLOB_IMG_URL="http://81.70.154.131/api"
# 接口前缀 # 接口前缀
VITE_GLOB_API_URL_PREFIX = /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'] NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid'] NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem'] NGridItem: typeof import('naive-ui')['NGridItem']
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage'] NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']

@ -66,10 +66,10 @@ const rules: FormRules = {
message: '请选择逻辑关系', message: '请选择逻辑关系',
trigger: 'blur', trigger: 'blur',
}, },
conditions: { // conditions: {
// required: true, // // required: true,
}, // },
} }
const formRef = ref<FormInst | null>(null) 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 = { const param: FilterCondition = {
searchname: formValue.name!, searchname: formValue.name!,
type: 1, type: 1,
@ -305,8 +311,8 @@ defineExpose({
/> />
<template #feedback> <template #feedback>
<div v-show="!formValue.name" style="color:#d03050"> <div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}} {{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/> 请输入标题内容 <SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" /> 请输入标题内容
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
@ -350,9 +356,9 @@ defineExpose({
</n-space> </n-space>
<n-select <n-select
v-else v-else
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result" v-model:value="item.result"
:max-tag-count="1"
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable filterable
style="margin-left: 8px" style="margin-left: 8px"
placeholder="请选择" placeholder="请选择"
@ -361,15 +367,15 @@ defineExpose({
<n-button <n-button
:style="noBorderInput" :style="noBorderInput"
icon-placement="right" icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0; style=" padding: 0;
margin-left: 17px;" margin-left: 17px;"
@click="index == 0 ? () => {} : removeCondition(index)"
> >
<template #icon> <template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/> <!-- <SvgIcon size="24" name="close" color="#F00"/>
--> -->
<svg <svg
:style="index==0?'cursor: not-allowed':''" :style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px" width="24px"
height="24px" height="24px"
viewBox="0 0 64 64" viewBox="0 0 64 64"
@ -412,22 +418,20 @@ defineExpose({
</template> </template>
</n-button> </n-button>
<template #feedback> <template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050"> <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;" />请选择过滤条件
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
<div class="wrapper-new" @click="createCondition"> <div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/> <SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px;">添加筛选条件</span> <span style="margin-left: 8px;">添加筛选条件</span>
</div> </div>
</div> </div>
</n-form> </n-form>
</div> </div>
</div> </div>
<div class="bottomline"></div> <div class="bottomline" />
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit"> <n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit">

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from 'naive-ui' 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 { asideMap } from '@/config/aside'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
@ -11,9 +12,9 @@ import SvgIcon from '@/components/Icon/SvgIcon.vue'
type Status = 'edit' | 'new' type Status = 'edit' | 'new'
const emit = defineEmits(['onOk','handleOk','select']) const emit = defineEmits(['onOk', 'handleOk', 'select'])
const show = ref(false) const show = ref(false)
const editValue=ref({}) const editValue = ref({})
const configStore = useConfig() const configStore = useConfig()
const dicStore = useDictionary() const dicStore = useDictionary()
const currentStatus = ref<Status>('new') const currentStatus = ref<Status>('new')
@ -68,9 +69,11 @@ const rules: FormRules = {
message: '请选择逻辑关系', message: '请选择逻辑关系',
trigger: 'blur', trigger: 'blur',
}, },
conditions: { // conditions: {
// required: true,
}, // message: '',
// trigger: 'blur',
// },
} }
const formRef = ref<FormInst | null>(null) 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 = { const param: FilterCondition = {
searchname: formValue.name!, searchname: formValue.name!,
type: 0, type: 0,
@ -116,16 +125,15 @@ function handleSumbit(e: MouseEvent) {
addCondition(param) addCondition(param)
else updateCondition({ id: currentEditId!, ...param }) else updateCondition({ id: currentEditId!, ...param })
console.log(editValue.value) console.log(editValue.value)
let obj=editValue.value const obj = editValue.value
if(currentStatus.value != 'new'){ if (currentStatus.value != 'new')
obj.searchname=param.searchname obj.searchname = param.searchname
// obj.ocrUsersearchchildList=param.ocrUsersearchchildList // obj.ocrUsersearchchildList=param.ocrUsersearchchildList
}
emit('handleOk', obj) emit('handleOk', obj)
if(currentStatus.value != 'new'){ if (currentStatus.value != 'new')
emit('select', currentEditId) emit('select', currentEditId)
}
closeModal() closeModal()
}) })
@ -153,8 +161,9 @@ function unformatValue(searchfield: string, searchvalue: any) {
const start = formatToDate3(dataStrs[0]) const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1]) const end = formatToDate3(dataStrs[1])
return [start, end] return [start, end]
}else if(searchfield !="izsimilarity"){ }
searchvalue= searchvalue.split(","); else if (searchfield != 'izsimilarity') {
searchvalue = searchvalue.split(',')
} }
// 80,90 // 80,90
@ -288,7 +297,7 @@ function leaveHandler() {
function edit(editFilter: any) { function edit(editFilter: any) {
currentStatus.value = 'edit' currentStatus.value = 'edit'
console.log(editFilter, 'editFilter') console.log(editFilter, 'editFilter')
editValue.value=editFilter editValue.value = editFilter
const { searchname, ocrUsersearchchildList, id } = editFilter const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id currentEditId = id
formValue.name = searchname formValue.name = searchname
@ -300,15 +309,14 @@ function edit(editFilter: any) {
} }
}) })
} }
function createTimeForNumber (type) { function createTimeForNumber(type) {
console.log(formValue.name) console.log(formValue.name)
if(formValue.name){ if (formValue.name)
return ``} return ``
else{ else
return `请输入标题内容` return `请输入标题内容`
}
} }
let inputNumberFeedback= createTimeForNumber(1) const inputNumberFeedback = createTimeForNumber(1)
defineExpose({ defineExpose({
showModal, showModal,
edit, edit,
@ -316,12 +324,12 @@ defineExpose({
watch( watch(
() => formValue.name, () => formValue.name,
(newVal) => { (newVal) => {
console.log(formValue.name) console.log(formValue.name)
if(formValue.name){ if (formValue.name)
createTimeForNumber(0) createTimeForNumber(0)
}else{
else
createTimeForNumber(1) createTimeForNumber(1)
}
}, },
) )
</script> </script>
@ -361,7 +369,7 @@ if(formValue.name){
:rules="rules" :rules="rules"
require-mark-placement="left" 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 --> <!-- j -->
<n-input <n-input
v-model:value="formValue.name" v-model:value="formValue.name"
@ -372,8 +380,8 @@ if(formValue.name){
/> />
<template #feedback> <template #feedback>
<div v-show="!formValue.name" style="color:#d03050"> <div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}} {{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;"/> {{ inputNumberFeedback }} <SvgIcon size="16" name="notice" style="margin-top: -2px;" /> {{ inputNumberFeedback }}
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
@ -419,9 +427,9 @@ if(formValue.name){
<n-select <n-select
v-else v-else
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result" v-model:value="item.result"
:max-tag-count="1"
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable filterable
style="margin-left: 8px" style="margin-left: 8px"
placeholder="请选择" placeholder="请选择"
@ -430,15 +438,15 @@ if(formValue.name){
<n-button <n-button
:style="noBorderInput" :style="noBorderInput"
icon-placement="right" icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0; style=" padding: 0;
margin-left: 17px;" margin-left: 17px;"
@click="index == 0 ? () => {} : removeCondition(index)"
> >
<template #icon> <template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/> <!-- <SvgIcon size="24" name="close" color="#F00"/>
--> -->
<svg <svg
:style="index==0?'cursor: not-allowed':''" :style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px" width="24px"
height="24px" height="24px"
viewBox="0 0 64 64" viewBox="0 0 64 64"
@ -481,22 +489,20 @@ if(formValue.name){
</template> </template>
</n-button> </n-button>
<template #feedback> <template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050"> <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;" />请选择过滤条件
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
<div class="wrapper-new" @click="createCondition"> <div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/> <SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px">添加筛选条件</span> <span style="margin-left: 8px">添加筛选条件</span>
</div> </div>
</div> </div>
</n-form> </n-form>
</div> </div>
</div> </div>
<div class="bottomline"></div> <div class="bottomline" />
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit"> <n-button style="background-color: #507afd;width: 72px;height: 38px;" type="info" @click="handleSumbit">

@ -65,9 +65,9 @@ const rules: FormRules = {
message: '请选择逻辑关系', message: '请选择逻辑关系',
trigger: 'blur', trigger: 'blur',
}, },
conditions: { // conditions: {
}, // },
} }
const formRef = ref<FormInst | null>(null) const formRef = ref<FormInst | null>(null)
@ -101,6 +101,11 @@ function handleSumbit(e: MouseEvent) {
orderNum: index + 1, orderNum: index + 1,
} }
}) })
for (const index in list) {
console.info(list)
if (list[index].searchvalue == undefined || list[index].searchvalue == '')
return
}
const param: FilterCondition = { const param: FilterCondition = {
searchname: formValue.name!, searchname: formValue.name!,
@ -236,13 +241,12 @@ function leaveHandler() {
}, },
] ]
} }
function createTimeForNumber (type) { function createTimeForNumber(type) {
console.log(formValue.name) console.log(formValue.name)
if(formValue.name){ if (formValue.name)
return ``} return ``
else{ else
return `请输入标题内容` return `请输入标题内容`
}
} }
function edit(editFilter: any) { function edit(editFilter: any) {
currentStatus.value = 'edit' currentStatus.value = 'edit'
@ -261,12 +265,12 @@ function edit(editFilter: any) {
watch( watch(
() => formValue.name, () => formValue.name,
(newVal) => { (newVal) => {
console.log(formValue.name) console.log(formValue.name)
if(formValue.name){ if (formValue.name)
createTimeForNumber(0) createTimeForNumber(0)
}else{
else
createTimeForNumber(1) createTimeForNumber(1)
}
}, },
) )
defineExpose({ defineExpose({
@ -309,7 +313,6 @@ defineExpose({
:rules="rules" :rules="rules"
require-mark-placement="left" require-mark-placement="left"
> >
<n-form-item path="name" label="标题"> <n-form-item path="name" label="标题">
<n-input <n-input
v-model:value="formValue.name" v-model:value="formValue.name"
@ -320,8 +323,8 @@ defineExpose({
/> />
<template #feedback> <template #feedback>
<div v-show="!formValue.name" style="color:#d03050"> <div v-show="!formValue.name" style="color:#d03050">
{{formValue.name}} {{ formValue.name }}
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/> 请输入标题内容 <SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;" /> 请输入标题内容
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
@ -366,9 +369,9 @@ defineExpose({
</n-space> </n-space>
<n-select <n-select
v-else v-else
:max-tag-count="1"
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
v-model:value="item.result" v-model:value="item.result"
:max-tag-count="1"
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
filterable filterable
style="margin-left: 8px" style="margin-left: 8px"
placeholder="请选择" placeholder="请选择"
@ -377,15 +380,15 @@ defineExpose({
<n-button <n-button
:style="noBorderInput" :style="noBorderInput"
icon-placement="right" icon-placement="right"
@click="index==0?()=>{}:removeCondition(index)"
style=" padding: 0; style=" padding: 0;
margin-left: 17px;" margin-left: 17px;"
@click="index == 0 ? () => {} : removeCondition(index)"
> >
<template #icon> <template #icon>
<!-- <SvgIcon size="24" name="close" color="#F00"/> <!-- <SvgIcon size="24" name="close" color="#F00"/>
--> -->
<svg <svg
:style="index==0?'cursor: not-allowed':''" :style="index == 0 ? 'cursor: not-allowed' : ''"
width="24px" width="24px"
height="24px" height="24px"
viewBox="0 0 64 64" viewBox="0 0 64 64"
@ -428,29 +431,29 @@ defineExpose({
</template> </template>
</n-button> </n-button>
<template #feedback> <template #feedback>
<div v-if="formValue.conditions[index].type==null||formValue.conditions[index].result==null||formValue.conditions[index].result==''" style="color:#d03050"> <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;" />请选择过滤条件
<SvgIcon size="16" name="notice" style="margin-top: -2px;margin-right: 5px;"/>请选择过滤条件
</div> </div>
</template> </template>
</n-form-item> </n-form-item>
<div class="wrapper-new" @click="createCondition"> <div class="wrapper-new" @click="createCondition">
<SvgIcon size="16" name="addicon" style="margin-top: 3px;"/> <SvgIcon size="16" name="addicon" style="margin-top: 3px;" />
<span style="margin-left: 8px">添加筛选条件</span> <span style="margin-left: 8px">添加筛选条件</span>
</div> </div>
</div> </div>
</n-form> </n-form>
</div> </div>
</div> </div>
<div class="bottomline"></div> <div class="bottomline" />
<template #footer> <template #footer>
<div class="wrapper-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>
<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> </n-button>
</div> </div>

Loading…
Cancel
Save