构建框架

This commit is contained in:
龙运模
2024-06-24 18:52:21 +08:00
commit 33942cbe95
328 changed files with 50716 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<template>
<el-empty :image-size="200" :description="title"></el-empty>
</template>
<script>
export default {
name: 'blank',
data() {
return {
title: "BLANK PAGE :)"
}
}
}
</script>
<style>
</style>
+39
View File
@@ -0,0 +1,39 @@
<template>
<el-container>
<el-aside>
<el-container>
<el-header>Left Header</el-header>
<el-main>Left Main</el-main>
<el-footer>Left Footer</el-footer>
</el-container>
</el-aside>
<el-container>
<el-header>Header</el-header>
<el-main class="nopadding">
<el-result icon="info" title="Tip" sub-title="可根据 <el-container> <el-header> <el-aside> <el-main> <el-footer> 灵活运用达到各种布局"></el-result>
</el-main>
<el-footer>Footer</el-footer>
</el-container>
<el-aside>
<el-container>
<el-header>Right Header</el-header>
<el-main>Right Main</el-main>
<el-footer>Right Footer</el-footer>
</el-container>
</el-aside>
</el-container>
</template>
<script>
export default {
name: 'layoutLCR',
data() {
return {
}
}
}
</script>
<style>
</style>
+23
View File
@@ -0,0 +1,23 @@
<template>
<el-container>
<el-header>Header</el-header>
<el-main class="nopadding">
<el-result icon="info" title="Tip" sub-title="可根据 <el-container> <el-header> <el-aside> <el-main> <el-footer> 灵活运用达到各种布局"></el-result>
</el-main>
<el-footer>Footer</el-footer>
</el-container>
</template>
<script>
export default {
name: 'layoutTCB',
data() {
return {
}
}
}
</script>
<style>
</style>
+42
View File
@@ -0,0 +1,42 @@
<template>
<sc-page-header :title="id?'编辑':'新增'" description="可用于非常复杂的表单提交,如一些较为简单的表单提交应使用dialog或者drawer更合适" icon="el-icon-burger"></sc-page-header>
<el-main>
<el-alert title="注意: 因为keep-alive只接受组件name,导致多路由共用组件时,关闭或刷新一个标签导致其他同一组件的页面缓存失效,后续还在寻找完美的解决方案.建议在列表页使用dialog或者drawer形式" type="error" style="margin-bottom: 15px;"></el-alert>
<el-card shadow="never">
<el-form ref="form" label-width="100px">
<el-form-item label="id">
<el-input v-model="id"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">保存</el-button>
</el-form-item>
</el-form>
</el-card>
</el-main>
</template>
<script>
export default {
name: 'listCrud-detail',
data() {
return {
id: this.$route.query.id,
input: ""
}
},
created() {
},
mounted() {
//修改tab名称
this.$store.commit("updateViewTagsTitle", this.id?`CURD编辑ID:${this.id}`:"CURD新增")
},
methods: {
}
}
</script>
<style>
</style>
+158
View File
@@ -0,0 +1,158 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="addPage">页面新增</el-button>
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" stripe>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="180"></el-table-column>
<el-table-column label="性别" prop="sex" width="150"></el-table-column>
<el-table-column label="邮箱" prop="email" width="250"></el-table-column>
<el-table-column label="状态" prop="boolean" width="60">
<template #default="scope">
<sc-status-indicator v-if="scope.row.boolean" type="success"></sc-status-indicator>
<sc-status-indicator v-if="!scope.row.boolean" pulse type="danger"></sc-status-indicator>
</template>
</el-table-column>
<el-table-column label="评分" prop="num" width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="300">
<template #default="scope">
<el-button plain size="small" @click="table_show(scope.row)">查看</el-button>
<el-button type="primary" plain size="small" @click="table_edit(scope.row)">编辑</el-button>
<el-button type="primary" plain size="small" @click="table_edit_page(scope.row)">页面编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button plain type="danger" size="small">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
<el-drawer v-model="dialog.info" :size="800" title="详细" direction="rtl" destroy-on-close>
<info ref="infoDialog"></info>
</el-drawer>
</template>
<script>
import saveDialog from './save'
import info from './info'
export default {
name: 'listCrud',
components: {
saveDialog,
info
},
data() {
return {
dialog:{
save: false,
info: false
},
list: {
apiObj: this.$API.demo.list
},
selection: []
}
},
mounted() {
},
methods: {
//窗口新增
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//窗口编辑
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//页面新增
addPage(){
this.$router.push({
path: '/template/list/crud/detail',
})
},
//页面编辑
table_edit_page(row){
this.$router.push({
path: '/template/list/crud/detail',
query: {
id: row.id
}
})
},
//查看
table_show(row){
this.dialog.info = true
this.$nextTick(() => {
this.$refs.infoDialog.setData(row)
})
},
//删除明细
async table_del(row, index){
var reqData = {id: row.id}
var res = await this.$API.demo.post.post(reqData);
if(res.code == 200){
this.$refs.table.removeIndex(index)
this.$message.success("删除成功")
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
},
//批量删除
async batch_del(){
var confirmRes = await this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning',
confirmButtonText: '删除',
confirmButtonClass: 'el-button--danger'
}).catch(() => {})
if(!confirmRes){
return false
}
var ids = this.selection.map(v => v.id)
this.$refs.table.removeKeys(ids)
this.$message.success("操作成功")
},
//表格选择后回调事件
selectionChange(selection){
this.selection = selection
},
//本地更新数据
handleSaveSuccess(data, mode){
//为了减少网络请求,直接变更表格内存数据
if(mode=='add'){
this.$refs.table.unshiftRow(data)
}else if(mode=='edit'){
this.$refs.table.updateKey(data)
}
//当然也可以暴力的直接刷新表格
// this.$refs.table.refresh()
}
}
}
</script>
<style>
</style>
+33
View File
@@ -0,0 +1,33 @@
<template>
<el-main style="padding:0 20px;">
<el-card shadow="never">
<el-descriptions title="Table row data" :column="2" border>
<el-descriptions-item v-for=" (val, key) in data" :key="key" :label="key" width="150px">{{val}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-main>
</template>
<script>
export default {
data() {
return {
data: {
id: ""
}
}
},
mounted() {
},
methods: {
//注入数据
setData(data){
this.data = data
}
}
}
</script>
<style>
</style>
+114
View File
@@ -0,0 +1,114 @@
<template>
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" clearable></el-input>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="form.sex">
<el-radio label="男">男</el-radio>
<el-radio label="女">女</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱" clearable></el-input>
</el-form-item>
<el-form-item label="评分" prop="num">
<el-input-number v-model="form.num" :min="0" style="width: 100%;"></el-input-number>
</el-form-item>
<el-form-item label="状态" prop="boolean">
<el-switch v-model="form.boolean"></el-switch>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="visible=false" >取 消</el-button>
<el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
</template>
</el-dialog>
</template>
<script>
export default {
emits: ['success', 'closed'],
data() {
return {
mode: "add",
titleMap: {
add: '新增',
edit: '编辑',
show: '查看'
},
visible: false,
isSaveing: false,
//表单数据
form: {
id:"",
name: "",
sex: "男",
email: "",
num: 0,
boolean: true
},
//验证规则
rules: {
name: [
{required: true, message: '请输入姓名'}
]
},
//所需数据选项
groups: [],
groupsProps: {
value: "id",
emitPath: false,
checkStrictly: true
}
}
},
mounted() {
},
methods: {
//显示
open(mode='add'){
this.mode = mode;
this.visible = true;
return this
},
//表单提交方法
async submit(){
var valid = await this.$refs.dialogForm.validate().catch(() => {})
if(!valid){
return false
}
this.isSaveing = true;
var res = await this.$API.demo.post.post(this.form);
this.isSaveing = false;
if(res.code == 200){
if(this.mode=='add'){
this.form.id = res.data
}
this.$emit('success', this.form, this.mode)
this.visible = false;
this.$message.success("操作成功")
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
},
//表单注入数据
setData(data){
this.form.id = data.id
this.form.name = data.name
this.form.sex = data.sex
this.form.email = data.email
this.form.num = data.num
this.form.boolean = data.boolean
//可以和上面一样单个注入,也可以像下面一样直接合并进去
//Object.assign(this.form, data)
}
}
}
</script>
<style>
</style>
+74
View File
@@ -0,0 +1,74 @@
<template>
<el-container>
<el-aside width="40%">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus"></el-button>
<el-button type="danger" plain icon="el-icon-delete"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="list.apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="ID" prop="id" width="200"></el-table-column>
<el-table-column label="评分" prop="num" width="80"></el-table-column>
<el-table-column label="进度" prop="progress" width="250" sortable>
<template #default="scope">
<el-progress :percentage="scope.row.progress" />
</template>
</el-table-column>
<el-table-column label="创建日期" prop="datetime" width="150" sortable></el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus"></el-button>
<el-button type="danger" plain icon="el-icon-delete"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="sontable" :apiObj="list.apiObj" row-key="id" stripe>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="180"></el-table-column>
<el-table-column label="状态" prop="type" width="60">
<template #default="scope">
<sc-status-indicator v-if="scope.row.type==0" type="success"></sc-status-indicator>
<sc-status-indicator v-if="scope.row.type==1" pulse type="danger"></sc-status-indicator>
</template>
</el-table-column>
<el-table-column label="邮箱" prop="email" width="250"></el-table-column>
<el-table-column label="评分" prop="num" width="150"></el-table-column>
<el-table-column label="注册时间" prop="datetime" width="150" sortable></el-table-column>
</scTable>
</el-main>
</el-container>
</el-container>
</template>
<script>
export default {
name: 'listSon',
data() {
return {
list: {
apiObj: this.$API.demo.list
},
}
},
methods: {
rowClick(row){
var params = {
groupId: row.id
}
this.$refs.sontable.reload(params)
}
}
}
</script>
<style>
</style>
+167
View File
@@ -0,0 +1,167 @@
<template>
<el-container>
<el-header class="header-tabs">
<el-tabs type="card" v-model="groupId" @tab-change="tabChange">
<el-tab-pane label="所有" name="0"></el-tab-pane>
<el-tab-pane label="未完成" name="1"></el-tab-pane>
<el-tab-pane label="已退回" name="2"></el-tab-pane>
<el-tab-pane label="已关闭" name="3"></el-tab-pane>
<el-tab-pane label="已完成" name="4"></el-tab-pane>
</el-tabs>
</el-header>
<el-header style="height: auto;">
<sc-select-filter :data="filterData" :label-width="80" @on-change="filterChange"></sc-select-filter>
</el-header>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus"></el-button>
<el-button type="danger" plain icon="el-icon-delete"></el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="关键词" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="list.apiObj" row-key="id" stripe>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
<el-table-column label="性别" prop="sex" width="150"></el-table-column>
<el-table-column label="邮箱" prop="email" width="250"></el-table-column>
<el-table-column label="评分" prop="num" width="150"></el-table-column>
<el-table-column label="注册时间" prop="datetime" width="150" sortable></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="160">
<template #default>
<el-button-group>
<el-button text type="primary" size="small">查看</el-button>
<el-button text type="primary" size="small">编辑</el-button>
<el-button text type="primary" size="small">删除</el-button>
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
import scSelectFilter from '@/components/scSelectFilter'
export default {
name: 'listTab',
components: {
scSelectFilter
},
data() {
return {
groupId: "0",
filterData: [
{
title: "所属行业",
key: "type",
multiple: true,
options: [
{
label: "全部",
value: ""
},
{
label: "汽车",
value: "1"
},
{
label: "大健康",
value: "2"
},
{
label: "节能环保",
value: "3"
},
{
label: "智能信息",
value: "4"
},
{
label: "文化旅游",
value: "5"
},
{
label: "新材料",
value: "6"
},
{
label: "高端装备",
value: "7"
},
{
label: "其他行业",
value: "99"
}
]
},
{
title: "所属区域",
key: "area",
options: [
{
label: "全部",
value: ""
},
{
label: "华东",
value: "HD"
},
{
label: "华北",
value: "HB"
},
{
label: "华南",
value: "HN"
},
{
label: "华中",
value: "HZ"
},
{
label: "华西南",
value: "HXN"
},
{
label: "东北",
value: "DB"
}
]
}
],
list: {
apiObj: this.$API.demo.list
},
search: {
keyword: ""
}
}
},
methods: {
//搜索
upsearch(){
this.$refs.table.upData(this.search)
},
//标签切换
tabChange(name){
var params = {
groupId: name
}
this.$refs.table.reload(params)
},
filterChange(data){
this.$refs.table.upData(data)
}
}
}
</script>
<style>
</style>
+128
View File
@@ -0,0 +1,128 @@
<template>
<el-container>
<el-aside width="200px">
<el-container>
<el-header>
<el-input placeholder="输入关键字进行过滤" v-model="groupFilterText" clearable></el-input>
</el-header>
<el-main class="nopadding">
<el-tree ref="group" class="menu" node-key="id" :data="groupData" :current-node-key="''" :highlight-current="true" :expand-on-click-node="false" :filter-node-method="groupFilterNode" @node-click="groupClick"></el-tree>
</el-main>
</el-container>
</el-aside>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus"></el-button>
<el-button type="danger" plain icon="el-icon-delete"></el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="关键词" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="list.apiObj" row-key="id" stripe>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
<el-table-column label="性别" prop="sex" width="150"></el-table-column>
<el-table-column label="邮箱" prop="email" width="250"></el-table-column>
<el-table-column label="评分" prop="num" width="150"></el-table-column>
<el-table-column label="注册时间" prop="datetime" width="150" sortable></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="160">
<template #default>
<el-button-group>
<el-button text type="primary" size="small">查看</el-button>
<el-button text type="primary" size="small">编辑</el-button>
<el-button text type="primary" size="small">删除</el-button>
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-container>
</template>
<script>
export default {
name: 'listTree',
data() {
return {
groupFilterText: "",
groupData: [
{
id: "",
label: "所有"
},
{
id: "1",
label: "华东总部",
children: [
{
id: "11",
label: "售前客服部"
},
{
id: "12",
label: "技术研发部"
},
{
id: "13",
label: "行政人事部"
}
]
},
{
id: "2",
label: "华难总部",
children: [
{
id: "21",
label: "售前客服部"
},
{
id: "22",
label: "技术研发部"
}
]
}
],
list: {
apiObj: this.$API.demo.list
},
search: {
keyword: ""
}
}
},
watch: {
groupFilterText(val) {
this.$refs.group.filter(val);
}
},
methods: {
//树过滤
groupFilterNode(value, data){
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//树点击事件
groupClick(data){
var params = {
groupId: data.id
}
this.$refs.table.reload(params)
},
//搜索
upsearch(){
this.$refs.table.upData(this.search)
},
}
}
</script>
<style>
</style>
+66
View File
@@ -0,0 +1,66 @@
<template>
<el-main class="sc-page">
<el-page-header content="定宽页面" />
<el-alert class="page-msg" description="<el-main>添加定宽样式 .sc-page 即可定宽, 固定1200px宽度, 适用于一些无法自适应的页面, 类似报表等需要固定宽度的页面. 其实定宽页面更受C端用户接受和习惯" type="warning" show-icon :closable="false" />
<el-card shadow="never" header="所有主机">
<div class="page-buttons">
<el-button type="primary" style="width: 180px;">创建云主机</el-button>
<el-button type="primary" text>管理秘钥</el-button>
<el-button type="primary" text>黑名单</el-button>
</div>
<scTable ref="table" :data="data" height="auto" paginationLayout="total, prev, pager, next" hideDo>
<el-table-column label="主机名称" prop="name" min-width="240"></el-table-column>
<el-table-column label="外网ip" prop="ip" width="200"></el-table-column>
<el-table-column label="系统盘" prop="c" width="150"></el-table-column>
<el-table-column label="数据盘" prop="d" width="150"></el-table-column>
<el-table-column label="业务状态" prop="zt" width="150">
<el-tag type="success">运行中</el-tag>
</el-table-column>
<el-table-column label="操作" width="70">
<el-dropdown>
<el-button icon="el-icon-more" size="small"></el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>配额</el-dropdown-item>
<el-dropdown-item divided>重启</el-dropdown-item>
<el-dropdown-item >停机</el-dropdown-item>
<el-dropdown-item divided>释放主机</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-table-column>
</scTable>
</el-card>
</el-main>
</template>
<script>
export default {
name: 'widthlist',
data(){
return {
data: [
{
name: "WIN-server-202256324",
ip: "211.187.11.18",
c: "80G",
d: "2048G",
out: "1"
},
{
name: "WIN-server-20210312081254",
ip: "211.187.41.56",
c: "80G",
d: "2048G",
out: "1"
}
]
}
}
}
</script>
<style scoped>
.page-msg {margin: 15px 0;}
.page-buttons {margin-bottom: 20px;}
</style>
+150
View File
@@ -0,0 +1,150 @@
<template>
<el-main>
<el-card shadow="never" header="分步表单">
<el-steps :active="active" align-center style="margin-bottom: 20px;">
<el-step title="填写转账信息"></el-step>
<el-step title="确认转账信息"></el-step>
<el-step title="完成"></el-step>
</el-steps>
<el-row>
<el-col :lg="{span: 8, offset: 8}">
<el-form v-if="active==0" ref="stepForm_0" :model="form" :rules="rules" label-position="top">
<el-form-item label="付款账户" prop="paymentAccount">
<el-select v-model="form.paymentAccount" clearable>
<el-option label="sakuya@scui.com" value="sakuya@scui.com"></el-option>
<el-option label="lolicode@scui.com" value="lolicode@scui.com"></el-option>
</el-select>
</el-form-item>
<el-form-item label="收款账户" prop="collectionAccount">
<el-input v-model="form.collectionAccount" clearable></el-input>
</el-form-item>
<el-form-item label="收款人姓名" prop="collectionName">
<el-input v-model="form.collectionName" clearable></el-input>
</el-form-item>
<el-form-item label="转账金额" prop="amount">
<el-input v-model="form.amount"></el-input>
</el-form-item>
</el-form>
<el-form v-if="active==1" ref="stepForm_1" :model="form" :rules="rules" label-position="top">
<el-alert title="确认转账后,资金将直接打入对方账户,无法退回。" type="warning" show-icon style="margin-bottom: 15px;"/>
<el-descriptions :column="1" border>
<el-descriptions-item label="付款账户">{{form.paymentAccount}}</el-descriptions-item>
<el-descriptions-item label="收款账户">{{form.collectionAccount}}</el-descriptions-item>
<el-descriptions-item label="收款人姓名">{{form.collectionName}}</el-descriptions-item>
<el-descriptions-item label="转账金额">{{form.amount}} 元</el-descriptions-item>
</el-descriptions>
<el-divider></el-divider>
<el-form-item label="支付密码" prop="payPassword">
<el-input v-model="form.payPassword" show-password placeholder="请输入"></el-input>
</el-form-item>
</el-form>
<div v-if="active==2">
<el-result icon="success" title="操作成功" sub-title="预计两小时内到账">
<template #extra>
<el-button type="primary" @click="again">再转一笔</el-button>
<el-button>查看账单</el-button>
</template>
</el-result>
</div>
<el-button v-if="active>0 && active<2" @click="pre" :disabled="submitLoading">上一步</el-button>
<el-button v-if="active<1" type="primary" @click="next">下一步</el-button>
<el-button v-if="active==1" type="primary" @click="submit" :loading="submitLoading">提交</el-button>
</el-col>
</el-row>
</el-card>
</el-main>
</template>
<script>
export default {
name: 'stepform',
data() {
return {
active: 0,
submitLoading: false,
form: {
paymentAccount: 'lolicode@scui.com',
collectionAccount: 'test@example.com',
collectionName: 'Lolowan',
amount: '100',
payPassword: ''
},
rules: {
paymentAccount: [
{
required: true,
message: '请选择付款账户',
}
],
collectionAccount: [
{
required: true,
message: '请输入收款账户',
}
],
collectionName: [
{
required: true,
message: '请输入收款人姓名',
}
],
amount: [
{
required: true,
message: '请输入转账金额',
}
],
payPassword: [
{
required: true,
message: '需要支付密码才能进行支付',
}
]
}
}
},
mounted() {
},
methods: {
//下一步
next(){
const formName = `stepForm_${this.active}`
this.$refs[formName].validate((valid) => {
if (valid) {
this.active += 1
}else{
return false
}
})
},
//上一步
pre(){
this.active -= 1
},
//提交
submit(){
const formName = `stepForm_${this.active}`
this.$refs[formName].validate((valid) => {
if (valid) {
this.submitLoading = true
setTimeout(()=>{
this.submitLoading = false
this.active += 1
},1000)
}else{
return false
}
})
},
//再来一次
again(){
this.active = 0
}
}
}
</script>
<style scoped>
.el-steps:deep(.is-finish) .el-step__line {background: var(--el-color-primary);}
</style>