1/*
2 * Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import type { BasicColumn, FormSchema } from '/@/components/Table';
17import { render } from '/@/utils/common/renderUtils';
18import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
19import { Component } from 'vue';
20
21export const columns: BasicColumn[] = [
22  {
23    title: '视频名称',
24    dataIndex: 'name',
25  },
26  {
27    title: '视频描述',
28    dataIndex: 'remark',
29  },
30  {
31    title: '视频链接',
32    dataIndex: 'url',
33    customRender: ({ text }): Promise<string> => {
34      return getFileAccessHttpUrl(text);
35    },
36  },
37  {
38    title: '审核状态',
39    dataIndex: 'status',
40    width: 120,
41    customRender: ({ text }): Component => {
42      return render.renderDict(text, 'check_status');
43    },
44  },
45  {
46    title: '上传作者',
47    dataIndex: 'createBy',
48    width: 120
49  },
50];
51
52export const searchFormSchema: FormSchema[] = [
53  {
54    field: 'name',
55    label: '视频名称',
56    component: 'JInput',
57    colProps: { span: 8 },
58  },
59  {
60    field: 'status',
61    label: '审核状态',
62    component: 'Select',
63    componentProps: {
64      options: [
65        { label: '未审核', value: '0' },
66        { label: '审核通过', value: '1' },
67        { label: '审核不通过', value: '2' },
68      ],
69    },
70    colProps: { span: 8 },
71  },
72];
73