Skip to content

Commit

Permalink
优化代码解决随机性值被清空
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingliao committed Nov 28, 2023
1 parent cfbe2a0 commit 48e53b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ export async function getTableApi(mainObject, fields, options){
if(options.isRelated){
api.url += "&recordId=${_master.recordId}";
}
// api.cache = 3000;
api.cache = 3000;

api.data.$term = "$term";
api.data.term = "$term";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,7 @@ export async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
const keywordsSearchBoxName = ctx.keywordsSearchBoxName || "__keywords";
const clear__filterFormValues = `
doAction(
{
"componentId": 'service_${ctx.crudId}',
"actionType": "setValue",
"args": {
"value": {
"__filterFormValues": null
}
}
}
)
`
const onSearchScript = `
${clear__filterFormValues}
const scope = event.context.scoped;
var filterForm = scope.parent.parent.getComponents().find(function(n){
return n.props.type === "form";
Expand Down Expand Up @@ -170,7 +156,17 @@ export async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
`;
const onCancelScript = `
${clear__filterFormValues}
doAction(
{
"componentId": 'service_${ctx.crudId}',
"actionType": "setValue",
"args": {
"value": {
"__filterFormValues": null
}
}
}
)
const scope = event.context.scoped;
var filterForm = scope.parent.parent.getComponents().find(function(n){
return n.props.type === "form";
Expand Down

0 comments on commit 48e53b6

Please sign in to comment.