<template>
  <div>
    <Tinymce v-model="defaultValue" :height="660" placeholder="在这里输入文字" />
    <el-button type="primary" style="float:right;margin: 10px" @click="save">保存</el-button>
  </div>
</template>

<script>
import Tinymce from '../index.vue'
import {updateTechnology,getTechnologyInfo} from "../../../api/system/machinery"

export default {
  components: {
    Tinymce
  },
  props: {

  },
  data() {
    return {
      defaultValue: '',
      form:null,
    }
  },
  computed: {

  },
  watch: {

  },
  created() {
  this.getInfo()
  },
  mounted() {

  },
  methods: {
    getInfo(){
      getTechnologyInfo(this.$route.query.machineryId).then((response) => {
        this.form=response.data
        this.defaultValue=response.data.remark
      })
    },
    save(){
      this.form.remark=this.defaultValue
      updateTechnology(this.form).then(response => {
        console.log(response,'更新设备工艺')
        if(response.data){
          this.$message.success('保存成功')
        }
      })
    }
  }
}
</script>
