查询优化

szh-new
lijingjia 5 months ago
parent eda1fd88a3
commit bc56062ceb

@ -6,75 +6,85 @@
<template> <template>
<!-- 高级查询 --> <!-- 高级查询 -->
<Modal <Modal
class="ds-modal-small" class="ds-modal-small ds-advanced-search-modal"
title="高级查询" title="高级查询"
:maskClosable="false" :maskClosable="false"
width="650px" width="670px"
:visible="modalFlag" :visible="modalFlag"
cancelText="重置" @cancel="modalFlag = false"
@ok="search"
@cancel="cancel"
> >
<div class="flex ant-form-small"> <a-spin :spinning="loading">
<a-switch <div class="flex ant-form-small">
v-model:checked="queryData.logicalOperator" <a-switch
checked-value="1" v-model:checked="queryData.logicalOperator"
un-checked-value="0" class="mt10"
checked-children="或" checked-value="1"
un-checked-children="且" un-checked-value="0"
/> checked-children="或"
<div style="flex: 1"> un-checked-children="且"
<div v-for="(item, index) in queryData.conditions" class="ds-advanced-search-item flex" :key="`f-${index}`"> />
<a-switch <div style="flex: 1">
v-model:checked="item.logicalOperator" <div v-for="(item, index) in queryData.conditions" class="ds-advanced-search-item flex" :key="`f-${index}`">
checked-value="1" <data :style="{left: index == 0 ? '-30px' : '-15px'}" class="v-line" style="top: 21px;"></data>
un-checked-value="0" <data v-if="index != queryData.conditions.length - 1" class="r-line r-height" style="left: -15px; top: 21px;"></data>
checked-children="或" <a-switch
un-checked-children="且" v-model:checked="item.logicalOperator"
/> checked-value="1"
<div style="flex: 1"> class="mt2"
<div v-for="(row, key) in item.conditions" :key="`c-${key}`" style="margin-bottom: 6px;"> un-checked-value="0"
<a-select checked-children="或"
v-model:value="row.field" un-checked-children="且"
style="width: 130px; margin-right: 6px;" />
placeholder="查询字段" <div style="flex: 1; margin-left: 30px">
@change="changeHandle($event, row)" <div v-for="(row, key) in item.conditions" :key="`c-${key}`" style="margin-bottom: 6px; position: relative;">
> <div v-if="(key != item.conditions.length - 1)" class="r-line"></div>
<a-select-option v-for="item in schemas" :key="item.field" :value="item.field"> <div :style="{ left: key == 0 ? '-29px' : '-16px' }" class="v-line"></div>
{{ item.label }} <a-select
</a-select-option> v-model:value="row.field"
</a-select> style="width: 150px; margin-right: 6px;"
<a-select placeholder="查询字段"
v-model:value="row.operator" @change="changeHandle($event, row)"
style="width: 90px; margin-right: 6px;" >
placeholder="筛选符" <a-select-option v-for="item in schemas" :key="item.field" :value="item.field">
> {{ item.label }}
<a-select-option v-for="item in operatorOptions" :key="item.value" :value="item.value"> </a-select-option>
{{ item.label }} </a-select>
</a-select-option> <a-select
</a-select> v-model:value="row.operator"
<a-date-picker v-if="row.component == 'RangePicker'" placeholder="请选择" style="width: 120px" v-model:value="row.value" /> style="width: 90px; margin-right: 6px;"
<a-input v-else v-model:value="row.value" placeholder="请输入" style="width: 120px"></a-input> placeholder="筛选符"
<span @click="deleteItem(index, key)" class="iconfont icon-shanchu21"></span> >
</div> <a-select-option v-for="item in operatorOptions" :key="item.value" :value="item.value">
<div class="item-btns"> {{ item.label }}
<a-button type="link" @click="addRow(index)"> </a-select-option>
<span class="iconfont icon-new_document"></span> </a-select>
添加条件 <a-date-picker v-if="row.component == 'RangePicker'" placeholder="请选择" style="width: 150px" v-model:value="row.value" />
</a-button> <a-input v-else v-model:value="row.value" placeholder="请输入" style="width: 150px"></a-input>
<a-button type="link" @click="deleteGroup(index)"> <span v-if="item.conditions.length != 1" @click="deleteItem(index, key)" class="iconfont icon-shanchu21"></span>
<span class="iconfont icon-shanchuzu"></span> </div>
删除整组 <div class="item-btns">
</a-button> <a-button type="link" @click="addRow(index)">
<span class="iconfont icon-new_document"></span>
添加条件
</a-button>
<a-button v-if="queryData.conditions.length != 1" type="link" @click="deleteGroup(index)">
<span class="iconfont icon-shanchuzu"></span>
删除整组
</a-button>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<a-button class="add-group" type="link" @click="addGroup"> </a-spin>
<span class="iconfont icon-calendar"></span> <a-button class="add-group" type="link" @click="addGroup">
添加条件组 <span class="iconfont icon-calendar"></span>
</a-button> 添加条件组
</div> </a-button>
<template #footer>
<a-button key="back" @click="reset"> </a-button>
<a-button key="submit" type="primary" :loading="loading" @click="search"> </a-button>
</template>
</Modal> </Modal>
</template> </template>
<script lang="ts" setup name="AdvancedSearch"> <script lang="ts" setup name="AdvancedSearch">
@ -84,6 +94,7 @@
import { GetUserQuerySet, UpdateUserQuerySet } from '/@/views/operation/seaexport/api/BookingLedger.js' import { GetUserQuerySet, UpdateUserQuerySet } from '/@/views/operation/seaexport/api/BookingLedger.js'
import { Modal } from 'ant-design-vue' import { Modal } from 'ant-design-vue'
import { get, omit } from 'lodash-es' import { get, omit } from 'lodash-es'
//
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
const props = defineProps({ const props = defineProps({
schemas: { schemas: {
@ -162,38 +173,39 @@
} }
] ]
}) })
// options
const operatorOptions = [ const operatorOptions = [
{ {
value: 'equal', value: 0,
label: '等于', label: '等于',
}, },
{ {
value: 'not_equal', value: 10,
label: '不等于', label: '不等于',
}, },
{ {
value: 'GreaterThan', value: 2,
label: '大于', label: '大于',
}, },
{ {
value: 'GreaterThanOrEqual', value: 3,
label: '大于等于', label: '大于等于',
}, },
{ {
value: 'LessThan', value: 4,
label: '小于', label: '小于',
}, },
{ {
value: 'LessThanOrEqual', value: 5,
label: '小于等于', label: '小于等于',
}, },
{ {
label: '包含', label: '包含',
value: 'contains', value: 1,
}, },
{ {
label: '不包含', label: '不包含',
value: 'not_contain', value: 13
}, },
] ]
// //
@ -201,15 +213,18 @@
logicalOperator: '', logicalOperator: '',
conditions: '' conditions: ''
} }
const loading = ref(false)
//
const init = () => { const init = () => {
modalFlag.value = true modalFlag.value = true
loading.value = true
const permissionId = permissionsInfo().permissionId const permissionId = permissionsInfo().permissionId
GetUserQuerySet({ permissionId }).then(res => { GetUserQuerySet({ permissionId }).then(res => {
loading.value = false
const { data } = res const { data } = res
const content = JSON.parse(data?.content || '{}') const content = JSON.parse(data?.content || '{}')
const source = JSON.parse(JSON.stringify(queryOldData)) const source = JSON.parse(JSON.stringify(queryOldData))
if (content && content?.conditions?.length) { if (content && content?.conditions?.length) {
console.log(content)
// sourceData.logicalOperator = JSON.stringify(JSON.parse(content.logicalOperator)) // sourceData.logicalOperator = JSON.stringify(JSON.parse(content.logicalOperator))
// sourceData.conditions = JSON.stringify(JSON.parse(content.conditions)) // sourceData.conditions = JSON.stringify(JSON.parse(content.conditions))
queryData.logicalOperator = content.logicalOperator queryData.logicalOperator = content.logicalOperator
@ -220,10 +235,11 @@
queryData.logicalOperator = source.logicalOperator queryData.logicalOperator = source.logicalOperator
queryData.conditions = source.conditions queryData.conditions = source.conditions
} }
}).catch(() => {
loading.value = false
}) })
} }
const cancel = () => { const reset = () => {
modalFlag.value = false
const source = JSON.parse(JSON.stringify(queryOldData)) const source = JSON.parse(JSON.stringify(queryOldData))
queryData.logicalOperator = source.logicalOperator queryData.logicalOperator = source.logicalOperator
queryData.conditions = source.conditions queryData.conditions = source.conditions
@ -234,6 +250,7 @@
// if (JSON.stringify(sourceData) != JSON.stringify(queryData)) { // if (JSON.stringify(sourceData) != JSON.stringify(queryData)) {
// } // }
modalFlag.value = false
emit('toSearch', queryData) emit('toSearch', queryData)
const propsData = { const propsData = {
permissionId: permissionsInfo().permissionId, permissionId: permissionsInfo().permissionId,
@ -287,31 +304,72 @@
</script> </script>
<style lang="less"> <style lang="less">
.ds-advanced-search-item { .ds-advanced-search-modal {
margin-left: 15px; .ant-form-small {
padding: 10px 15px; margin-top: 15px;
border-left: 1px solid #257AFA; min-height: 400px;
background: #F5F9FC;
margin-bottom: 20px;
border-radius: 2px;
.icon-shanchu21 {
margin-left: 6px;
color: #257AFA;
cursor: pointer;
} }
.item-btns { .ds-advanced-search-item {
text-align: right; position: relative;
color: #257AFA; margin-left: 30px;
.iconfont { padding: 10px 15px;
border-left: 1px solid #257AFA;
background: #F5F9FC;
margin-bottom: 20px;
border-radius: 2px;
.icon-shanchu21 {
margin-left: 6px;
color: #257AFA;
cursor: pointer; cursor: pointer;
} }
.item-btns {
text-align: right;
color: #257AFA;
.iconfont {
cursor: pointer;
}
padding-right: 18px;
}
}
.ds-advanced-search-item:last-child {
margin-bottom: 0;
}
.add-group {
position: absolute;
bottom: 16px;
margin-left: 65px;
}
.ant-switch {
background: #257AFA;
font-weight: 600;
}
.ant-switch-checked {
background: #17A6A3;
font-weight: 600;
}
.r-line {
width: 0.8px;
height: 35px;
background: #CCCCCC;
display: inline-block;
position: absolute;
left: -16px;
top: 13px;
}
.r-line:last-child {
height: 10px;
}
.r-height {
height: calc(100% + 20px);
}
.v-line {
width: 30px;
height: 0.8px;
background: #CCCCCC;
display: inline-block;
position: absolute;
left: -16px;
top: 13px;
} }
}
.ds-advanced-search-item:last-child {
margin-bottom: 0;
}
.add-group {
position: absolute;
bottom: 16px;
} }
</style> </style>

@ -60,7 +60,7 @@
<AdvancedSearch <AdvancedSearch
ref="advanceSearch" ref="advanceSearch"
:schemas="schemas" :schemas="schemas"
@toSearch="submitAction" @toSearch="toSearch"
/> />
</a-col> </a-col>
</template> </template>
@ -94,6 +94,10 @@
useAdvancedSearch: propTypes.bool.def(false), useAdvancedSearch: propTypes.bool.def(false),
// //
useNumbersSearch: propTypes.bool.def(false), useNumbersSearch: propTypes.bool.def(false),
// 使
fetch: {
type: Function
},
showSubmitButton: propTypes.bool.def(true), showSubmitButton: propTypes.bool.def(true),
showAdvancedButton: propTypes.bool.def(true), showAdvancedButton: propTypes.bool.def(true),
resetButtonOptions: { resetButtonOptions: {
@ -108,6 +112,11 @@
type: Object as PropType<Partial<ColEx>>, type: Object as PropType<Partial<ColEx>>,
default: () => ({}), default: () => ({}),
}, },
//
tableAction: {
type: Object,
default: () => ({}),
},
actionSpan: propTypes.number.def(6), actionSpan: propTypes.number.def(6),
isAdvanced: propTypes.bool, isAdvanced: propTypes.bool,
hideAdvanceBtn: propTypes.bool, hideAdvanceBtn: propTypes.bool,
@ -145,7 +154,7 @@
}) })
// //
const toSearch = (params) => { const toSearch = (params) => {
console.log(params) props.fetch({ advanced : params })
} }
const getSubmitBtnOptions = computed(() => { const getSubmitBtnOptions = computed(() => {
return Object.assign( return Object.assign(

@ -84,7 +84,7 @@ export const basicProps = {
// 自定义重置函数 // 自定义重置函数
resetFunc: Function as PropType<() => Promise<void>>, resetFunc: Function as PropType<() => Promise<void>>,
submitFunc: Function as PropType<() => Promise<void>>, submitFunc: Function as PropType<() => Promise<void>>,
fetch: Function as PropType<() => Promise<void>>,
// 以下为默认props // 以下为默认props
hideRequiredMark: propTypes.bool, hideRequiredMark: propTypes.bool,

@ -6,6 +6,7 @@
ref="formRef" ref="formRef"
submit-on-reset submit-on-reset
v-bind="getFormProps" v-bind="getFormProps"
:fetch="fetch"
:table-action="tableAction" :table-action="tableAction"
:autoSubmitOnEnter="true" :autoSubmitOnEnter="true"
@register="registerForm" @register="registerForm"
@ -233,7 +234,6 @@
const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } = const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } =
useTableForm(getProps, slots, fetch, getLoading) useTableForm(getProps, slots, fetch, getLoading)
console.log(getFormProps)
const getBindValues = computed(() => { const getBindValues = computed(() => {
const dataSource = unref(getDataSourceRef) const dataSource = unref(getDataSourceRef)
let propsData: Recordable = { let propsData: Recordable = {
@ -340,6 +340,7 @@
wrapRef, wrapRef,
tableAction, tableAction,
redoHeight, redoHeight,
fetch,
getFormProps: getFormProps as any, getFormProps: getFormProps as any,
replaceFormSlotKey, replaceFormSlotKey,
getFormSlotKeys, getFormSlotKeys,

@ -297,6 +297,44 @@ export function useDataSource(
opt?.sortInfo ?? {}, opt?.sortInfo ?? {},
opt?.filterInfo ?? {}, opt?.filterInfo ?? {},
) )
// 如果是高级查询,塞入高级查询参数
if (opt && opt.advanced) {
const ap = {
Key: opt?.advanced?.logicalOperator,
Value: {
ConditionalList: []
}
}
// 配置高级查询参数固定格式
opt.advanced?.conditions.forEach(item => {
let obj = {
Key: '',
Value: null
}
obj['Key'] = item.logicalOperator
if (item?.conditions) {
item.conditions.forEach(row => {
// 只有当查询条件字段和筛选符都有值的时候才行(不然后台报错)
if (row.field && row.value) {
obj.Value = {
FieldName: row.field,
FieldValue: row.value,
ConditionalType: row.operator
}
}
})
}
if (obj.Value != null) {
ap.Value.ConditionalList.push(obj)
}
})
if (ap.Value.ConditionalList.length) {
params['advancedSearchParams'] = { ConditionalList: [ap] }
} else {
// ConditionalList没有值还不能传空数组。。。
params['advancedSearchParams'] = { ConditionalList: [] }
}
}
if (beforeFetch && isFunction(beforeFetch)) { if (beforeFetch && isFunction(beforeFetch)) {
params = (await beforeFetch(params)) || params params = (await beforeFetch(params)) || params
} }

@ -27,7 +27,6 @@ export function closePage(topath) {
} else { } else {
// 父级路由 // 父级路由
const parent = router?.options?.history?.state?.back const parent = router?.options?.history?.state?.back
console.log(router)
// 如果存在父级路由,直接返回父级 // 如果存在父级路由,直接返回父级
if (parent) { if (parent) {
router.push(parent) router.push(parent)
@ -119,3 +118,70 @@ function toBlob(fileData, name) {
document.body.removeChild(a) document.body.removeChild(a)
}, 0) }, 0)
} }
// 返回表格查询的参数
export function formatParams(params = {}) {
const postData = {
queryCondition: '',
pageCondition: {
pageIndex: params?.page,
pageSize: params?.pageSize,
sortConditions: []
}
}
const conditions = []
for (let key in params) {
if (key != 'page' && key != 'pageSize' && key != 'order' && key != 'field') {
if (key == 'advancedSearchParams') {
// 高级查询
conditions.push(params[key])
} else {
// 其他查询
if (Array.isArray(params[key])) {
if (params[key][0].length && params[key][0].length > 3) {
// 判定成日期
conditions.push({
FieldName: key,
FieldValue: params[key][0],
ConditionalType: 3
})
conditions.push({
FieldName: key,
FieldValue: params[key][1],
ConditionalType: 5
})
} else {
// 判定为筛选
params[key].forEach(item => {
conditions.push({
FieldName: key,
FieldValue: item,
ConditionalType: 1
})
})
}
} else {
// 其他普通查询
if (params[key] || params[key] === 0) {
conditions.push({
FieldName: key,
FieldValue: params[key],
ConditionalType: 1
})
}
}
}
}
}
// 排序
if (params?.field) {
postData.pageCondition.sortConditions = [{
sortField: params.field,
listSortDirection: params.order == "ascend" ? 0 : 1
}]
} else {
postData.pageCondition.sortConditions = []
}
postData.queryCondition = JSON.stringify(conditions)
return postData
}

@ -82,20 +82,6 @@
<a-textarea v-model:value="moreNumVal" style="height: 200px" /> <a-textarea v-model:value="moreNumVal" style="height: 200px" />
</div> </div>
</a-modal> </a-modal>
<!-- 高级查询 -->
<a-modal
class="high-search"
title="高级查询"
:maskClosable="false"
width="40%"
:visible="AdvancedQueryVisible"
@ok="FnAdvancedQuery"
@cancel="FnCancelAdvancedQuery"
>
<div class="CsConditionFilter">
<ConditionFilter v-model="AdvancedQueryData" :filter-fields="fields" :disabled="false" />
</div>
</a-modal>
<a-modal <a-modal
:title=" :title="
TaskShippingOrderCompareData.isExistsDiff ? '下货纸比对(有差异)' : '下货纸比对(正常)' TaskShippingOrderCompareData.isExistsDiff ? '下货纸比对(有差异)' : '下货纸比对(正常)'
@ -179,17 +165,15 @@
<script lang="ts" setup name="海运出口"> <script lang="ts" setup name="海运出口">
import TableActionBar from './components/tableActionBar.vue' import TableActionBar from './components/tableActionBar.vue'
import tableActionBarRight from './components/tableActionBarRight.vue' import tableActionBarRight from './components/tableActionBarRight.vue'
import ConditionFilter from '/@/components/Condition/index.vue'
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { PageDataByBooking, UpdateUserQuerySet, GetUserQuerySet } from './api/BookingLedger.js' import { PageDataByBooking, } from './api/BookingLedger.js'
import { getColumnsByClient } from '/@/views/baseinfo/formcopy/api' import { getColumnsByClient } from '/@/views/baseinfo/formcopy/api'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import { columns, searchFormSchema, FeeStatus } from './columns' import { columns, searchFormSchema, FeeStatus } from './columns'
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { formatTableData } from '/@/hooks/web/common' import { formatTableData } from '/@/hooks/web/common'
import { FilterRules } from '/@/components/Condition/index'
import { Field } from '/@/components/Render/interface' import { Field } from '/@/components/Render/interface'
import { useOptionsStore } from '/@/store/modules/options' import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore() const optionsStore = useOptionsStore()
@ -197,8 +181,10 @@
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
const { t } = useI18n() const { t } = useI18n()
import initData from './modules/initData.js' import initData from './modules/initData.js'
import { useRouter, useRoute } from 'vue-router' import { useRouter } from 'vue-router'
import { useAppStore } from '/@/store/modules/app' import { useAppStore } from '/@/store/modules/app'
//
import { formatParams } from '/@/hooks/web/common'
const appStore = useAppStore() const appStore = useAppStore()
const router = useRouter() const router = useRouter()
const { notification } = useMessage() const { notification } = useMessage()
@ -326,142 +312,21 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
console.log(p) return formatParams(p)
var data = getForm().getFieldsValue() // if (moreNumVal.value) {
const postParam: API.PageRequest = { // let ManyQueryData: any = { ConditionalList: [] }
queryCondition: '', // moreNumVal.value
pageCondition: { // .replace(/\n|\r/g, ',')
pageIndex: p.current, // .split(',')
pageSize: p.pageSize, // .forEach((item) => {
sortConditions: [] // ManyQueryData.ConditionalList.push({
} // Key: 0,
} // Value: { FieldName: 'mblno', FieldValue: item, ConditionalType: 1 },
if (p.field) { // })
postParam.sortConditions = [ // })
{
sortField: p.field,
listSortDirection: p.order == "ascend" ? 0 : 1
}
]
} else {
postParam.sortConditions = []
}
let condition: API.ConditionItem[] = []
if (!!data.mblno) {
condition.push({
FieldName: 'mblno',
FieldValue: data.mblno,
ConditionalType: 1
})
}
if (!!data.hblno) {
condition.push({
FieldName: 'hblno',
FieldValue: data.hblno,
ConditionalType: 1
})
}
if (!!data.customerId) {
condition.push({
FieldName: 'customerId',
FieldValue: data.customerId,
ConditionalType: 1
})
}
if (!!data.etd) {
condition.push({
FieldName: 'etd',
FieldValue: data.etd[0],
ConditionalType: 3
})
condition.push({
FieldName: 'etd',
FieldValue: data.etd[1],
ConditionalType: 5
})
}
if (!!data.operatorId) {
condition.push({
FieldName: 'operatorId',
FieldValue: data.operatorId,
ConditionalType: 1
})
}
if (!!data.saleId) {
condition.push({
FieldName: 'saleId',
FieldValue: data.saleId,
ConditionalType: 1
})
}
if (!!data.vesselId) {
condition.push({
FieldName: 'vesselId',
FieldValue: data.vesselId,
ConditionalType: 1
})
}
if (!!data.voyno) {
condition.push({
FieldName: 'voyno',
FieldValue: data.voyno,
ConditionalType: 1
})
}
if (!!data.dischargePortId) {
condition.push({
FieldName: 'dischargePortId',
FieldValue: data.dischargePortId,
ConditionalType: 1
})
}
if (!!data.destinationId) {
condition.push({
FieldName: 'destinationId',
FieldValue: data.destinationId,
ConditionalType: 1
})
}
if (!!data.carrierId) {
condition.push({
FieldName: 'carrierId',
FieldValue: data.carrierId,
ConditionalType: 1
})
}
if (!!data.laneId) {
condition.push({
FieldName: 'laneId',
FieldValue: data.laneId,
ConditionalType: 1
})
}
if (!!data.laneId) {
condition.push({
FieldName: 'laneId',
FieldValue: data.laneId,
ConditionalType: 1
})
}
if (isAdvancedQuery.value) {
condition.push(ConditionalList.value)
}
if (moreNumVal.value) {
let ManyQueryData: any = { ConditionalList: [] }
moreNumVal.value
.replace(/\n|\r/g, ',')
.split(',')
.forEach((item) => {
ManyQueryData.ConditionalList.push({
Key: 0,
Value: { FieldName: 'mblno', FieldValue: item, ConditionalType: 1 },
})
})
condition.push(ManyQueryData) // condition.push(ManyQueryData)
} // }
postParam.queryCondition = JSON.stringify(condition)
return postParam
}, },
afterFetch: () => { afterFetch: () => {
isAdvancedQuery.value = false isAdvancedQuery.value = false
@ -471,7 +336,9 @@
columns, columns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
//
schemas: searchFormSchema, schemas: searchFormSchema,
// ()
useAdvancedSearch: true useAdvancedSearch: true
}, },
isTreeTable: false, isTreeTable: false,
@ -527,8 +394,6 @@
moreNumVisible.value = false moreNumVisible.value = false
} }
const isAdvancedQuery = ref(false) const isAdvancedQuery = ref(false)
const AdvancedQueryVisible = ref(false)
const AdvancedQueryData = ref<FilterRules>({ logicalOperator: 'and', conditions: [], groups: [] })
const showColumns = ref({}) const showColumns = ref({})
const formAllData = ref([]) const formAllData = ref([])
const fromTableAllData = ref({}) const fromTableAllData = ref({})
@ -542,14 +407,6 @@
const TaskShippingOrderCompareVisible = ref(false) const TaskShippingOrderCompareVisible = ref(false)
const formatSheetVisible = ref(false) const formatSheetVisible = ref(false)
//
function FnOpenAdvancedQuery() {
AdvancedQueryVisible.value = true
}
//
function FnCancelAdvancedQuery() {
AdvancedQueryVisible.value = false
}
// //
function batchEditing() { function batchEditing() {
const select = getSelectRows() const select = getSelectRows()
@ -567,60 +424,6 @@
} }
const permissionId = ref<String>('') const permissionId = ref<String>('')
const ConditionalList: Ref<any> = ref() const ConditionalList: Ref<any> = ref()
//
async function FnAdvancedQuery() {
let Api = (data) => {
let Obj: any = {}
let key: number = 0
data.logicalOperator == 'and' ? (key = 0) : (key = 1)
if (data.conditions.length) {
if (!Obj.ConditionalList) {
Obj.ConditionalList = []
}
let Arr: any[] = []
data.conditions.forEach((item) => {
Arr.push({
Key: key,
Value: {
FieldName: item.field,
FieldValue: item.operator,
ConditionalType: item.value,
},
})
})
Obj.ConditionalList.push(...Arr)
}
if (data.groups.length) {
if (!Obj.ConditionalList) {
Obj.ConditionalList = []
}
let Arr: any[] = []
data.groups.forEach((item) => {
Arr.push({
Key: key,
Value: Api(item),
})
})
Obj.ConditionalList.push(...Arr)
}
return Obj
}
ConditionalList.value = {
ConditionalList: Api(AdvancedQueryData.value).ConditionalList,
}
let ApiData = {
permissionId: permissionId.value,
content: JSON.stringify(AdvancedQueryData.value),
}
const res: API.DataResult = await UpdateUserQuerySet(ApiData)
if (res.succeeded) {
isAdvancedQuery.value = true
reload()
}
}
async function createdInit() { async function createdInit() {
showColumns.value = JSON.parse(JSON.stringify(initData.columns)) showColumns.value = JSON.parse(JSON.stringify(initData.columns))
formAllData.value = JSON.parse(JSON.stringify(initData.condAllData)) formAllData.value = JSON.parse(JSON.stringify(initData.condAllData))
@ -661,17 +464,6 @@
fields.value = data fields.value = data
} }
FnGetUserQuerySet()
// getConfigUser(true)
}
async function FnGetUserQuerySet() {
const res: API.DataResult = await GetUserQuerySet({
permissionId: permissionId.value,
})
if (res.succeeded) {
console.log(res)
AdvancedQueryData.value = JSON.parse(res.data.content)
}
} }
function handledbclick(record) { function handledbclick(record) {
editColumns(record) editColumns(record)

Loading…
Cancel
Save