|
@@ -0,0 +1,626 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container space">
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">手动更新点位(无操作)</div>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules7" label-width="80px">
|
|
|
+ <el-row :gutter="12">
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="起始位:" prop="startId">
|
|
|
+ <el-input v-model="form.startId" placeholder="起始库位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="目的位:" prop="endId">
|
|
|
+ <el-input v-model="form.endId" placeholder="目的库位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="updateStorge" >更改</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">查询指令完成状态</div>
|
|
|
+ <el-form ref="form1" :model="form" :rules="rules1" label-width="80px">
|
|
|
+ <el-row :gutter="12">
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="节点ID:" prop="taskNodeId">
|
|
|
+ <el-input v-model="form.taskNodeId" placeholder="节点ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="任务ID:" prop="taskId">
|
|
|
+ <el-input v-model="form.taskId" placeholder="任务ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="getCallbackList" >查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">读取RFID数据</div>
|
|
|
+ <el-form ref="form2" :model="form" :rules="rules2" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="节点ID:" prop="taskNodeId">
|
|
|
+ <el-input v-model="form.taskNodeId" placeholder="节点ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="任务ID:" prop="taskId">
|
|
|
+ <el-input v-model="form.taskId" placeholder="任务ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="次序号:" prop="positionIndex">
|
|
|
+ <el-input-number v-model="form.positionIndex" :min="1" :max="6"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="getRFID" >读取</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">设置设备上线\离线</div>
|
|
|
+ <el-form ref="form3" :model="form" :rules="rules3" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="设备IP:" prop="ip">
|
|
|
+ <el-tooltip content="例如:192.168.11.240" placement="top">
|
|
|
+ <el-input v-model="form.ip" placeholder="设备IP"></el-input>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="updateOnlineStatus" >设置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">创建AGV任务</div>
|
|
|
+ <el-form ref="form4" :model="form" :rules="rules4" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="起点:" prop="start">
|
|
|
+ <el-tooltip content="例如:BZ_361" placement="top">
|
|
|
+ <el-input v-model="form.start" placeholder="起点"></el-input>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="终点:" prop="goal">
|
|
|
+ <el-tooltip content="例如:KT_121" placement="top">
|
|
|
+ <el-input v-model="form.goal" placeholder="终点"></el-input>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="addHikTask">创建</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">重发指令</div>
|
|
|
+ <el-form ref="form5" :model="form" :rules="rules1" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="节点ID:" prop="taskNodeId">
|
|
|
+ <el-input v-model="form.taskNodeId" placeholder="节点ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="任务ID:" prop="taskId">
|
|
|
+ <el-input v-model="form.taskId" placeholder="任务ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="resend">重发</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">发送回调指令</div>
|
|
|
+ <el-form ref="form6" :model="form" :rules="rules1" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="节点ID:" prop="taskNodeId">
|
|
|
+ <el-input v-model="form.taskNodeId" placeholder="节点ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="任务ID:" prop="taskId">
|
|
|
+ <el-input v-model="form.taskId" placeholder="任务ID"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="sendCallback" >发送</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">动态移动零件(产线内)</div>
|
|
|
+ <el-form ref="form7" :model="form" :rules="rules5" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-select v-model="form.zoneId" placeholder="选择产线">
|
|
|
+ <el-option v-for="deviceUnit in lineList " :label="deviceUnit.name" :value="deviceUnit.no" :key="deviceUnit.no" ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="起始位:" prop="startpointId">
|
|
|
+ <el-input v-model="form.startpointId" placeholder="起始点位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="目的位:" prop="endpointId">
|
|
|
+ <el-input v-model="form.endpointId" placeholder="目的点位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="manualTask">执行</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">零件动态入线边库(产线内)</div>
|
|
|
+ <el-form ref="form8" :model="form" :rules="rules6" label-width="80px">
|
|
|
+ <el-row :gutter="12" >
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-select v-model="form.zoneId" placeholder="选择产线">
|
|
|
+ <el-option v-for="deviceUnit in lineList " :label="deviceUnit.name" :value="deviceUnit.no" :key="deviceUnit.no" ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="6" :sm="5">
|
|
|
+ <el-form-item label="节点ID:" prop="startpointId">
|
|
|
+ <el-input v-model="form.startpointId" placeholder="起始点位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="manualXbk">执行</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ // 【锁定记录、出入库记录】-API
|
|
|
+ import toolbarApi from "@/api/systemMgr/toolbar"
|
|
|
+ import warnLogApi from "@/api/lineSideLibrary/warnLog"
|
|
|
+ import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
|
|
|
+ import { convertEnum, initDicts, initQueryParams } from '@/utils/commons'
|
|
|
+ export default {
|
|
|
+ name: "Tools",
|
|
|
+ directives: { },
|
|
|
+ components: { },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ form:{
|
|
|
+ taskNodeId: '',
|
|
|
+ taskId: '',
|
|
|
+ positionIndex: 1,
|
|
|
+ ip: "",
|
|
|
+ start: "",
|
|
|
+ goal: "",
|
|
|
+ startpointId: "",
|
|
|
+ endpointId: "",
|
|
|
+ zoneId: "",
|
|
|
+ startId: "",
|
|
|
+ endId: ""
|
|
|
+ },
|
|
|
+ lineList: [],
|
|
|
+ tenantViewVisible: false,
|
|
|
+ tableKey: 0,
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ selection: [],
|
|
|
+ loading: false,
|
|
|
+ rules1: {
|
|
|
+ taskNodeId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ taskId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules2: {
|
|
|
+ taskNodeId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ taskId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ positionIndex: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ rules3: {
|
|
|
+ ip: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules4: {
|
|
|
+ start: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ goal: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ rules5: {
|
|
|
+ startpointId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ endpointId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ zoneId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ rules6: {
|
|
|
+ startpointId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ zoneId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ rules7: {
|
|
|
+ startId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ endId: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ // 调用常量-审核状态
|
|
|
+ this.audioStatus = this.$constWKS.OPTTYPE
|
|
|
+ // 加载【字典】
|
|
|
+ initDicts(['NATION'], this.dicts);
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ currentUser () {
|
|
|
+ return this.$store.state.account.user
|
|
|
+ },
|
|
|
+ nationList() {
|
|
|
+ return convertEnum(this.dicts.NATION)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ updateStorge () {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.updateStorge(this.form).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.updateSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCallbackList () {
|
|
|
+ this.$refs.form1.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.getCallbackList(this.form).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ console.log(res.data)
|
|
|
+ this.$message({
|
|
|
+ message: "节点"+ res.data.data.operateName + "操作" + (res.data.data.state ? "未完成" : "已完成"),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ getRFID () {
|
|
|
+ this.$refs.form2.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.getRFID(this.form).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ console.log(res.data)
|
|
|
+ this.$message({
|
|
|
+ message: "节点RFID值为:"+ res.data.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ updateOnlineStatus () {
|
|
|
+ this.$refs.form3.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.updateOnlineStatus({ip: this.form.ip}).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.updateSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addHikTask () {
|
|
|
+ this.$refs.form4.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.addHikTask({start: this.form.start, goal: this.form.goal}).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.updateSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resend() {
|
|
|
+ this.$refs.form5.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.addHikTask({taskNodeId: this.form.taskNodeId, taskId: this.form.taskId}).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.updateSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ sendCallback(){
|
|
|
+ this.$refs.form6.validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ toolbarApi.addHikTask({taskNodeId: this.form.taskNodeId, taskId: this.form.taskId}).then(response=>{
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.updateSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ manualTask(){
|
|
|
+
|
|
|
+ },
|
|
|
+ manualXbk(){
|
|
|
+
|
|
|
+ },
|
|
|
+ reset () {
|
|
|
+ this.queryParams = initQueryParams({})
|
|
|
+ this.$refs.table.clearSort()
|
|
|
+ this.$refs.table.clearFilter()
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ add () {
|
|
|
+ this.$refs.edit.type = "add"
|
|
|
+ this.$refs.edit.setTenant(false, this.dicts)
|
|
|
+ this.dialog.title = this.$t("common.add")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ singleDelete (row) {
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
+ this.batchDelete()
|
|
|
+ },
|
|
|
+ batchDelete () {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm(this.$t("developer.tips.wareTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const ids = []
|
|
|
+ this.selection.forEach(item => {
|
|
|
+ ids.push(item.id)
|
|
|
+ })
|
|
|
+ this.delete(ids)
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ clearSelections () {
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ },
|
|
|
+ view(row){
|
|
|
+ this.$refs.view.setTenant(row)
|
|
|
+ this.tenantViewVisible = true
|
|
|
+ },
|
|
|
+ marking(){
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ const ids = []
|
|
|
+ this.selection.forEach(item => {
|
|
|
+ ids.push(item.id)
|
|
|
+ })
|
|
|
+ this.updateStatus(ids)
|
|
|
+ },
|
|
|
+ updateStatus(ids){
|
|
|
+ warnLogApi.updateStatus({ids: ids}).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: '标注成功',
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delete (ids) {
|
|
|
+ warnLogApi.remove({ ids: ids }).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.deleteSuccess"),
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.search()
|
|
|
+ // 清理已经删除的数据
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 【修改】表头上Btn-事件
|
|
|
+ editOne() {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.selection.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.edit(this.selection[0]);
|
|
|
+ },
|
|
|
+ edit (row) {
|
|
|
+ this.$refs.edit.setTenant(row, this.dicts)
|
|
|
+ this.$refs.edit.type = "edit"
|
|
|
+ this.dialog.title = this.$t("common.edit")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ fetch () {
|
|
|
+ this.loading = true
|
|
|
+ areaMgrApi.page(this.queryParams).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.lineList = res.data.records
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .space .box-card {
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+</style>
|