<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="demo-form-inline">
      <el-form-item label="设备类型">
        <el-select v-model="queryParams.region" placeholder="活动区域">
          <el-option label="区域一" value="shanghai"></el-option>
          <el-option label="区域二" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="设备名称">
        <el-input v-model="queryParams.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="设备编码">
        <el-input v-model="queryParams.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="生产厂家">
        <el-input v-model="queryParams.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</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="handleAdd"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleExport"
          >导入</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          >导出</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-upload" size="mini"
          >模型同步</el-button
        >
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column
        type="selection"
        width="55"
        align="center"
        fixed="left"
      />
      <el-table-column prop="date" label="设备名称" align="center" fixed="left">
      </el-table-column>
      <el-table-column prop="name" label="设备编码" align="center" fixed="left">
      </el-table-column>
      <el-table-column
        prop="address"
        label="视频NVR编码"
        align="center"
        fixed="left"
      >
      </el-table-column>
      <el-table-column
        prop="address"
        label="生产厂家"
        align="center"
        fixed="left"
      >
      </el-table-column>
      <el-table-column
        prop="address"
        label="主系统编号"
        align="center"
        fixed="left"
      >
      </el-table-column>
      <el-table-column prop="address" label="变电站名称" align="center">
      </el-table-column>
      <el-table-column prop="address" label="变电站编码" align="center">
      </el-table-column>
      <el-table-column prop="address" label="区域名称" align="center">
      </el-table-column>
      <el-table-column prop="address" label="设备类型" align="center">
      </el-table-column>
      <el-table-column prop="address" label="使用单位" align="center">
      </el-table-column>
      <el-table-column prop="address" label="设备来源" align="center">
      </el-table-column>
      <el-table-column prop="address" label="生产日期" align="center">
      </el-table-column>
      <el-table-column prop="address" label="出厂编号" align="center">
      </el-table-column>
      <el-table-column prop="address" label="是否转轮" align="center">
      </el-table-column>
      <el-table-column prop="address" label="使用类型" align="center">
      </el-table-column>
      <el-table-column prop="address" label="安装位置" align="center">
      </el-table-column>
      <el-table-column prop="address" label="相对空间位置x" align="center">
      </el-table-column>
      <el-table-column prop="address" label="相对空间位置y" align="center">
      </el-table-column>
      <el-table-column prop="address" label="相对空间位置z" align="center">
      </el-table-column>
      <el-table-column prop="address" label="所属机器人" align="center">
      </el-table-column>
      <el-table-column prop="address" label="ip地址" align="center">
      </el-table-column>
      <el-table-column prop="address" label="端口" align="center">
      </el-table-column>
      <el-table-column prop="address" label="用户" align="center">
      </el-table-column>
      <el-table-column prop="address" label="密码" align="center">
      </el-table-column>
      <el-table-column label="操作" align="center" fixed="right" width="200px">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            >删除</el-button
          >
          <el-button size="mini" type="text" icon="el-icon-s-promotion"
            >通道</el-button
          >
          <el-button size="mini" type="text" icon="el-icon-upload"
            >上传图片</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
    />

    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="70%"
      :before-close="handleClose"
    >
      <el-row :gutter="10">
        <el-form
          :model="dialogForm"
          class="demo-form-inline"
          label-position="right"
          label-width="110px"
        >
          <el-col span="6">
            <el-form-item label="区域名称">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择区域"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="设备类型">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择类型"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="设备名称">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入设备名称"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="设备编码">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入设备编码"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="设备型号">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入设备型号"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="生产厂家">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入生产"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="主系统" class="mainSystem">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择主系统"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col span="6">
            <el-form-item label="使用单位">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入使用单位"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="设备来源">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入设备来源"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="生产日期">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入生产日期"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="出厂编号">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入出厂编号"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="是否转轮">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="使用类型">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择使用类型"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="视频类型">
              <el-select
                v-model="dialogForm.region"
                placeholder="请选择视频类型"
                style="display: block; width: 100%"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="安装位置">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入安装位置"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="所属机器人">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入所属机器人"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="相对空间位置x">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入相对空间位置x"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="相对空间位置y">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入相对空间位置y"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="相对空间位置z">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入相对空间位置 z"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="ip地址">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入ip地址"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="端口">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入端口"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="用户">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入用户"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="密码">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入密码"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="视频NVR编码">
              <el-input
                v-model="dialogForm.region"
                placeholder="请输入视频NVR编码"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>

      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script >
export default {
  name: "equipment",
  data() {
    return {
      queryParams: {},
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      total: 20,
      dialogVisible: false,
      title: "新增",
      dialogForm: {},
    };
  },
  methods: {
    handleClose() {
      this.dialogVisible = false;
    },
    handleAdd(){
      this.dialogVisible = true;
    }
  },
};
</script>

<style lang="scss" scoped>
.operate-left {
  height: 30px;
  display: flex;
  justify-content: flex-end;
  i {
    font-size: 20px;
    margin-left: 5px;
    cursor: pointer;
  }
}
::v-deep .el-tree-node:focus > .el-tree-node__content {
  color: #4a9de7 !important;
  // color: #fff !important;
}
/*节点失焦时的背景颜色*/
//   .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content{
//     background-color: #4a9de7 !important;
//     color: #fff !important;
//   }
.grid-content-right {
  padding: 0 20%;
}
.titleName {
  font-size: 26px;
  padding: 10px;
}
.number-title {
  margin-left: 10px;
}
.serial-number {
  color: #999;
  font-size: 12px;
  margin-bottom: 30px;
  margin-top: 20px;
}
.mainSystem {
  ::v-deep.el-form-item__label {
    color: rgb(255, 200, 0);
  }
}
</style>
