修改了展厅的模块,修改了房间内容,修改了设备管理模块

This commit is contained in:
chendaze 2024-03-26 13:46:30 +08:00
parent 8bf956657f
commit e96f0d72e0
4 changed files with 68 additions and 26 deletions

View File

@ -171,6 +171,7 @@
:rowSelection='{ selectedRowKeys: selectedServeRowKeys, onChange: onServeSelectChange }' :rowSelection='{ selectedRowKeys: selectedServeRowKeys, onChange: onServeSelectChange }'
:columns='serveColumns' :columns='serveColumns'
:data='serveLoadData' :data='serveLoadData'
:scroll="{ x: true }"
> >
<span slot='serveType' slot-scope='text'> <span slot='serveType' slot-scope='text'>
{{ text | serveTypeFilter }} {{ text | serveTypeFilter }}

View File

@ -34,10 +34,10 @@
<a-col :span='11'> <a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备类型'> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备类型'>
<a-select v-decorator="['type',{rules: [{ required: true, message: '请选择设备类型'}]}]" placeholder='请选择设备类型'> <a-select v-decorator="['type',{rules: [{ required: true, message: '请选择设备类型'}]}]" placeholder='请选择设备类型'>
<a-select-option value='0'> <a-select-option :value='0'>
门禁 门禁
</a-select-option> </a-select-option>
<a-select-option value='1'> <a-select-option :value='1'>
开门控制器 开门控制器
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -75,13 +75,13 @@
<a-col :span='11'> <a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备状态'> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备状态'>
<a-select v-decorator="['status',{rules: [{ required: true, message: '请选择设备状态'}]}]" placeholder='请选择设备状态'> <a-select v-decorator="['status',{rules: [{ required: true, message: '请选择设备状态'}]}]" placeholder='请选择设备状态'>
<a-select-option value='0'> <a-select-option :value='0'>
开启 开启
</a-select-option> </a-select-option>
<a-select-option value='1'> <a-select-option :value='1'>
损坏 损坏
</a-select-option> </a-select-option>
<a-select-option value='2'> <a-select-option :value='2'>
离线 离线
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -242,11 +242,6 @@ export default {
if (record.id != 0){ if (record.id != 0){
get(record.id).then((res) => { get(record.id).then((res) => {
this.form.setFieldsValue({ this.form.setFieldsValue({
ip: res.ip,
status: res.status.toString(),
type: res.type.toString(),
buildId: res.buildId,
roomId: res.roomName,
}) })
}) })
recordByDeviceId(record.id).then(res =>{ recordByDeviceId(record.id).then(res =>{
@ -262,7 +257,7 @@ export default {
} }
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'equipmentName', 'status', 'createDate', 'equipmentNum', 'pic', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime')) this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'equipmentName', 'status', 'createDate', 'equipmentNum','buildId','ip','roomId', 'pic', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime'))
}) })
}, },
handleSubmit(e) { handleSubmit(e) {

View File

@ -76,10 +76,10 @@
<a-form-item label='是否启用' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='是否启用' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['isShow',{rules: [{ required: true, message: '请选择是否启用'}]}]" placeholder='是否启用'> <a-select v-decorator="['isShow',{rules: [{ required: true, message: '请选择是否启用'}]}]" placeholder='是否启用'>
<a-select-option value='0'> <a-select-option :value='0'>
</a-select-option> </a-select-option>
<a-select-option value='1'> <a-select-option :value='1'>
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -166,7 +166,7 @@ import {
import pick from 'lodash.pick' import pick from 'lodash.pick'
import moment from 'moment' import moment from 'moment'
import storage from 'store' import storage from 'store'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
name: 'ShowroomModal', name: 'ShowroomModal',
props: {}, props: {},
@ -181,6 +181,11 @@ export default {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 }, sm: { span: 5 },
}, },
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
imageUrl: '',
headers: {
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
},
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 }, sm: { span: 16 },
@ -199,6 +204,42 @@ export default {
}, },
methods: { methods: {
moment, moment,
beforeUpload (file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!')
}
const isLt2M = file.size / 1024 < 5000
if (!isLt2M) {
this.$message.error('图片必须小于 5M!')
}
return isJpgOrPng && isLt2M
},
handleChange (info) {
if (info.file.status === 'uploading') {
this.loading = true
return
}
if (info.file.status === 'done') {
const { form: { setFieldsValue } } = this
const result = info.file.response
//
this.$nextTick(() => {
setFieldsValue({
//
indoorPicUrl: result.fileName
})
})
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl
this.loading = false
})
}
},
getArea(value) { getArea(value) {
let param = { let param = {
'id': value 'id': value
@ -227,12 +268,15 @@ export default {
this.form.resetFields() this.form.resetFields()
this.edit({ id: 0 }) this.edit({ id: 0 })
}, },
edit(record) { edit(record) {
this.mdl = Object.assign(record) this.mdl = Object.assign(record)
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomCode', 'meetingName', 'capacityNum', 'expandNum', 'indoorPicUrl', 'address', 'startTime', 'endDate', 'isShow', 'headName', 'headPhone', 'content', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag', 'roomId', 'area')) this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomCode', 'meetingName', 'capacityNum', 'expandNum','buildId', 'indoorPicUrl', 'address', 'startTime', 'endDate', 'isShow', 'headName', 'headPhone', 'content', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag', 'roomId', 'area'))
}) })
get(record.id).then(res =>{ get(record.id).then(res =>{
let param = { let param = {
@ -242,9 +286,6 @@ export default {
this.roomList = res.data this.roomList = res.data
}) })
this.form.setFieldsValue({ this.form.setFieldsValue({
roomId:res.roomId,
buildId:res.buildingName.toString(),
isShow:res.isShow.toString()
}) })
}) })
@ -287,4 +328,9 @@ export default {
*/ */
} }
} }
function getBase64 (img, callback) {
const reader = new FileReader()
reader.addEventListener('load', () => callback(reader.result))
reader.readAsDataURL(img)
}
</script> </script>

View File

@ -17,23 +17,23 @@
<div style='display: flex;margin-bottom: 20px'> <div style='display: flex;margin-bottom: 20px'>
<span style='width: 20px;display: block;font-size: 25px;color: #1890ff;font-weight: bold;'>|</span> <span style='width: 20px;display: block;font-size: 25px;color: #1890ff;font-weight: bold;'>|</span>
<span style='display: block;margin-top: 11px;font-size: 15px'>新增优惠</span> <span style='display: block;margin-top: 11px;font-size: 15px'>新增优惠</span>
</div> </div>
<a-row> <a-row>
<a-col :span='11'> <a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='优惠名称'> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='优惠名称'>
<a-input placeholder='优惠名称' <a-input placeholder='优惠名称'
v-decorator="['title',{rules: [{ required: true, message: '优惠名称'}]}]" /> v-decorator="['title',{rules: [{ required: true, message: '优惠名称'}]}]" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span='11'> <a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='优惠类型'> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='优惠类型'>
<a-select <a-select
placeholder='请选择类型' v-decorator="['type',{rules: [{ required: true, message: '优惠类型'}]}]" placeholder='请选择类型' v-decorator="['type',{rules: [{ required: true, message: '优惠类型'}]}]"
@change='getType' @change='getType'
> >
<a-select-option value='1'>抵用</a-select-option> <a-select-option value='1'>抵用</a-select-option>
<a-select-option value='2'>优惠</a-select-option> <a-select-option value='2'>优惠</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>