ModelSupplierManage.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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="createTime" label="创建时间">
  32. <span slot-scope="scope">{{
  33. scope.row.createTime | timestampFilter
  34. }}</span>
  35. </el-table-column>
  36. <el-table-column prop="updateTime" label="修改时间">
  37. <span slot-scope="scope">{{
  38. scope.row.updateTime | timestampFilter
  39. }}</span>
  40. </el-table-column>
  41. <el-table-column
  42. v-if="
  43. checkPrivilege('LLM_SUPPLIER_EDIT') ||
  44. checkPrivilege('LLM_MODEL_VIEW')
  45. "
  46. class-name="action-column"
  47. label="操作"
  48. width="220"
  49. fixed="right"
  50. >
  51. <template slot-scope="scope">
  52. <el-button
  53. v-if="checkPrivilege('LLM_SUPPLIER_EDIT')"
  54. class="btn-primary"
  55. type="text"
  56. @click="toEdit(scope.row)"
  57. >编辑</el-button
  58. >
  59. <el-button
  60. v-if="checkPrivilege('LLM_MODEL_VIEW')"
  61. class="btn-primary"
  62. type="text"
  63. @click="toModelManage(scope.row)"
  64. >模型管理</el-button
  65. >
  66. <el-button
  67. class="btn-primary"
  68. type="text"
  69. @click="toCueWord(scope.row)"
  70. >提示词模板</el-button
  71. >
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. <modify-supplier
  77. ref="ModifySupplier"
  78. :instance="curRow"
  79. @modified="getList"
  80. ></modify-supplier>
  81. <ModelManage ref="ModelManage" :curRow="curRow"></ModelManage>
  82. <OrgSet ref="OrgSet"></OrgSet>
  83. <CueWordTpl
  84. :key="curWordDialogKey"
  85. ref="CueWordTpl"
  86. @modified="getList"
  87. :supplierInfo="curRow"
  88. ></CueWordTpl>
  89. </div>
  90. </template>
  91. <script>
  92. import { modelSupplierListQuery } from "../api";
  93. import ModifySupplier from "./ModifySupplier.vue";
  94. import ModelManage from "./ModelManage/index.vue";
  95. import OrgSet from "./OrgSet/index.vue";
  96. import CueWordTpl from "./ModelManage/CueWordTpl/index.vue";
  97. export default {
  98. name: "model-supplier",
  99. components: { ModifySupplier, ModelManage, OrgSet, CueWordTpl },
  100. data() {
  101. return {
  102. dataList: [],
  103. curRow: {},
  104. loading: false,
  105. curWordDialogKey: Math.random() + "",
  106. };
  107. },
  108. created() {
  109. this.initData();
  110. },
  111. methods: {
  112. async getList() {
  113. this.loading = true;
  114. const data = await modelSupplierListQuery();
  115. this.dataList = data;
  116. this.loading = false;
  117. },
  118. initData() {
  119. this.getList();
  120. },
  121. toAdd() {
  122. this.curRow = {};
  123. this.$refs.ModifySupplier.open();
  124. },
  125. toEdit(row) {
  126. this.curRow = row;
  127. this.$refs.ModifySupplier.open();
  128. },
  129. toModelManage(row) {
  130. this.curRow = row;
  131. this.$refs.ModelManage.open();
  132. },
  133. orgSet() {
  134. this.$refs.OrgSet.open();
  135. },
  136. toCueWord(row) {
  137. this.curRow = row;
  138. this.curWordDialogKey = Math.random() + "";
  139. setTimeout(() => {
  140. this.$refs.CueWordTpl.open();
  141. }, 30);
  142. },
  143. },
  144. };
  145. </script>
  146. <style></style>