no message

This commit is contained in:
小陌 2023-06-11 16:34:56 +08:00
parent 0c2e425a63
commit 26dcd6fb08
9 changed files with 52 additions and 49 deletions

View File

@ -4,7 +4,7 @@
const APP_CONFIG = { const APP_CONFIG = {
//标题 //标题
//APP_NAME: "SCUI", APP_NAME: "寄托天下",
//接口地址如遇跨域需使用nginx代理 //接口地址如遇跨域需使用nginx代理
//API_URL: "https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api" // API_URL: "https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

View File

@ -1,6 +1,9 @@
import http from "@/utils/request" import http from "@/utils/request"
export default { export default {
apartment: { apartment: {
delete: async function(params) {
return await http.get('/app/apartment/delete', params);
},
lists: { lists: {
url: `/app/apartment/lists`, url: `/app/apartment/lists`,
name: "获取公域列表", name: "获取公域列表",

View File

@ -1,5 +1,5 @@
<template> <template>
<el-drawer title="图片组(支持拖拽排序)" :size="670" v-model="visible" destroy-on-close @closed="$emit('closed', data)"> <el-drawer title="图片组(支持拖拽排序)" :size="670" v-model="visible" :close-on-press-escape="false" :close-on-click-modal="false" destroy-on-close @closed="$emit('closed')">
<el-container> <el-container>
<el-main style="padding:0 20px 20px 20px"> <el-main style="padding:0 20px 20px 20px">
<sc-upload-multiple v-model="data.images" draggable :width="120" :height="90" :limit="20" tip="最多上传20个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple> <sc-upload-multiple v-model="data.images" draggable :width="120" :height="90" :limit="20" tip="最多上传20个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
@ -29,11 +29,12 @@
this.visible = true; this.visible = true;
return this; return this;
}, },
// close(){
async submit(){
this.$emit('success', this.data)
this.visible = false; this.visible = false;
this.$message.success("操作成功") },
//
submit(){
this.$emit('success', this.data, this)
}, },
// //
setData(o){ setData(o){

View File

@ -59,21 +59,21 @@
</el-container> </el-container>
<room-dialog v-if="dialog.room" ref="roomDialog" @success="handleSuccess" @closed="dialog.room=false"></room-dialog> <room-dialog v-if="dialog.room" ref="roomDialog" @success="handleSuccess" @closed="dialog.room=false"></room-dialog>
<x-update v-if="dialog.update" ref="xUpdate" @success="handleSuccess" @closed="dialog.update=false"></x-update> <update v-if="dialog.update" ref="update" @success="handleSuccess" @closed="dialog.update=false"></update>
<images ref="images" @closed="handleClosed" @success="handleSuccess"></images> <images v-if="dialog.images" ref="images" @success="handleSuccess" @closed="dialog.images=false"></images>
<videos ref="videos" @closed="handleClosed" @success="handleSuccess"></videos> <videos v-if="dialog.videos" ref="videos" @success="handleSuccess" @closed="dialog.videos=false"></videos>
</template> </template>
<script> <script>
import roomDialog from './room' import roomDialog from './room'
import xUpdate from './update' import update from './update'
import images from './images' import images from './images'
import videos from './videos' import videos from './videos'
export default { export default {
name: 'apartment', name: 'apartment',
components: { components: {
roomDialog, roomDialog,
xUpdate, update,
videos, videos,
images, images,
}, },
@ -82,6 +82,8 @@
dialog: { dialog: {
room: false, room: false,
update: false, update: false,
images: false,
videos: false,
}, },
apiObj: this.$API.app.apartment.lists, apiObj: this.$API.app.apartment.lists,
selection: [] selection: []
@ -91,35 +93,21 @@
}, },
methods: { methods: {
handleClosed(data){
this.$confirm('请选择是否需要保存改动', '文件有改动哦', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
});
console.log(data)
},
// //
add(){ add(){
this.dialog.update = true this.dialog.update = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.xUpdate.open().setConfig() this.$refs.update.open().setConfig()
}) })
}, },
setImage(o){ setImage(o){
this.dialog.images = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.images.open().remoteData(o) this.$refs.images.open().remoteData(o)
}) })
}, },
setVideo(o){ setVideo(o){
this.dialog.videos = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.videos.open().remoteData(o) this.$refs.videos.open().remoteData(o)
}) })
@ -128,7 +116,7 @@
table_edit(row){ table_edit(row){
this.dialog.update = true this.dialog.update = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.xUpdate.open('edit').setConfig().setData(row) this.$refs.update.open('edit').setConfig().setData(row)
}) })
}, },
// //
@ -141,7 +129,7 @@
// //
async table_del(row, index){ async table_del(row, index){
var reqData = {id: row.id} var reqData = {id: row.id}
var res = await this.$API.demo.post.post(reqData); var res = await this.$API.app.apartment.delete(reqData);
if(res.code == 200){ if(res.code == 200){
// OR / // OR /
this.$refs.table.tableData.splice(index, 1); this.$refs.table.tableData.splice(index, 1);
@ -152,7 +140,7 @@
}, },
// //
async batch_del(){ async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', { this.$confirm(`确定下架选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const loading = this.$loading(); const loading = this.$loading();
@ -174,17 +162,21 @@
this.selection = selection; this.selection = selection;
}, },
// //
handleSuccess(data, mode){ handleSuccess(data, o){
alert(2) o.close()
if(mode=='add'){
data.id = new Date().getTime()
this.$refs.table.tableData.unshift(data) console.log(data)
}else if(mode=='edit'){
this.$refs.table.tableData.filter(item => item.id===data.id ).forEach(item => { // if(mode=='add'){
Object.assign(item, data) // data.id = new Date().getTime()
}) // this.$refs.table.tableData.unshift(data)
} // }else if(mode=='edit'){
// this.$refs.table.tableData.filter(item => item.id===data.id ).forEach(item => {
// Object.assign(item, data)
// })
// }
} }
} }
} }

