This commit is contained in:
ray_wuhao 2023-03-10 15:38:02 +08:00
parent 79c5dea7a6
commit ffef1ee509
8 changed files with 240 additions and 210 deletions

View File

@ -12,3 +12,10 @@
- 新增面包屑 - 新增面包屑
- 支持国际化语言包分包管理(但是,依旧是合并到一个文件中,所以需要注意 key 的管理) - 支持国际化语言包分包管理(但是,依旧是合并到一个文件中,所以需要注意 key 的管理)
- 新增国内预览地址 - 新增国内预览地址
## 3.1.2
### Feats
- 修改 demo 页面展示
- 修改 RayCollapseGrid, RayTable 组件为默认不展示 border

View File

@ -1,7 +1,7 @@
{ {
"name": "ray-template", "name": "ray-template",
"private": true, "private": true,
"version": "3.1.1", "version": "3.1.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -33,10 +33,10 @@ export const collapseGridProps = {
* *
* *
* *
* `true` * `false`
*/ */
type: Boolean, type: Boolean,
default: true, default: false,
}, },
...gridProps, ...gridProps,
} as const } as const

View File

@ -9,6 +9,23 @@
* @remark * @remark
*/ */
/**
*
* <https://www.naiveui.com/zh-CN/dark/components/data-table>
*
* `NDataTable`, `NDataTable Props`
*
* 实现: 抬头, , , `excel`
*
* , `showMenu` 使
*
* `action` `false`
*
* `props` , `props.ts`
*
* `xlsx.js` `excel`
*/
import './index.scss' import './index.scss'
import { NDataTable, NCard, NDropdown, NDivider } from 'naive-ui' import { NDataTable, NCard, NDropdown, NDivider } from 'naive-ui'
import TableSetting from './components/TableSetting/index' import TableSetting from './components/TableSetting/index'
@ -240,20 +257,3 @@ const RayTable = defineComponent({
}) })
export default RayTable export default RayTable
/**
*
* <https://www.naiveui.com/zh-CN/dark/components/data-table>
*
* `NDataTable`, `NDataTable Props`
*
* 实现: 抬头, , , `excel`
*
* , `showMenu` 使
*
* `action` `false`
*
* `props` , `props.ts`
*
* `xlsx.js` `excel`
*/

View File

@ -205,7 +205,7 @@ const rayTableProps = {
* *
*/ */
type: Boolean, type: Boolean,
default: true, default: false,
}, },
} as const } as const

View File

@ -6,6 +6,8 @@ import {
NDescriptionsItem, NDescriptionsItem,
NTag, NTag,
NSpace, NSpace,
NP,
NH6,
} from 'naive-ui' } from 'naive-ui'
import RayIcon from '@/components/RayIcon/index' import RayIcon from '@/components/RayIcon/index'
import RayLink from '@/components/RayLink/index' import RayLink from '@/components/RayLink/index'
@ -58,9 +60,28 @@ const Dashboard = defineComponent({
span: 2, span: 2,
}, },
] ]
const technologyTagOptions = [
{
label: 'Vue3.x',
value: 'Vue3.x',
},
{
label: 'Vite4.0',
value: 'Vite4.0',
},
{
label: 'Pinia',
value: 'Pinia',
},
{
label: 'TSX',
value: 'TSX',
},
]
return { return {
coverLetterOptions, coverLetterOptions,
technologyTagOptions,
} }
}, },
render() { render() {
@ -93,6 +114,22 @@ const Dashboard = defineComponent({
))} ))}
</NDescriptions> </NDescriptions>
</NCard> </NCard>
<NCard title="项目介绍">
<NH6></NH6>
<NP>
<NSpace>
{this.technologyTagOptions.map((curr) => (
<NTag key={curr.value} type="info">
{curr.label}
</NTag>
))}
</NSpace>
</NP>
<NH6></NH6>
<NP>
</NP>
</NCard>
<NCard title="友情链接"> <NCard title="友情链接">
<RayLink /> <RayLink />
</NCard> </NCard>

View File

