fix: bug#20430

This commit is contained in:
XieYongHong 2023-11-23 10:16:34 +08:00
parent 6c8e8f3608
commit 4bd1bcceda
2 changed files with 23 additions and 12 deletions

View File

@ -203,6 +203,17 @@ const handOptionByColumn = (option: any) => {
valueOptions.value = [] valueOptions.value = []
valueColumnOptions.value = [] valueColumnOptions.value = []
} }
if(paramsValue.termType){
if (columnType.value ==='date') {
if (timeTypeKeys.includes(paramsValue.termType)) {
if (tabsOptions.value[0].component !== 'int') {
}
tabsOptions.value[0].component = 'int'
} else if (!timeTypeKeys.includes(paramsValue.termType) && tabsOptions.value[0].component == 'int') {
tabsOptions.value[0].component = 'date'
}
}
}
} }
watch(() => [columnOptions.value, paramsValue.column], () => { watch(() => [columnOptions.value, paramsValue.column], () => {
@ -367,4 +378,4 @@ nextTick(() => {
<style scoped> <style scoped>
</style> </style>

View File

@ -225,21 +225,21 @@ const _send = () => {
let url = props.selectApi?.url; let url = props.selectApi?.url;
let params let params
if (methodName === 'get'){ const urlParams = {};
const urlParams = {}; requestBody.params.paramsTable.forEach((item) => {
requestBody.params.paramsTable.forEach((item) => { urlParams[item.name] = item.value;
urlParams[item.name] = item.value; if (url.includes(`{${item.name}}`))
if (url.includes(`{${item.name}}`)) url = url.replace(`{${item.name}}`, item.value);
url = url.replace(`{${item.name}}`, item.value);
}); });
params = { if (methodName === 'get'){
...JSON.parse(requestBody.code || '{}'), params = {
...urlParams, ...JSON.parse(requestBody.code || '{}'),
}; ...urlParams,
};
}else{ }else{
params = JSON.parse(requestBody.code || '{}') params = JSON.parse(requestBody.code || '{}')
} }
server[methodObj[methodName]](url, params).then((resp: any) => { server[methodObj[methodName]](url, params).then((resp: any) => {
// body // body
if (Object.keys(params).length === 0 && refStr.value) { if (Object.keys(params).length === 0 && refStr.value) {