no message

This commit is contained in:
小陌 2023-06-12 23:07:24 +08:00
parent 21c72f6082
commit c571931375
3 changed files with 35 additions and 6 deletions

View File

@ -1,9 +1,23 @@
<template> <template>
<el-container> <el-container>
<el-header class="header-tabs">
<el-tabs type="card" v-model="search.status" @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-tabs>
</el-header>
<el-header> <el-header>
<div class="left-panel"> <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="add"></el-button>
</div> </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-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" :hideSetting="true" remoteSort remoteFilter stripe> <scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" :hideSetting="true" remoteSort remoteFilter stripe>
@ -99,13 +113,26 @@
lives: false, lives: false,
}, },
apiObj: api.list, apiObj: api.list,
selection: [] selection: [],
search: {
keyword: "",
status:'0',
}
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
//
tabChange(status){
this.search.status = status;
this.$refs.table.reload(this.search)
},
//
upsearch(){
this.$refs.table.reload(this.search)
},
// //
add(){ add(){
this.dialog.update = true this.dialog.update = true

View File

@ -107,6 +107,7 @@
}, },
data() { data() {
return { return {
token: null,
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
@ -150,7 +151,7 @@
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
var res = await api.room.submit(this.form); var res = await api.room.submit({room:this.form.room, token:this.token});
this.isSaveing = false; this.isSaveing = false;
if(res.code == 200){ if(res.code == 200){
// this.$emit('success', this.form, this) // this.$emit('success', this.form, this)
@ -175,7 +176,8 @@
setTimeout(async ()=>{ setTimeout(async ()=>{
var res = await api.room.get(params) var res = await api.room.get(params)
this.loading = false this.loading = false
this.form.room = res.data; this.form.room = res.data.data;
this.token = res.data.token;
},400) },400)
}, },

View File

@ -23,13 +23,13 @@
visible: false, visible: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: '新增', add: '新增公寓',
edit: '编辑' edit: '编辑公寓'
}, },
info:{}, info:{},
id:0, id:0,
token:null, token:null,
config:{} config:{},
} }
}, },
mounted() { mounted() {