亚洲欧洲∨国产一区二区三区动漫网, 久久国产精品亚洲国产成人蜜臀av, chinese国产外卖体育生gv, 成 人 h动 漫网站hd在线播放,2021国产不卡精品午夜,xsav性色无码免费,一级做a爰片欧美激情一级,二次元美女被捆绑用震蛋折磨,欧美诱人大屁股18p

Skip to content

Javascript代碼 ?

在瀏覽器中執(zhí)行自定義 JavaScript 代碼。

超時 ?

設置 JavaScript 代碼執(zhí)行的超時時間,默認為 20000ms(20 秒)。超時后工作流將繼續(xù)執(zhí)行后續(xù)組件。

執(zhí)行每個新標簽頁 ?

每次 MakAgent 新建或切換標簽頁時都會執(zhí)行 JavaScript 代碼。

注意事項

  • 啟用此選項后,JavaScript 代碼塊不再需要活動標簽頁即可工作
  • 內置函數(shù)(如 automaRefData、automaNextBlock 等)將不可用

在每個新標簽頁上執(zhí)行

執(zhí)行上下文 ?

參考:Javascript執(zhí)行上下文

JavaScript 代碼 ?

你可以在代碼中調用幾個內置函數(shù)。

automaNextBlock(data, insert?) ?

js
automaNextBlock(
	data?: Object | Object[], 
	insert?: boolean | { insert?: boolean; nextBlockId?: string; replaceTable?: boolean }
): void;
automaNextBlock(
	data?: Object | Object[], 
	insert?: boolean | { insert?: boolean; nextBlockId?: string; replaceTable?: boolean }
): void;

告訴工作流繼續(xù)執(zhí)行下一個塊。

使用 data 數(shù)將數(shù)據(jù)插入表中。此參數(shù)可以采用對象或對象數(shù)組數(shù)據(jù)類型。并且對象的鍵必須在表中中定義。

參數(shù) insert 用于控制是否將 data 參數(shù)中的數(shù)據(jù)插入到表中,默認為 true?;蛘撸憧梢詡鬟f一個包含兩個可選屬性的對象:

  • insert: 是否向表中插入數(shù)據(jù)。
  • nextBlockId: 指定要導航到的下一個塊的 ID 的字符串。
  • replaceTable: 用第一個參數(shù)傳遞的值替換工作流表值。 例子
js
automaNextBlock({ title: 'Something', count: 200 });

//or

automaNextBlock([{ title: 'Foo', count: 300 }, { title: 'Bar', count: 200 }])

// Continue execution to a specific block
automaNextBlock({ title: 'Hello' }, { nextBlockId: '4dxcxa3' })
automaNextBlock({ title: 'Something', count: 200 });

//or

automaNextBlock([{ title: 'Foo', count: 300 }, { title: 'Bar', count: 200 }])

// Continue execution to a specific block
automaNextBlock({ title: 'Hello' }, { nextBlockId: '4dxcxa3' })

table

agentSetVariable(name, value) ?

設置工作流變量的值。

例子

js
agentSetVariable('name', 'John Doe');

agentSetVariable('prices', [200, 1000, 4000, 900, 200]);

agentSetVariable('profile', { firstName: 'John', lastName: 'Doe' });
agentSetVariable('name', 'John Doe');

agentSetVariable('prices', [200, 1000, 4000, 900, 200]);

agentSetVariable('profile', { firstName: 'John', lastName: 'Doe' });

automaRefData(keyword, path) ?

使用此功能可以訪問工作流數(shù)據(jù),如表、變量等。

閱讀更多: 表達式

例子

js
// Get the first row of the table
const firstRow = automaRefData('table', '0');

// Get the last row of the table
const firstRow = automaRefData('table', '$last');

// Get the "name" column on the first row of the table
const firstRow = automaRefData('table', '0.name');

// Get the global data of the workflow
const globalData = automaRefData('globalData');

// Get the iteration data of the loop data block
const data = automaRefData('loopData', 'loopId');

// Get the value of the "text" variable
const value = automaRefData('variables', 'text');
// Get the first row of the table
const firstRow = automaRefData('table', '0');

// Get the last row of the table
const firstRow = automaRefData('table', '$last');

// Get the "name" column on the first row of the table
const firstRow = automaRefData('table', '0.name');

// Get the global data of the workflow
const globalData = automaRefData('globalData');

// Get the iteration data of the loop data block
const data = automaRefData('loopData', 'loopId');

// Get the value of the "text" variable
const value = automaRefData('variables', 'text');

agentFetch(type, resource) ?

在擴展后臺發(fā)起HTTP請求,用它來避免CORS。

  • type: 請求的響應類型??赡艿闹?text & json;
  • resource: 你希望獲取的資源。

例子

js
agentFetch('json', { url: 'https://api.example.com'}).then((result) => {
	console.log(result);
})

agentFetch('json', {
	url: 'https://api.example.com',
	method: 'POST',
	body: JSON.stringify({
		title: 'Hello world',
	}),
})
agentFetch('json', { url: 'https://api.example.com'}).then((result) => {
	console.log(result);
})

agentFetch('json', {
	url: 'https://api.example.com',
	method: 'POST',
	body: JSON.stringify({
		title: 'Hello world',
	}),
})

agentResetTimeout() ?

重置執(zhí)行超時。

預加載腳本 ?

在執(zhí)行 javascript 代碼之前加載一個 javascript 文件。

  • URL
    javascript 文件的 URL。