haoxuan
2023-10-11 a1a6630f2eabfc78a379b5808b1bf7231a084d0b
src/components/AddControl.vue
@@ -54,17 +54,16 @@
export default {
  components: {},
  props: {
    id:{
      type: [Number,String],
    Arr:{
      type: [Array],
      default: () => {
        return '';
        return [];
      },
    }
  },
  data() {
    return {
      islook: false,
      Arr:[]
    };
  },
  mounted() {
@@ -73,19 +72,11 @@
  watch: {
    islook(val) {
      if (val) {
        this.getStartInfo()
      }
    },
  },
  methods: {
    getStartInfo(){
      startTask({id:this.id}).then(res=>{
        if(res.code==200){
          this.Arr=res.data.params;
        }
      })
    },
    validatorNum(rule, value, callback) {
      if (value) {
        if (value == undefined || value == null) {
@@ -105,13 +96,17 @@
    onSubmit() {
      
      sendProcessParams({id:this.id}).then(res=>{
        if(res.code==200){
          this.$message.success("下发成功!");
          this.shutdown();
        }
      })
      if(this.id){
        sendProcessParams({id:this.id}).then(res=>{
          if(res.code==200){
            this.$message.success("下发成功!");
            this.shutdown();
          }
        })
      }else{
        this.$message.error("当前设备没有工序!");
      }
    },
    shutdown() {
      this.islook = false;