大屏新增启用、停用功能
This commit is contained in:
		| @@ -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"> | ||||
| @@ -87,7 +95,6 @@ | ||||
| <script> | ||||
|   import Layout from './Layout.vue' | ||||
|   import Sortable from 'sortablejs' | ||||
| import AppGigscreenViewer from "../../viewer/AppGigscreenViewer"; | ||||
|  | ||||
|   export default { | ||||
|     name: 'Add', | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user