mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-08-08 01:22:42 +08:00
修改了智能设备页面
This commit is contained in:
parent
92ab4bc2fb
commit
2af53d07fa
2
.env
2
.env
@ -1,4 +1,4 @@
|
||||
NODE_ENV=production
|
||||
VUE_APP_PREVIEW=false
|
||||
VUE_APP_API_BASE_URL=/api
|
||||
VUE_APP_API_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
||||
VUE_APP_MODEL_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
@ -1,4 +1,4 @@
|
||||
NODE_ENV=development
|
||||
VUE_APP_PREVIEW=true
|
||||
VUE_APP_API_BASE_URL=/api
|
||||
VUE_APP_API_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
||||
VUE_APP_MODEL_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
@ -1,4 +1,4 @@
|
||||
NODE_ENV=production
|
||||
VUE_APP_PREVIEW=true
|
||||
VUE_APP_API_BASE_URL=/saas-ics
|
||||
VUE_APP_MODEL_BASE_URL=http://localhost/saas-ics
|
||||
VUE_APP_API_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
||||
VUE_APP_MODEL_BASE_URL=https://www.chuangzhikj.com/saas-ics
|
@ -3,10 +3,10 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"report": "vue-cli-service build --report",
|
||||
"build:preview": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode preview",
|
||||
"build:preview": "vue-cli-service build --mode preview",
|
||||
"lint": "vue-cli-service lint",
|
||||
"lint:nofix": "vue-cli-service lint --no-fix"
|
||||
},
|
||||
|
34
src/api/admin/wisdomPanel.js
Normal file
34
src/api/admin/wisdomPanel.js
Normal file
@ -0,0 +1,34 @@
|
||||
import { axios } from '@/utils/request'
|
||||
|
||||
const api = {
|
||||
wisdomPanel: '/wisdomPanel'
|
||||
}
|
||||
|
||||
export function getWisdomPanelList (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanel + '/list',
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function saveWisdomPanel (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanel + (parameter.id > 0 ? '/update' : '/save'),
|
||||
method: 'post',
|
||||
data: parameter,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function delWisdomPanel (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanel + '/remove',
|
||||
method: 'post',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export const wisdomPanelExport = api.wisdomPanel + '/export'
|
34
src/api/admin/wisdomPanelEquipment.js
Normal file
34
src/api/admin/wisdomPanelEquipment.js
Normal file
@ -0,0 +1,34 @@
|
||||
import { axios } from '@/utils/request'
|
||||
|
||||
const api = {
|
||||
wisdomPanelEquipment: '/admin/wisdomPanelEquipment'
|
||||
}
|
||||
|
||||
export function getWisdomPanelEquipmentList (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanelEquipment + '/list',
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function saveWisdomPanelEquipment (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanelEquipment + (parameter.id > 0 ? '/update' : '/save'),
|
||||
method: 'post',
|
||||
data: parameter,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function delWisdomPanelEquipment (parameter) {
|
||||
return axios({
|
||||
url: api.wisdomPanelEquipment + '/remove',
|
||||
method: 'post',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export const wisdomPanelEquipmentExport = api.wisdomPanelEquipment + '/export'
|
155
src/views/admin/WisdomPanelEquipmentList.vue
Normal file
155
src/views/admin/WisdomPanelEquipmentList.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="48">
|
||||
<a-col :md="5" :sm="15">
|
||||
<a-form-item label="面板id">
|
||||
<a-input placeholder="请输入面板id" v-model="queryParam.panelId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="5" :sm="15">
|
||||
<a-form-item label="设备id">
|
||||
<a-input placeholder="请输入设备id" v-model="queryParam.equipmentId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button>
|
||||
<a-dropdown v-if="removeEnable&&selectedRowKeys.length > 0">
|
||||
<a-button type="danger" icon="delete" @click="delByIds(selectedRowKeys)">删除</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<s-table
|
||||
size="default"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a v-if="removeEnable" @click="delByIds([record.id])">删除</a>
|
||||
</span>
|
||||
</s-table>
|
||||
<wisdomPanelEquipment-modal ref="modal" @ok="handleOk" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { STable } from '@/components'
|
||||
|
||||
import { delWisdomPanelEquipment, getWisdomPanelEquipmentList } from '@/api/admin/wisdomPanelEquipment'
|
||||
import WisdomPanelEquipmentModal from './modules/WisdomPanelEquipmentModal.vue'
|
||||
import { checkPermission } from '@/utils/permissions'
|
||||
|
||||
export default {
|
||||
name: 'TableList',
|
||||
components: {
|
||||
STable,
|
||||
WisdomPanelEquipmentModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
form: this.$form.createForm(this),
|
||||
mdl: {},
|
||||
// 高级搜索 展开/关闭
|
||||
advanced: false,
|
||||
// 查询参数
|
||||
queryParam: {},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '面板id',
|
||||
dataIndex: 'panelId'
|
||||
},
|
||||
{
|
||||
title: '设备id',
|
||||
dataIndex: 'equipmentId'
|
||||
},
|
||||
{
|
||||
title: '类型,open,close',
|
||||
dataIndex: 'type'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '200px',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return getWisdomPanelEquipmentList(Object.assign(parameter, this.queryParam))
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
addEnable: checkPermission('admin:wisdomPanelEquipment:add'),
|
||||
editEnabel: checkPermission('admin:wisdomPanelEquipment:edit'),
|
||||
removeEnable: checkPermission('admin:wisdomPanelEquipment:remove')
|
||||
}
|
||||
},
|
||||
filters: {},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
onSelectChange (selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
this.selectedRows = selectedRows
|
||||
},
|
||||
handleAdd () {
|
||||
this.$refs.modal.add()
|
||||
},
|
||||
handleEdit (record) {
|
||||
this.$refs.modal.edit(record)
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.table.refresh(true)
|
||||
console.log('handleSaveOk')
|
||||
},
|
||||
delByIds (ids) {
|
||||
delWisdomPanelEquipment({ ids: ids.join(',') }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('删除成功')
|
||||
this.handleOk()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.selectedRowKeys = []
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/*
|
||||
'selectedRows': function (selectedRows) {
|
||||
this.needTotalList = this.needTotalList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
total: selectedRows.reduce( (sum, val) => {
|
||||
return sum + val[item.dataIndex]
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
150
src/views/admin/WisdomPanelList.vue
Normal file
150
src/views/admin/WisdomPanelList.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="48">
|
||||
<a-col :md="5" :sm="15">
|
||||
<a-form-item label="面板名称">
|
||||
<a-input placeholder="请输入面板名称" v-model="queryParam.panelName" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button>
|
||||
<a-dropdown v-if="removeEnable&&selectedRowKeys.length > 0">
|
||||
<a-button type="danger" icon="delete" @click="delByIds(selectedRowKeys)">删除</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<s-table
|
||||
size="default"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a v-if="removeEnable" @click="delByIds([record.id])">删除</a>
|
||||
</span>
|
||||
</s-table>
|
||||
<wisdomPanel-modal ref="modal" @ok="handleOk" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { STable } from '@/components'
|
||||
|
||||
import { delWisdomPanel, getWisdomPanelList } from '@/api/admin/wisdomPanel'
|
||||
import WisdomPanelModal from './modules/WisdomPanelModal.vue'
|
||||
import { checkPermission } from '@/utils/permissions'
|
||||
|
||||
export default {
|
||||
name: 'TableList',
|
||||
components: {
|
||||
STable,
|
||||
WisdomPanelModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
form: this.$form.createForm(this),
|
||||
mdl: {},
|
||||
// 高级搜索 展开/关闭
|
||||
advanced: false,
|
||||
// 查询参数
|
||||
queryParam: {},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '面板名称',
|
||||
dataIndex: 'panelName'
|
||||
},
|
||||
{
|
||||
title: '按钮id',
|
||||
dataIndex: 'buttonId'
|
||||
},
|
||||
{
|
||||
title: '房间id',
|
||||
dataIndex: 'meetingName'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '200px',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return getWisdomPanelList(Object.assign(parameter, this.queryParam))
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
addEnable: checkPermission('admin:panel:add'),
|
||||
editEnabel: checkPermission('admin:panel:edit'),
|
||||
removeEnable: checkPermission('admin:panel:remove')
|
||||
}
|
||||
},
|
||||
filters: {},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
onSelectChange (selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
this.selectedRows = selectedRows
|
||||
},
|
||||
handleAdd () {
|
||||
this.$refs.modal.add()
|
||||
},
|
||||
handleEdit (record) {
|
||||
this.$refs.modal.edit(record)
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.table.refresh(true)
|
||||
console.log('handleSaveOk')
|
||||
},
|
||||
delByIds (ids) {
|
||||
delWisdomPanel({ ids: ids.join(',') }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('删除成功')
|
||||
this.handleOk()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.selectedRowKeys = []
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/*
|
||||
'selectedRows': function (selectedRows) {
|
||||
this.needTotalList = this.needTotalList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
total: selectedRows.reduce( (sum, val) => {
|
||||
return sum + val[item.dataIndex]
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
@ -20,16 +20,19 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设备名称">
|
||||
<a-input placeholder="设备名称" v-decorator="['equipmentName' , {rules: [{ required: true, message: '请输入设备名称' }]}]" />
|
||||
<a-input placeholder="设备名称"
|
||||
v-decorator="['equipmentName' , {rules: [{ required: true, message: '请输入设备名称' }]}]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设备编号">
|
||||
<a-input placeholder="设备编号" v-decorator="['equipmentNum' , {rules: [{ required: true, message: '请输入设备编号' }]}]" />
|
||||
<a-input placeholder="设备编号"
|
||||
v-decorator="['equipmentNum' , {rules: [{ required: true, message: '请输入设备编号' }]}]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会议室">
|
||||
<a-select :label-in-value="true"
|
||||
v-decorator="['contentId', {rules: [{ required: true, message: '请选择会议室' }]}]"
|
||||
@change="selectRoom">
|
||||
<a-select-option v-for="item in roomList" :key="item.id" :value="item.id">{{ item.meetingName }}</a-select-option>
|
||||
<a-select-option v-for="item in roomList" :key="item.id" :value="item.id">{{ item.meetingName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
@ -78,10 +81,16 @@ export default {
|
||||
{
|
||||
key: '5',
|
||||
value: '调光灯'
|
||||
},
|
||||
{
|
||||
key: '6',
|
||||
value: '门锁'
|
||||
}
|
||||
],
|
||||
confirmLoading: false,
|
||||
mdl: {},
|
||||
roomId: '',
|
||||
roomName: '',
|
||||
form: this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
@ -99,6 +108,8 @@ export default {
|
||||
},
|
||||
selectRoom (item) {
|
||||
console.log(item)
|
||||
this.roomId = item.key
|
||||
this.roomName = item.label
|
||||
},
|
||||
add () {
|
||||
this.form.resetFields()
|
||||
@ -117,6 +128,9 @@ export default {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values)
|
||||
this.confirmLoading = true
|
||||
values.wisdomRoomId = this.roomId
|
||||
console.log(this.roomName)
|
||||
values.contentName = this.roomName
|
||||
saveWisdomDevice(values).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
|
106
src/views/admin/modules/WisdomPanelEquipmentModal.vue
Normal file
106
src/views/admin/modules/WisdomPanelEquipmentModal.vue
Normal file
@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<a-modal
|
||||
title="操作"
|
||||
style="top: 20px;"
|
||||
:width="800"
|
||||
v-model="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<a-form :form="form">
|
||||
<a-form-item style="display:none">
|
||||
<a-input v-decorator="['id']"/>
|
||||
</a-form-item>
|
||||
<a-form-item style="display:none">
|
||||
<a-input v-decorator="['version']"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="面板id">
|
||||
<a-input placeholder="面板id" v-decorator="['panelId']"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设备id">
|
||||
<a-input placeholder="设备id" v-decorator="['equipmentId']"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import {saveWisdomPanelEquipment} from '@/api/admin/wisdomPanelEquipment'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
name: 'WisdomPanelEquipmentModal',
|
||||
props: {
|
||||
},
|
||||
components: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
confirmLoading: false,
|
||||
mdl: {},
|
||||
form: this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
beforeCreate () {
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.form.resetFields()
|
||||
this.edit({ id: 0 })
|
||||
},
|
||||
edit (record) {
|
||||
this.mdl = Object.assign(record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'panelId', 'equipmentId', 'createTime', 'type'))
|
||||
})
|
||||
},
|
||||
handleSubmit (e) {
|
||||
e.preventDefault()
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values)
|
||||
this.confirmLoading = true
|
||||
saveWisdomPanelEquipment(values).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
this.$emit('ok')
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('系统错误,请稍后再试')
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/*
|
||||
'selectedRows': function (selectedRows) {
|
||||
this.needTotalList = this.needTotalList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
total: selectedRows.reduce( (sum, val) => {
|
||||
return sum + val[item.dataIndex]
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
133
src/views/admin/modules/WisdomPanelModal.vue
Normal file
133
src/views/admin/modules/WisdomPanelModal.vue
Normal file
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<a-modal
|
||||
title="操作"
|
||||
style="top: 20px;"
|
||||
:width="800"
|
||||
v-model="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<a-form :form="form">
|
||||
<a-form-item style="display:none">
|
||||
<a-input v-decorator="['id']"/>
|
||||
</a-form-item>
|
||||
<a-form-item style="display:none">
|
||||
<a-input v-decorator="['version']"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="面板名称">
|
||||
<a-input placeholder="面板名称" v-decorator="['panelName']"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="按钮id">
|
||||
<a-input placeholder="按钮" v-decorator="['buttonId']"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="房间">
|
||||
<a-select :label-in-value="true"
|
||||
v-decorator="['wisdomRoom', {rules: [{ required: true, message: '请选择房间' }]}]"
|
||||
@change="selectRoom">
|
||||
<a-select-option v-for="item in roomList" :key="item.id" :value="item.id">{{ item.meetingName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="控制面板id">
|
||||
<a-input placeholder="控制面板id" v-decorator="['panelId']"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import {saveWisdomPanel} from '@/api/admin/wisdomPanel'
|
||||
import { getWisdomRoomList } from '@/api/admin/wisdomRoom'
|
||||
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
name: 'WisdomPanelModal',
|
||||
props: {
|
||||
},
|
||||
components: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
confirmLoading: false,
|
||||
mdl: {},
|
||||
form: this.$form.createForm(this),
|
||||
roomList: []
|
||||
}
|
||||
},
|
||||
beforeCreate () {
|
||||
},
|
||||
created () {
|
||||
this.selectRoomList()
|
||||
},
|
||||
methods: {
|
||||
selectRoomList () {
|
||||
getWisdomRoomList().then(res => {
|
||||
console.log(res)
|
||||
this.roomList = res.rows
|
||||
})
|
||||
},
|
||||
selectRoom (item) {
|
||||
console.log(item)
|
||||
this.roomId = item.key
|
||||
this.roomName = item.label
|
||||
},
|
||||
add () {
|
||||
this.form.resetFields()
|
||||
this.edit({ id: 0 })
|
||||
},
|
||||
edit (record) {
|
||||
this.mdl = Object.assign(record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'panelName', 'createTime', 'buttonId', 'wisdomRoom', 'panelId'))
|
||||
})
|
||||
},
|
||||
handleSubmit (e) {
|
||||
e.preventDefault()
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values)
|
||||
this.confirmLoading = true
|
||||
values.wisdomRoom = this.roomId
|
||||
saveWisdomPanel(values).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
this.$emit('ok')
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('系统错误,请稍后再试')
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/*
|
||||
'selectedRows': function (selectedRows) {
|
||||
this.needTotalList = this.needTotalList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
total: selectedRows.reduce( (sum, val) => {
|
||||
return sum + val[item.dataIndex]
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
</script>
|
@ -34,6 +34,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { saveWisdomRoom, selectStaff } from '@/api/admin/wisdomRoom'
|
||||
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
@ -62,6 +63,7 @@ export default {
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
|
||||
selectStaffList () {
|
||||
selectStaff().then(res => {
|
||||
this.staffLists = res.data
|
||||
|
@ -108,8 +108,8 @@ const vueConfig = {
|
||||
port: 8000,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://192.168.0.30:9227',
|
||||
// target: 'https://www.chuangzhikj.com/saas-ics',
|
||||
// target: 'http://192.168.0.30:9227',
|
||||
target: 'https://www.chuangzhikj.com/saas-ics',
|
||||
pathRewrite: { '^/api': '' },
|
||||
ws: false,
|
||||
changeOrigin: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user