mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-17 03:32:27 +08:00
fix Bug Features CHANGELOG.ms
This commit is contained in:
@@ -2,71 +2,71 @@ import { h } from 'vue'
|
||||
import { NAvatar, NButton } from 'naive-ui'
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: 'id',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
key: 'avatar',
|
||||
render(row) {
|
||||
return h(
|
||||
NAvatar,
|
||||
{
|
||||
size: 48,
|
||||
src: row.avatar
|
||||
{
|
||||
title: 'id',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
key: 'avatar',
|
||||
render(row) {
|
||||
return h(
|
||||
NAvatar,
|
||||
{
|
||||
size: 48,
|
||||
src: row.avatar
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address'
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
key: 'beginTime',
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
key: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'date',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 150,
|
||||
//简单写一下例子,不建议这么写,过段时间,这里封二次封装
|
||||
render() {
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
type: 'error',
|
||||
style: 'margin-right:10px',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '删除' }
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '编辑' }
|
||||
)
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address'
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
key: 'beginTime',
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
key: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'date',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width:150,
|
||||
//简单写一下例子,不建议这么写,过段时间,这里封二次封装
|
||||
render() {
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
type:'error',
|
||||
style:'margin-right:10px',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '删除' }
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '编辑' }
|
||||
)
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
<template>
|
||||
<n-card :bordered="false" class="proCard">
|
||||
<ProTable
|
||||
title="表格列表"
|
||||
titleTooltip="这是一个提示"
|
||||
:columns="columns"
|
||||
:request="loadDataTable"
|
||||
:row-key="row => row.id"
|
||||
ref="actionRef"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
<BasicTable
|
||||
title="表格列表"
|
||||
titleTooltip="这是一个提示"
|
||||
:columns="columns"
|
||||
:request="loadDataTable"
|
||||
:row-key="row => row.id"
|
||||
ref="actionRef"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
>
|
||||
<template #toolbar>
|
||||
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</BasicTable>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, reactive, toRefs, ref, h } from 'vue'
|
||||
import { NTag, NButton, useMessage } from 'naive-ui'
|
||||
import { ProTable } from '@/components/ProTable'
|
||||
import { BasicTable } from '@/components/Table'
|
||||
import { getTableList } from '@/api/table/list'
|
||||
import { columns } from './columns'
|
||||
|
||||
export default defineComponent({
|
||||
components: { ProTable },
|
||||
components: { BasicTable },
|
||||
setup() {
|
||||
const message = useMessage()
|
||||
const actionRef = ref()
|
||||
|
||||
128
src/views/comp/upload/index.vue
Normal file
128
src/views/comp/upload/index.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="n-layout-page-header">
|
||||
<n-card :bordered="false" title="上传图片">
|
||||
上传图片,用于向用户收集图片信息
|
||||
</n-card>
|
||||
</div>
|
||||
<n-card :bordered="false" class="proCard mt-4">
|
||||
<n-grid cols="2 s:1 m:3 l:3 xl:3 2xl:3" responsive="screen">
|
||||
<n-grid-item offset="0 s:0 m:1 l:1 xl:1 2xl:1">
|
||||
<n-form
|
||||
:label-width="80"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="formRef"
|
||||
class="py-8"
|
||||
>
|
||||
<n-form-item label="预约姓名" path="name">
|
||||
<n-input v-model:value="formValue.name" placeholder="输入姓名"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="预约号码" path="mobile">
|
||||
<n-input placeholder="电话号码" v-model:value="formValue.mobile"/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="病例图片" path="images">
|
||||
<BasicUpload
|
||||
:action="`${uploadUrl}/v1.0/files`"
|
||||
:headers="uploadHeaders"
|
||||
:data="{ type: 0 }"
|
||||
name="files"
|
||||
:width="100"
|
||||
:height="100"
|
||||
@uploadChange="uploadChange"
|
||||
v-model:value="formValue.images"
|
||||
helpText="单个文件不超过2MB,最多只能上传10个文件"/>
|
||||
</n-form-item>
|
||||
<div style="margin-left:80px">
|
||||
<n-space>
|
||||
<n-button type="primary" @click="formSubmit">提交预约</n-button>
|
||||
<n-button @click="resetForm">重置</n-button>
|
||||
</n-space>
|
||||
</div>
|
||||
</n-form>
|
||||
</n-grid-item>
|
||||
</n-grid>
|
||||
</n-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, unref, reactive, toRefs, } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { BasicUpload } from '@/components/Upload'
|
||||
import { useGlobSetting } from '@/hooks/setting'
|
||||
|
||||
const globSetting = useGlobSetting()
|
||||
|
||||
const rules = {
|
||||
name: {
|
||||
required: true,
|
||||
message: '请输入预约姓名',
|
||||
trigger: 'blur'
|
||||
},
|
||||
remark: {
|
||||
required: true,
|
||||
message: '请输入预约备注',
|
||||
trigger: 'blur'
|
||||
},
|
||||
images: {
|
||||
required: true,
|
||||
type: 'array',
|
||||
message: '请上传病例图片',
|
||||
trigger: 'change'
|
||||
},
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
components: { BasicUpload },
|
||||
setup() {
|
||||
const formRef: any = ref(null)
|
||||
const message = useMessage()
|
||||
const { uploadUrl } = globSetting
|
||||
|
||||
const state = reactive({
|
||||
formValue: {
|
||||
name: '',
|
||||
mobile: '',
|
||||
//图片列表 通常查看和编辑使用 绝对路径 | 相对路径都可以
|
||||
images: ['https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'],
|
||||
},
|
||||
uploadHeaders: {
|
||||
platform: "miniPrograms",
|
||||
timestamp: new Date().getTime(),
|
||||
token: 'Q6fFCuhc1vkKn5JNFWaCLf6gRAc5n0LQHd08dSnG4qo=',
|
||||
}
|
||||
})
|
||||
|
||||
function formSubmit() {
|
||||
formRef.value.validate((errors) => {
|
||||
if (!errors) {
|
||||
message.success('验证成功')
|
||||
} else {
|
||||
message.error('验证失败,请填写完整信息')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formRef.value.restoreValidation()
|
||||
}
|
||||
|
||||
function uploadChange(list: string[]) {
|
||||
state.formValue.images = unref(list)
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
formRef,
|
||||
uploadUrl,
|
||||
rules,
|
||||
formSubmit,
|
||||
resetForm,
|
||||
uploadChange
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -1,25 +1,25 @@
|
||||
import {
|
||||
CaretUpOutlined,
|
||||
CaretDownOutlined,
|
||||
UsergroupAddOutlined,
|
||||
BarChartOutlined,
|
||||
ShoppingCartOutlined,
|
||||
AccountBookOutlined,
|
||||
CreditCardOutlined,
|
||||
MailOutlined,
|
||||
TagsOutlined,
|
||||
SettingOutlined
|
||||
CaretUpOutlined,
|
||||
CaretDownOutlined,
|
||||
UsergroupAddOutlined,
|
||||
BarChartOutlined,
|
||||
ShoppingCartOutlined,
|
||||
AccountBookOutlined,
|
||||
CreditCardOutlined,
|
||||
MailOutlined,
|
||||
TagsOutlined,
|
||||
SettingOutlined
|
||||
} from '@vicons/antd'
|
||||
|
||||
export default {
|
||||
CaretUpOutlined,
|
||||
CaretDownOutlined,
|
||||
UsergroupAddOutlined,
|
||||
BarChartOutlined,
|
||||
ShoppingCartOutlined,
|
||||
AccountBookOutlined,
|
||||
CreditCardOutlined,
|
||||
MailOutlined,
|
||||
TagsOutlined,
|
||||
SettingOutlined
|
||||
CaretUpOutlined,
|
||||
CaretDownOutlined,
|
||||
UsergroupAddOutlined,
|
||||
BarChartOutlined,
|
||||
ShoppingCartOutlined,
|
||||
AccountBookOutlined,
|
||||
CreditCardOutlined,
|
||||
MailOutlined,
|
||||
TagsOutlined,
|
||||
SettingOutlined
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<NCol :span="24">
|
||||
<n-card content-style="padding: 0;" :bordered="false">
|
||||
<n-tabs
|
||||
type="line"
|
||||
size="large"
|
||||
:tabs-padding="20"
|
||||
pane-style="padding: 20px;"
|
||||
type="line"
|
||||
size="large"
|
||||
:tabs-padding="20"
|
||||
pane-style="padding: 20px;"
|
||||
>
|
||||
<n-tab-pane name="流量趋势">
|
||||
<FluxTrend/>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { PropType } from 'vue';
|
||||
|
||||
export interface BasicProps {
|
||||
width: string;
|
||||
height: string;
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
|
||||
export const basicProps = {
|
||||
width: {
|
||||
type: String as PropType<string>,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String as PropType<string>,
|
||||
default: '280px',
|
||||
},
|
||||
width: {
|
||||
type: String as PropType<string>,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String as PropType<string>,
|
||||
default: '280px',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -50,10 +50,10 @@
|
||||
<div class="py-2 px-2 flex justify-between ">
|
||||
<div class="text-sn flex-1">
|
||||
<n-progress
|
||||
type="line"
|
||||
:percentage="saleroom.degree"
|
||||
:indicator-placement="'inside'"
|
||||
processing
|
||||
type="line"
|
||||
:percentage="saleroom.degree"
|
||||
:indicator-placement="'inside'"
|
||||
processing
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<div class="flex items-center">
|
||||
<div>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="64"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="64"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -147,9 +147,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="Ah Jung 刚才把工作台页面随便写了一些,凑合能看了!">
|
||||
@@ -159,9 +159,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="Ah Jung 在 开源组 创建了项目 naive-ui-admin?">
|
||||
@@ -171,9 +171,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="@It界风清扬,向naive-ui-admin提交了一个bug,抽时间看看吧!">
|
||||
@@ -183,9 +183,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="技术部那几位童鞋,再次警告,不要摸鱼,不要摸鱼,不要摸鱼啦!">
|
||||
@@ -195,9 +195,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="上班不摸鱼,和咸鱼有什么区别(这话真不是我说的哈)!">
|
||||
@@ -207,9 +207,9 @@
|
||||
<n-list-item>
|
||||
<template #prefix>
|
||||
<n-avatar
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
circle
|
||||
:size="40"
|
||||
:src="schoolboy"
|
||||
/>
|
||||
</template>
|
||||
<n-thing title="页面切换其实也支持缓存,只是加了过度效果,看起来像是重新渲染了">
|
||||
|
||||
@@ -18,7 +18,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
return {
|
||||
goHome(){
|
||||
goHome() {
|
||||
router.push('/')
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,14 @@ export default defineComponent({
|
||||
background-color: white;
|
||||
border-radius: 4px;
|
||||
padding: 50px 0;
|
||||
.text-center{
|
||||
h1{ color: #666;padding: 20px 0}
|
||||
|
||||
.text-center {
|
||||
h1 {
|
||||
color: #666;
|
||||
padding: 20px 0
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 350px;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -18,7 +18,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
return {
|
||||
goHome(){
|
||||
goHome() {
|
||||
router.push('/')
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,14 @@ export default defineComponent({
|
||||
background-color: white;
|
||||
border-radius: 4px;
|
||||
padding: 50px 0;
|
||||
.text-center{
|
||||
h1{ color: #666;padding: 20px 0}
|
||||
|
||||
.text-center {
|
||||
h1 {
|
||||
color: #666;
|
||||
padding: 20px 0
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 350px;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -18,7 +18,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
return {
|
||||
goHome(){
|
||||
goHome() {
|
||||
router.push('/')
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,14 @@ export default defineComponent({
|
||||
background-color: white;
|
||||
border-radius: 4px;
|
||||
padding: 50px 0;
|
||||
.text-center{
|
||||
h1{ color: #666;padding: 20px 0}
|
||||
|
||||
.text-center {
|
||||
h1 {
|
||||
color: #666;
|
||||
padding: 20px 0
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 350px;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
<n-grid cols="2 s:1 m:3 l:3 xl:3 2xl:3" responsive="screen">
|
||||
<n-grid-item offset="0 s:0 m:1 l:1 xl:1 2xl:1">
|
||||
<n-form
|
||||
:label-width="80"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="formRef"
|
||||
class="py-8"
|
||||
:label-width="80"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="formRef"
|
||||
class="py-8"
|
||||
>
|
||||
<n-form-item label="预约姓名" path="name">
|
||||
<n-input v-model:value="formValue.name" placeholder="输入姓名"/>
|
||||
@@ -27,17 +27,17 @@
|
||||
</n-form-item>
|
||||
<n-form-item label="预约医生" path="doctor">
|
||||
<n-select
|
||||
placeholder="请选择预约医生"
|
||||
:options="doctorList"
|
||||
v-model:value="formValue.doctor"
|
||||
placeholder="请选择预约医生"
|
||||
:options="doctorList"
|
||||
v-model:value="formValue.doctor"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="预约事项" path="matter">
|
||||
<n-select
|
||||
placeholder="请选择预约事项"
|
||||
:options="matterList"
|
||||
v-model:value="formValue.matter"
|
||||
multiple
|
||||
placeholder="请选择预约事项"
|
||||
:options="matterList"
|
||||
v-model:value="formValue.matter"
|
||||
multiple
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="性别" path="sex">
|
||||
@@ -50,11 +50,23 @@
|
||||
</n-form-item>
|
||||
<n-form-item label="预约备注" path="remark">
|
||||
<n-input
|
||||
v-model:value="formValue.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入预约备注"
|
||||
v-model:value="formValue.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入预约备注"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="图片" path="img">
|
||||
<BasicUpload
|
||||
:action="`${uploadUrl}/v1.0/files`"
|
||||
:headers="uploadHeaders"
|
||||
:data="{ type: 0 }"
|
||||
name="files"
|
||||
:width="100"
|
||||
:height="100"
|
||||
@uploadChange="uploadChange"
|
||||
v-model:value="uploadList"
|
||||
helpText="单个文件不超过20MB,最多只能上传10个文件"/>
|
||||
</n-form-item>
|
||||
<div style="margin-left:80px">
|
||||
<n-space>
|
||||
<n-button type="primary" @click="formSubmit">提交预约</n-button>
|
||||
@@ -69,8 +81,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue'
|
||||
import { defineComponent, ref, reactive, toRefs, } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { BasicUpload } from '@/components/Upload'
|
||||
import { useGlobSetting } from '@/hooks/setting'
|
||||
|
||||
const globSetting = useGlobSetting()
|
||||
|
||||
const matterList = [
|
||||
{
|
||||
@@ -102,14 +118,45 @@ const doctorList = [
|
||||
}
|
||||
]
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const formRef = ref(null)
|
||||
const message = useMessage()
|
||||
const rules = {
|
||||
name: {
|
||||
required: true,
|
||||
message: '请输入预约姓名',
|
||||
trigger: 'blur'
|
||||
},
|
||||
remark: {
|
||||
required: true,
|
||||
message: '请输入预约备注',
|
||||
trigger: 'blur'
|
||||
},
|
||||
mobile: {
|
||||
required: true,
|
||||
message: '请输入预约电话号码',
|
||||
trigger: ['input']
|
||||
},
|
||||
datetime: {
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请选择预约时间',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
doctor: {
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请选择预约医生',
|
||||
trigger: 'change'
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
formRef,
|
||||
formValue: ref({
|
||||
export default defineComponent({
|
||||
components: { BasicUpload },
|
||||
setup() {
|
||||
const formRef: any = ref(null)
|
||||
const message = useMessage()
|
||||
const { uploadUrl } = globSetting
|
||||
|
||||
const state = reactive({
|
||||
formValue: {
|
||||
name: '',
|
||||
mobile: '',
|
||||
remark: '',
|
||||
@@ -117,50 +164,46 @@ export default defineComponent({
|
||||
matter: null,
|
||||
doctor: null,
|
||||
datetime: [],
|
||||
}),
|
||||
rules: {
|
||||
name: {
|
||||
required: true,
|
||||
message: '请输入预约姓名',
|
||||
trigger: 'blur'
|
||||
},
|
||||
remark: {
|
||||
required: true,
|
||||
message: '请输入预约备注',
|
||||
trigger: 'blur'
|
||||
},
|
||||
mobile: {
|
||||
required: true,
|
||||
message: '请输入预约电话号码',
|
||||
trigger: ['input']
|
||||
},
|
||||
datetime: {
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请选择预约时间',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
doctor: {
|
||||
required: true,
|
||||
type: 'number',
|
||||
message: '请选择预约医生',
|
||||
trigger: 'change'
|
||||
},
|
||||
},
|
||||
//图片列表 通常查看和编辑使用 绝对路径 | 相对路径都可以
|
||||
uploadList: [
|
||||
'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
||||
],
|
||||
uploadHeaders: {
|
||||
platform: "miniPrograms",
|
||||
timestamp: new Date().getTime(),
|
||||
token: 'Q6fFCuhc1vkKn5JNFWaCLf6gRAc5n0LQHd08dSnG4qo=',
|
||||
}
|
||||
})
|
||||
|
||||
function formSubmit() {
|
||||
formRef.value.validate((errors) => {
|
||||
if (!errors) {
|
||||
message.success('验证成功')
|
||||
} else {
|
||||
message.error('验证失败,请填写完整信息')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formRef.value.restoreValidation()
|
||||
}
|
||||
|
||||
function uploadChange(list: string[]) {
|
||||
console.log(list)
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
formRef,
|
||||
uploadUrl,
|
||||
rules,
|
||||
doctorList,
|
||||
matterList,
|
||||
formSubmit(e) {
|
||||
formRef.value.validate((errors) => {
|
||||
if (!errors) {
|
||||
message.success('验证成功')
|
||||
} else {
|
||||
message.error('验证失败,请填写完整信息')
|
||||
}
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
formRef.value.restoreValidation()
|
||||
}
|
||||
formSubmit,
|
||||
resetForm,
|
||||
uploadChange
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,22 +7,32 @@
|
||||
</div>
|
||||
<n-card :bordered="false" title="基本信息" class="proCard mt-4" size="small" :segmented="{content: 'hard'}">
|
||||
<n-descriptions label-placement="left" class="py-2">
|
||||
<n-descriptions-item><template #label>收款人姓名</template>啊俊</n-descriptions-item>
|
||||
<n-descriptions-item>
|
||||
<template #label>收款人姓名</template>
|
||||
啊俊
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="收款账户">NaiveUiAdmin@qq.com</n-descriptions-item>
|
||||
<n-descriptions-item label="付款类型">支付宝</n-descriptions-item>
|
||||
<n-descriptions-item label="付款账户">NaiveUiAdmin@163.com</n-descriptions-item>
|
||||
<n-descriptions-item label="转账金额">¥1980.00</n-descriptions-item>
|
||||
<n-descriptions-item label="状态"><n-tag type="success"> 已到账 </n-tag></n-descriptions-item>
|
||||
<n-descriptions-item label="状态">
|
||||
<n-tag type="success"> 已到账</n-tag>
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</n-card>
|
||||
<n-card :bordered="false" title="其它信息" class="proCard mt-4" size="small" :segmented="{content: 'hard'}">
|
||||
<n-descriptions label-placement="left" class="py-2">
|
||||
<n-descriptions-item><template #label>城市</template>深圳</n-descriptions-item>
|
||||
<n-descriptions-item>
|
||||
<template #label>城市</template>
|
||||
深圳
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item label="性别">男</n-descriptions-item>
|
||||
<n-descriptions-item label="邮箱">NaiveUiAdmin@qq.com</n-descriptions-item>
|
||||
<n-descriptions-item label="地址">广东省深圳市南山区</n-descriptions-item>
|
||||
<n-descriptions-item label="生日">1991-06-04</n-descriptions-item>
|
||||
<n-descriptions-item label="认证"><n-tag type="success"> 已认证 </n-tag></n-descriptions-item>
|
||||
<n-descriptions-item label="认证">
|
||||
<n-tag type="success"> 已认证</n-tag>
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</n-card>
|
||||
<n-card :bordered="false" title="表格信息" class="proCard mt-4" size="small" :segmented="{content: 'hard'}">
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<n-form
|
||||
:label-width="90"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="form1Ref"
|
||||
style="max-width: 500px; margin: 40px auto 0;"
|
||||
:label-width="90"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="form1Ref"
|
||||
style="max-width: 500px; margin: 40px auto 0;"
|
||||
>
|
||||
<n-form-item label="付款账户" path="myAccount">
|
||||
<n-select
|
||||
placeholder="请选择付款账户"
|
||||
:options="myAccountList"
|
||||
v-model:value="formValue.myAccount"
|
||||
placeholder="请选择付款账户"
|
||||
:options="myAccountList"
|
||||
v-model:value="formValue.myAccount"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="收款账户" path="account">
|
||||
<n-input-group>
|
||||
<n-select
|
||||
placeholder="请选择"
|
||||
:options="accountTypeList"
|
||||
:style="{ width: '20%' }"
|
||||
v-model:value="formValue.accountType"
|
||||
placeholder="请选择"
|
||||
:options="accountTypeList"
|
||||
:style="{ width: '20%' }"
|
||||
v-model:value="formValue.accountType"
|
||||
/>
|
||||
<n-input placeholder="请输入收款账户" :style="{ width: '80%' }" v-model:value="formValue.account"/>
|
||||
</n-input-group>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<n-form
|
||||
:label-width="90"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="form2Ref"
|
||||
style="max-width: 500px; margin: 40px auto 0;"
|
||||
:label-width="90"
|
||||
:model="formValue"
|
||||
:rules="rules"
|
||||
label-placement="left"
|
||||
ref="form2Ref"
|
||||
style="max-width: 500px; margin: 40px auto 0;"
|
||||
>
|
||||
<n-form-item label="付款账户" path="myAccount">
|
||||
<span>NaiveUiAdmin@163.com</span>
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
<n-space vertical class="steps">
|
||||
<n-steps :current="currentTab" :status="currentStatus">
|
||||
<n-step
|
||||
title="填写转账信息"
|
||||
description="确保填写正确"
|
||||
title="填写转账信息"
|
||||
description="确保填写正确"
|
||||
/>
|
||||
<n-step
|
||||
title="确认转账信息"
|
||||
description="确认转账信息"
|
||||
title="确认转账信息"
|
||||
description="确认转账信息"
|
||||
/>
|
||||
<n-step
|
||||
title="完成"
|
||||
description="恭喜您,转账成功"
|
||||
title="完成"
|
||||
description="恭喜您,转账成功"
|
||||
/>
|
||||
</n-steps>
|
||||
<step1 v-if="currentTab === 1" @nextStep="nextStep"/>
|
||||
|
||||
@@ -2,71 +2,71 @@ import { h } from 'vue'
|
||||
import { NAvatar, NButton } from 'naive-ui'
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: 'id',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
key: 'avatar',
|
||||
render(row) {
|
||||
return h(
|
||||
NAvatar,
|
||||
{
|
||||
size: 48,
|
||||
src: row.avatar
|
||||
{
|
||||
title: 'id',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
key: 'avatar',
|
||||
render(row) {
|
||||
return h(
|
||||
NAvatar,
|
||||
{
|
||||
size: 48,
|
||||
src: row.avatar
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address'
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
key: 'beginTime',
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
key: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'date',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 150,
|
||||
//简单写一下例子,不建议这么写,过段时间,这里封二次封装
|
||||
render() {
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
type: 'error',
|
||||
style: 'margin-right:10px',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '删除' }
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '编辑' }
|
||||
)
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address'
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
key: 'beginTime',
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
key: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'date',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width:150,
|
||||
//简单写一下例子,不建议这么写,过段时间,这里封二次封装
|
||||
render() {
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
type:'error',
|
||||
style:'margin-right:10px',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '删除' }
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
size: 'small',
|
||||
onClick: () => {
|
||||
}
|
||||
},
|
||||
{ default: () => '编辑' }
|
||||
)
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<n-card :bordered="false" class="proCard">
|
||||
<ProTable
|
||||
<BasicTable
|
||||
:columns="columns"
|
||||
:request="loadDataTable"
|
||||
:row-key="row => row.id"
|
||||
@@ -20,7 +20,7 @@
|
||||
<template #toolbar>
|
||||
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</BasicTable>
|
||||
|
||||
<n-modal v-model:show="showModal" :show-icon="false" preset="dialog" title="新建">
|
||||
<n-form
|
||||
@@ -57,7 +57,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, toRefs, ref, h } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ProTable } from '@/components/ProTable'
|
||||
import { BasicTable } from '@/components/Table'
|
||||
import { getTableList } from '@/api/table/list'
|
||||
import { columns } from './columns'
|
||||
import { PlusOutlined } from '@vicons/antd'
|
||||
@@ -82,7 +82,7 @@ const rules = {
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
components: { ProTable, PlusOutlined },
|
||||
components: { BasicTable, PlusOutlined },
|
||||
setup() {
|
||||
const formRef: any = ref(null)
|
||||
const message = useMessage()
|
||||
|
||||
@@ -28,6 +28,18 @@
|
||||
</template>
|
||||
</n-input>
|
||||
</n-form-item>
|
||||
<n-form-item
|
||||
|
||||
path="isCaptcha">
|
||||
<div class="w-full">
|
||||
<mi-captcha
|
||||
width="384"
|
||||
theme-color="#2d8cf0"
|
||||
:logo="logo"
|
||||
@success="onAuthCode"
|
||||
></mi-captcha>
|
||||
</div>
|
||||
</n-form-item>
|
||||
<n-form-item class="default-color">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex-initial">
|
||||
@@ -80,6 +92,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ResultEnum } from '@/enums/httpEnum'
|
||||
import logo from '@/assets/images/logo.png'
|
||||
|
||||
interface FormState {
|
||||
username: string
|
||||
@@ -96,12 +109,18 @@ export default defineComponent({
|
||||
autoLogin: true,
|
||||
formInline: {
|
||||
username: 'admin',
|
||||
password: '123456'
|
||||
password: '123456',
|
||||
isCaptcha: false
|
||||
}
|
||||
})
|
||||
const rules = {
|
||||
username: { required: true, message: '请输入用户名!', trigger: 'blur' },
|
||||
password: { required: true, message: '请输入密码!', trigger: 'blur' }
|
||||
username: { required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
password: { required: true, message: '请输入密码', trigger: 'blur' },
|
||||
isCaptcha: {
|
||||
required: true, type: 'boolean', trigger: 'change',
|
||||
message: '请点击按钮进行验证码校验',
|
||||
validator: (_, value) => value === true,
|
||||
},
|
||||
}
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -135,15 +154,22 @@ export default defineComponent({
|
||||
message.info(msg || '登录失败')
|
||||
}
|
||||
} else {
|
||||
message.error('请填写完整信息')
|
||||
message.error('请填写完整信息,并且进行验证码校验')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function onAuthCode() {
|
||||
state.formInline.isCaptcha = true
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
formRef,
|
||||
rules,
|
||||
handleSubmit
|
||||
logo,
|
||||
handleSubmit,
|
||||
onAuthCode
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -167,14 +193,9 @@ export default defineComponent({
|
||||
padding: 32px 0;
|
||||
text-align: center;
|
||||
|
||||
&-logo {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
&-desc {
|
||||
font-size: 14px;
|
||||
color: #808695;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p class="mt-3">
|
||||
<n-space align="center">
|
||||
<n-icon size="20" color="#f0a020">
|
||||
<InfoCircleOutlined />
|
||||
<InfoCircleOutlined/>
|
||||
</n-icon>
|
||||
<span>认证照片不够清晰</span>
|
||||
<n-button type="info" text>立即修改</n-button>
|
||||
@@ -16,7 +16,7 @@
|
||||
<p class="mt-3">
|
||||
<n-space>
|
||||
<n-icon size="20" color="#f0a020">
|
||||
<InfoCircleOutlined />
|
||||
<InfoCircleOutlined/>
|
||||
</n-icon>
|
||||
<span>备注包含敏感字符,并且不能包含政治相关</span>
|
||||
<n-button type="info" text>立即修改</n-button>
|
||||
@@ -42,7 +42,7 @@ import { useRouter } from 'vue-router'
|
||||
import { InfoCircleOutlined } from '@vicons/antd'
|
||||
|
||||
export default defineComponent({
|
||||
components:{ InfoCircleOutlined },
|
||||
components: { InfoCircleOutlined },
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
return {
|
||||
@@ -59,6 +59,7 @@ export default defineComponent({
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding-top: 5px;
|
||||
|
||||
&-extra {
|
||||
padding: 24px 40px;
|
||||
text-align: left;
|
||||
@@ -66,4 +67,4 @@ export default defineComponent({
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p class="mt-3">
|
||||
<n-space align="center">
|
||||
<n-icon size="20" color="#18a058">
|
||||
<CheckCircleOutlined />
|
||||
<CheckCircleOutlined/>
|
||||
</n-icon>
|
||||
<span>转入支付宝账户(189****5426):¥1980元</span>
|
||||
<n-button type="info" text>立即撤回</n-button>
|
||||
@@ -16,7 +16,7 @@
|
||||
<p class="mt-3">
|
||||
<n-space>
|
||||
<n-icon size="20" color="#18a058">
|
||||
<CheckCircleOutlined />
|
||||
<CheckCircleOutlined/>
|
||||
</n-icon>
|
||||
<span>转入支付宝账户(187****5426):¥2980元</span>
|
||||
<n-button type="info" text>立即撤回</n-button>
|
||||
@@ -42,7 +42,7 @@ import { useRouter } from 'vue-router'
|
||||
import { CheckCircleOutlined } from '@vicons/antd'
|
||||
|
||||
export default defineComponent({
|
||||
components:{ CheckCircleOutlined },
|
||||
components: { CheckCircleOutlined },
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
return {
|
||||
@@ -59,6 +59,7 @@ export default defineComponent({
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding-top: 5px;
|
||||
|
||||
&-extra {
|
||||
padding: 24px 40px;
|
||||
text-align: left;
|
||||
@@ -66,4 +67,4 @@ export default defineComponent({
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -39,6 +39,7 @@ export default defineComponent({
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding-top: 5px;
|
||||
|
||||
&-extra {
|
||||
padding: 24px 40px;
|
||||
text-align: left;
|
||||
@@ -46,4 +47,4 @@ export default defineComponent({
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -149,7 +149,7 @@ export default defineComponent({
|
||||
watermarkClarity: null,
|
||||
pricePrecise: 1,
|
||||
isMarketPrice: true,
|
||||
pricePreciseNum:null,
|
||||
pricePreciseNum: null,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user