perf: 合并参数
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* @Author: zhaojinfeng 121016171@qq.com
|
||||
* @Date: 2023-08-14 11:07:15
|
||||
* @LastEditors: zhaojinfeng 121016171@qq.com
|
||||
* @LastEditTime: 2023-09-05 18:26:31
|
||||
* @LastEditTime: 2023-09-06 20:03:04
|
||||
* @FilePath: \vue3\packages\select-transfer-modal\index.vue
|
||||
* @Description:
|
||||
*
|
||||
@ -19,9 +19,8 @@
|
||||
:z-index="zIndex" @open="getList" @closed="closed"
|
||||
>
|
||||
<div flex>
|
||||
<slot name="left" :left-params="leftParams" />
|
||||
<div>
|
||||
{{ queryParams }}
|
||||
<slot name="left" />
|
||||
<div grow>
|
||||
<el-form ref="queryRef" :model="queryParams" inline>
|
||||
<el-form-item v-for="formItem in formItems" :key="formItem.prop" :label="formItem.label" :prop="formItem.prop">
|
||||
<el-select v-if="formItem.selectOptions" :placeholder="formItem.placeholder">
|
||||
@ -148,8 +147,6 @@ const queryParams = reactive({
|
||||
pageSize: properties.pageSizes[0] || 10,
|
||||
})
|
||||
|
||||
const leftParams = reactive({})
|
||||
|
||||
const data = computed(() => {
|
||||
const all: any[] = []
|
||||
const { props: { disabled = 'disabled', key = 'id' }, lockList } = properties
|
||||
@ -180,7 +177,6 @@ async function getList() {
|
||||
try {
|
||||
const response = await properties.request({
|
||||
...properties.defaultParams,
|
||||
...leftParams, // 合并参数
|
||||
...queryParams,
|
||||
})
|
||||
const { key = 'id' } = properties.props
|
||||
@ -241,7 +237,7 @@ function transferValueInit() {
|
||||
|
||||
transferValueInit()
|
||||
|
||||
watch(() => leftParams, handleQuery)
|
||||
watch(() => properties.defaultParams, handleQuery, { deep: true })
|
||||
watch(() => properties.value, transferValueInit)
|
||||
watch(() => properties.show, (show) => {
|
||||
showDialog.value = show
|
||||
|
Reference in New Issue
Block a user