Skip to content

Commit

Permalink
feat: Modify prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleurxxx committed Oct 28, 2024
1 parent 9a44fcf commit e438520
Showing 1 changed file with 48 additions and 69 deletions.
117 changes: 48 additions & 69 deletions packages/plugins/robot/src/js/codeRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ export const codeRules = `\`\`\`
</tiny-container>
</div>
<!-- Icon 图标 -->
<div class="icon-demo">
<tiny-icon-share></tiny-icon-share>
<tiny-icon-del></tiny-icon-del>
</div>
<!-- Layout 栅格布局 -->
<div class="content">
<tiny-layout :cols="12">
Expand Down Expand Up @@ -145,9 +139,12 @@ export const codeRules = `\`\`\`
<tiny-button type="primary" @click="submitForm">提交</tiny-button>
</tiny-form-item>
</tiny-form>
<!-- Rate 评分 -->
<tiny-rate v-model="rateValue" show-text></tiny-rate>
<!-- ButtonGroup 按钮组 -->
<div>
<tiny-button-group :data="groupData" v-model="checkedVal"></tiny-button-group>
<div class="mt-12">当前选中值:{{ checkedVal }}</div>
</div>
<!-- Search 搜索 -->
<div>
Expand Down Expand Up @@ -187,9 +184,21 @@ export const codeRules = `\`\`\`
<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="createdDate" title="创建日期" sortable></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-column title="操作" width="100">
<template #default="data">
<div class="demo-custom-column">
<tiny-button size="mini" @click="clickHandler(data.row)">保存</tiny-button>
<!-- Icon 图标 -->
<tiny-icon-search class="tiny-svg-size" @click="clickHandler(data.row)"></tiny-icon-search>
<tiny-icon-edit class="tiny-svg-size" @click="clickHandler(data.row)"></tiny-icon-edit>
<tiny-icon-share></tiny-icon-share>
<tiny-icon-del></tiny-icon-del>
</div>
</template>
</tiny-grid-column>
</tiny-grid>
Expand Down Expand Up @@ -311,17 +320,6 @@ export const codeRules = `\`\`\`
</tiny-popconfirm>
</div>
<!-- Progress 进度条 -->
<div>
<div>
<tiny-button :icon="IconMinus" :reset-time="0" @click="decreaseProgress"></tiny-button>
<tiny-button :icon="IconPlus" :reset-time="0" @click="increaseProgress"></tiny-button>
</div>
<tiny-progress class="progress-first" :stroke-width="4" :percentage="progressPercentage"></tiny-progress>
<tiny-progress class="progress-second" :stroke-width="24" :percentage="progressPercentage"></tiny-progress>
<div class="tip" v-if="progressPercentage !== 100">努力加载中,请稍后...</div>
</div>
<!-- Popover 气泡卡片 -->
<tiny-popover placement="top-start" title="标题" content="这是一段内容。" width="200">
<template #reference>
Expand All @@ -339,6 +337,7 @@ export const codeRules = `\`\`\`
<script setup>
import {
Button as TinyButton,
ButtonGroup as TinyButtonGroup,
Layout as TinyLayout,
Row as TinyRow,
Container as TinyContainer,
Expand Down Expand Up @@ -368,7 +367,6 @@ import {
FormItem as TinyFormItem,
Numeric as TinyNumeric,
Input as TinyInput,
Rate as TinyRate,
Search as TinySearch,
Select as TinySelect,
Option as TinyOption,
Expand Down Expand Up @@ -396,25 +394,33 @@ import {
Modal,
Notify,
PopConfirm as TinyPopconfirm,
Progress as TinyProgress,
Popover as TinyPopover,
Tooltip as TinyTooltip
} from '@opentiny/vue'
import { ref } from 'vue'
import { iconMinus, iconPlus, iconSmile } from '@opentiny/vue-icon'
// Container 布局数据
const pattern = ref('default')
import { iconMinus, iconPlus, iconSmile, iconEdit, iconSearch } from '@opentiny/vue-icon'
// Icon 图标数据
const TinyIconShare = IconShare()
const TinyIconDel = IconDel()
const TinyIconEdit = iconEdit()
const TinyIconSearch = iconSearch()
// Container 布局数据
const pattern = ref('default')
// Link 链接数据
function handleClick() {
console.log('clicked')
}
// ButtonGroup 数据
const checkedVal = ref('Button1')
const groupData = ref([
{ text: 'Button1', value: 'Button1' },
{ text: 'Button2', value: 'Button2' }
])
// ActionMenu 动作菜单数据
const options = ref([
{
Expand Down Expand Up @@ -510,9 +516,6 @@ function submitForm() {
console.log('Form submitted', formValue)
}
// Rate 评分数据
const rateValue = ref(2)
// Search 搜索数据
const searchValue = ref('默认值')
Expand Down Expand Up @@ -582,6 +585,11 @@ function checkboxEdit(h, { row }) {
)
}
//Grid表格操作
function clickHandler(row) {
Modal.message({ message: JSON.stringify(row), status: 'success' })
}
// Collapse 折叠面板数据
const activeNames = ref(['1'])
Expand Down Expand Up @@ -651,25 +659,6 @@ function handleNotifyClick() {
// PopConfirm 气泡确认框数据
const popConfirmTitle = ref('这是气泡标题')
const popConfirmMessage = ref('这是气泡确认框提示内容文本描述,这是两行内容的展示样式,文本内容很长很长。')
// Progress 进度条数据
const progressPercentage = ref(90)
const IconMinus = iconMinus()
const IconPlus = iconPlus()
function increaseProgress() {
progressPercentage.value += 10
if (progressPercentage.value > 100) {
progressPercentage.value = 100
}
}
function decreaseProgress() {
progressPercentage.value -= 10
if (progressPercentage.value < 0) {
progressPercentage.value = 0
}
}
</script>
<style scoped>
.mt-12 { margin-top: 12px; }
Expand All @@ -687,7 +676,16 @@ function decreaseProgress() {
步骤:
1. 首先在state内部定义一个属性值:
"state": {
"tableData": []
"tableData": [
{
"id": "1",
"name": "GFD科技有限公司"
},
{
"id": "2",
"name": "WWW科技有限公司"
}
]
}
2. 在需要展示数据的字段中引用该属性:
错误示例:
Expand Down Expand Up @@ -766,25 +764,6 @@ function decreaseProgress() {
"css": "",
"props": {},
"children": [
{
"componentName": "div",
"props": {
"style": ""
},
"id": "",
"children": [
{
"componentName": "TinyTimeLine",
"props": {
"active": "",
"data": [],
"horizontal": true,
"style": ""
},
"id": ""
}
]
},
{
"componentName": "div",
"props": {
Expand Down

0 comments on commit e438520

Please sign in to comment.