no message
This commit is contained in:
parent
0c2e425a63
commit
26dcd6fb08
@ -4,7 +4,7 @@
|
||||
|
||||
const APP_CONFIG = {
|
||||
//标题
|
||||
//APP_NAME: "SCUI",
|
||||
APP_NAME: "寄托天下",
|
||||
//接口地址,如遇跨域需使用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 |
@ -1,6 +1,9 @@
|
||||
import http from "@/utils/request"
|
||||
export default {
|
||||
apartment: {
|
||||
delete: async function(params) {
|
||||
return await http.get('/app/apartment/delete', params);
|
||||
},
|
||||
lists: {
|
||||
url: `/app/apartment/lists`,
|
||||
name: "获取公域列表",
|
||||
|
@ -1,5 +1,5 @@
|
||||
<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-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>
|
||||
@ -29,11 +29,12 @@
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//表单提交方法
|
||||
async submit(){
|
||||
this.$emit('success', this.data)
|
||||
close(){
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功")
|
||||
},
|
||||
//表单提交方法
|
||||
submit(){
|
||||
this.$emit('success', this.data, this)
|
||||
},
|
||||
//表单注入数据
|
||||
setData(o){
|
||||
|
@ -59,21 +59,21 @@
|
||||
</el-container>
|
||||
|
||||
<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>
|
||||
<images ref="images" @closed="handleClosed" @success="handleSuccess"></images>
|
||||
<videos ref="videos" @closed="handleClosed" @success="handleSuccess"></videos>
|
||||
<update v-if="dialog.update" ref="update" @success="handleSuccess" @closed="dialog.update=false"></update>
|
||||
<images v-if="dialog.images" ref="images" @success="handleSuccess" @closed="dialog.images=false"></images>
|
||||
<videos v-if="dialog.videos" ref="videos" @success="handleSuccess" @closed="dialog.videos=false"></videos>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import roomDialog from './room'
|
||||
import xUpdate from './update'
|
||||
import update from './update'
|
||||
import images from './images'
|
||||
import videos from './videos'
|
||||
export default {
|
||||
name: 'apartment',
|
||||
components: {
|
||||
roomDialog,
|
||||
xUpdate,
|
||||
update,
|
||||
videos,
|
||||
images,
|
||||
},
|
||||
@ -82,6 +82,8 @@
|
||||
dialog: {
|
||||
room: false,
|
||||
update: false,
|
||||
images: false,
|
||||
videos: false,
|
||||
},
|
||||
apiObj: this.$API.app.apartment.lists,
|
||||
selection: []
|
||||
@ -91,35 +93,21 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClosed(data){
|
||||
|
||||
this.$confirm('请选择是否需要保存改动', '文件有改动哦', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
console.log(data)
|
||||
},
|
||||
//增加
|
||||
add(){
|
||||
this.dialog.update = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.xUpdate.open().setConfig()
|
||||
this.$refs.update.open().setConfig()
|
||||
})
|
||||
},
|
||||
setImage(o){
|
||||
this.dialog.images = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.images.open().remoteData(o)
|
||||
})
|
||||
},
|
||||
setVideo(o){
|
||||
this.dialog.videos = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.videos.open().remoteData(o)
|
||||
})
|
||||
@ -128,7 +116,7 @@
|
||||
table_edit(row){
|
||||
this.dialog.update = true
|
||||
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){
|
||||
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){
|
||||
//这里选择刷新整个表格 OR 插入/编辑现有表格数据
|
||||
this.$refs.table.tableData.splice(index, 1);
|
||||
@ -152,7 +140,7 @@
|
||||
},
|
||||
//批量删除
|
||||
async batch_del(){
|
||||
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
|
||||
this.$confirm(`确定下架选中的 ${this.selection.length} 项吗?`, '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading();
|
||||
@ -174,17 +162,21 @@
|
||||
this.selection = selection;
|
||||
},
|
||||
//本地更新数据
|
||||
handleSuccess(data, mode){
|
||||
handleSuccess(data, o){
|
||||
|
||||
alert(2)
|
||||
if(mode=='add'){
|
||||
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)
|
||||
})
|
||||
}
|
||||
o.close()
|
||||
|
||||
|
||||
console.log(data)
|
||||
|
||||
// if(mode=='add'){
|
||||
// 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)
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,6 +129,9 @@
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
close(){
|
||||
this.visible = false;
|
||||
},
|
||||
//表单提交方法
|
||||
submit(){
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
@ -137,7 +140,7 @@
|
||||
var res = await this.$API.app.apartment.roomSubmit.post(this.form);
|
||||
this.isSaveing = false;
|
||||
if(res.code == 200){
|
||||
this.$emit('success', this.form, this.mode)
|
||||
this.$emit('success', this.form, this)
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功")
|
||||
}else{
|
||||
|
@ -37,12 +37,16 @@
|
||||
if (valid) {
|
||||
console.log(this.info)
|
||||
alert('submit!')
|
||||
this.$emit('success', this.data, this)
|
||||
}else{
|
||||
this.$refs.formref.scrollToField(Object.keys(obj)[0])
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
close(){
|
||||
this.visible = false;
|
||||
},
|
||||
//显示
|
||||
open(mode='add'){
|
||||
this.mode = mode;
|
||||
@ -71,7 +75,6 @@
|
||||
this.info = res.data.info;
|
||||
return ;
|
||||
}
|
||||
|
||||
this.$message.warning(res.message)
|
||||
this.visible = false;
|
||||
},400)
|
||||
|
@ -97,11 +97,12 @@
|
||||
}
|
||||
this.$message.warning(res.message);
|
||||
},
|
||||
//表单提交方法
|
||||
async submit(){
|
||||
this.$emit('success', this.data)
|
||||
close(){
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功")
|
||||
},
|
||||
//表单提交方法
|
||||
submit(){
|
||||
this.$emit('success', this.data, this)
|
||||
},
|
||||
//显示
|
||||
open(){
|
||||
|
@ -4,7 +4,7 @@ module.exports = defineConfig({
|
||||
//设置为空打包后不分更目录还是多级目录
|
||||
publicPath:'',
|
||||
//build编译后存放静态文件的目录
|
||||
//assetsDir: "static",
|
||||
assetsDir: "static/admin",
|
||||
|
||||
// build编译后不生成资源MAP文件
|
||||
productionSourceMap: false,
|
||||
|
Loading…
Reference in New Issue
Block a user