AiLib.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div id="aiLib w-full" style="width:100%">
  3. <div class="page-header">
  4. <div class="page-title">
  5. <el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="toBack" ></el-button>
  6. <el-divider direction="vertical"></el-divider>
  7. ai数据库
  8. <el-select v-model="aiTypeVal" @change="getNowAiLib" placeholder="请选择ai类型">
  9. <el-option
  10. v-for="item in aiTypeArr"
  11. :key="item.val"
  12. :label="item.text"
  13. :value="item.val"
  14. :disabled="item.disabled">
  15. </el-option>
  16. </el-select>
  17. <el-button icon="el-icon-search" type="primary" :loading="isLoading">搜索</el-button>
  18. </div>
  19. <div class="page-header-btn">
  20. </div>
  21. </div>
  22. <el-table :data="libList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header">
  23. <el-table-column prop="libraryId" label="id" ></el-table-column>
  24. <el-table-column prop="libraryName" label="数据库名称" min-width="160"></el-table-column>
  25. <el-table-column prop="version" label="数据库版本号" ></el-table-column>
  26. <el-table-column prop="arithmetic" label="对应算法" ></el-table-column>
  27. <el-table-column prop="total" label="id" ></el-table-column>
  28. <el-table-column label="操作" >
  29. <template slot-scope="scope">
  30. <el-button size="medium" @click="editLibHandle(scope.row)">编辑</el-button>
  31. </template>
  32. </el-table-column>
  33. </el-table>
  34. <el-pagination
  35. style="float: right"
  36. @size-change="handleSizeChange"
  37. @current-change="currentChange"
  38. :current-page="currentPage"
  39. :page-size="count"
  40. :page-sizes="[15, 25, 35, 50]"
  41. layout="total, sizes, prev, pager, next"
  42. :total="total"
  43. ></el-pagination>
  44. </div>
  45. </template>
  46. <script>
  47. import {toNumber} from "@/until/typeTool";
  48. import aiMap from "@/map/ai";
  49. export default {
  50. name: "AiLib",
  51. data(){return {
  52. isLoading: false,
  53. aiTypes: aiMap.aiTypes,
  54. aiTypeArr: aiMap.getAITypeArr(),
  55. triggerTypes: aiMap.triggerTypes,
  56. triggerTypeArr: aiMap.getTriggerTypeArr(),
  57. aiTypeVal: 0,
  58. arithmetic: this.$route.params.arithmetic,
  59. libList: [],
  60. currentPage: 1,
  61. count: 15,
  62. total: 1,
  63. }},
  64. methods:{
  65. toBack(){
  66. this.$router.back();
  67. if (this.deviceId === "" ) {
  68. this.beforeUrl = "/deviceList"
  69. }
  70. },
  71. getNowAiLib(){
  72. this.nowAiLib = this.aiLibList.filter(aiLib=>toNumber(aiLib.libraryId)===toNumber(this.aiTypeVal));
  73. this.libraryId = 0;
  74. this.triggerType = this.triggerTypes.unlimited;
  75. },
  76. searchLibList(){
  77. },
  78. /**
  79. * 编辑lib数据
  80. * @param row
  81. */
  82. editLibHandle(row){
  83. this.$router.push(`/libEdit/${row.libraryId}`);
  84. },
  85. currentChange: function (val) {
  86. this.currentPage = val;
  87. this.searchLibList();
  88. },
  89. handleSizeChange: function (val) {
  90. this.count = val;
  91. this.searchLibList();
  92. },
  93. }
  94. }
  95. </script>
  96. <style scoped>
  97. </style>