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,26 +213,24 @@ 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>
</NCard> <NH2></NH2>
<NCard title="能跟随主题切换的可视化图">
<div class="chart--container"> <div class="chart--container">
<RayChart <RayChart
autoChangeTheme autoChangeTheme
@ -227,13 +238,11 @@ const Echart = defineComponent({
showAria={this.chartAria} showAria={this.chartAria}
/> />
</div> </div>
</NCard> <NH2></NH2>
<NCard title="不跟随主题切换的暗色主题可视化图">
<div class="chart--container"> <div class="chart--container">
<RayChart theme="dark" options={this.baseOptions} /> <RayChart theme="dark" options={this.baseOptions} />
</div> </div>
</NCard> <NH2></NH2>
<NCard title="加载动画">
<NSwitch <NSwitch
v-model:value={this.chartLoading} v-model:value={this.chartLoading}
onUpdateValue={this.handleLoadingShow.bind(this)} onUpdateValue={this.handleLoadingShow.bind(this)}
@ -247,8 +256,7 @@ const Echart = defineComponent({
<div class="chart--container"> <div class="chart--container">
<RayChart ref="baseChartRef" options={this.baseOptions} /> <RayChart ref="baseChartRef" options={this.baseOptions} />
</div> </div>
</NCard> <NH2></NH2>
<NCard title="贴画可视化图">
<NSwitch <NSwitch
v-model:value={this.chartAria} v-model:value={this.chartAria}
onUpdateValue={this.handleAriaShow.bind(this)} onUpdateValue={this.handleAriaShow.bind(this)}
@ -262,7 +270,6 @@ const Echart = defineComponent({
<div class="chart--container"> <div class="chart--container">
<RayChart options={this.baseOptions} showAria={this.chartAria} /> <RayChart options={this.baseOptions} showAria={this.chartAria} />
</div> </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,43 +156,27 @@ 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>
{{
default: () => (
<NSpace vertical>
<NSpace style={['margin-top: 18px']}>
NGird , css grid ,
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 <RayCollapseGrid
bordered={false}
collapsedRows={this.gridCollapsedRows} collapsedRows={this.gridCollapsedRows}
cols={this.gridItemCount} cols={this.gridItemCount}
onUpdateValue={(value: boolean) => onUpdateValue={(value: boolean) =>
window.$message.info( window.$message.info(
`我是 RayCollapseGrid 组件${ `我是 RayCollapseGrid 组件${value ? '收起' : '展开'}的回调函数`,
value ? '收起' : '展开'
}`,
) )
} }
> >
@ -215,12 +208,8 @@ const TableView = defineComponent({
), ),
}} }}
</RayCollapseGrid> </RayCollapseGrid>
</NSpace>
),
}}
</NCard>
<NCard title="基础使用" style={['margin-top: 18px']}>
<RayTable <RayTable
style="margin-top: 18px"
title={h( title={h(
NSwitch, NSwitch,
{ {
@ -240,23 +229,16 @@ const TableView = defineComponent({
tableFooter: () => '表格的底部内容区域,有时候你可能会用上', tableFooter: () => '表格的底部内容区域,有时候你可能会用上',
}} }}
</RayTable> </RayTable>
</NCard> <NH2>RayTable </NH2>
<NCard style={['margin-top: 18px']}> <NP>
{{
header: () => (
<div>
<p>
使 columns action 使 columns action
(v-model:columns) (v-model:columns)
</p> </NP>
<p></p> <NP></NP>
<p>, </p> <NP></NP>
<p>, </p> <NP></NP>
<p> excel , </p> <NP> excel </NP>
<p></p> <NP></NP>
</div>
),
default: () => (
<RayTable <RayTable
title={h(NInput, { title={h(NInput, {
placeholder: '请输入检索条件', placeholder: '请输入检索条件',
@ -264,11 +246,9 @@ const TableView = defineComponent({
})} })}
data={this.tableData} data={this.tableData}
v-model:columns={this.actionColumns} v-model:columns={this.actionColumns}
bordered={false}
/> />
), <NH2></NH2>
}}
</NCard>
<NCard title="右键菜单" style={['margin-top: 18px']}>
<RayTable <RayTable
title="右键菜单表格" title="右键菜单表格"
action={false} action={false}
@ -277,7 +257,6 @@ const TableView = defineComponent({
rightClickMenu={this.tableMenuOptions} rightClickMenu={this.tableMenuOptions}
onMenuSelect={this.handleMenuSelect.bind(this)} onMenuSelect={this.handleMenuSelect.bind(this)}
/> />
</NCard>
</NLayout> </NLayout>
) )
}, },