|  | @ -5,7 +5,7 @@ | 
		
	
		
			
				|  |  |       <el-row type="flex"> |  |  |       <el-row type="flex"> | 
		
	
		
			
				|  |  |         <el-col :span="20" class="col_flex"> |  |  |         <el-col :span="20" class="col_flex"> | 
		
	
		
			
				|  |  |           <div class="form_item"> |  |  |           <div class="form_item"> | 
		
	
		
			
				|  |  |             <span>设备ID:</span> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |             <span>设备ID:</span> | 
		
	
		
			
				|  |  |             <el-input v-model="queryInfo.device_id" clearable size="small" placeholder="请输入设备ID" style="width: 200px" class="filter-item" @keyup.enter.native="getStartUpList" @blur="getStartUpList" /> |  |  |             <el-input v-model="queryInfo.device_id" clearable size="small" placeholder="请输入设备ID" style="width: 200px" class="filter-item" @keyup.enter.native="getStartUpList" @blur="getStartUpList" /> | 
		
	
		
			
				|  |  |           </div> |  |  |           </div> | 
		
	
		
			
				|  |  |           <div class="form_item"> |  |  |           <div class="form_item"> | 
		
	
	
		
			
				|  | @ -14,15 +14,14 @@ | 
		
	
		
			
				|  |  |           </div> |  |  |           </div> | 
		
	
		
			
				|  |  |         </el-col> |  |  |         </el-col> | 
		
	
		
			
				|  |  |         <el-col class="page_add" :span="4"> |  |  |         <el-col class="page_add" :span="4"> | 
		
	
		
			
				|  |  |           <!-- @click="clearStartUp" --> |  |  |  | 
		
	
		
			
				|  |  |           <el-button class="table_add clear_btn" plain :disabled="clearBtnDisabled">清空</el-button> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-button class="table_add clear_btn" plain :disabled="clearBtnDisabled" @click="removeStartUp(sels)">清空</el-button> | 
		
	
		
			
				|  |  |         </el-col> |  |  |         </el-col> | 
		
	
		
			
				|  |  |       </el-row> |  |  |       </el-row> | 
		
	
		
			
				|  |  |     </div> |  |  |     </div> | 
		
	
		
			
				|  |  |     <!-- 配置开关机列表 --> |  |  |     <!-- 配置开关机列表 --> | 
		
	
		
			
				|  |  |     <el-row :gutter="15"> |  |  |     <el-row :gutter="15"> | 
		
	
		
			
				|  |  |       <el-col> |  |  |       <el-col> | 
		
	
		
			
				|  |  |         <el-table style="width: 100%;" :data="startUpList" :header-cell-style="{ background: '#3a8aeb', color: '#fff' }" @selection-change="handleSelectionChange"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         <el-table style="width: 100%;" :data="startUpList" :header-cell-style="{ background: '#3a8aeb', color: '#fff' }" @selection-change="handleSelectionChange" > | 
		
	
		
			
				|  |  |           <el-table-column type="selection" width="55" /> |  |  |           <el-table-column type="selection" width="55" /> | 
		
	
		
			
				|  |  |           <el-table-column prop="device_id" label="设备ID" align="center" /> |  |  |           <el-table-column prop="device_id" label="设备ID" align="center" /> | 
		
	
		
			
				|  |  |           <el-table-column prop="device_account" label="设备账号" align="center" width="150" /> |  |  |           <el-table-column prop="device_account" label="设备账号" align="center" width="150" /> | 
		
	
	
		
			
				|  | @ -34,13 +33,13 @@ | 
		
	
		
			
				|  |  |           </el-table-column> |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |           <el-table-column prop="period" label="配置周期" align="center" width="300"> |  |  |           <el-table-column prop="period" label="配置周期" align="center" width="300"> | 
		
	
		
			
				|  |  |             <template slot-scope="{row}"> |  |  |             <template slot-scope="{row}"> | 
		
	
		
			
				|  |  |               <div>{{ row.open_setting==1? '每天 - 开机 '+row.open_time :'每周'+setWeekly(row.open_weekly)+'开机'+row.open_time }}</div> |  |  |  | 
		
	
		
			
				|  |  |               <div>{{ row.close_setting==1?'每天 - 关机'+row.close_time :'每周'+setWeekly(row.close_weekly)+'关机'+row.close_time }}</div> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <div v-show="row.open_setting">{{row.open_setting==1? '每天 - 开机 '+row.open_time :'每周'+setWeekly(row.open_weekly)+'开机'+row.open_time }}</div> | 
		
	
		
			
				|  |  |  |  |  |               <div v-show="row.open_setting">{{ row.close_setting==1?'每天 - 关机'+row.close_time :'每周'+setWeekly(row.close_weekly)+'关机'+row.close_time }}</div> | 
		
	
		
			
				|  |  |             </template> |  |  |             </template> | 
		
	
		
			
				|  |  |           </el-table-column> |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |           <el-table-column label="启动画面" align="center"> |  |  |           <el-table-column label="启动画面" align="center"> | 
		
	
		
			
				|  |  |             <template slot-scope="{row}"> |  |  |             <template slot-scope="{row}"> | 
		
	
		
			
				|  |  |               <el-image class="cover_img" :src="row.startup_screen" /> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <el-image class="cover_img" :src="row.startup_screen" v-show="row.startup_screen"></el-image> | 
		
	
		
			
				|  |  |             </template> |  |  |             </template> | 
		
	
		
			
				|  |  |           </el-table-column> |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |           <el-table-column prop="create_time" label="创建时间" align="center" width="200"> |  |  |           <el-table-column prop="create_time" label="创建时间" align="center" width="200"> | 
		
	
	
		
			
				|  | @ -211,7 +210,7 @@ | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | <script> |  |  | <script> | 
		
	
		
			
				|  |  | import UploadCover from '../components/upload_cover.vue' |  |  | import UploadCover from '../components/upload_cover.vue' | 
		
	
		
			
				|  |  | import { reqStartUpList, reqEditStartUp } from '@/api/device/startUpList.js' |  |  |  | 
		
	
		
			
				|  |  |  |  |  | import { reqStartUpList, reqEditStartUp ,reqClearStartUp} from '@/api/device/startUpList.js' | 
		
	
		
			
				|  |  | import { parseTime } from '@/utils/index.js' |  |  | import { parseTime } from '@/utils/index.js' | 
		
	
		
			
				|  |  | export default { |  |  | export default { | 
		
	
		
			
				|  |  |   name: 'DeviceConfig', |  |  |   name: 'DeviceConfig', | 
		
	
	
		
			
				|  | @ -251,7 +250,8 @@ export default { | 
		
	
		
			
				|  |  |       selectOpenWeekly: [], // 选中的开机每周状态 |  |  |       selectOpenWeekly: [], // 选中的开机每周状态 | 
		
	
		
			
				|  |  |       selectCloseweekly: [], // 选中的关机机每周状态 |  |  |       selectCloseweekly: [], // 选中的关机机每周状态 | 
		
	
		
			
				|  |  |       addFromVisible: false, |  |  |       addFromVisible: false, | 
		
	
		
			
				|  |  |       selectedList: [], |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       // 被选中的行 | 
		
	
		
			
				|  |  |  |  |  |       sels: [], | 
		
	
		
			
				|  |  |       clearBtnDisabled: true, |  |  |       clearBtnDisabled: true, | 
		
	
		
			
				|  |  |       deviceData: [{ key: '1', name: '竖屏' }, { key: '2', name: '横屏' }], |  |  |       deviceData: [{ key: '1', name: '竖屏' }, { key: '2', name: '横屏' }], | 
		
	
		
			
				|  |  |       weeklyList: [ |  |  |       weeklyList: [ | 
		
	
	
		
			
				|  | @ -303,7 +303,8 @@ export default { | 
		
	
		
			
				|  |  |           return str.split(',').map(i => a[i]).join('/') |  |  |           return str.split(',').map(i => a[i]).join('/') | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     } |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   watch: {}, |  |  |   watch: {}, | 
		
	
		
			
				|  |  |   mounted() { |  |  |   mounted() { | 
		
	
	
		
			
				|  | @ -360,8 +361,7 @@ export default { | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 选择设备方向处理 |  |  |     // 选择设备方向处理 | 
		
	
		
			
				|  |  |     selectDirection(selVal) { |  |  |     selectDirection(selVal) { | 
		
	
		
			
				|  |  |       this.key = selVal.key |  |  |  | 
		
	
		
			
				|  |  |       this.name = selVal.name |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       console.log(selVal) | 
		
	
		
			
				|  |  |       this.form.device_direction = selVal.key |  |  |       this.form.device_direction = selVal.key | 
		
	
		
			
				|  |  |       this.form.device_direction_name = selVal.name |  |  |       this.form.device_direction_name = selVal.name | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
	
		
			
				|  | @ -413,14 +413,46 @@ export default { | 
		
	
		
			
				|  |  |     //   this.form.startup_screen = res.data |  |  |     //   this.form.startup_screen = res.data | 
		
	
		
			
				|  |  |     // }, |  |  |     // }, | 
		
	
		
			
				|  |  |     // 列表多选操作 - 清空btn状态 |  |  |     // 列表多选操作 - 清空btn状态 | 
		
	
		
			
				|  |  |     handleSelectionChange(val) { |  |  |  | 
		
	
		
			
				|  |  |       this.selectedList = val |  |  |  | 
		
	
		
			
				|  |  |       if (val.length > 0) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     // 单选单个复选框 | 
		
	
		
			
				|  |  |  |  |  |     handleSelectionChange(sels) { | 
		
	
		
			
				|  |  |  |  |  |       this.sels = sels | 
		
	
		
			
				|  |  |  |  |  |       if (sels.length > 0) { | 
		
	
		
			
				|  |  |         this.clearBtnDisabled = false |  |  |         this.clearBtnDisabled = false | 
		
	
		
			
				|  |  |       } else { |  |  |       } else { | 
		
	
		
			
				|  |  |         this.clearBtnDisabled = true |  |  |         this.clearBtnDisabled = true | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |       console.log(val) |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 清空 | 
		
	
		
			
				|  |  |  |  |  |     removeStartUp(rows){ | 
		
	
		
			
				|  |  |  |  |  |       let ids=[] | 
		
	
		
			
				|  |  |  |  |  |       rows.forEach(item=>{   | 
		
	
		
			
				|  |  |  |  |  |         ids.push(item.device_id) | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |  |  |  |       // console.log(ids) | 
		
	
		
			
				|  |  |  |  |  |       this.$confirm('确定要清空选中配置的周期和启动画面吗?','提示', { | 
		
	
		
			
				|  |  |  |  |  |         confirmButtonText: "确定", | 
		
	
		
			
				|  |  |  |  |  |         cancelButtonText: "取消", | 
		
	
		
			
				|  |  |  |  |  |         type: "warning", | 
		
	
		
			
				|  |  |  |  |  |       }).then(()=>{ | 
		
	
		
			
				|  |  |  |  |  |          const params={ | 
		
	
		
			
				|  |  |  |  |  |            ids | 
		
	
		
			
				|  |  |  |  |  |          } | 
		
	
		
			
				|  |  |  |  |  |         reqClearStartUp(params).then(res=>{ | 
		
	
		
			
				|  |  |  |  |  |           console.log(res) | 
		
	
		
			
				|  |  |  |  |  |           if(res.code==200){ | 
		
	
		
			
				|  |  |  |  |  |             this.$message({ | 
		
	
		
			
				|  |  |  |  |  |               message: '清空成功', | 
		
	
		
			
				|  |  |  |  |  |               type: 'success' | 
		
	
		
			
				|  |  |  |  |  |             }) | 
		
	
		
			
				|  |  |  |  |  |              this.getDevice() | 
		
	
		
			
				|  |  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |         }).catch(()=>{ | 
		
	
		
			
				|  |  |  |  |  |         this.$message({ | 
		
	
		
			
				|  |  |  |  |  |           message:'清空失败', | 
		
	
		
			
				|  |  |  |  |  |           type:'info' | 
		
	
		
			
				|  |  |  |  |  |         }) | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   } |  |  |   } | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
	
		
			
				|  | 
 |