@formio/uag-js (英语)
这个 表格.io UAG formio.js的应用程序。 登记一次,并标记表格 uag 除了通过UAG(所以他们的“代理:运行任务”动作运行),以及任务有输入者获得 代理输入,它从用户描述的内容中填入表格,而不覆盖输入的内容。 每种其他形式, 和任何其他请求, 都和以前一样,去Form.io。 任意 uag 形式也可以作为 聊天。 。 。 .
npm install @formio/uag-js
它与formio.js 5(英语:@formio/js 5.x),无附属关系.
import { Formio } from '@formio/js';
import { UAG } from '@formio/uag-js';
import '@formio/uag-js/uag-js.css';
Formio.setProjectUrl('https://forms.example.com/myproject');
Formio.use(UAG('https://uag.example.com'));
Formio.createForm(document.getElementById('claim'), 'https://forms.example.com/myproject/claim');
没有捆绑,装上UAG自己的 https://uag.example.com/uag-js/uag.use.js (和 uag-js.css在formio.js之后:它用该UAG及其模块的组件进行注册。 见 或者从UAG装入。 。 。 .
向UAG提出的请求带有用户的Form.io令牌(x-jwt-token由于formio.js将它发送给form.io;不需要其他标志。 在浏览器中行走不是一个安全边界:保护代理在服务器上拥有的、具有代理角色的字段,组成权限和 uagAuthoritative。 。 。 .
AI 文件
这个 AI 文件 构成部分uagdocument)是来自 @formio/uag-extras (单位:千美元)npm install @formio/uag-extras@^1),而不是从这个包裹。 使用模块的 UAG 将组件添加到其 /uag-js/uag.use.js; 带有捆绑器的应用程序在此包后注册:
import aiDocument from '@formio/uag-extras/modules/ai-document/client';
Formio.use(UAG('https://uag.example.com'));
Formio.use(aiDocument);
见 AI 文件。 。 。 .
对于组件: client
一旦UAG注册, client (另见: Formio.uagClient, (中文(简体) ), FormioUAG.client 财务报告和审定财务报表 UAG.client)是UAG模块组件所基于,在主要版本内稳定的浏览器API:UAG的URL,用户的令牌和信头,UAG上的窗体URL,已安装的插件, stream() 用于模块路由,和Markdown渲染.
import { client } from '@formio/uag-js';
await client.ready;
const done = await client.stream(client.formUrl(form) + '/document/process', { path, files }, { onEvent: (name, data) => {} });
每个成员,如何 stream() 决定并拒绝: 模块组件: client。 。 。 .
聊天
标记任何窗体 uag 也可以作为聊天的方式 Formio.createForm 把它变成一种形式。 一个人描述他们需要什么;聊天询问还缺少什么,并填充后面的表格,这些表格一旦确认就通过UAG验证并提交. 每个转弯就是形式 {form}/agent/chat 在UAG上,所以没有模型代码,也没有自己的服务器,它不需要代理格式流许可证(UAG需要代理引擎).
Formio.use(UAG('https://uag.example.com'));
const chat = await Formio.createChat(document.getElementById('help'), 'https://forms.example.com/myproject/service-request', {
suggestions: ['My internet is down'],
markdown: (text) => marked.parse(text) // optional; the output is sanitized
});
chat.on('submitDone', (submission) => console.log('Saved', submission._id));
createChat 也导出(和 FormioUAG.createChat 带有脚本标记). 聊天通过formio.js模板(uagChat, (中文(简体) ), uagChatMessage,.) 您可以替换每个框架或每个聊天, 翻译通过 i18n和以物配主者 --uag-chat-* CSS 属性在 uag-js.css。 。 。 .
联合国 Java 脚本 (formio.js) • 妇女 聊天部件。 。 。 .