提交 | 用户 | 时间
|
2f0aa4
|
1 |
<template> |
潘 |
2 |
<!-- 搜索 --> |
|
3 |
<ContentWrap> |
|
4 |
<el-form |
|
5 |
class="-mb-15px" |
|
6 |
:model="queryParams" |
|
7 |
ref="queryFormRef" |
|
8 |
:inline="true" |
|
9 |
label-width="68px" |
|
10 |
> |
|
11 |
<el-form-item label="模型编号" prop="modelCode"> |
|
12 |
<el-input |
|
13 |
v-model="queryParams.modelCode" |
|
14 |
placeholder="请输入模型编号" |
|
15 |
clearable |
|
16 |
@keyup.enter="handleQuery" |
|
17 |
class="!w-240px" |
|
18 |
/> |
|
19 |
</el-form-item> |
|
20 |
<el-form-item label="模型名称" prop="modelName"> |
|
21 |
<el-input |
|
22 |
v-model="queryParams.modelName" |
|
23 |
placeholder="请输入模型名称" |
|
24 |
clearable |
|
25 |
@keyup.enter="handleQuery" |
|
26 |
class="!w-240px" |
|
27 |
/> |
|
28 |
</el-form-item> |
|
29 |
<el-form-item> |
|
30 |
<el-button @click="handleQuery"> |
|
31 |
<Icon icon="ep:search" class="mr-5px" /> |
|
32 |
搜索 |
|
33 |
</el-button> |
|
34 |
<el-button @click="resetQuery"> |
|
35 |
<Icon icon="ep:refresh" class="mr-5px" /> |
|
36 |
重置 |
|
37 |
</el-button> |
|
38 |
<el-button |
|
39 |
type="primary" |
|
40 |
plain |
|
41 |
@click="openForm('create')" |
|
42 |
v-hasPermi="['sche:model:create']" |
|
43 |
> |
|
44 |
<Icon icon="ep:plus" class="mr-5px" /> |
|
45 |
新增 |
|
46 |
</el-button> |
|
47 |
</el-form-item> |
|
48 |
</el-form> |
|
49 |
</ContentWrap> |
|
50 |
|
|
51 |
<!-- 列表 --> |
|
52 |
<ContentWrap> |
|
53 |
<el-table v-loading="loading" :data="list"> |
6badb7
|
54 |
<el-table-column label="模型编号" align="center" prop="modelCode" min-width="100"/> |
3559ee
|
55 |
<el-table-column label="模型名称" header-align="center" align="left" prop="modelName" min-width="100"/> |
潘 |
56 |
<el-table-column label="模型类型" align="center" prop="modelType" min-width="100"> |
|
57 |
<template #default="scope"> |
|
58 |
<dict-tag :type="DICT_TYPE.SCHE_MODEL_TYPE" :value="scope.row.modelType" /> |
|
59 |
</template> |
|
60 |
</el-table-column> |
d3ee81
|
61 |
<el-table-column label="类名" header-align="center" align="left" prop="className" min-width="200"/> |
6badb7
|
62 |
<el-table-column label="方法名" align="center" prop="methodName" min-width="100"/> |
潘 |
63 |
<el-table-column label="参数数量" align="center" prop="portLength" min-width="100"/> |
d3ee81
|
64 |
<el-table-column label="参数构造" header-align="center" align="left" prop="paramStructure" min-width="200" /> |
6badb7
|
65 |
<el-table-column label="调用方式" align="center" prop="invocation" min-width="100"> |
潘 |
66 |
<template #default="scope"> |
|
67 |
<dict-tag :type="DICT_TYPE.SCHE_MODEL_INVOCATION" :value="scope.row.invocation" /> |
|
68 |
</template> |
|
69 |
</el-table-column> |
|
70 |
<el-table-column label="操作" align="center" min-width="100" fixed="right"> |
2f0aa4
|
71 |
<template #default="scope"> |
潘 |
72 |
<el-button |
|
73 |
link |
|
74 |
type="primary" |
|
75 |
@click="openForm('update', scope.row.id)" |
|
76 |
v-hasPermi="['sche:model:update']" |
|
77 |
> |
|
78 |
编辑 |
|
79 |
</el-button> |
|
80 |
<el-button |
|
81 |
link |
|
82 |
type="danger" |
|
83 |
@click="handleDelete(scope.row.id)" |
|
84 |
v-hasPermi="['sche:model:delete']" |
|
85 |
> |
|
86 |
删除 |
|
87 |
</el-button> |
|
88 |
</template> |
|
89 |
</el-table-column> |
|
90 |
</el-table> |
|
91 |
<!-- 分页 --> |
|
92 |
<Pagination |
|
93 |
:total="total" |
|
94 |
v-model:page="queryParams.pageNo" |
|
95 |
v-model:limit="queryParams.pageSize" |
|
96 |
@pagination="getList" |
|
97 |
/> |
|
98 |
</ContentWrap> |
|
99 |
|
|
100 |
<!-- 表单弹窗:添加/修改 --> |
|
101 |
<ScheduleModelForm ref="formRef" @success="getList" /> |
|
102 |
|
|
103 |
</template> |
|
104 |
<script lang="ts" setup> |
|
105 |
import {DICT_TYPE, getIntDictOptions} from '@/utils/dict' |
|
106 |
import {dateFormatter} from '@/utils/formatTime' |
|
107 |
import download from '@/utils/download' |
|
108 |
import * as ScheduleModelApi from '@/api/model/sche/model' |
|
109 |
import ScheduleModelForm from './ScheduleModelForm.vue' |
|
110 |
|
|
111 |
defineOptions({name: 'ScheduleModel'}) |
|
112 |
|
|
113 |
const message = useMessage() // 消息弹窗 |
|
114 |
const {t} = useI18n() // 国际化 |
|
115 |
|
|
116 |
const loading = ref(true) // 列表的加载中 |
|
117 |
const total = ref(0) // 列表的总页数 |
|
118 |
const list = ref([]) // 列表的数据 |
|
119 |
const queryParams = reactive({ |
|
120 |
pageNo: 1, |
|
121 |
pageSize: 10, |
|
122 |
modelCode: undefined, |
|
123 |
modelName: undefined |
|
124 |
}) |
|
125 |
const queryFormRef = ref() // 搜索的表单 |
|
126 |
const exportLoading = ref(false) // 导出的加载中 |
|
127 |
|
|
128 |
/** 查询列表 */ |
|
129 |
const getList = async () => { |
|
130 |
loading.value = true |
|
131 |
try { |
|
132 |
const page = await ScheduleModelApi.getScheduleModelPage(queryParams) |
|
133 |
list.value = page.list |
|
134 |
total.value = page.total |
|
135 |
} finally { |
|
136 |
loading.value = false |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
/** 搜索按钮操作 */ |
|
141 |
const handleQuery = () => { |
|
142 |
queryParams.pageNo = 1 |
|
143 |
getList() |
|
144 |
} |
|
145 |
|
|
146 |
/** 重置按钮操作 */ |
|
147 |
const resetQuery = () => { |
|
148 |
queryFormRef.value.resetFields() |
|
149 |
handleQuery() |
|
150 |
} |
|
151 |
|
|
152 |
/** 添加/修改操作 */ |
|
153 |
const formRef = ref() |
|
154 |
const openForm = (type: string, id?: number) => { |
|
155 |
formRef.value.open(type, id) |
|
156 |
} |
|
157 |
|
|
158 |
/** 删除按钮操作 */ |
|
159 |
const handleDelete = async (id: number) => { |
|
160 |
try { |
|
161 |
// 删除的二次确认 |
|
162 |
await message.delConfirm() |
|
163 |
// 发起删除 |
|
164 |
await ScheduleModelApi.deleteScheduleModel(id) |
|
165 |
message.success(t('common.delSuccess')) |
|
166 |
// 刷新列表 |
|
167 |
await getList() |
|
168 |
} catch { |
|
169 |
} |
|
170 |
} |
|
171 |
|
|
172 |
/** 初始化 **/ |
|
173 |
onMounted(async () => { |
|
174 |
await getList() |
|
175 |
}) |
|
176 |
</script> |