|  | @ -1,7 +1,11 @@ | 
		
	
		
			
				|  |  | <template> |  |  | <template> | 
		
	
		
			
				|  |  |   <div> |  |  |   <div> | 
		
	
		
			
				|  |  |     <div class="head-container"> |  |  |     <div class="head-container"> | 
		
	
		
			
				|  |  |       <crudOperation :permission="permission" /> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       <crudOperation :permission="permission"> | 
		
	
		
			
				|  |  |  |  |  |         <template v-slot:right> | 
		
	
		
			
				|  |  |  |  |  |           <el-button :loading="crud.downloadLoading" :disabled="!crud.selections.length" size="mini" icon="el-icon-download" style="margin-right: 6px;" @click="downloadApi(crud.selections)">导出</el-button> | 
		
	
		
			
				|  |  |  |  |  |         </template> | 
		
	
		
			
				|  |  |  |  |  |       </crudOperation> | 
		
	
		
			
				|  |  |       <div class="head-search" style="margin-left: 40px;"> |  |  |       <div class="head-search" style="margin-left: 40px;"> | 
		
	
		
			
				|  |  |         <!-- 搜索 --> |  |  |         <!-- 搜索 --> | 
		
	
		
			
				|  |  |         <el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery"> |  |  |         <el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery"> | 
		
	
	
		
			
				|  | @ -42,41 +46,165 @@ | 
		
	
		
			
				|  |  |       <pagination /> |  |  |       <pagination /> | 
		
	
		
			
				|  |  |     </div> |  |  |     </div> | 
		
	
		
			
				|  |  |     <!-- form --> |  |  |     <!-- form --> | 
		
	
		
			
				|  |  |     <el-dialog :title="formTitle" :visible.sync="formVisible" :before-close="handleClose"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     <el-dialog class="form-dialog" :title="crud.status.title" append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"> | 
		
	
		
			
				|  |  |       <span class="dialog-right-top" /> |  |  |       <span class="dialog-right-top" /> | 
		
	
		
			
				|  |  |       <span class="dialog-left-bottom" /> |  |  |       <span class="dialog-left-bottom" /> | 
		
	
		
			
				|  |  |       <div class="setting-dialog"> |  |  |       <div class="setting-dialog"> | 
		
	
		
			
				|  |  |         <div class="dialog-delt"> |  |  |  | 
		
	
		
			
				|  |  |           111 |  |  |  | 
		
	
		
			
				|  |  |         </div> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         <ul class="archives-tab"> | 
		
	
		
			
				|  |  |  |  |  |           <li :class="{'active': tabIndex === 0}" @click="changeFormTab(0)">任务设定</li> | 
		
	
		
			
				|  |  |  |  |  |           <li :class="{'active': tabIndex === 1}" @click="changeFormTab(1)">计划设定</li> | 
		
	
		
			
				|  |  |  |  |  |         </ul> | 
		
	
		
			
				|  |  |  |  |  |         <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> | 
		
	
		
			
				|  |  |  |  |  |           <div v-show="tabIndex===0"> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item label="任务类型" prop="type"> | 
		
	
		
			
				|  |  |  |  |  |               <el-select | 
		
	
		
			
				|  |  |  |  |  |                 v-model="form.type" | 
		
	
		
			
				|  |  |  |  |  |                 style="width: 240px; height:30px" | 
		
	
		
			
				|  |  |  |  |  |                 clearable | 
		
	
		
			
				|  |  |  |  |  |                 placeholder="请选择" | 
		
	
		
			
				|  |  |  |  |  |                 @change="handleTaskType" | 
		
	
		
			
				|  |  |  |  |  |               > | 
		
	
		
			
				|  |  |  |  |  |                 <el-option | 
		
	
		
			
				|  |  |  |  |  |                   v-for="item in typeOptions" | 
		
	
		
			
				|  |  |  |  |  |                   :key="item.value" | 
		
	
		
			
				|  |  |  |  |  |                   :label="item.label" | 
		
	
		
			
				|  |  |  |  |  |                   :value="item.value" | 
		
	
		
			
				|  |  |  |  |  |                 /> | 
		
	
		
			
				|  |  |  |  |  |               </el-select> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item label="目标设备" prop="deviceName"> | 
		
	
		
			
				|  |  |  |  |  |               <el-select | 
		
	
		
			
				|  |  |  |  |  |                 v-model="form.deviceName" | 
		
	
		
			
				|  |  |  |  |  |                 style="width: 240px; height:30px" | 
		
	
		
			
				|  |  |  |  |  |                 clearable | 
		
	
		
			
				|  |  |  |  |  |                 placeholder="请选择" | 
		
	
		
			
				|  |  |  |  |  |               > | 
		
	
		
			
				|  |  |  |  |  |                 <el-option | 
		
	
		
			
				|  |  |  |  |  |                   v-for="item in deviceOptions" | 
		
	
		
			
				|  |  |  |  |  |                   :key="item.value" | 
		
	
		
			
				|  |  |  |  |  |                   :label="item.label" | 
		
	
		
			
				|  |  |  |  |  |                   :value="item.value" | 
		
	
		
			
				|  |  |  |  |  |                 /> | 
		
	
		
			
				|  |  |  |  |  |               </el-select> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item label="任务名称" prop="name"> | 
		
	
		
			
				|  |  |  |  |  |               <el-input v-model="form.name" style="width: 572px;" /> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item v-if="form.deviceName === 'DDAF09DDD05ED8ACF9928E'" label="说明" prop="remark"> | 
		
	
		
			
				|  |  |  |  |  |               <div style="display:inline-block; width: 572px; color: #fff; border: 1px solid #339cff; border-radius: 4px; padding: 6px 10px; line-height: 24px;">通风任务是系统给 密集架设备 指定的专属计划任务,根据计划设定的时间可开启通风作业,作业完成后通风会自动停止。同一个密集架设备可以设置多个任务,注意每个任务的计划尽量不要有冲突或者重复,否则会导致任务执行失败。<span style="font-weight: bold; color: rgb(26, 174, 147);">如果用户在创建任务时,未手动设置“计划”,系统将默认从创建时间开始,每隔1天执行1次该任务。</span></div> | 
		
	
		
			
				|  |  |  |  |  |               <!-- <el-input v-model="form.remark" type="textarea" style="width: 572px;" disabled :rows="4" /> --> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |           </div> | 
		
	
		
			
				|  |  |  |  |  |           <div v-show="tabIndex===1"> | 
		
	
		
			
				|  |  |  |  |  |             <div> | 
		
	
		
			
				|  |  |  |  |  |               <el-form-item label="定时类型" prop="timeType"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-select | 
		
	
		
			
				|  |  |  |  |  |                   v-model="form.timeType" | 
		
	
		
			
				|  |  |  |  |  |                   style="width: 240px; height:30px" | 
		
	
		
			
				|  |  |  |  |  |                   clearable | 
		
	
		
			
				|  |  |  |  |  |                   placeholder="请选择" | 
		
	
		
			
				|  |  |  |  |  |                 > | 
		
	
		
			
				|  |  |  |  |  |                   <el-option | 
		
	
		
			
				|  |  |  |  |  |                     v-for="item in timeTypeOptions" | 
		
	
		
			
				|  |  |  |  |  |                     :key="item.value" | 
		
	
		
			
				|  |  |  |  |  |                     :label="item.label" | 
		
	
		
			
				|  |  |  |  |  |                     :value="item.value" | 
		
	
		
			
				|  |  |  |  |  |                   /> | 
		
	
		
			
				|  |  |  |  |  |                 </el-select> | 
		
	
		
			
				|  |  |  |  |  |               </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             </div> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item v-if="form.timeType===1 || form.timeType===2" label="间隔" prop="interval"> | 
		
	
		
			
				|  |  |  |  |  |               <el-input-number v-model="form.interval" controls-position="right" :min="1" /> | 
		
	
		
			
				|  |  |  |  |  |               <span v-if="form.timeType===1" class="unit-name">小时</span> | 
		
	
		
			
				|  |  |  |  |  |               <span v-if="form.timeType===2" class="unit-name">天</span> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             <!-- <el-form-item v-if="form.timeType===3" label="" prop="weekly"> | 
		
	
		
			
				|  |  |  |  |  |               <el-checkbox-group v-model="form.weekly" style="margin-left: 80px;" @change="handleWeeklyTypes"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-checkbox v-for="item in weeklyOptions" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox> | 
		
	
		
			
				|  |  |  |  |  |               </el-checkbox-group> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> --> | 
		
	
		
			
				|  |  |  |  |  |             <el-form-item v-if="form.timeType===4" label="" prop="halfOrPart"> | 
		
	
		
			
				|  |  |  |  |  |               <el-radio-group v-model="form.halfOrPart" style="margin-left: 80px;"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-radio v-for="item in halfOrPartOptions" :key="item.value" :label="item.value">{{ item.label }}</el-radio> | 
		
	
		
			
				|  |  |  |  |  |               </el-radio-group> | 
		
	
		
			
				|  |  |  |  |  |             </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             <div> | 
		
	
		
			
				|  |  |  |  |  |               <el-form-item label="开始时间" prop="startTime"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-date-picker | 
		
	
		
			
				|  |  |  |  |  |                   v-model="form.startTime" | 
		
	
		
			
				|  |  |  |  |  |                   type="datetime" | 
		
	
		
			
				|  |  |  |  |  |                   placeholder="选择日期时间" | 
		
	
		
			
				|  |  |  |  |  |                   :disabled="form.nowTime === true" | 
		
	
		
			
				|  |  |  |  |  |                   format="yyyy-MM-dd HH:mm:ss" | 
		
	
		
			
				|  |  |  |  |  |                   value-format="yyyy-MM-dd HH:mm:ss" | 
		
	
		
			
				|  |  |  |  |  |                   :picker-options="{ | 
		
	
		
			
				|  |  |  |  |  |                     disabledDate: (time) => | 
		
	
		
			
				|  |  |  |  |  |                       time.getTime() < | 
		
	
		
			
				|  |  |  |  |  |                       new Date(new Date().setHours(0, 0, 0, 0)) | 
		
	
		
			
				|  |  |  |  |  |                   }" | 
		
	
		
			
				|  |  |  |  |  |                   style="width: 240px; height:30px" | 
		
	
		
			
				|  |  |  |  |  |                 /> | 
		
	
		
			
				|  |  |  |  |  |               </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |               <el-form-item label="" prop="nowTime"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-checkbox v-model="form.nowTime" style="margin-left: 20px;" @change="handleNowTime">现在</el-checkbox> | 
		
	
		
			
				|  |  |  |  |  |               </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             </div> | 
		
	
		
			
				|  |  |  |  |  |             <div> | 
		
	
		
			
				|  |  |  |  |  |               <el-form-item label="结束时间" prop="endTime"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-date-picker | 
		
	
		
			
				|  |  |  |  |  |                   v-model="form.endTime" | 
		
	
		
			
				|  |  |  |  |  |                   class="task-date" | 
		
	
		
			
				|  |  |  |  |  |                   type="datetime" | 
		
	
		
			
				|  |  |  |  |  |                   placeholder="选择日期时间" | 
		
	
		
			
				|  |  |  |  |  |                   :disabled="form.longTime === true" | 
		
	
		
			
				|  |  |  |  |  |                   :picker-options="endPickerOptions" | 
		
	
		
			
				|  |  |  |  |  |                   format="yyyy-MM-dd HH:mm:ss" | 
		
	
		
			
				|  |  |  |  |  |                   value-format="yyyy-MM-dd HH:mm:ss" | 
		
	
		
			
				|  |  |  |  |  |                   default-time="['23:59:59']" | 
		
	
		
			
				|  |  |  |  |  |                   style="width: 240px; height:30px" | 
		
	
		
			
				|  |  |  |  |  |                 /> | 
		
	
		
			
				|  |  |  |  |  |               </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |               <el-form-item label="" prop="longTime"> | 
		
	
		
			
				|  |  |  |  |  |                 <el-checkbox v-model="form.longTime" style="margin-left: 20px;" @change="handleLongTime">长期</el-checkbox> | 
		
	
		
			
				|  |  |  |  |  |               </el-form-item> | 
		
	
		
			
				|  |  |  |  |  |             </div> | 
		
	
		
			
				|  |  |  |  |  |           </div> | 
		
	
		
			
				|  |  |  |  |  |         </el-form> | 
		
	
		
			
				|  |  |         <div slot="footer" class="dialog-footer"> |  |  |         <div slot="footer" class="dialog-footer"> | 
		
	
		
			
				|  |  |           <el-button type="text">取消</el-button> |  |  |  | 
		
	
		
			
				|  |  |           <el-button type="primary" @click.native="formVisible = false">确定</el-button> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-button type="text" @click="crud.cancelCU">取消</el-button> | 
		
	
		
			
				|  |  |  |  |  |           <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> | 
		
	
		
			
				|  |  |         </div> |  |  |         </div> | 
		
	
		
			
				|  |  |       </div> |  |  |       </div> | 
		
	
		
			
				|  |  |     </el-dialog> |  |  |     </el-dialog> | 
		
	
		
			
				|  |  |  |  |  |     <Detail ref="detailRefs" /> | 
		
	
		
			
				|  |  |   </div> |  |  |   </div> | 
		
	
		
			
				|  |  | </template> |  |  | </template> | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | <script> |  |  | <script> | 
		
	
		
			
				|  |  | import crudRoles from '@/api/system/role' |  |  |  | 
		
	
		
			
				|  |  |  |  |  | import crudTask from '@/api/storeManage/taskManage/index' | 
		
	
		
			
				|  |  | import CRUD, { presenter, header, form, crud } from '@crud/crud' |  |  | import CRUD, { presenter, header, form, crud } from '@crud/crud' | 
		
	
		
			
				|  |  | import rrOperation from '@crud/RR.operation' |  |  | import rrOperation from '@crud/RR.operation' | 
		
	
		
			
				|  |  | import crudOperation from '@crud/CRUD.operation' |  |  | import crudOperation from '@crud/CRUD.operation' | 
		
	
		
			
				|  |  | import pagination from '@crud/Pagination' |  |  | import pagination from '@crud/Pagination' | 
		
	
		
			
				|  |  |  |  |  | import Detail from './module/detail' | 
		
	
		
			
				|  |  |  |  |  | import { parseTime } from '@/utils/index.js' | 
		
	
		
			
				|  |  |  |  |  | import { getAllDev } from '@/api/system/logs' | 
		
	
		
			
				|  |  |  |  |  | import qs from 'qs' | 
		
	
		
			
				|  |  |  |  |  | import { exportFile } from '@/utils/index' | 
		
	
		
			
				|  |  |  |  |  | import { mapGetters } from 'vuex' | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | const defaultForm = { id: null, name: null, depts: [], description: null, dataScope: '全部', level: 3 } |  |  |  | 
		
	
		
			
				|  |  |  |  |  | const defaultForm = { id: null, type: null, deviceName: null, name: null, timeType: 2, halfOrPart: 1, interval: 1, startTime: parseTime(new Date().getTime()), endTime: null, nowTime: null, longTime: true, remark: null } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | export default { |  |  | export default { | 
		
	
		
			
				|  |  |   name: 'TaskManage', |  |  |   name: 'TaskManage', | 
		
	
		
			
				|  |  |   components: { rrOperation, crudOperation, pagination }, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |   components: { rrOperation, crudOperation, pagination, Detail }, | 
		
	
		
			
				|  |  |   cruds() { |  |  |   cruds() { | 
		
	
		
			
				|  |  |     return CRUD({ title: '计划任务管理', url: 'api/roles', crudMethod: crudRoles, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     return CRUD({ title: '任务', url: 'api/roles', crudMethod: crudTask, | 
		
	
		
			
				|  |  |       optShow: { |  |  |       optShow: { | 
		
	
		
			
				|  |  |         add: true, |  |  |         add: true, | 
		
	
		
			
				|  |  |         edit: true, |  |  |         edit: true, | 
		
	
		
			
				|  |  |         del: true, |  |  |         del: true, | 
		
	
		
			
				|  |  |         download: true, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         download: false, | 
		
	
		
			
				|  |  |         group: false |  |  |         group: false | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     }) |  |  |     }) | 
		
	
	
		
			
				|  | @ -84,6 +212,7 @@ export default { | 
		
	
		
			
				|  |  |   mixins: [presenter(), header(), form(defaultForm), crud()], |  |  |   mixins: [presenter(), header(), form(defaultForm), crud()], | 
		
	
		
			
				|  |  |   data() { |  |  |   data() { | 
		
	
		
			
				|  |  |     return { |  |  |     return { | 
		
	
		
			
				|  |  |  |  |  |       tabIndex: 0, | 
		
	
		
			
				|  |  |       formVisible: false, |  |  |       formVisible: false, | 
		
	
		
			
				|  |  |       formTitle: '新增任务', |  |  |       formTitle: '新增任务', | 
		
	
		
			
				|  |  |       enabledTypeOptions: [ |  |  |       enabledTypeOptions: [ | 
		
	
	
		
			
				|  | @ -94,11 +223,126 @@ export default { | 
		
	
		
			
				|  |  |         add: ['admin', 'task:add'], |  |  |         add: ['admin', 'task:add'], | 
		
	
		
			
				|  |  |         edit: ['admin', 'task:edit'], |  |  |         edit: ['admin', 'task:edit'], | 
		
	
		
			
				|  |  |         del: ['admin', 'task:del'] |  |  |         del: ['admin', 'task:del'] | 
		
	
		
			
				|  |  |  |  |  |       }, | 
		
	
		
			
				|  |  |  |  |  |       typeOptions: [ | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '通风任务', | 
		
	
		
			
				|  |  |  |  |  |           value: 1 | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |  |       deviceOptions: [], | 
		
	
		
			
				|  |  |  |  |  |       timeTypeOptions: [ | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '小时循环', | 
		
	
		
			
				|  |  |  |  |  |           value: 1 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '天循环', | 
		
	
		
			
				|  |  |  |  |  |           value: 2 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         // { | 
		
	
		
			
				|  |  |  |  |  |         //   label: '周循环', | 
		
	
		
			
				|  |  |  |  |  |         //   value: 3 | 
		
	
		
			
				|  |  |  |  |  |         // }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '整点/半点', | 
		
	
		
			
				|  |  |  |  |  |           value: 4 | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |  |       weeklyOptions: [ | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周一', | 
		
	
		
			
				|  |  |  |  |  |           value: 1 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周二', | 
		
	
		
			
				|  |  |  |  |  |           value: 2 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周三', | 
		
	
		
			
				|  |  |  |  |  |           value: 3 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周四', | 
		
	
		
			
				|  |  |  |  |  |           value: 4 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周五', | 
		
	
		
			
				|  |  |  |  |  |           value: 5 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周六', | 
		
	
		
			
				|  |  |  |  |  |           value: 6 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '周日', | 
		
	
		
			
				|  |  |  |  |  |           value: 7 | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |  |       halfOrPartOptions: [ | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '整点', | 
		
	
		
			
				|  |  |  |  |  |           value: 1 | 
		
	
		
			
				|  |  |  |  |  |         }, | 
		
	
		
			
				|  |  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |  |           label: '半点', | 
		
	
		
			
				|  |  |  |  |  |           value: 2 | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |  |       rules: { | 
		
	
		
			
				|  |  |  |  |  |         name: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请输入', trigger: 'blur' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         type: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请选择', trigger: 'change' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         deviceName: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请选择', trigger: 'change' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         timeType: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请选择', trigger: 'change' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         interval: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请输入', trigger: 'blur' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         startTime: [ | 
		
	
		
			
				|  |  |  |  |  |           { required: true, message: '请选择', trigger: 'change' } | 
		
	
		
			
				|  |  |  |  |  |         ], | 
		
	
		
			
				|  |  |  |  |  |         endTime: [ | 
		
	
		
			
				|  |  |  |  |  |           { | 
		
	
		
			
				|  |  |  |  |  |             validator: (rule, value, callback) => { | 
		
	
		
			
				|  |  |  |  |  |               if (this.isRequired && !value) { | 
		
	
		
			
				|  |  |  |  |  |                 callback(new Error('请选择结束时间')) | 
		
	
		
			
				|  |  |  |  |  |               } else { | 
		
	
		
			
				|  |  |  |  |  |                 callback() | 
		
	
		
			
				|  |  |  |  |  |               } | 
		
	
		
			
				|  |  |  |  |  |             }, | 
		
	
		
			
				|  |  |  |  |  |             trigger: 'change' | 
		
	
		
			
				|  |  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |         ] | 
		
	
		
			
				|  |  |  |  |  |       }, | 
		
	
		
			
				|  |  |  |  |  |       endPickerOptions: { | 
		
	
		
			
				|  |  |  |  |  |         disabledDate: (time) => { | 
		
	
		
			
				|  |  |  |  |  |           const startTime = this.form.startTime | 
		
	
		
			
				|  |  |  |  |  |           if (startTime) { | 
		
	
		
			
				|  |  |  |  |  |             return time.getTime() < new Date(startTime).getTime() | 
		
	
		
			
				|  |  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |  |  |  |   computed: { | 
		
	
		
			
				|  |  |  |  |  |     isRequired() { | 
		
	
		
			
				|  |  |  |  |  |       return this.form.longTime === false | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     ...mapGetters([ | 
		
	
		
			
				|  |  |  |  |  |       'baseApi' | 
		
	
		
			
				|  |  |  |  |  |     ]) | 
		
	
		
			
				|  |  |  |  |  |   }, | 
		
	
		
			
				|  |  |   created() { |  |  |   created() { | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |  |  |  |   mounted() { | 
		
	
		
			
				|  |  |  |  |  |   }, | 
		
	
		
			
				|  |  |   methods: { |  |  |   methods: { | 
		
	
		
			
				|  |  |     // 新增与编辑前做的操作 |  |  |     // 新增与编辑前做的操作 | 
		
	
		
			
				|  |  |     [CRUD.HOOK.afterToCU](crud, form) { |  |  |     [CRUD.HOOK.afterToCU](crud, form) { | 
		
	
	
		
			
				|  | @ -111,14 +355,71 @@ export default { | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 提交前做的操作 |  |  |     // 提交前做的操作 | 
		
	
		
			
				|  |  |     [CRUD.HOOK.afterValidateCU](crud) { |  |  |     [CRUD.HOOK.afterValidateCU](crud) { | 
		
	
		
			
				|  |  |       return true |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       console.log(crud.form) | 
		
	
		
			
				|  |  |  |  |  |       if (crud.form.timeType !== 4) { | 
		
	
		
			
				|  |  |  |  |  |         this.form.halfOrPart = null | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |       delete crud.form.remark | 
		
	
		
			
				|  |  |  |  |  |       return false | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     changeFormTab(index) { | 
		
	
		
			
				|  |  |  |  |  |       this.tabIndex = index | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     handleWeeklyTypes(val) { | 
		
	
		
			
				|  |  |  |  |  |       if (val.length < 1) { | 
		
	
		
			
				|  |  |  |  |  |         this.$nextTick(() => { | 
		
	
		
			
				|  |  |  |  |  |           this.weekly = [] | 
		
	
		
			
				|  |  |  |  |  |         }) | 
		
	
		
			
				|  |  |  |  |  |         return | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     handleLongTime(val) { | 
		
	
		
			
				|  |  |  |  |  |       if (val === true) { | 
		
	
		
			
				|  |  |  |  |  |         this.form.endTime = null | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     handleNowTime(val) { | 
		
	
		
			
				|  |  |  |  |  |       if (val === true) { | 
		
	
		
			
				|  |  |  |  |  |         this.form.startTime = parseTime(new Date().getTime()) | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     handleTaskType(val) { | 
		
	
		
			
				|  |  |  |  |  |       this.form.deviceName = null | 
		
	
		
			
				|  |  |  |  |  |       if (val) { | 
		
	
		
			
				|  |  |  |  |  |         this.getDev() | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 获取设备 | 
		
	
		
			
				|  |  |  |  |  |     getDev() { | 
		
	
		
			
				|  |  |  |  |  |       getAllDev().then(res => { | 
		
	
		
			
				|  |  |  |  |  |         let arr = [] | 
		
	
		
			
				|  |  |  |  |  |         if (this.form.type === 1) { | 
		
	
		
			
				|  |  |  |  |  |           arr = res.filter(item => item.deviceTypeId.name === '密集架') | 
		
	
		
			
				|  |  |  |  |  |             .map(item => ({ | 
		
	
		
			
				|  |  |  |  |  |               value: item.id, | 
		
	
		
			
				|  |  |  |  |  |               label: item.deviceName | 
		
	
		
			
				|  |  |  |  |  |             })) | 
		
	
		
			
				|  |  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  |  |           arr = res.map(item => { | 
		
	
		
			
				|  |  |  |  |  |             const val = item.id | 
		
	
		
			
				|  |  |  |  |  |             const lab = item.deviceName | 
		
	
		
			
				|  |  |  |  |  |             const obj = { | 
		
	
		
			
				|  |  |  |  |  |               value: val, | 
		
	
		
			
				|  |  |  |  |  |               label: lab | 
		
	
		
			
				|  |  |  |  |  |             } | 
		
	
		
			
				|  |  |  |  |  |             return obj | 
		
	
		
			
				|  |  |  |  |  |           }) | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |         this.deviceOptions = arr | 
		
	
		
			
				|  |  |  |  |  |         console.log('this.deviceOptions', this.deviceOptions) | 
		
	
		
			
				|  |  |  |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     clickRowHandler(row) { |  |  |     clickRowHandler(row) { | 
		
	
		
			
				|  |  |       this.$refs.table.toggleRowSelection(row) |  |  |       this.$refs.table.toggleRowSelection(row) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 双击详情 |  |  |     // 双击详情 | 
		
	
		
			
				|  |  |     handleDbClick(row) { |  |  |     handleDbClick(row) { | 
		
	
		
			
				|  |  |       this.$refs.DetailsDom.detailsVisible = true |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       this.$refs.detailRefs.detailVisible = true | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 改变状态 |  |  |     // 改变状态 | 
		
	
		
			
				|  |  |     changeEnabled(data, val) { |  |  |     changeEnabled(data, val) { | 
		
	
	
		
			
				|  | @ -136,14 +437,20 @@ export default { | 
		
	
		
			
				|  |  |         data.enabled = !data.enabled |  |  |         data.enabled = !data.enabled | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     handleClose() { |  |  |  | 
		
	
		
			
				|  |  |       this.formVisible = false |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     // 导出接口调用 | 
		
	
		
			
				|  |  |  |  |  |     downloadApi(data) { | 
		
	
		
			
				|  |  |  |  |  |       const ids = data.map(item => { return item.id }) | 
		
	
		
			
				|  |  |  |  |  |       const params = { | 
		
	
		
			
				|  |  |  |  |  |         'logIds': ids | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |       exportFile(this.baseApi + '/api/case/exportCaseLogList?' + qs.stringify(params, { indices: false })) | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   } |  |  |   } | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
		
			
				|  |  | </script> |  |  | </script> | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | <style lang="scss" scoped> |  |  | <style lang="scss" scoped> | 
		
	
		
			
				|  |  |  |  |  | @import "~@/assets/styles/archives-manage.scss"; | 
		
	
		
			
				|  |  | ::v-deep .head-container{ |  |  | ::v-deep .head-container{ | 
		
	
		
			
				|  |  |   display: flex; |  |  |   display: flex; | 
		
	
		
			
				|  |  |   padding-bottom: 0; |  |  |   padding-bottom: 0; | 
		
	
	
		
			
				|  | @ -151,4 +458,37 @@ export default { | 
		
	
		
			
				|  |  | .head-search{ |  |  | .head-search{ | 
		
	
		
			
				|  |  |   margin-bottom:0 ; |  |  |   margin-bottom:0 ; | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
		
			
				|  |  |  |  |  | ::v-deep .form-dialog.el-dialog{ | 
		
	
		
			
				|  |  |  |  |  |   width: 712px !important; | 
		
	
		
			
				|  |  |  |  |  |   .el-dialog__body{ | 
		
	
		
			
				|  |  |  |  |  |     padding: 0 0 30px 0; | 
		
	
		
			
				|  |  |  |  |  |     .archives-tab{ | 
		
	
		
			
				|  |  |  |  |  |       margin-bottom: 20px; | 
		
	
		
			
				|  |  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |  |     .el-form{ | 
		
	
		
			
				|  |  |  |  |  |       padding: 0 20px; | 
		
	
		
			
				|  |  |  |  |  |       .el-checkbox__label{ | 
		
	
		
			
				|  |  |  |  |  |         color: #fff !important; | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |       .unit-name{ | 
		
	
		
			
				|  |  |  |  |  |         color: #fff; | 
		
	
		
			
				|  |  |  |  |  |         margin-left: 15px; | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  | </style> | 
		
	
		
			
				|  |  |  |  |  | <style> | 
		
	
		
			
				|  |  |  |  |  |   .el-picker-panel__footer .el-button, | 
		
	
		
			
				|  |  |  |  |  |   .el-picker-panel__footer .el-button--info.is-plain{ | 
		
	
		
			
				|  |  |  |  |  |     color: #1890ff !important; | 
		
	
		
			
				|  |  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |   .el-picker-panel__footer .el-button--text{ | 
		
	
		
			
				|  |  |  |  |  |     border: none !important; | 
		
	
		
			
				|  |  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  |   .el-picker-panel__footer .el-button:hover{ | 
		
	
		
			
				|  |  |  |  |  |     background-color: #fff !important; | 
		
	
		
			
				|  |  |  |  |  |   } | 
		
	
		
			
				|  |  | </style> |  |  | </style> |