广丰卷烟厂数采质量分析系统
zhuguifei
2026-03-04 64c2870483568cdeb0206661249a19c5b06de8fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { request } from '@/service/request';
 
/** 查询代码生成列表 */
export function fetchGetGenTableList(params?: Api.Tool.GenTableSearchParams) {
  return request<Api.Tool.GenTableList>({
    url: '/tool/gen/list',
    method: 'get',
    params
  });
}
 
/**
 * 导入表结构
 *
 * @param tables 表名称
 * @param dataName 数据源名称
 */
export function fetchImportGenTable(tables: string[], dataName: string) {
  return request<boolean>({
    url: '/tool/gen/importTable',
    method: 'post',
    params: { tables: tables.join(','), dataName }
  });
}
 
/** 修改代码生成 */
export function fetchUpdateGenTable(data: Api.Tool.GenTable) {
  return request<boolean>({
    url: '/tool/gen',
    method: 'put',
    data
  });
}
 
/** 获取代码生成信息 */
export function fetchGetGenTableInfo(tableId: CommonType.IdType) {
  return request<Api.Tool.GenTableInfo>({
    url: `/tool/gen/${tableId}`,
    method: 'get'
  });
}
 
/** 批量删除代码生成 */
export function fetchBatchDeleteGenTable(tableIds: CommonType.IdType[]) {
  const ids = tableIds.join(',');
  return request<boolean>({
    url: `/tool/gen/${ids}`,
    method: 'delete'
  });
}
 
/** 查询数据源名称列表 */
export function fetchGetGenDataNames() {
  return request<string[]>({
    url: '/tool/gen/getDataNames',
    method: 'get'
  });
}
 
/** 查询数据库列表 */
export function fetchGetGenDbList(params?: Api.Tool.GenTableDbSearchParams) {
  return request<Api.Tool.GenTableDbList>({
    url: '/tool/gen/db/list',
    method: 'get',
    params
  });
}
 
/** 同步数据库 */
export function fetchSynchGenDbList(tableId: CommonType.IdType) {
  return request<Api.Tool.GenTableDbList>({
    url: `/tool/gen/synchDb/${tableId}`,
    method: 'get'
  });
}
 
/** 预览代码 */
export function fetchGetGenPreview(tableId: CommonType.IdType) {
  return request<Api.Tool.GenTablePreview>({
    url: `/tool/gen/preview/${tableId}`,
    method: 'get'
  });
}
 
/** 生成代码(自定义路径) */
export function fetchGenCode(tableId: CommonType.IdType) {
  return request<Api.Tool.GenTableDbList>({
    url: `/tool/gen/genCode/${tableId}`,
    method: 'get'
  });
}
 
/** 批量生成代码 */
export function fetchBatchGenCode(tableIds: CommonType.IdType[]) {
  const tableIdStr = tableIds.join(',');
  return request<Api.Tool.GenTableDbList>({
    url: '/tool/gen/genCode/',
    method: 'get',
    params: { tableIdStr }
  });
}