<template>
  <div class="app-container">
    <!-- 筛选条件 -->
    <div>
      <el-form label-width="70px" size="small" label-position="left">
        <el-row :gutter="20">
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="名称" prop="account">
              <el-input placeholder="请输入名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="型号" prop="nickname">
              <el-input placeholder="请输入型号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="编码" prop="account">
              <el-input placeholder="请输入编码"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="体积" prop="nickname">
              <el-input placeholder="请输入体积"></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="24" :lg="24" class="tr">
            <el-form-item label="">
              <el-button size="small" @click="resetScreenForm">清空</el-button>
              <el-button size="small" type="primary" @click="submitScreenForm"
                >搜索</el-button
              >
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 按钮 -->
    <div class="btn-group clearfix">
      <div class="fl">
        <el-button type="primary" size="small">新增</el-button>
        <el-button type="primary" size="small">编辑</el-button>
        <el-button type="primary" size="small">删除</el-button>
      </div>
      <div class="fr">
        <el-button type="primary" size="small">导入</el-button>
        <el-button type="primary" size="small">导出</el-button>
        <el-button type="primary" size="small">打印</el-button>
      </div>
    </div>
    <div class="mymain-container">
      <!-- 列表 -->
      <div class="table">
        <el-table
          v-loading="listLoading"
          :data="dataList"
          element-loading-text="Loading"
          border
          fit
          highlight-current-row
          stripe
        >
          <el-table-column type="selection" align="center"></el-table-column>
          <el-table-column
            align="center"
            label="内机名称"
            prop="name"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="内机型号"
            prop="number"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="编码"
            prop="code"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="内机体积"
            prop="volume"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="外机名称"
            prop="outName"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="外机型号"
            prop="outNumber"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="外机编码"
            prop="updateUser"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="外机体积"
            prop="outVolume"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="配件1"
            prop="partsOne"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="配件2"
            prop="partsTwo"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="创建人"
            prop="create"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="创建时间"
            prop="createDate"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="更新人"
            prop="update"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="更新时间"
            prop="updateDate"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>

          <el-table-column
            align="center"
            label="操作"
            min-width="160"
            show-overflow-tooltip
          >
            <el-button type="text" class="textColor" @click="editFn"
              >编辑</el-button
            >
            <el-button type="text" class="textColor">删除</el-button>
          </el-table-column>
        </el-table>
      </div>
      <!-- 分页 -->
      <div class="fr">
        <el-pagination
          :current-page="currentPage"
          :page-sizes="[10, 20, 30, 50]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="listTotal"
        >
        </el-pagination>
      </div>
    </div>

    <!-- 弹窗 -->
    <el-dialog
      title="产品信息"
      :visible.sync="showDialogForm"
      width="30%"
      :show-close="false"
      :close-on-click-modal="false"
    >
      <el-form ref="form" :model="diaLogForm" label-width="100px">
        <el-form-item label="内机名称">
          <el-select
            v-model="diaLogForm.positionName"
            multiple
            placeholder="请选择"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="内机型号">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="内机编码">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="内机体积">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="外机名称">
          <el-select
            v-model="diaLogForm.positionName"
            multiple
            placeholder="请选择"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="外机机型号">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="外机编码">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="外机体积">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="配件1">
          <el-input v-model="diaLogForm.alert"></el-input>
        </el-form-item>
        <el-form-item label="配件2">
          <el-input v-model="diaLogForm.alert"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showDialogForm = false">取 消</el-button>
        <el-button type="primary" @click="showDialogForm = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      currentPage: 1, // 当前页码
      pageSize: 10, // 每页数量
      listTotal: 0, // 列表总数
      options: [
        {
          value: "选项1",
          label: "1",
        },
        {
          value: "选项2",
          label: "2",
        },
        {
          value: "选项3",
          label: "3",
        },
        {
          value: "选项4",
          label: "4",
        },
        {
          value: "选项5",
          label: "5",
        },
      ],
      diaLogForm: {
        storeName: "",
        positionName: [],
        alert: "",
        text: "",
      },
      showDialogForm: false,
      dataList: [
        {
          name: "新风机XXX内机",
          number: "DSAFSAF232312321",
          code: "DSAFSAF232312321",
          volume: "23M^3",
          outName: "新风机XXX外机",
          outNumber: "DSAFSAF232312321",
          updateUser: "DSAFSAF232312321",
          outVolume: "23M^3",
          partsOne: "",
          partsTwo: "",
          create: "LID",
          createDate: "2022-09-12 12:21",
          update: "LID",
          updateDate: "2022-09-12 12:21",
        },
        {
          name: "新风机XXX内机",
          number: "DSAFSAF232312321",
          code: "DSAFSAF232312321",
          volume: "23M^3",
          outName: "新风机XXX外机",
          outNumber: "DSAFSAF232312321",
          updateUser: "DSAFSAF232312321",
          outVolume: "23M^3",
          partsOne: "",
          partsTwo: "",
          create: "LID",
          createDate: "2022-09-12 12:21",
          update: "LID",
          updateDate: "2022-09-12 12:21",
        },
        {
          name: "新风机XXX内机",
          number: "DSAFSAF232312321",
          code: "DSAFSAF232312321",
          volume: "23M^3",
          outName: "新风机XXX外机",
          outNumber: "DSAFSAF232312321",
          updateUser: "DSAFSAF232312321",
          outVolume: "23M^3",
          partsOne: "",
          partsTwo: "",
          create: "LID",
          createDate: "2022-09-12 12:21",
          update: "LID",
          updateDate: "2022-09-12 12:21",
        },
        {
          name: "新风机XXX内机",
          number: "DSAFSAF232312321",
          code: "DSAFSAF232312321",
          volume: "23M^3",
          outName: "新风机XXX外机",
          outNumber: "DSAFSAF232312321",
          updateUser: "DSAFSAF232312321",
          outVolume: "23M^3",
          partsOne: "",
          partsTwo: "",
          create: "LID",
          createDate: "2022-09-12 12:21",
          update: "LID",
          updateDate: "2022-09-12 12:21",
        },
        {
          name: "新风机XXX内机",
          number: "DSAFSAF232312321",
          code: "DSAFSAF232312321",
          volume: "23M^3",
          outName: "新风机XXX外机",
          outNumber: "DSAFSAF232312321",
          updateUser: "DSAFSAF232312321",
          outVolume: "23M^3",
          partsOne: "",
          partsTwo: "",
          create: "LID",
          createDate: "2022-09-12 12:21",
          update: "LID",
          updateDate: "2022-09-12 12:21",
        },
      ],
      searchForm: {
        positionName: "",
        storeName: "",
      },
    };
  },
  methods: {
    editFn() {
      this.showDialogForm = true;
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-select {
  width: 100%;
}
</style>