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 的管理)
- 新增国内预览地址
## 3.1.2
### Feats
- 修改 demo 页面展示
- 修改 RayCollapseGrid, RayTable 组件为默认不展示 border

View File

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

View File

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

View File

@ -9,6 +9,23 @@
* @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 { NDataTable, NCard, NDropdown, NDivider } from 'naive-ui'
import TableSetting from './components/TableSetting/index'
@ -240,20 +257,3 @@ const RayTable = defineComponent({
})
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,
default: true,
default: false,
},
} as const

View File

@ -6,6 +6,8 @@ import {
NDescriptionsItem,
NTag,
NSpace,
NP,
NH6,
} from 'naive-ui'
import RayIcon from '@/components/RayIcon/index'
import RayLink from '@/components/RayLink/index'
@ -58,9 +60,28 @@ const Dashboard = defineComponent({
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 {
coverLetterOptions,
technologyTagOptions,
}
},
render() {
@ -93,6 +114,22 @@ const Dashboard = defineComponent({
))}
</NDescriptions>
</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="友情链接">
<RayLink />
</NCard>

View File

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

View File

@ -21,6 +21,15 @@ import {
NInputNumber,
NSpace,
NSwitch,
NDescriptions,
NDescriptionsItem,
NP,
NH6,
NH2,
NH3,
NUl,
NLi,
NOl,
} from 'naive-ui'
import RayTable from '@/components/RayTable/index'
import RayCollapseGrid from '@/components/RayCollapseGrid/index'
@ -147,137 +156,107 @@ const TableView = defineComponent({
render() {
return (
<NLayout>
<NCard title="RayTable">
<p>
Naive UI DataTable . , ,
excel
</p>
<p>RayTable DataTable </p>
<p>
props ,
<NH2>RayTable 使</NH2>
<NUl alignText>
<NLi>
Naive UI DataTable
excel
</NLi>
<NLi>RayTable DataTable </NLi>
<NLi>
props
src/components/RayTable/src/props.ts
</p>
<p> RayCollapseGird 使</p>
</NCard>
<NCard style={['margin-top: 18px']}>
</NLi>
<NLi> RayCollapseGird 使</NLi>
</NUl>
<NH2> RayCollapseGird 使</NH2>
<RayCollapseGrid
bordered={false}
collapsedRows={this.gridCollapsedRows}
cols={this.gridItemCount}
onUpdateValue={(value: boolean) =>
window.$message.info(
`我是 RayCollapseGrid 组件${value ? '收起' : '展开'}的回调函数`,
)
}
>
{{
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
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>
action: () => (
<>
<NButton></NButton>
<NButton></NButton>
</>
),
default: () => (
<RayTable
title={h(NInput, {
placeholder: '请输入检索条件',
style: ['width: 200px'],
})}
data={this.tableData}
v-model:columns={this.actionColumns}
/>
<>
<NGridItem>
<NSelect />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
<NGridItem>
<NDatePicker type="datetimerange" clearable />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
<NGridItem>
<NInput />
</NGridItem>
</>
),
}}
</NCard>
<NCard title="右键菜单" style={['margin-top: 18px']}>
<RayTable
title="右键菜单表格"
action={false}
data={this.tableData}
columns={this.baseColumns}
rightClickMenu={this.tableMenuOptions}
onMenuSelect={this.handleMenuSelect.bind(this)}
/>
</NCard>
</RayCollapseGrid>
<RayTable
style="margin-top: 18px"
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>
<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>
)
},