|
@@ -0,0 +1,212 @@
|
|
|
+<template>
|
|
|
+ <div class="org-set">
|
|
|
+ <el-dialog
|
|
|
+ title="机构设置"
|
|
|
+ class="page-dialog"
|
|
|
+ :visible.sync="modalIsShow"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ append-to-body
|
|
|
+ fullscreen
|
|
|
+ @opened="visibleChange"
|
|
|
+ >
|
|
|
+ <div class="part-box part-box-filter part-box-flex">
|
|
|
+ <el-form ref="FilterForm" label-position="left" inline>
|
|
|
+ <el-form-item label="机构:">
|
|
|
+ <NormalSelect
|
|
|
+ v-model="filter.orgId"
|
|
|
+ valueStr="code"
|
|
|
+ :func="orgQuery"
|
|
|
+ filterable
|
|
|
+ page
|
|
|
+ placeholder="请选择机构"
|
|
|
+ ></NormalSelect>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构名称前缀:">
|
|
|
+ <el-input
|
|
|
+ style="width: 180px"
|
|
|
+ v-model.trim="filter.orgNameStartWith"
|
|
|
+ placeholder="机构名称前缀"
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="应用类型:">
|
|
|
+ <NormalSelect
|
|
|
+ v-model="filter.appType"
|
|
|
+ :init="true"
|
|
|
+ @getOptions="getAppTypeOptions"
|
|
|
+ :func="appTypeList"
|
|
|
+ valueStr="code"
|
|
|
+ placeholder="请选择应用类型"
|
|
|
+ ></NormalSelect>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('LLM_ORG_CONFIG_INSERT')"
|
|
|
+ type="success"
|
|
|
+ @click="toAdd"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
+ <el-table ref="TableList" :data="dataList" v-loading="loading">
|
|
|
+ <el-table-column prop="org" label="机构">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.org.name }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="model" label="模型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.model.name }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="supplier" label="模型供应商">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.supplier.name }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="promptTemplate" label="提示词模板">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.promptTemplate.remark }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="appType" label="应用类型"> </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ class-name="action-column"
|
|
|
+ label="操作"
|
|
|
+ width="200"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('LLM_ORG_CONFIG_EDIT')"
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="addCount(scope.row)"
|
|
|
+ >增加许可次数</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total,prev, pager, next"
|
|
|
+ :current-page="current"
|
|
|
+ :total="total"
|
|
|
+ :page-size="size"
|
|
|
+ @current-change="toPage"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <ModifyOrgSet
|
|
|
+ :instance="curOrgSet"
|
|
|
+ ref="ModifyOrgSet"
|
|
|
+ @modified="toPage(1)"
|
|
|
+ ></ModifyOrgSet>
|
|
|
+ <AddCount
|
|
|
+ :instance="curOrgSet"
|
|
|
+ ref="AddCount"
|
|
|
+ @modified="toPage(1)"
|
|
|
+ ></AddCount>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { orgSetListQuery, orgQuery, appTypeList } from "../../api";
|
|
|
+import NormalSelect from "@/components/NormalSelect.vue";
|
|
|
+import ModifyOrgSet from "./ModifyOrgSet.vue";
|
|
|
+import AddCount from "./AddCount.vue";
|
|
|
+export default {
|
|
|
+ name: "OrgSet",
|
|
|
+ components: { NormalSelect, ModifyOrgSet, AddCount },
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ appTypeList,
|
|
|
+ orgQuery,
|
|
|
+ modalIsShow: false,
|
|
|
+ loading: false,
|
|
|
+ dataList: [],
|
|
|
+ curOrgSet: {},
|
|
|
+ filter: {
|
|
|
+ orgCode: "",
|
|
|
+ orgNameStartWith: "",
|
|
|
+ appType: "",
|
|
|
+ modelId: "",
|
|
|
+ },
|
|
|
+ appTypeOptions: [],
|
|
|
+ current: 1,
|
|
|
+ size: this.GLOBAL.pageSize,
|
|
|
+ total: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getAppTypeOptions(arr) {
|
|
|
+ this.appTypeOptions = arr;
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.modalIsShow = false;
|
|
|
+ },
|
|
|
+ open() {
|
|
|
+ this.modalIsShow = true;
|
|
|
+ },
|
|
|
+ toPage(page) {
|
|
|
+ this.current = page;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ const datas = {
|
|
|
+ ...this.filter,
|
|
|
+ pageNumber: this.current,
|
|
|
+ pageSize: this.size,
|
|
|
+ };
|
|
|
+ orgSetListQuery(datas).then((res) => {
|
|
|
+ this.dataList = res?.records || [];
|
|
|
+ this.total = res.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async visibleChange() {
|
|
|
+ if (this.filter.appType) {
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toAdd() {
|
|
|
+ this.curOrgSet = {};
|
|
|
+ this.$refs.ModifyOrgSet.open();
|
|
|
+ },
|
|
|
+ toEdit(row) {
|
|
|
+ this.curOrgSet = row;
|
|
|
+ this.$refs.ModifyOrgSet.open();
|
|
|
+ },
|
|
|
+ addCount(row) {
|
|
|
+ this.curOrgSet = row;
|
|
|
+ this.$refs.AddCount.open();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ "filter.appType"(val) {
|
|
|
+ if (val) {
|
|
|
+ this.toPage(1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|