| | |
| | | <div class="row"> |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="24" style="position: relative"> |
| | | <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"> |
| | | <el-menu :default-active="activeIndex" class="el-menu" mode="horizontal" @select="handleSelect"> |
| | | <el-menu-item index="0" @click="changeUnit(null, '全部')"> |
| | | 全部单位 |
| | | 全部单位(430) |
| | | </el-menu-item> |
| | | <el-menu-item index="1"> |
| | | 自流井运维单位(70/70) |
| | | 自流井运维单位(70) |
| | | </el-menu-item> |
| | | <el-menu-item index="2"> |
| | | 大安运维(50/50) |
| | | 大安运维(50) |
| | | </el-menu-item> |
| | | <el-menu-item index="3">富顺运维单位(20/70)</el-menu-item> |
| | | <el-menu-item index="4">高新运维单位(15/40)</el-menu-item> |
| | | <el-menu-item index="5">荣县运维单位(90/90)</el-menu-item> |
| | | <el-menu-item index="6">贡井运维单位(45/45)</el-menu-item> |
| | | <el-menu-item index="7">沿滩运维单位(70/70)</el-menu-item> |
| | | <el-menu-item index="3">富顺运维单位(70)</el-menu-item> |
| | | <el-menu-item index="4">高新运维单位(15)</el-menu-item> |
| | | <el-menu-item index="5">荣县运维单位(90)</el-menu-item> |
| | | <el-menu-item index="6">贡井运维单位(45)</el-menu-item> |
| | | <el-menu-item index="7">沿滩运维单位(70)</el-menu-item> |
| | | </el-menu> |
| | | <el-tooltip class="item" effect="dark" content="自动下发设置" placement="left"> |
| | | <el-button class="setting" style="" type="success" icon="el-icon-s-tools" circle></el-button> |
| | | </el-tooltip> |
| | | <el-popover |
| | | placement="right" |
| | | width="400" |
| | | trigger="click"> |
| | | <el-form :model="settingForm" :rules="settingRules" ref="settingForm" label-width="120px"> |
| | | <el-form-item label="录像质量" prop="videoQuality"> |
| | | <el-select style="width: 100%" v-model="settingForm.videoQuality" placeholder="最低录像质量"> |
| | | <el-option label="全录像" value="全录像"/> |
| | | <el-option label="部分录像" value="部分录像"/> |
| | | <el-option label="无录像" value="无录像"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="点位离线时长" prop="outLine"> |
| | | <el-input type="number" v-model="settingForm.outLine" placeholder="不能超过多久"> |
| | | <template slot="append">分钟</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="视频标注准确率" prop="videoLabel"> |
| | | <el-input type="number" v-model="settingForm.videoLabel" placeholder="最低准确率"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitSetting">保存</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button title="自动生成工单设置" slot="reference" class="setting" style="" type="success" icon="el-icon-s-tools" circle></el-button> |
| | | </el-popover> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row class="op-warp" type="flex" justify="left" > |
| | | <el-col :span="24"> |
| | | <el-button size="small" type="info" @click="selectedDistribute" class="op">下发选中工单</el-button> |
| | | <el-button size="small" type="danger" @click="allDistribute" class="op">全部下发</el-button> |
| | | <el-popconfirm |
| | | @confirm="allDistribute" |
| | | title="确定要下发所有工单吗?" |
| | | > |
| | | <el-button size="small" type="danger" class="op" slot="reference">全部下发</el-button> |
| | | </el-popconfirm> |
| | | |
| | | <el-popover |
| | | class="op" |
| | | placement="right" |
| | | width="300px" |
| | | trigger="click"> |
| | | <span style="font-weight: bold;font-size: 16px">快速下发</span> |
| | | <span style="font-weight: bold;font-size: 16px">快捷下发</span> |
| | | <el-form ref="fastDistributeForm" :model="fastDistributeForm" :rules="fastDistributeRules" label-width="80px"> |
| | | <el-form-item label="快捷方式" prop="fastWay"> |
| | | <el-radio v-model="fastDistributeForm.fastWay" label="0">最近30分钟</el-radio> |
| | |
| | | </el-form> |
| | | <el-button slot="reference" type="primary" size="small">快捷下发</el-button> |
| | | </el-popover> |
| | | <el-button size="small" type="primary" @click="page" class="op">刷新</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {distributeWorkOrder, fastDistribute} from '@/api/platform/work-order' |
| | | export default { |
| | | name: 'index', |
| | | data() { |
| | | return { |
| | | settingForm: { |
| | | // 离线 |
| | | outLine: null, |
| | | // 视频可用 |
| | | videoQuality: "", |
| | | // 视频标注 |
| | | videoLabel: "" |
| | | }, |
| | | // 当前运维单位 |
| | | unitId: null, |
| | | unitName: "", |
| | |
| | | fastTimeRange: [], |
| | | // 下发 |
| | | fastDistributeForm: { |
| | | fastWay: '', |
| | | fastWay: null, |
| | | fastNumLimit: null, |
| | | start: null, |
| | | end: null, |
| | | unitId: null |
| | | }, |
| | | // 自动生成工单规则 |
| | | settingRules: { |
| | | outLine: [ |
| | | { required: true, message: "请填写点位离线时长", trigger: "blur" } |
| | | ], |
| | | videoQuality: [ |
| | | { required: true, message: "请填写视频可用程度", trigger: "change" } |
| | | ], |
| | | videoLabel: [ |
| | | { required: true, message: "请填写点视频标注准确率", trigger: "blur" } |
| | | ], |
| | | }, |
| | | // 下发表单验证 |
| | | fastDistributeRules: { |
| | |
| | | ], |
| | | }, |
| | | queryParams: { |
| | | unitId: null, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | pageSize: 20, |
| | | }, |
| | | // 总条数 |
| | | total: 0, |
| | |
| | | workOrderList: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.page(); |
| | | }, |
| | | methods: { |
| | | submitSetting() { |
| | | this.$refs['settingForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.$modal.msgSuccess("保存成功") |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | page() { |
| | | this.loading = true; |
| | | distributeWorkOrder(this.queryParams).then(res => { |
| | | this.workOrderList = res.data; |
| | | this.total = res.total; |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | changeUnit(unitId, unitName) { |
| | | this.unitId = unitId; |
| | | this.queryParams.unitId = unitId; |
| | | this.unitName = unitName; |
| | | // todo 触发数据查询 |
| | | this.page() |
| | | }, |
| | | clearFastDistributeForm() { |
| | | this.fastDistributeForm.fastWay = '' |
| | |
| | | this.fastDistributeForm.fastNumLimit = null |
| | | this.fastTimeRange = [] |
| | | }, |
| | | allDis() {}, |
| | | // 全部下发 |
| | | allDistribute() { |
| | | this.$modal.confirm("确定要下发" + (this.unitId ? this.unitName + "下的" : "所有工单") + "吗?").then(function() { |
| | | return this.allDis(); |
| | | }).then(() => { |
| | | // this.getList(); |
| | | // this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | this.fastDistribute(); |
| | | }, |
| | | // 快速下发 |
| | | fastDistribute() { |
| | | this.$refs['fastDistributeForm'].validate((valid) => { |
| | | if (valid) { |
| | | // this.$refs['fastDistributeForm'].validate((valid) => { |
| | | // if (valid) { |
| | | // 如果是自定义方式,那么时间段必填 |
| | | if (this.fastDistributeForm.fastWay === '101' && !this.fastTimeRange.length > 0) { |
| | | this.$message.warning("请选择时间范围") |
| | |
| | | this.fastDistributeForm.end = this.fastTimeRange[1] |
| | | } |
| | | this.fastDistributeForm.unitId = this.unitId |
| | | // todo 提交快速发布请求 |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | fastDistribute(this.fastDistributeForm).then(res => { |
| | | // this.clearFastDistributeForm(); |
| | | this.page(); |
| | | }) |
| | | // } else { |
| | | // return false |
| | | // } |
| | | // }) |
| | | }, |
| | | // 选中工单下发 |
| | | selectedDistribute() { |
| | |
| | | this.$message.warning("请先选择要下发的工单") |
| | | return |
| | | } |
| | | // todo 下发工单 |
| | | this.fastDistribute(); |
| | | }, |
| | | handleSelect(key, keyPath) { |
| | | console.log(key, keyPath); |
| | |
| | | top: 10px; |
| | | right:5px |
| | | } |
| | | |
| | | </style> |