@ -1,6 +1,19 @@
import './index.scss' import './index.scss'
import {
NCard,
NSwitch,
NLayout,
NDescriptions,
NDescriptionsItem,
NTag,
NSpace,
NP,
NH6,
NH2,
NH3,
} from 'naive-ui'
import RayChart from '@/components/RayChart/index' import RayChart from '@/components/RayChart/index'
import { NCard, NSwitch } from 'naive-ui'
const Echart = defineComponent({ const Echart = defineComponent({
name: 'Echart', name: 'Echart',
@ -200,69 +213,63 @@ const Echart = defineComponent({
render() { render() {
return ( return (
<div class="echart"> <div class="echart">
<NCard title="RayChart组件使用"> <NH2>RayChart 使</NH2>
使, , <NP>
使, echarts , 使 use 200*200
. , , use
</NCard> </NP>
<NCard title="基础使用"> <NH2>使</NH2>
<div class="chart--container"> <div class="chart--container">
<RayChart options={this.baseOptions} /> <RayChart options={this.baseOptions} />
</div> </div>
</NCard> <NH2></NH2>
<NCard title="渲染成功后运行回调函数"> <div class="chart--container">
<div class="chart--container"> <RayChart
<RayChart options={this.basePieOptions}
options={this.basePieOptions} success={this.handleChartRenderSuccess.bind(this)}
success={this.handleChartRenderSuccess.bind(this)} />
/> </div>
</div> <NH2></NH2>
</NCard> <div class="chart--container">
<NCard title="能跟随主题切换的可视化图"> <RayChart
<div class="chart--container"> autoChangeTheme
<RayChart options={this.baseLineOptions}
autoChangeTheme showAria={this.chartAria}
options={this.baseLineOptions} />
showAria={this.chartAria} </div>
/> <NH2></NH2>
</div> <div class="chart--container">
</NCard> <RayChart theme="dark" options={this.baseOptions} />
<NCard title="不跟随主题切换的暗色主题可视化图"> </div>
<div class="chart--container"> <NH2></NH2>
<RayChart theme="dark" options={this.baseOptions} /> <NSwitch
</div> v-model:value={this.chartLoading}
</NCard> onUpdateValue={this.handleLoadingShow.bind(this)}
<NCard title="加载动画"> style={['padding: 18px 0']}
<NSwitch >
v-model:value={this.chartLoading} {{
onUpdateValue={this.handleLoadingShow.bind(this)} checked: () => '隐藏加载动画',
style={['padding: 18px 0']} unchecked: () => '显示加载动画',
> }}
{{ </NSwitch>
checked: () => '隐藏加载动画', <div class="chart--container">
unchecked: () => '显示加载动画', <RayChart ref="baseChartRef" options={this.baseOptions} />
}} </div>
</NSwitch> <NH2></NH2>
<div class="chart--container"> <NSwitch
<RayChart ref="baseChartRef" options={this.baseOptions} /> v-model:value={this.chartAria}
</div> onUpdateValue={this.handleAriaShow.bind(this)}
</NCard> style={['padding: 18px 0']}
<NCard title="贴画可视化图"> >
<NSwitch {{
v-model:value={this.chartAria} checked: () => '隐藏贴花',
onUpdateValue={this.handleAriaShow.bind(this)} unchecked: () => '显示贴花',
style={['padding: 18px 0']} }}
> </NSwitch>
{{ <div class="chart--container">
checked: () => '隐藏贴花', <RayChart options={this.baseOptions} showAria={this.chartAria} />
unchecked: () => '显示贴花', </div>
}}
</NSwitch>
<div class="chart--container">
<RayChart options={this.baseOptions} showAria={this.chartAria} />
</div>
</NCard>
</div> </div>
) )
}, },

View File

@ -21,6 +21,15 @@ import {
NInputNumber, NInputNumber,
NSpace, NSpace,
NSwitch, NSwitch,
NDescriptions,
NDescriptionsItem,
NP,
NH6,
NH2,
NH3,
NUl,
NLi,
NOl,
} from 'naive-ui' } from 'naive-ui'
import RayTable from '@/components/RayTable/index' import RayTable from '@/components/RayTable/index'
import RayCollapseGrid from '@/components/RayCollapseGrid/index' import RayCollapseGrid from '@/components/RayCollapseGrid/index'
@ -147,137 +156,107 @@ const TableView = defineComponent({
render() { render() {
return ( return (
<NLayout> <NLayout>
<NCard title="RayTable"> <NH2>RayTable 使</NH2>
<p> <NUl alignText>
Naive UI DataTable . , , <NLi>
excel Naive UI DataTable
</p> excel
<p>RayTable DataTable </p> </NLi>
<p> <NLi>RayTable DataTable </NLi>
props , <NLi>
props
src/components/RayTable/src/props.ts src/components/RayTable/src/props.ts
</p> </NLi>
<p> RayCollapseGird 使</p> <NLi> RayCollapseGird 使</NLi>
</NCard> </NUl>
<NCard style={['margin-top: 18px']}> <NH2> RayCollapseGird 使</NH2>
<RayCollapseGrid
bordered={false}
collapsedRows={this.gridCollapsedRows}
cols={this.gridItemCount}
onUpdateValue={(value: boolean) =>
window.$message.info(
`我是 RayCollapseGrid 组件${value ? '收起' : '展开'}的回调函数`,
)
}
>
{{ {{
default: () => ( action: () => (
<NSpace vertical> <>
<NSpace style={['margin-top: 18px']}> <NButton></NButton>
NGird , css grid , <NButton></NButton>
NGridItem , 使 NGridItem </>
使(使 NGridItem ).
</NSpace>
<NSpace style={['margin-top: 18px']}>
<NSpace align="center">
<NInputNumber v-model:value={this.gridItemCount} />
</NSpace>
<NSpace align="center">
<NInputNumber v-model:value={this.gridCollapsedRows} />
</NSpace>
</NSpace>
<RayCollapseGrid
collapsedRows={this.gridCollapsedRows}
cols={this.gridItemCount}
onUpdateValue={(value: boolean) =>
window.$message.info(
`我是 RayCollapseGrid 组件${
value ? '收起' : '展开'
}`,
)
}
>
{{
action: () => (
<>
<NButton></NButton>
<NButton></NButton>
</>
),
default: () => (
<>
<NGridItem>
<NSelect />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
<NGridItem>
<NDatePicker type="datetimerange" clearable />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
</>
),
}}
</RayCollapseGrid>
</NSpace>
),
}}
</NCard>
<NCard title="基础使用" style={['margin-top: 18px']}>
<RayTable
title={h(
NSwitch,
{
onUpdateValue: (value: boolean) => (this.tableLoading = value),
},
{},
)}
data={this.tableData}
columns={this.baseColumns}
action={false}
pagination={{
pageSize: 10,
}}
loading={this.tableLoading}
>
{{
tableFooter: () => '表格的底部内容区域,有时候你可能会用上',
}}
</RayTable>
</NCard>
<NCard style={['margin-top: 18px']}>
{{
header: () => (
<div>
<p>
使 columns action
(v-model:columns)
</p>
<p></p>
<p>, </p>
<p>, </p>
<p> excel , </p>
<p></p>
</div>
), ),
default: () => ( default: () => (
<RayTable <>
title={h(NInput, { <NGridItem>
placeholder: '请输入检索条件', <NSelect />
style: ['width: 200px'], </NGridItem>
})} <NGridItem>
data={this.tableData} <NInput />
v-model:columns={this.actionColumns} </NGridItem>
/> <NGridItem>
<NDatePicker type="datetimerange" clearable />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
</>
), ),
}} }}
</NCard> </RayCollapseGrid>
<NCard title="右键菜单" style={['margin-top: 18px']}> <RayTable
<RayTable style="margin-top: 18px"
title="右键菜单表格" title={h(
action={false} NSwitch,
data={this.tableData} {
columns={this.baseColumns} onUpdateValue: (value: boolean) => (this.tableLoading = value),
rightClickMenu={this.tableMenuOptions} },
onMenuSelect={this.handleMenuSelect.bind(this)} {},
/> )}
</NCard> data={this.tableData}
columns={this.baseColumns}
action={false}
pagination={{
pageSize: 10,
}}
loading={this.tableLoading}
>
{{
tableFooter: () => '表格的底部内容区域,有时候你可能会用上',
}}
</RayTable>
<NH2>RayTable </NH2>
<NP>
使 columns action
(v-model:columns)
</NP>
<NP></NP>
<NP></NP>
<NP></NP>
<NP> excel </NP>
<NP></NP>
<RayTable
title={h(NInput, {
placeholder: '请输入检索条件',
style: ['width: 200px'],
})}
data={this.tableData}
v-model:columns={this.actionColumns}
bordered={false}
/>
<NH2></NH2>
<RayTable
title="右键菜单表格"
action={false}
data={this.tableData}
columns={this.baseColumns}
rightClickMenu={this.tableMenuOptions}
onMenuSelect={this.handleMenuSelect.bind(this)}
/>
</NLayout> </NLayout>
) )
}, },