<template>
  <div class="app-container">
    <el-card shadow="always" style="width: 55%; margin: 0 auto">
      <ReleaseForm
        v-model="form"
        :isAdd="false"
        :labelWidth="labelWidth"
        ref="releaseForm"
      />
      <div :style="{ marginLeft: labelWidth + 'px' }">
        <el-button type="primary" @click="submitForm(0)">保存草稿</el-button>
        <el-button type="primary" @click="submitForm(1)">提交审核</el-button>
      </div>
    </el-card>
  </div>
</template>
<script setup>
import { achievementAdd } from "@/api/admin/expert/technology";
import ReleaseForm from "../components/ReleaseForm";
const { proxy } = getCurrentInstance();
const labelWidth = 140;
const form = reactive({
  mode: 1,
});
function submitForm(is_submit) {
  form["is_submit"] = is_submit;
  if (proxy.$refs.releaseForm.submitForm()) {
    console.log(form);
    // achievementAdd(form).then((res) => {
    //   proxy.$modal.msgSuccess("新增成功");
    //   proxy.$router.go(-1);
    // });
  } else {
    console.log("校验未通过");
  }
}
</script>