columns.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
  3. *
  4. * Licensed under the GNU Affero General Public License, Version 3 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * https://www.gnu.org/licenses/agpl-3.0.html
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import { FormSchema } from '@/components/Form';
  17. export const searchSchemas: FormSchema[] = [
  18. {
  19. field: 'name',
  20. component: 'NInput',
  21. label: '知识库名称',
  22. componentProps: {
  23. placeholder: '请输入知识库名称',
  24. },
  25. },
  26. ];
  27. export const formSchemas: FormSchema[] = [
  28. {
  29. field: 'id',
  30. label: 'ID',
  31. component: 'NInput',
  32. isHidden: true,
  33. },
  34. {
  35. field: 'name',
  36. component: 'NInput',
  37. label: '知识库名称',
  38. componentProps: {
  39. placeholder: '请输入知识库名称',
  40. },
  41. rules: [{ required: true, message: '请输入知识库名称', trigger: ['blur'] }],
  42. },
  43. {
  44. field: 'embedStoreId',
  45. label: '向量数据库',
  46. component: 'NInput',
  47. slot: 'embedStoreSlot',
  48. rules: [{ required: true, message: '请选择关联向量数据库', trigger: ['blur'] }],
  49. },
  50. {
  51. field: 'embedModelId',
  52. label: '向量模型',
  53. component: 'NInput',
  54. slot: 'embedModelSlot',
  55. rules: [{ required: true, message: '请选择关联向量模型', trigger: ['blur'] }],
  56. },
  57. {
  58. field: 'des',
  59. component: 'NInput',
  60. label: '知识库描述',
  61. componentProps: {
  62. placeholder: '请输入知识库描述',
  63. type: 'textarea',
  64. autosize: {
  65. minRows: 3,
  66. maxRows: 3,
  67. },
  68. },
  69. rules: [{ required: true, message: '请输入知识库描述', trigger: ['blur'] }],
  70. },
  71. ];