大屏新增启用、停用功能

This commit is contained in:
yanran200730
2022-08-01 11:00:40 +08:00
parent f448d214b5
commit 0c279f3d2e

View File

@@ -12,8 +12,7 @@
<el-input size="small" :maxlength="30" placeholder="请输入大屏项目名称" v-model="form.name"></el-input> <el-input size="small" :maxlength="30" placeholder="请输入大屏项目名称" v-model="form.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" style="width: 100%;" prop="description"> <el-form-item label="描述" style="width: 100%;" prop="description">
<el-input size="small" :maxlength="200" :rows="5" type="textarea" style="width: 100%;" <el-input size="small" :maxlength="200" :rows="5" type="textarea" style="width: 100%;" placeholder="请输入描述" v-model="form.description"></el-input>
placeholder="请输入描述" v-model="form.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否开启" style="width: 100%;" prop="status"> <el-form-item label="是否开启" style="width: 100%;" prop="status">
<el-switch <el-switch
@@ -40,6 +39,15 @@
row-key="id" row-key="id"
:isShowPagination="false" :isShowPagination="false"
@getList="() => {}"> @getList="() => {}">
<el-table-column slot="options" label="状态" align="center">
<template slot-scope="{ row }">
<el-switch
v-model="row.status"
active-value="1"
@change="() => onStatusChange(row.id)">
</el-switch>
</template>
</el-table-column>
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center"> <el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
<template slot-scope="{ row, column, $index }"> <template slot-scope="{ row, column, $index }">
<div class="table-options"> <div class="table-options">
@@ -85,11 +93,10 @@
</template> </template>
<script> <script>
import Layout from './Layout.vue' import Layout from './Layout.vue'
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import AppGigscreenViewer from "../../viewer/AppGigscreenViewer";
export default { export default {
name: 'Add', name: 'Add',
props: { props: {
instance: Function, instance: Function,
@@ -99,7 +106,10 @@ export default {
inject: { inject: {
home: {default: ''} home: {default: ''}
}, },
components: {AppGigscreenViewer, Layout}, components: {
Layout
},
data() { data() {
return { return {
info: {}, info: {},
@@ -155,7 +165,8 @@ export default {
title: v.title, title: v.title,
dv: conf.custom || '', dv: conf.custom || '',
meta: JSON.stringify(conf.meta), meta: JSON.stringify(conf.meta),
isCustom: !!conf.custom isCustom: !!conf.custom,
status: v.status
} }
}) })
this.total = res.data.lsList.length this.total = res.data.lsList.length
@@ -167,6 +178,16 @@ export default {
} }
}) })
}, },
onStatusChange (id) {
this.instance.post(`${this.urlPrefix}/appdiylargescreen/enableLargeScreen?id=${id}`).then(res => {
if (res.code === 0) {
this.getInfo()
this.$message.success('操作成功')
}
})
},
rowDrop() { rowDrop() {
const tbody = document.querySelector('.el-table__body-wrapper tbody') const tbody = document.querySelector('.el-table__body-wrapper tbody')
const _this = this const _this = this
@@ -272,7 +293,7 @@ export default {
}) })
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">