-
Notifications
You must be signed in to change notification settings - Fork 310
feat(site): add the tiny-robot drawer to the official website. #3467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c0183a5
feat(site): 添加tiny-robot的初始代码
shenjunjian 1bcc505
fix(site): fix
shenjunjian 27b06c2
fix(robot): fix
shenjunjian 9c59f8a
fix(robot): 添加自定义适配 dify
shenjunjian 41c679b
fix(site): fix
shenjunjian 5182627
fix(site): 在表格中,专门添加智能体文件
shenjunjian c54301c
Merge branch 'dev' of github.com:opentiny/tiny-vue into shen/site-add…
shenjunjian 2fee84b
fix(site): ai-agent
shenjunjian b63202f
fix(site): fix
shenjunjian d8bfc13
ci(workflow): update branches for auto deployment
zzcr 0bdd7f5
chore: 还原action脚本
zzcr 56ea1a2
fix(site): fix 检视意见
shenjunjian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
examples/sites/demos/pc/app/grid/ai-agent/basic-usage-composition-api.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<template> | ||
<tiny-grid :data="tableData" :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }"> | ||
<tiny-grid-column type="index" width="60"></tiny-grid-column> | ||
<tiny-grid-column type="selection" width="60"></tiny-grid-column> | ||
<tiny-grid-column field="employees" title="员工数"></tiny-grid-column> | ||
<tiny-grid-column field="createdDate" title="创建日期"></tiny-grid-column> | ||
<tiny-grid-column field="city" title="城市"></tiny-grid-column> | ||
<tiny-grid-column | ||
field="boole" | ||
title="布尔值" | ||
align="center" | ||
format-text="boole" | ||
:editor="checkboxEdit" | ||
></tiny-grid-column> | ||
</tiny-grid> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
import { TinyGrid, TinyGridColumn } from '@opentiny/vue' | ||
import { reactive } from 'vue' | ||
|
||
const tableData = reactive([ | ||
{ | ||
id: '1', | ||
name: 'GFD 科技 YX 公司', | ||
city: '福州', | ||
employees: 800, | ||
createdDate: '2014-04-30 00:56:00', | ||
boole: false | ||
}, | ||
{ | ||
id: '2', | ||
name: 'WWW 科技 YX 公司', | ||
city: '深圳', | ||
employees: 300, | ||
createdDate: '2016-07-08 12:36:22', | ||
boole: true | ||
}, | ||
{ | ||
id: '3', | ||
name: 'RFV 有限责任公司', | ||
city: '中山', | ||
employees: 1300, | ||
createdDate: '2014-02-14 14:14:14', | ||
boole: false | ||
}, | ||
{ | ||
id: '4', | ||
name: 'TGB 科技 YX 公司', | ||
city: '龙岩', | ||
employees: 360, | ||
createdDate: '2013-01-13 13:13:13', | ||
boole: true | ||
}, | ||
{ | ||
id: '5', | ||
name: 'YHN 科技 YX 公司', | ||
city: '韶关', | ||
employees: 810, | ||
createdDate: '2012-12-12 12:12:12', | ||
boole: true | ||
}, | ||
{ | ||
id: '6', | ||
name: 'WSX 科技 YX 公司', | ||
city: '黄冈', | ||
employees: 800, | ||
createdDate: '2011-11-11 11:11:11', | ||
boole: true | ||
}, | ||
{ | ||
id: '7', | ||
name: 'KBG 物业 YX 公司', | ||
city: '赤壁', | ||
employees: 400, | ||
createdDate: '2016-04-30 23:56:00', | ||
boole: false | ||
}, | ||
{ | ||
id: '8', | ||
name: '深圳市福德宝网络技术 YX 公司', | ||
boole: true, | ||
city: '厦门', | ||
createdDate: '2016-06-03 13:53:25', | ||
employees: 540 | ||
} | ||
]) | ||
|
||
function checkboxEdit(h, { row }) { | ||
return ( | ||
<input | ||
type="checkbox" | ||
checked={row.boole} | ||
onChange={(event) => { | ||
row.boole = event.target.checked | ||
}} | ||
/> | ||
) | ||
} | ||
</script> |
182 changes: 182 additions & 0 deletions
182
examples/sites/demos/pc/app/grid/ai-agent/basic-usage.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
<template> | ||
<tiny-grid | ||
:data="tableData" | ||
:edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }" | ||
:tiny_mcp_config="{ | ||
server, | ||
business: { | ||
id: 'company-information', | ||
description: '公司人员信息表' | ||
} | ||
}" | ||
> | ||
<tiny-grid-column type="index" width="60"></tiny-grid-column> | ||
<tiny-grid-column type="selection" width="60"></tiny-grid-column> | ||
<tiny-grid-column field="employees" title="员工数"></tiny-grid-column> | ||
<tiny-grid-column field="createdDate" title="创建日期"></tiny-grid-column> | ||
<tiny-grid-column field="city" title="城市"></tiny-grid-column> | ||
<tiny-grid-column | ||
field="boole" | ||
title="布尔值" | ||
align="center" | ||
format-text="boole" | ||
:editor="checkboxEdit" | ||
></tiny-grid-column> | ||
</tiny-grid> | ||
</template> | ||
|
||
<script lang="jsx"> | ||
import { TinyGrid, TinyGridColumn } from '@opentiny/vue' | ||
import { createTransportPair, createSseProxy } from '@opentiny/next' | ||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js' | ||
import { Client } from '@modelcontextprotocol/sdk/client/index.js' | ||
|
||
export default { | ||
components: { | ||
TinyGrid, | ||
TinyGridColumn | ||
}, | ||
data() { | ||
const tableData = [ | ||
{ | ||
id: '1', | ||
name: 'GFD 科技 YX 公司', | ||
city: '福州', | ||
employees: 800, | ||
createdDate: '2014-04-30 00:56:00', | ||
boole: false | ||
}, | ||
{ | ||
id: '2', | ||
name: 'WWW 科技 YX 公司', | ||
city: '深圳', | ||
employees: 300, | ||
createdDate: '2016-07-08 12:36:22', | ||
boole: true | ||
}, | ||
{ | ||
id: '3', | ||
name: 'RFV 有限责任公司', | ||
city: '中山', | ||
employees: 1300, | ||
createdDate: '2014-02-14 14:14:14', | ||
boole: false | ||
}, | ||
{ | ||
id: '4', | ||
name: 'TGB 科技 YX 公司', | ||
city: '龙岩', | ||
employees: 360, | ||
createdDate: '2013-01-13 13:13:13', | ||
boole: true | ||
}, | ||
{ | ||
id: '5', | ||
name: 'YHN 科技 YX 公司', | ||
city: '韶关', | ||
employees: 810, | ||
createdDate: '2012-12-12 12:12:12', | ||
boole: true | ||
}, | ||
{ | ||
id: '6', | ||
name: 'WSX 科技 YX 公司', | ||
city: '黄冈', | ||
employees: 800, | ||
createdDate: '2011-11-11 11:11:11', | ||
boole: true | ||
}, | ||
{ | ||
id: '7', | ||
name: 'KBG 物业 YX 公司', | ||
city: '赤壁', | ||
employees: 400, | ||
createdDate: '2016-04-30 23:56:00', | ||
boole: false | ||
}, | ||
{ | ||
id: '8', | ||
name: '深圳市福德宝网络技术 YX 公司', | ||
boole: true, | ||
city: '厦门', | ||
createdDate: '2016-06-03 13:53:25', | ||
employees: 540 | ||
} | ||
] | ||
|
||
return { | ||
server: new McpServer({ name: 'base-config', version: '1.0.0' }, {}), | ||
sessionID: '', | ||
op: { | ||
editConfig: { | ||
trigger: 'click', | ||
mode: 'cell', | ||
showStatus: true | ||
}, | ||
columns: [ | ||
{ | ||
type: 'index', | ||
width: 60 | ||
}, | ||
{ | ||
type: 'selection', | ||
width: 60 | ||
}, | ||
{ | ||
field: 'employees', | ||
title: '员工数' | ||
}, | ||
{ | ||
field: 'createdDate', | ||
title: '创建日期' | ||
}, | ||
{ | ||
field: 'city', | ||
title: '城市' | ||
}, | ||
{ | ||
field: 'boole', | ||
title: '布尔值', | ||
align: 'center', | ||
formatText: 'boole', | ||
editor: this.checkboxEdit | ||
} | ||
], | ||
data: tableData | ||
}, | ||
tableData | ||
} | ||
}, | ||
methods: { | ||
checkboxEdit(h, { row }) { | ||
return ( | ||
<input | ||
type="checkbox" | ||
checked={row.boole} | ||
onChange={(event) => { | ||
row.boole = event.target.checked | ||
}} | ||
/> | ||
) | ||
} | ||
}, | ||
async mounted() { | ||
// 1、 | ||
const [transport, clientTransport] = createTransportPair() | ||
|
||
// 2、 | ||
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) | ||
await client.connect(clientTransport) | ||
const { sessionId } = await createSseProxy({ | ||
client, | ||
url: 'http://39.108.160.245/sse' | ||
}) | ||
chenxi-20 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
this.sessionID = sessionId | ||
window.$sessionId = this.sessionID | ||
chenxi-20 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 3、 | ||
await this.server.connect(transport) | ||
} | ||
} | ||
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Grid 表格 | ||
--- | ||
|
||
# Grid 表格 | ||
|
||
<div>表格组件,提供了非常强大数据表格功能,在 Grid 可以展示数据列表,可以对数据列表进行选择、编辑等。</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Grid Table | ||
--- | ||
|
||
# Grid Table | ||
|
||
<div>Table component, which provides powerful data table functions. In Grid, data lists can be displayed, selected, and edited.</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default { | ||
column: '1', | ||
owner: '', | ||
demos: [ | ||
{ | ||
demoId: 'grid-ai-agent', | ||
name: { 'zh-CN': '表格智能体', 'en-US': 'grid agent' }, | ||
desc: { | ||
'zh-CN': `表格智能体是表格组件面向 AI 领域的应用,提供了一个基于表格数据的智能体交互界面。用户可以通过自然语言与表格进行交互,智能体会根据表格内容和用户输入执行操作。<br> | ||
目前表格智能体支持的操作包括:<br> | ||
- 查询表格数据:用户可以输入自然语言查询表格中的数据,智能体会解析查询并返回结果,以及根据结果执行后续的操作。<br> | ||
- 滚动到指定行:用户可以通过自然语言指令,将表格滚动到指定位置。<br> | ||
- 选中表格数据:用户可以通过自然语言指令,选中表格数据。<br> | ||
- 选中全部数据:用户可以通过自然语言指令,选中全部数据。<br> | ||
|
||
通过属性 <code>tiny-mcp-config</code> 可以配置表格的业务意义以及传入<code>server</code>对象,详见示例。`, | ||
'en-US': `` | ||
}, | ||
codeFiles: ['ai-agent/basic-usage.vue'] | ||
} | ||
], | ||
apis: [{ name: 'grid-ai-agent', 'type': 'component', 'props': [], 'events': [], 'slots': [] }] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.