forked from github/dataease
Merge remote-tracking branch 'origin/dev-v2' into dev-v2
This commit is contained in:
commit
75e456f7a0
4
.github/workflows/llm-code-review.yml
vendored
4
.github/workflows/llm-code-review.yml
vendored
@ -14,12 +14,12 @@ jobs:
|
||||
steps:
|
||||
- uses: fit2cloud/LLM-CodeReview-Action@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.FIT2CLOUDRD_LLM_CODE_REVIEW_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
|
||||
LANGUAGE: Chinese
|
||||
OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||
MODEL: qwen2-1.5b-instruct
|
||||
PROMPT: "请检查下面的代码差异是否有不规范、潜在的问题或者优化建议"
|
||||
PROMPT: "请检查下面的代码差异是否有不规范、潜在的问题或者优化建议,用中文回答。"
|
||||
top_p: 1
|
||||
temperature: 1
|
||||
# max_tokens: 10000
|
||||
|
@ -488,6 +488,9 @@ const clearData = () => {
|
||||
})
|
||||
})
|
||||
;(list.value || []).reduce((pre, next) => {
|
||||
if (!next.visible) {
|
||||
return pre
|
||||
}
|
||||
next.selectValue = next.multiple || +next.displayType === 7 ? [] : undefined
|
||||
if (next.optionValueSource === 1 && next.defaultMapValue?.length) {
|
||||
next.mapValue = next.multiple ? [] : undefined
|
||||
@ -564,6 +567,15 @@ const queryData = () => {
|
||||
requiredName = next.name
|
||||
}
|
||||
}
|
||||
|
||||
if (next.displayType === '22') {
|
||||
if (
|
||||
[next.numValueEnd, next.numValueStart].filter(itx => ![null, undefined, ''].includes(itx))
|
||||
.length === 1
|
||||
) {
|
||||
requiredName = next.name
|
||||
}
|
||||
}
|
||||
const keyList = Object.entries(next.checkedFieldsMap)
|
||||
.filter(ele => next.checkedFields.includes(ele[0]))
|
||||
.filter(ele => !!ele[1])
|
||||
|
@ -246,242 +246,237 @@ const duplicateRemoval = arr => {
|
||||
export const searchQuery = (queryComponentList, filter, curComponentId, firstLoad) => {
|
||||
queryComponentList.forEach(ele => {
|
||||
if (!!ele.propValue?.length) {
|
||||
ele.propValue
|
||||
.filter(itx => itx.visible)
|
||||
.forEach(item => {
|
||||
ele.propValue.forEach(item => {
|
||||
if (item.checkedFields.includes(curComponentId) && item.checkedFieldsMap[curComponentId]) {
|
||||
let selectValue
|
||||
const {
|
||||
selectValue: value,
|
||||
timeGranularityMultiple,
|
||||
defaultNumValueEnd,
|
||||
numValueEnd,
|
||||
numValueStart,
|
||||
defaultNumValueStart,
|
||||
conditionType = 0,
|
||||
treeFieldList = [],
|
||||
defaultConditionValueOperatorF = 'eq',
|
||||
defaultConditionValueF = '',
|
||||
defaultConditionValueOperatorS = 'like',
|
||||
defaultConditionValueS = '',
|
||||
conditionValueOperatorF = 'eq',
|
||||
conditionValueF = '',
|
||||
conditionValueOperatorS = 'like',
|
||||
conditionValueS = '',
|
||||
defaultValueCheck,
|
||||
timeType = 'fixed',
|
||||
defaultValue,
|
||||
optionValueSource,
|
||||
defaultMapValue,
|
||||
mapValue,
|
||||
parameters = [],
|
||||
timeGranularity = 'date',
|
||||
displayType,
|
||||
displayId,
|
||||
multiple
|
||||
} = item
|
||||
|
||||
const isTree = +displayType === 9
|
||||
|
||||
if (
|
||||
item.checkedFields.includes(curComponentId) &&
|
||||
item.checkedFieldsMap[curComponentId]
|
||||
timeType === 'dynamic' &&
|
||||
[1, 7].includes(+displayType) &&
|
||||
firstLoad &&
|
||||
defaultValueCheck
|
||||
) {
|
||||
let selectValue
|
||||
const {
|
||||
selectValue: value,
|
||||
timeGranularityMultiple,
|
||||
if (+displayType === 1) {
|
||||
selectValue = getDynamicRange(item)
|
||||
item.defaultValue = new Date(selectValue[0])
|
||||
item.selectValue = new Date(selectValue[0])
|
||||
} else {
|
||||
const {
|
||||
timeNum,
|
||||
relativeToCurrentType,
|
||||
around,
|
||||
relativeToCurrentRange,
|
||||
arbitraryTime,
|
||||
timeGranularity,
|
||||
timeNumRange,
|
||||
relativeToCurrentTypeRange,
|
||||
aroundRange,
|
||||
timeGranularityMultiple,
|
||||
arbitraryTimeRange
|
||||
} = item
|
||||
|
||||
let startTime = getCustomTime(
|
||||
timeNum,
|
||||
relativeToCurrentType,
|
||||
timeGranularity,
|
||||
around,
|
||||
arbitraryTime,
|
||||
timeGranularityMultiple,
|
||||
'start-panel'
|
||||
)
|
||||
let endTime = getCustomTime(
|
||||
timeNumRange,
|
||||
relativeToCurrentTypeRange,
|
||||
timeGranularity,
|
||||
aroundRange,
|
||||
arbitraryTimeRange,
|
||||
timeGranularityMultiple,
|
||||
'end-panel'
|
||||
)
|
||||
|
||||
if (!!relativeToCurrentRange && relativeToCurrentRange !== 'custom') {
|
||||
;[startTime, endTime] = getCustomRange(relativeToCurrentRange)
|
||||
}
|
||||
item.defaultValue = [startTime, endTime]
|
||||
item.selectValue = [startTime, endTime]
|
||||
selectValue = [startTime, endTime]
|
||||
}
|
||||
} else if (displayType === '8') {
|
||||
selectValue = getResult(
|
||||
conditionType,
|
||||
defaultConditionValueF,
|
||||
defaultConditionValueS,
|
||||
conditionValueF,
|
||||
conditionValueS,
|
||||
firstLoad
|
||||
)
|
||||
} else if (displayType === '22') {
|
||||
selectValue = getResultNum(
|
||||
defaultNumValueEnd,
|
||||
numValueEnd,
|
||||
numValueStart,
|
||||
defaultNumValueStart,
|
||||
conditionType = 0,
|
||||
treeFieldList = [],
|
||||
defaultConditionValueOperatorF = 'eq',
|
||||
defaultConditionValueF = '',
|
||||
defaultConditionValueOperatorS = 'like',
|
||||
defaultConditionValueS = '',
|
||||
conditionValueOperatorF = 'eq',
|
||||
conditionValueF = '',
|
||||
conditionValueOperatorS = 'like',
|
||||
conditionValueS = '',
|
||||
firstLoad
|
||||
)
|
||||
} else {
|
||||
selectValue = getValueByDefaultValueCheckOrFirstLoad(
|
||||
defaultValueCheck,
|
||||
timeType = 'fixed',
|
||||
defaultValue,
|
||||
optionValueSource,
|
||||
value,
|
||||
firstLoad,
|
||||
multiple,
|
||||
defaultMapValue,
|
||||
optionValueSource,
|
||||
mapValue,
|
||||
parameters = [],
|
||||
timeGranularity = 'date',
|
||||
displayType,
|
||||
displayId,
|
||||
multiple
|
||||
} = item
|
||||
displayId
|
||||
)
|
||||
}
|
||||
if (
|
||||
!!selectValue?.length ||
|
||||
['[object Number]', '[object Date]'].includes(
|
||||
Object.prototype.toString.call(selectValue)
|
||||
) ||
|
||||
displayType === '8'
|
||||
) {
|
||||
let result = forMatterValue(
|
||||
+displayType,
|
||||
selectValue,
|
||||
timeGranularity,
|
||||
timeGranularityMultiple
|
||||
)
|
||||
const operator = getOperator(
|
||||
displayType,
|
||||
multiple,
|
||||
conditionType,
|
||||
defaultConditionValueOperatorF,
|
||||
defaultConditionValueF,
|
||||
defaultConditionValueOperatorS,
|
||||
defaultConditionValueS,
|
||||
conditionValueOperatorF,
|
||||
conditionValueF,
|
||||
conditionValueOperatorS,
|
||||
conditionValueS,
|
||||
firstLoad
|
||||
)
|
||||
if (result?.length) {
|
||||
const fieldId = isTree
|
||||
? getFieldId(treeFieldList, result)
|
||||
: item.checkedFieldsMap[curComponentId]
|
||||
let parametersFilter = duplicateRemoval(
|
||||
parameters.reduce((pre, next) => {
|
||||
if (next.id === fieldId && !pre.length) {
|
||||
pre.push(next)
|
||||
}
|
||||
return pre
|
||||
}, [])
|
||||
)
|
||||
|
||||
const isTree = +displayType === 9
|
||||
|
||||
if (
|
||||
timeType === 'dynamic' &&
|
||||
[1, 7].includes(+displayType) &&
|
||||
firstLoad &&
|
||||
defaultValueCheck
|
||||
) {
|
||||
if (+displayType === 1) {
|
||||
selectValue = getDynamicRange(item)
|
||||
item.defaultValue = new Date(selectValue[0])
|
||||
item.selectValue = new Date(selectValue[0])
|
||||
} else {
|
||||
const {
|
||||
timeNum,
|
||||
relativeToCurrentType,
|
||||
around,
|
||||
relativeToCurrentRange,
|
||||
arbitraryTime,
|
||||
timeGranularity,
|
||||
timeNumRange,
|
||||
relativeToCurrentTypeRange,
|
||||
aroundRange,
|
||||
timeGranularityMultiple,
|
||||
arbitraryTimeRange
|
||||
} = item
|
||||
|
||||
let startTime = getCustomTime(
|
||||
timeNum,
|
||||
relativeToCurrentType,
|
||||
timeGranularity,
|
||||
around,
|
||||
arbitraryTime,
|
||||
timeGranularityMultiple,
|
||||
'start-panel'
|
||||
if (item.checkedFieldsMapArr?.[curComponentId]?.length) {
|
||||
const endTimeFieldId = item.checkedFieldsMapArr?.[curComponentId].find(
|
||||
element => element !== fieldId
|
||||
)
|
||||
let endTime = getCustomTime(
|
||||
timeNumRange,
|
||||
relativeToCurrentTypeRange,
|
||||
timeGranularity,
|
||||
aroundRange,
|
||||
arbitraryTimeRange,
|
||||
timeGranularityMultiple,
|
||||
'end-panel'
|
||||
const resultEnd = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEnd[curComponentId]
|
||||
? result[1]
|
||||
: result[0]
|
||||
)
|
||||
result = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEnd[curComponentId]
|
||||
? result[0]
|
||||
: result[1]
|
||||
)
|
||||
parametersFilter = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === fieldId)
|
||||
)
|
||||
|
||||
if (!!relativeToCurrentRange && relativeToCurrentRange !== 'custom') {
|
||||
;[startTime, endTime] = getCustomRange(relativeToCurrentRange)
|
||||
}
|
||||
item.defaultValue = [startTime, endTime]
|
||||
item.selectValue = [startTime, endTime]
|
||||
selectValue = [startTime, endTime]
|
||||
}
|
||||
} else if (displayType === '8') {
|
||||
selectValue = getResult(
|
||||
conditionType,
|
||||
defaultConditionValueF,
|
||||
defaultConditionValueS,
|
||||
conditionValueF,
|
||||
conditionValueS,
|
||||
firstLoad
|
||||
)
|
||||
} else if (displayType === '22') {
|
||||
selectValue = getResultNum(
|
||||
defaultNumValueEnd,
|
||||
numValueEnd,
|
||||
numValueStart,
|
||||
defaultNumValueStart,
|
||||
firstLoad
|
||||
)
|
||||
} else {
|
||||
selectValue = getValueByDefaultValueCheckOrFirstLoad(
|
||||
defaultValueCheck,
|
||||
defaultValue,
|
||||
value,
|
||||
firstLoad,
|
||||
multiple,
|
||||
defaultMapValue,
|
||||
optionValueSource,
|
||||
mapValue,
|
||||
displayType,
|
||||
displayId
|
||||
)
|
||||
}
|
||||
if (
|
||||
!!selectValue?.length ||
|
||||
['[object Number]', '[object Date]'].includes(
|
||||
Object.prototype.toString.call(selectValue)
|
||||
) ||
|
||||
displayType === '8'
|
||||
) {
|
||||
let result = forMatterValue(
|
||||
+displayType,
|
||||
selectValue,
|
||||
timeGranularity,
|
||||
timeGranularityMultiple
|
||||
)
|
||||
const operator = getOperator(
|
||||
displayType,
|
||||
multiple,
|
||||
conditionType,
|
||||
defaultConditionValueOperatorF,
|
||||
defaultConditionValueF,
|
||||
defaultConditionValueOperatorS,
|
||||
defaultConditionValueS,
|
||||
conditionValueOperatorF,
|
||||
conditionValueF,
|
||||
conditionValueOperatorS,
|
||||
conditionValueS,
|
||||
firstLoad
|
||||
)
|
||||
if (result?.length) {
|
||||
const fieldId = isTree
|
||||
? getFieldId(treeFieldList, result)
|
||||
: item.checkedFieldsMap[curComponentId]
|
||||
let parametersFilter = duplicateRemoval(
|
||||
parameters.reduce((pre, next) => {
|
||||
if (next.id === fieldId && !pre.length) {
|
||||
pre.push(next)
|
||||
}
|
||||
return pre
|
||||
}, [])
|
||||
const parametersFilterEnd = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === endTimeFieldId)
|
||||
)
|
||||
|
||||
if (item.checkedFieldsMapArr?.[curComponentId]?.length) {
|
||||
const endTimeFieldId = item.checkedFieldsMapArr?.[curComponentId].find(
|
||||
element => element !== fieldId
|
||||
)
|
||||
const resultEnd = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEnd[curComponentId]
|
||||
? result[1]
|
||||
: result[0]
|
||||
)
|
||||
result = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEnd[curComponentId]
|
||||
? result[0]
|
||||
: result[1]
|
||||
)
|
||||
parametersFilter = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === fieldId)
|
||||
)
|
||||
|
||||
const parametersFilterEnd = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === endTimeFieldId)
|
||||
)
|
||||
filter.push({
|
||||
componentId: ele.id,
|
||||
fieldId: endTimeFieldId,
|
||||
operator,
|
||||
value: resultEnd,
|
||||
parameters: parametersFilterEnd,
|
||||
isTree
|
||||
})
|
||||
}
|
||||
|
||||
if (item.checkedFieldsMapArrNum?.[curComponentId]?.length) {
|
||||
const endTimeFieldId = item.checkedFieldsMapArrNum?.[curComponentId].find(
|
||||
element => element !== fieldId
|
||||
)
|
||||
const resultEnd = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEndNum[curComponentId]
|
||||
? result[1]
|
||||
: result[0]
|
||||
)
|
||||
result = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEndNum[curComponentId]
|
||||
? result[0]
|
||||
: result[1]
|
||||
)
|
||||
parametersFilter = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === fieldId)
|
||||
)
|
||||
|
||||
const parametersFilterEnd = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === endTimeFieldId)
|
||||
)
|
||||
filter.push({
|
||||
componentId: ele.id,
|
||||
fieldId: endTimeFieldId,
|
||||
operator,
|
||||
value: resultEnd,
|
||||
parameters: parametersFilterEnd,
|
||||
isTree
|
||||
})
|
||||
}
|
||||
|
||||
filter.push({
|
||||
componentId: ele.id,
|
||||
fieldId,
|
||||
fieldId: endTimeFieldId,
|
||||
operator,
|
||||
value: result,
|
||||
parameters: parametersFilter,
|
||||
value: resultEnd,
|
||||
parameters: parametersFilterEnd,
|
||||
isTree
|
||||
})
|
||||
}
|
||||
|
||||
if (item.checkedFieldsMapArrNum?.[curComponentId]?.length) {
|
||||
const endTimeFieldId = item.checkedFieldsMapArrNum?.[curComponentId].find(
|
||||
element => element !== fieldId
|
||||
)
|
||||
const resultEnd = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEndNum[curComponentId]
|
||||
? result[1]
|
||||
: result[0]
|
||||
)
|
||||
result = Array(2).fill(
|
||||
endTimeFieldId === item.checkedFieldsMapEndNum[curComponentId]
|
||||
? result[0]
|
||||
: result[1]
|
||||
)
|
||||
parametersFilter = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === fieldId)
|
||||
)
|
||||
|
||||
const parametersFilterEnd = duplicateRemoval(
|
||||
item.parametersArr[curComponentId].filter(e => e.id === endTimeFieldId)
|
||||
)
|
||||
filter.push({
|
||||
componentId: ele.id,
|
||||
fieldId: endTimeFieldId,
|
||||
operator,
|
||||
value: resultEnd,
|
||||
parameters: parametersFilterEnd,
|
||||
isTree
|
||||
})
|
||||
}
|
||||
|
||||
filter.push({
|
||||
componentId: ele.id,
|
||||
fieldId,
|
||||
operator,
|
||||
value: result,
|
||||
parameters: parametersFilter,
|
||||
isTree
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -228,6 +228,7 @@ watch(
|
||||
|
||||
<style scoped lang="less">
|
||||
.mobile-background-selector {
|
||||
padding-left: 16px;
|
||||
:deep(.ed-form-item) {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 9b96136877d95f5e02477002cdbe513c9fecfc59
|
||||
Subproject commit 15fd94f9b316a6956be8eddaf4ba6196dcccb7a2
|
Loading…
Reference in New Issue
Block a user