<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="项目编号" prop="projectNo">
        <el-input
          v-model="queryParams.fileName"
          placeholder="请输入文件名称"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="页面号" prop="pageno">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入页面号"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini">
          搜索
        </el-button>
        <el-button icon="el-icon-refresh" size="mini">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddClick">
          新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="btnClick">
          删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="btnClick">
          导入
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-download" size="mini" @click="btnClick">
          导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
    </el-row>

    <el-table :data="listData" border>
      <el-table-column label="序号" type="index" align="center">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目编号" align="center" prop="key1" />
      <el-table-column label="项目名称" align="center" prop="key2" />
      <el-table-column label="页面号" align="center" prop="key3" />
      <el-table-column label="文件名称" align="center" prop="key4" />
      <el-table-column label="上传时间" align="center" prop="key5" />
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog :title="dialogTitle" :visible.sync="visible" width="800px" append-to-body>
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="项目编号" prop="key1">
          <el-input v-model="form.key1" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="项目名称" prop="key2">
          <el-input v-model="form.key2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="页面号" prop="key3">
          <el-input v-model="form.key3" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="文件名称" prop="key4">
          <el-input v-model="form.key4" placeholder="请输入" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "InternalFile",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 表单参数
      form: {},
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      listData: [
        {
          key1: "111111111111",
          key2: "科研档案",
          key3: "Y5284165210",
          key4: "2025年科研档案汇集",
          key5: "2023-06-15 22:48:47"
        },
      ],
      visible: false,
      formData: {},
      dialogTitle: "新增"
    };
  },
  methods: {
    handleQuery() {},
    getList() {},
    btnClick() {
      this.$message.warning("功能建设中...");
    },
    handleAddClick() {
      this.visible = true;
    },
    submitForm() {
      this.$message.warning("功能建设中...");
    },
    cancel() {
      this.visible = false;
    }
  },
};
</script>
