修改了智能设备页面

This commit is contained in:
chenze 2024-08-21 17:12:48 +08:00
parent 6322e1f476
commit 14b2824530
2 changed files with 35 additions and 12 deletions

View File

@ -12,6 +12,14 @@ export function getWisdomRoomList (parameter) {
})
}
export function selectStaff (parameter) {
return axios({
url: api.wisdomRoom + '/selectStaff',
method: 'get',
params: parameter
})
}
export function saveWisdomRoom (parameter) {
return axios({
url: api.wisdomRoom + (parameter.id > 0 ? '/update' : '/save'),

View File

@ -9,29 +9,37 @@
>
<a-form :form="form">
<a-form-item style="display:none">
<a-input v-decorator="['id']"/>
<a-input v-decorator="['id']" />
</a-form-item>
<a-form-item style="display:none">
<a-input v-decorator="['version']"/>
<a-input v-decorator="['version']" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会议室名称">
<a-input placeholder="会议室名称" v-decorator="['meetingName',{rules: [{ required: true, message: '请输入会议室名称' }]}]"/>
<a-input placeholder="会议室名称"
v-decorator="['meetingName',{rules: [{ required: true, message: '请输入会议室名称' }]}]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="管理员">
<a-select show-search mode="multiple"
v-decorator="['staffId', {rules: [{ required: true, message: '管理员' }]}]" optionFilterProp="label">
<a-select-option v-for="item in staffLists" :key="item.id" :label="item.mobile">{{ item.username
}}--{{ item.mobile }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-input placeholder="备注" v-decorator="['remake']"/>
<a-input placeholder="备注" v-decorator="['remake']" />
</a-form-item>
</a-form>
</a-modal>
</template>
<script>
import {saveWisdomRoom} from '@/api/admin/wisdomRoom'
import pick from 'lodash.pick'
export default {
import { saveWisdomRoom, selectStaff } from '@/api/admin/wisdomRoom'
import pick from 'lodash.pick'
export default {
name: 'WisdomRoomModal',
props: {
},
components: {
},
props: {},
components: {},
data () {
return {
visible: false,
@ -45,14 +53,21 @@
},
confirmLoading: false,
mdl: {},
staffLists: [],
form: this.$form.createForm(this)
}
},
beforeCreate () {
},
created () {
this.selectStaffList()
},
methods: {
selectStaffList () {
selectStaff().then(res => {
this.staffLists = res.data
})
},
add () {
this.form.resetFields()
this.edit({ id: 0 })
@ -61,7 +76,7 @@
this.mdl = Object.assign(record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'meetingName', 'startTime', 'endDate', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag', 'remake', 'tenantId', 'parkId'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'staffId', 'meetingName', 'startTime', 'endDate', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag', 'remake', 'tenantId', 'parkId'))
})
},
handleSubmit (e) {