ModelSupplierManage.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="model-supplier">
  3. <div
  4. class="part-box part-box-filter part-box-flex"
  5. style="padding-bottom: 20px"
  6. >
  7. <div>
  8. <el-button
  9. v-if="checkPrivilege('LLM_SUPPLIER_INSERT')"
  10. type="success"
  11. @click="toAdd"
  12. >新增</el-button
  13. >
  14. <el-button
  15. v-if="checkPrivilege('LLM_ORG_CONFIG_VIEW')"
  16. type="primary"
  17. @click="orgSet"
  18. >机构设置</el-button
  19. >
  20. </div>
  21. <div>
  22. <el-tooltip effect="dark" content="刷新" placement="bottom">
  23. <el-button icon="el-icon-refresh-right" @click="getList"></el-button>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. <div class="part-box part-box-pad">
  28. <el-table ref="TableList" :data="dataList" v-loading="loading">
  29. <el-table-column prop="id" label="ID"></el-table-column>
  30. <el-table-column prop="name" label="名称"> </el-table-column>
  31. <el-table-column prop="qps" label="QPS限流"> </el-table-column>
  32. <el-table-column prop="createTime" label="创建时间">
  33. <span slot-scope="scope">{{
  34. scope.row.createTime | timestampFilter
  35. }}</span>
  36. </el-table-column>
  37. <el-table-column prop="updateTime" label="修改时间">
  38. <span slot-scope="scope">{{
  39. scope.row.updateTime | timestampFilter
  40. }}</span>
  41. </el-table-column>
  42. <el-table-column
  43. v-if="
  44. checkPrivilege('LLM_SUPPLIER_EDIT') ||
  45. checkPrivilege('LLM_MODEL_VIEW')
  46. "
  47. class-name="action-column"
  48. label="操作"
  49. width="120"
  50. fixed="right"
  51. >
  52. <template slot-scope="scope">
  53. <el-button
  54. v-if="checkPrivilege('LLM_SUPPLIER_EDIT')"
  55. class="btn-primary"
  56. type="text"
  57. @click="toEdit(scope.row)"
  58. >编辑</el-button
  59. >
  60. <el-button
  61. v-if="checkPrivilege('LLM_MODEL_VIEW')"
  62. class="btn-primary"
  63. type="text"
  64. @click="toModelManage(scope.row)"
  65. >模型管理</el-button
  66. >
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. </div>
  71. <modify-supplier
  72. ref="ModifySupplier"
  73. :instance="curRow"
  74. @modified="getList"
  75. ></modify-supplier>
  76. <ModelManage ref="ModelManage" :curRow="curRow"></ModelManage>
  77. <OrgSet ref="OrgSet"></OrgSet>
  78. </div>
  79. </template>
  80. <script>
  81. import { modelSupplierListQuery } from "../api";
  82. import ModifySupplier from "./ModifySupplier.vue";
  83. import ModelManage from "./ModelManage/index.vue";
  84. import OrgSet from "./OrgSet/index.vue";
  85. export default {
  86. name: "model-supplier",
  87. components: { ModifySupplier, ModelManage, OrgSet },
  88. data() {
  89. return {
  90. dataList: [],
  91. curRow: {},
  92. loading: false,
  93. };
  94. },
  95. created() {
  96. this.initData();
  97. },
  98. methods: {
  99. async getList() {
  100. this.loading = true;
  101. const data = await modelSupplierListQuery();
  102. this.dataList = data;
  103. this.loading = false;
  104. },
  105. initData() {
  106. this.getList();
  107. },
  108. toAdd() {
  109. this.curRow = {};
  110. this.$refs.ModifySupplier.open();
  111. },
  112. toEdit(row) {
  113. this.curRow = row;
  114. this.$refs.ModifySupplier.open();
  115. },
  116. toModelManage(row) {
  117. this.curRow = row;
  118. this.$refs.ModelManage.open();
  119. },
  120. orgSet() {
  121. this.$refs.OrgSet.open();
  122. },
  123. },
  124. };
  125. </script>
  126. <style></style>