<template>
  <div>

<!--    <el-form  label-width="80px" :model="engine"  :inline="true" class="demo-form-inline" size="small">-->
<!--      <el-form-item label="规则名称">-->
<!--        <el-input v-model="engine.name"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="规则类型">-->
<!--        <el-input v-model="engine.type"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="是否激活">-->
<!--        <el-input v-model="engine.isActivate"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="规则状态">-->
<!--        <el-input v-model="engine.status"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-button @click="findSelectSourceList()">-->
<!--        查询-->
<!--      </el-button>-->
<!--    </el-form>-->


<!--    <el-button-->
<!--      v-hasPermi="['tool:gen:import']"-->
<!--      icon="el-icon-upload"-->
<!--      plain-->
<!--      size="mini"-->
<!--      type="info"-->
<!--      @click="findSelectSourceExport"-->
<!--    >导出-->
<!--    </el-button>-->


<!--    <el-button-->
<!--      icon="el-icon-delete"-->
<!--      plain-->
<!--      size="mini"-->
<!--      type="danger"-->
<!--      @click="insertAdd()"-->
<!--    >新增-->
<!--    </el-button>-->


<!--    <el-dialog title="添加数据源接入" :visible.sync="dialogFormVisible">-->

<!--      <el-form :model="sourceAddReq">-->
<!--        <el-form-item label="接入源名称">-->
<!--          <el-input v-model="sourceAddReq.dataResourceName"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据来源系统名称">-->
<!--          <el-input v-model="sourceAddReq.dataSourcesSystemName"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="主机地址">-->
<!--          <el-input v-model="sourceAddReq.host"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="主机端口">-->
<!--          <el-input v-model="sourceAddReq.port"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据接入类型">-->
<!--          <el-input v-model="sourceAddReq.databaseType"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据库名称">-->
<!--          <el-input v-model="sourceAddReq.databaseName"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据库用户">-->
<!--          <el-input v-model="sourceAddReq.username"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据库密码">-->
<!--          <el-input v-model="sourceAddReq.password"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="数据连接参数">-->
<!--          <el-input v-model="sourceAddReq.connectionParams"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="初始化连接数量">-->
<!--          <el-input v-model="sourceAddReq.initLinkNum"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="最大连接数量">-->
<!--          <el-input v-model="sourceAddReq.maxLinkNum"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="最大等待时间">-->
<!--          <el-input v-model="sourceAddReq.maxWaitTime"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="最大等待次数">-->
<!--          <el-input v-model="sourceAddReq.maxWaitTimes"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="备注">-->
<!--          <el-input v-model="sourceAddReq.remark"></el-input>-->
<!--        </el-form-item>-->

<!--      </el-form>-->


<!--      <div slot="footer" class="dialog-footer">-->
<!--        <el-button @click="dialogFormVisible = false">测试</el-button>-->
<!--        <el-button @click="dialogFormVisible = false">取 消</el-button>-->
<!--        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>-->
<!--      </div>-->
<!--    </el-dialog>-->






    <el-table
      :data="arr"
      style="width: 100%"
      >


      <el-table-column label="编号" prop="id"></el-table-column>
      <el-table-column label="名称" prop="name"></el-table-column>
      <el-table-column label="类型" prop="type">
        <template v-slot="scope">
          <span v-if="scope.row.type==1">数据字段</span>
          <span v-if="scope.row.type==2">基本类型</span>
          <span v-if="scope.row.type==3">时间类型</span>
          <span v-if="scope.row.type==4">普通类型</span>
        </template>
      </el-table-column>
      <el-table-column label="作用域" prop="scope"></el-table-column>
      <el-table-column label="引擎编码" prop="engineCode"></el-table-column>
      <el-table-column label="是否激活" prop="isActivate"></el-table-column>
      <el-table-column label="状态" prop="status">

        <template v-slot="scope">
          <span v-if="status==1">开启</span>
          <span v-if="status==2">关闭</span>
        </template>

      </el-table-column>
      <el-table-column label="描述" prop="description"></el-table-column>




      <el-table-column
        align="right">
        <template slot-scope="scope">
          <el-button
            icon="el-icon-pear"
            size="mini"
            type="text"
            @click="update(scope.row)">修改</el-button>

          <el-button
            icon="el-icon-delete"
            size="mini"
            type="text"
            @click="handleDelete(scope.row)">删除</el-button>

          <el-button
            icon="el-icon-service"
            size="mini"
            type="text"
            @click="struceure(scope.row)">同步资产结构</el-button>

          <el-button
            icon="el-icon-aim"
            size="mini"
            type="text"
            @click="text(scope.row)">测试连接</el-button>
        </template>

      </el-table-column>

    </el-table>







  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）,
//例如：import 《组件名称》 from '《组件路径》,
import {insertAdd} from "@/api/etl/switch";
import {selectEngineList} from "@/api/engine/engine";
import {selectList} from "@/api/pay/customer";
export default {
  //import引入的组件需要注入到对象中才能使用"
  components: {},
  props: {},
  data() {
    //这里存放数据"

    return {
      // dialogFormVisible:false,
      // SourceReq:{
      //
      // },
      // engine:{
      //
      // },
      arr:[],
    };
  },
  //计算属性 类似于data概念",
  computed: {},
  //监控data中的数据变化",
  watch: {},
  //方法集合",
  methods: {
    selectList,
    // insertAdd(){
    //   this.dialogFormVisible=true
    // },
    findSelectSourceList(){
      selectEngineList().then(res=>{
          this.arr=res.data;
      })
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）",
  created() {
    this.findSelectSourceList();
  },
  //生命周期 - 挂载完成（可以访问DOM元素）",
  mounted() {
  },
  beforeCreate() {
  }, //生命周期 - 创建之前",
  beforeMount() {
  }, //生命周期 - 挂载之前",
  beforeUpdate() {
  }, //生命周期 - 更新之前",
  updated() {
  }, //生命周期 - 更新之后",
  beforeDestroy() {
  }, //生命周期 - 销毁之前",
  destroyed() {
  }, //生命周期 - 销毁完成",
  activated() {
  } //如果页面有keep-alive缓存功能，这个函数会触发",
};
</script>
<style scoped>

</style>
