<template>
  <app-sign
    @sign-success="signSuccess"
    :file-path="selectdata.f_survey_user_sign"
    :selectdata = "selectdata"
    :blobid="selectdata.defname === '通气点火' ? selectdata.f_blobid : selectdata.f_process_id"
    :defname="selectdata.defname"
    :type="selectdata.defname + title"
    @sign-clean="signClean"
    :isclean="mark === 0 ? true : false"
    :issign="mark === 0 ? true : false"
  ></app-sign>
</template>
<script>
import {HttpResetClass} from 'vue-client'
import Vue from "vue";

export default {
  title: '用户签字',
  props: {
    selectdata: {
      type: Object
    },
    mark: {
      type: Number,
      default: 0
    },
    title: {
      type: String
    }
  },
  data () {
    return {
    }
  },
  ready () {
  },
  methods: {
    signClean () {
      this.selectdata.f_survey_user_sign = null
    },
    signSuccess (fileUrl) {
      console.log('==============签字回调==================')
      console.log(fileUrl)
      if (this.selectdata.defname === '现场勘察') {
        this.selectdata.f_survey_user_sign = fileUrl
      }
      if (this.selectdata.defname === '工程施工') {
        this.selectdata.f_construction_sign = fileUrl
      }
      if (this.selectdata.defname === '安检维修施工') {
        this.selectdata.f_construction_sign = fileUrl
      }
    }
  },
  events: {
  },
  computed: {
  },
  watch: {
  }
}
</script>
<style scoped lang="less">
</style>
