index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="app-container model-container">
  3. <search :addText="addText" @handle="handleSearch">
  4. <el-input v-model="params.name" style="width: 240px;margin-right: 10px" placeholder="请输入应用程序名称"/>
  5. <template #afterBtn>
  6. <el-button icon="Download">下载Agent</el-button>
  7. </template>
  8. </search>
  9. <div class="table-content">
  10. <el-table
  11. ref="multipleTableRef"
  12. :data="tableData"
  13. border
  14. style="width: 100%"
  15. >
  16. <el-table-column type="index" width="55" align="center" label="#"/>
  17. <el-table-column label="Date" width="120">
  18. <template #default="scope">{{ scope.row.date }}</template>
  19. </el-table-column>
  20. <el-table-column property="name" label="Name" width="120"/>
  21. <el-table-column property="address" label="Address"/>
  22. <el-table-column label="edit" width="120">
  23. <template #default="scope">
  24. <el-button link type="primary">编辑</el-button>
  25. <el-button link type="info">删除</el-button>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. </div>
  30. <pagination :total="total" :size="params.size" @size-change="sizeChange"/>
  31. </div>
  32. <el-dialog
  33. v-model="dialogVisible"
  34. :title="title"
  35. width="600"
  36. top="30vh"
  37. >
  38. <add-app-manage />
  39. <template #footer>
  40. <div class="dialog-footer">
  41. <el-button type="primary" @click="dialogVisible = false">
  42. 提交
  43. </el-button>
  44. <el-button @click="dialogVisible = false">取消</el-button>
  45. </div>
  46. </template>
  47. </el-dialog>
  48. </template>
  49. <script setup lang="ts">
  50. import search from "../../component/search.vue"
  51. import pagination from "../../component/pagination.vue"
  52. import addAppManage from "./component/addAppManage.vue"
  53. import {reactive, ref} from "vue";
  54. import {ElTable} from "element-plus"
  55. const title = ref<string>('添加应用程序')
  56. const dialogVisible = ref<boolean>(false)
  57. const total = ref<number>(100)
  58. const params = reactive({
  59. name: '',
  60. page: 1,
  61. size: 10,
  62. type: 0
  63. })
  64. const addText = "添加"
  65. const handleSearch = (event) => {
  66. switch (event) {
  67. case "add":
  68. dialogVisible.value = true
  69. title.value = "添加应用程序"
  70. break;
  71. }
  72. }
  73. interface User {
  74. date: string
  75. name: string
  76. address: string
  77. }
  78. const sizeChange = (event) => {
  79. }
  80. const multipleTableRef = ref<InstanceType<typeof ElTable>>()
  81. const tableData: User[] = [
  82. {
  83. date: '2016-05-03',
  84. name: 'Tom',
  85. address: 'No. 189, Grove St, Los Angeles',
  86. },
  87. {
  88. date: '2016-05-02',
  89. name: 'Tom',
  90. address: 'No. 189, Grove St, Los Angeles',
  91. },
  92. {
  93. date: '2016-05-04',
  94. name: 'Tom',
  95. address: 'No. 189, Grove St, Los Angeles',
  96. },
  97. {
  98. date: '2016-05-01',
  99. name: 'Tom',
  100. address: 'No. 189, Grove St, Los Angeles',
  101. },
  102. {
  103. date: '2016-05-08',
  104. name: 'Tom',
  105. address: 'No. 189, Grove St, Los Angeles',
  106. },
  107. {
  108. date: '2016-05-06',
  109. name: 'Tom',
  110. address: 'No. 189, Grove St, Los Angeles',
  111. },
  112. {
  113. date: '2016-05-07',
  114. name: 'Tom',
  115. address: 'No. 189, Grove St, Los Angeles',
  116. },
  117. ]
  118. </script>
  119. <style lang="scss">
  120. @import "../../model/css/css.scss";
  121. </style>