update AddForm、Search组件修改

This commit is contained in:
赵霄
2023-08-29 16:44:45 +08:00
parent f560c8a64c
commit fecd8c01cc
10 changed files with 577 additions and 93 deletions
+38 -32
View File
@@ -73,19 +73,19 @@
<a-col :md="(24 / (minLength + 1))" :sm="(24 / minLength)" v-for="(item,index) in searchList.slice(3)" :key="index" style="line-height: 48px">
<template v-if="index > minLength && toggleSearchStatus">
<!-- 树形选择器 -->
<!-- <template v-if="item.fieldShowType === FieldType.TREE.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-tree-select-->
<!-- tree-node-filter-prop="title"-->
<!-- v-model="queryParam[item.dbFieldName]"-->
<!-- :maxTagCount="1"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- :tree-data="item.tree"-->
<!-- tree-checkable-->
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- <template v-if="item.fieldShowType === FieldType.TREE.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-tree-select-->
<!-- tree-node-filter-prop="title"-->
<!-- v-model="queryParam[item.dbFieldName]"-->
<!-- :maxTagCount="1"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- :tree-data="item.tree"-->
<!-- tree-checkable-->
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- 输入框 -->
<template v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value]
@@ -96,20 +96,20 @@
</a-form-item>
</template>
<!-- 数字输入框 -->
<!-- <template v-else-if="item.fieldShowType === FieldType.TEXT_NUMBER.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input-number :placeholder="$t('pleaseEnter')+item.dbFieldTxt"-->
<!-- v-model="queryParam[item.dbFieldName]" :min="1" :max="99999999"/>-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- <template v-else-if="item.fieldShowType === FieldType.TEXT_NUMBER.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input-number :placeholder="$t('pleaseEnter')+item.dbFieldTxt"-->
<!-- v-model="queryParam[item.dbFieldName]" :min="1" :max="99999999"/>-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- 字典多选框 -->
<!-- <template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <j-multi-select-tag v-model="queryParam[item.dbFieldName]"-->
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt" :type="'select'"-->
<!-- :triggerChange="false" :dictCode="item.dict_field"/>-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- <template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">-->
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <j-multi-select-tag v-model="queryParam[item.dbFieldName]"-->
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt" :type="'select'"-->
<!-- :triggerChange="false" :dictCode="item.dict_field"/>-->
<!-- </a-form-item>-->
<!-- </template>-->
<!-- 日期区间选择器 -->
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -124,7 +124,7 @@
<j-dict-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
:triggerChange="false" :dictCode="item.dict_field" />
</a-form-item>
</template>
</template>
@@ -137,16 +137,18 @@
import JDictSelectTag from '../dict/JDictSelectTag'
import { FieldType } from '../../enums/commonEnums'
import eventBus from '@/common/event'
import { getAction } from '@/api/manage'
export default {
name: 'Search',
components: { JDictSelectTag },
props: {
url: {
type: Object,
// 获取查询条件的方法
getQueryConditionFunc: {
type: Function,
required: false,
default: () => {
return {}
return function () {
}
}
},
flag: { // 暂时不清楚flag的用处,是要查searchList的时候传给后端的
@@ -251,10 +253,14 @@ export default {
},
// 获取查询条件列表
getSearch () {
console.log(this.getQueryConditionFunc)
if (!this.getQueryConditionFunc || typeof this.getQueryConditionFunc !== 'function') {
return
}
const params = {
module: this.flag
}
getAction(this.url.getSearchList, params).then((res) => {
this.getQueryConditionFunc(params).then((res) => {
if (res.success) {
this.searchList = res.result
// if (this.searchQueryList && this.searchQueryList.length > 0) {