View File

@ -129,6 +129,9 @@
this.visible = true; this.visible = true;
return this; return this;
}, },
close(){
this.visible = false;
},
// //
submit(){ submit(){
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
@ -137,7 +140,7 @@
var res = await this.$API.app.apartment.roomSubmit.post(this.form); var res = await this.$API.app.apartment.roomSubmit.post(this.form);
this.isSaveing = false; this.isSaveing = false;
if(res.code == 200){ if(res.code == 200){
this.$emit('success', this.form, this.mode) this.$emit('success', this.form, this)
this.visible = false; this.visible = false;
this.$message.success("操作成功") this.$message.success("操作成功")
}else{ }else{

View File

@ -37,12 +37,16 @@
if (valid) { if (valid) {
console.log(this.info) console.log(this.info)
alert('submit!') alert('submit!')
this.$emit('success', this.data, this)
}else{ }else{
this.$refs.formref.scrollToField(Object.keys(obj)[0]) this.$refs.formref.scrollToField(Object.keys(obj)[0])
return false return false
} }
}) })
}, },
close(){
this.visible = false;
},
// //
open(mode='add'){ open(mode='add'){
this.mode = mode; this.mode = mode;
@ -71,7 +75,6 @@
this.info = res.data.info; this.info = res.data.info;
return ; return ;
} }
this.$message.warning(res.message) this.$message.warning(res.message)
this.visible = false; this.visible = false;
},400) },400)

View File

@ -97,11 +97,12 @@
} }
this.$message.warning(res.message); this.$message.warning(res.message);
}, },
// close(){
async submit(){
this.$emit('success', this.data)
this.visible = false; this.visible = false;
this.$message.success("操作成功") },
//
submit(){
this.$emit('success', this.data, this)
}, },
// //
open(){ open(){

View File

@ -4,7 +4,7 @@ module.exports = defineConfig({
//设置为空打包后不分更目录还是多级目录 //设置为空打包后不分更目录还是多级目录
publicPath:'', publicPath:'',
//build编译后存放静态文件的目录 //build编译后存放静态文件的目录
//assetsDir: "static", assetsDir: "static/admin",
// build编译后不生成资源MAP文件 // build编译后不生成资源MAP文件
productionSourceMap: false, productionSourceMap: false,