<template>
  <div class="app-container">
    <div v-show="viewState ==1">
      <el-tabs class="my-tabs" v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane label="自主学习计划指导" name="roleList">
          <div class="container">
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column label="序号" width="70px" type="index" align="center">
              </el-table-column>
              <el-table-column label="操作" width="100px" align="center">
                <template slot-scope="scope">
                  <el-button  type="primary" size="mini" @click="editRow(scope.row)">
                    反馈
                  </el-button>
                  <!-- <el-button type="primary" size="mini" @click="detail(scope.row)">
                    查看
                  </el-button> -->
                </template>
              </el-table-column>
              <el-table-column prop="teacherNo" label="教师工号" align="center" />
              <el-table-column prop="studentNo" label="学生学号" align="center" />
              <el-table-column prop="planContent" label="学习计划" align="center" />
              <el-table-column prop="stateChinese" label="数据状态" align="center" />
              <el-table-column prop="plan0pinion" label="反馈意见" align="center" />
            </el-table>
          </div>
        </el-tab-pane>

        <el-dialog :title="dialogTitle + '学习计划'" :visible.sync="editDialog" width="40%">
          <table class="e-table" cellspacing="0">
            <tr>
              <td>教师工号</td>
              <td>
                <!-- <el-select v-model="form.type" class="addinputw" placeholder="请选择论坛类别" style="width:300px"
             @change="getType">
             <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue"
               :value="item.dictKey" />
           </el-select> -->
                <span>{{form.teacherNo}}</span>
                <!-- <el-input v-model="form.teacherNo" style="width: 300px"></el-input> -->
              </td>
            </tr>
            <tr>
              <td>学生学号</td>
              <td>
                <span>{{form.studentNo}}</span>
                <!-- <el-input v-model="form.studentNo" style="width: 300px"></el-input> -->
              </td>
            </tr>
            <tr>
              <td>学习计划内容</td>
              <td>
                <span>{{form.planContent}}</span>
                <!-- <el-input v-model="form.planContent" style="width: 300px"></el-input> -->
              </td>
            </tr>
            <tr>
              <td>反馈意见</td>
              <td>
                <!-- <span>{{form.planContent}}</span> -->
                <el-input v-model="form.planOpinion" style="width: 300px"></el-input>
              </td>
            </tr>
          </table>
          <div style="margin-top: 20px; text-align: center">
            <el-button type="primary" @click="save()">保存</el-button>
          </div>
        </el-dialog>
      </el-tabs>
    </div>
    <!-- <organizationManageInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" /> -->
  </div>
</template>

<script>
  import {
    selectSysPlanStudent,
  } from "@/api/system/datamapping/datamapping.js";
  // import organizationManageInfo from './organizationManageInfo.vue'
  export default {
    components: {
      // organizationManageInfo,
    },
    data() {
      return {
        viewState: 1,
        activeName: "roleList",
        dialogTitle: "",
        editDialog: false,
        form: {},
        formBackup: Object.assign({}, this.form),
        tableData: [],
      }
    },
    mounted() {
      this.getPageList();
    },
    methods: {
      getPageList() {
        // 获取列表
        selectSysPlanStudent().then((res) => {
          this.tableData = res.data;
        });
      },
      handleClick(tab, event) {
        if (tab.name == "addrole") {
          this.dialogTitle = "新增";
          this.roleForm = Object.assign({}, this.formBackup);
        } else {
          this.getPageList();
        }
      },
      save() {
        console.log("form", this.form)


          this.reset();
      },
      reset() {
        this.form = {};
      },
      editRow(row) {
        this.dialogTitle = "反馈";
        this.editDialog = true;
        this.form = Object.assign({}, row);
      },
    }
  };
</script>

<style scoped="scoped" lang="scss">
  .my-tabs {
    margin-top: 10px;
  }
</style>
