|
|
|
@ -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')
|
|
|
|
@ -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'){
|
|
|
|
|
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){
|
|
|
|
|
console.log(formValue.name)
|
|
|
|
|
if (formValue.name)
|
|
|
|
|
createTimeForNumber(0)
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
@ -372,8 +380,8 @@ if(formValue.name){
|
|
|
|
|
/>
|
|
|
|
|
<template #feedback>
|
|
|
|
|
<div v-show="!formValue.name" style="color:#d03050">
|
|
|
|
|
{{formValue.name}}
|
|
|
|
|
<SvgIcon size="16" name="notice" style="margin-top: -2px;"/> {{ inputNumberFeedback }}
|
|
|
|
|
{{ formValue.name }}
|
|
|
|
|
<SvgIcon size="16" name="notice" style="margin-top: -2px;" /> {{ inputNumberFeedback }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</n-form-item>
|
|
|
|
@ -419,9 +427,9 @@ if(formValue.name){
|
|
|
|
|
|
|
|
|
|
<n-select
|
|
|
|
|
v-else
|
|
|
|
|
:max-tag-count="1"
|
|
|
|
|
:multiple="item.type!='izyear'&&item.type!='izsimilarity'"
|
|
|
|
|
v-model:value="item.result"
|
|
|
|
|
:max-tag-count="1"
|
|
|
|
|
:multiple="item.type != 'izyear' && item.type != 'izsimilarity'"
|
|
|
|
|
filterable
|
|
|
|
|
style="margin-left: 8px"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
@ -430,15 +438,15 @@ if(formValue.name){
|
|
|
|
|
<n-button
|
|
|
|
|
:style="noBorderInput"
|
|
|
|
|
icon-placement="right"
|
|
|
|
|
@click="index==0?()=>{}:removeCondition(index)"
|
|
|
|
|
style=" padding: 0;
|
|
|
|
|
margin-left: 17px;"
|
|
|
|
|
@click="index == 0 ? () => {} : removeCondition(index)"
|
|
|
|
|
>
|
|
|
|
|
<template #icon>
|
|
|
|
|
<!-- <SvgIcon size="24" name="close" color="#F00"/>
|
|
|
|
|
-->
|
|
|
|
|
<svg
|
|
|
|
|
:style="index==0?'cursor: not-allowed':''"
|
|
|
|
|
:style="index == 0 ? 'cursor: not-allowed' : ''"
|
|
|
|
|
width="24px"
|
|
|
|
|
height="24px"
|
|
|
|
|
viewBox="0 0 64 64"
|
|
|
|
@ -481,22 +489,20 @@ if(formValue.name){
|
|
|
|
|
</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 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;"/>
|
|
|
|
|
<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">
|
|
|
|
|