dongyukun
21 小时以前 e295922209fb87c6dcd68ea1560fd16c3e6d808c
src/views/ai/model/template/index.vue
@@ -8,31 +8,44 @@
      :inline="true"
      label-width="68px"
    >
      <el-form-item label="模型编号" prop="modelCode">
      <el-form-item label="问题编号" prop="questionCode">
        <el-input
          v-model="queryParams.modelCode"
          placeholder="请输入模型编号"
          v-model="queryParams.questionCode"
          placeholder="请输入问题编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="模型名称" prop="modelName">
      <el-form-item label="问题名称" prop="questionName">
        <el-input
          v-model="queryParams.modelName"
          placeholder="请输入模型名称"
          v-model="queryParams.questionName"
          placeholder="请输入问题名称"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="模型名称" prop="modelId">
        <el-select v-model="queryParams.modelId"
                   clearable
                   filterable
                   :fit-input-width="false" placeholder="请选择模型">
          <el-option
            v-for="item in aiModelList"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button @click="handleQuery">
          <Icon icon="ep:search" class="mr-5px" />
          <Icon icon="ep:search" class="mr-5px"/>
          搜索
        </el-button>
        <el-button @click="resetQuery">
          <Icon icon="ep:refresh" class="mr-5px" />
          <Icon icon="ep:refresh" class="mr-5px"/>
          重置
        </el-button>
        <el-button
@@ -41,7 +54,7 @@
          @click="openForm('create')"
          v-hasPermi="['ai:question-template:create']"
        >
          <Icon icon="ep:plus" class="mr-5px" />
          <Icon icon="ep:plus" class="mr-5px"/>
          新增
        </el-button>
      </el-form-item>
@@ -51,13 +64,16 @@
  <!-- 列表 -->
  <ContentWrap>
    <el-table v-loading="loading" :data="list">
      <el-table-column label="模型id" align="center" prop="modelId" min-width="100"/>
      <el-table-column label="问题编号" header-align="center" align="left" prop="questionCode" min-width="100"/>
      <el-table-column label="问题内容" align="center" prop="questionName" min-width="100"/>
      <el-table-column label="问题名称" header-align="center" align="left" prop="questionContent" min-width="200"/>
      <el-table-column label="输入个数" align="center" prop="isEnable" min-width="100"/>
      <el-table-column label="是否启用" align="center" prop="portLength" min-width="100"/>
      <el-table-column label="备注" header-align="center" align="left" prop="remark" min-width="200" />
      <el-table-column label="模型名称" align="center" prop="modelName" min-width="100"/>
      <el-table-column label="问题编号" align="center" prop="questionCode" min-width="100"/>
      <el-table-column label="问题名称" align="center" prop="questionName" min-width="100"/>
      <el-table-column label="输入个数" align="center" prop="dataLength" min-width="100"/>
      <el-table-column label="是否启用" align="center" prop="isEnable" min-width="100">
        <template #default="scope">
          <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.isEnable"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" min-width="200"/>
      <el-table-column label="操作" align="center" min-width="100" fixed="right">
        <template #default="scope">
          <el-button
@@ -89,15 +105,15 @@
  </ContentWrap>
  <!-- 表单弹窗:添加/修改 -->
  <TemplateForm ref="formRef" @success="getList" />
  <TemplateForm ref="formRef" @success="getList"/>
</template>
<script lang="ts" setup>
  import {DICT_TYPE, getIntDictOptions} from '@/utils/dict'
  import {dateFormatter} from '@/utils/formatTime'
  import download from '@/utils/download'
  import { DICT_TYPE } from '@/utils/dict'
  import * as AiQuestionTemplateApi from '@/api/ai/questiontemplate'
  import TemplateForm from './templateForm.vue'
  import * as AiModelApi from "@/api/ai/model/model";
  import {AiModelTypeEnum} from "@/views/ai/utils/constants";
  defineOptions({name: 'AiTemplate'})
@@ -107,15 +123,16 @@
  const loading = ref(true) // 列表的加载中
  const total = ref(0) // 列表的总页数
  const list = ref([]) // 列表的数据
  const aiModelList = ref([] as AiModelApi.ModelVO[])
  const queryParams = reactive({
    pageNo: 1,
    pageSize: 10,
    modelCode: undefined,
    modelName: undefined
    questionCode: undefined,
    questionName: undefined,
    modelId: undefined,
  })
  const queryFormRef = ref() // 搜索的表单
  const exportLoading = ref(false) // 导出的加载中
  /** 查询列表 */
  const getList = async () => {
    loading.value = true
@@ -162,6 +179,8 @@
  /** 初始化 **/
  onMounted(async () => {
    aiModelList.value = await AiModelApi.ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT + "," + AiModelTypeEnum.LLM)
    await getList()
  })
</script>