大屏新增启用、停用功能

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-form-item>
<el-form-item label="描述" style="width: 100%;" prop="description">
<el-input size="small" :maxlength="200" :rows="5" type="textarea" style="width: 100%;"
placeholder="请输入描述" v-model="form.description"></el-input>
<el-input size="small" :maxlength="200" :rows="5" type="textarea" style="width: 100%;" placeholder="请输入描述" v-model="form.description"></el-input>
</el-form-item>
<el-form-item label="是否开启" style="width: 100%;" prop="status">
<el-switch
@@ -40,6 +39,15 @@
row-key="id"
:isShowPagination="false"
@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">
<template slot-scope="{ row, column, $index }">
<div class="table-options">
@@ -85,11 +93,10 @@
</template>
<script>
import Layout from './Layout.vue'
import Sortable from 'sortablejs'
import AppGigscreenViewer from "../../viewer/AppGigscreenViewer";
import Layout from './Layout.vue'
import Sortable from 'sortablejs'
export default {
export default {
name: 'Add',
props: {
instance: Function,
@@ -99,7 +106,10 @@ export default {
inject: {
home: {default: ''}
},
components: {AppGigscreenViewer, Layout},
components: {
Layout
},
data() {
return {
info: {},
@@ -155,7 +165,8 @@ export default {
title: v.title,
dv: conf.custom || '',
meta: JSON.stringify(conf.meta),
isCustom: !!conf.custom
isCustom: !!conf.custom,
status: v.status
}
})
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() {
const tbody = document.querySelector('.el-table__body-wrapper tbody')
const _this = this
@@ -272,7 +293,7 @@ export default {
})
}
}
}
}
</script>
<style scoped lang="scss">