提交 | 用户 | 时间
|
7462da
|
1 |
<template> |
L |
2 |
<!-- 搜索 --> |
|
3 |
<ContentWrap> |
|
4 |
<el-form |
|
5 |
class="-mb-15px" |
|
6 |
:model="queryParams" |
|
7 |
ref="queryFormRef" |
|
8 |
:inline="true" |
|
9 |
label-width="68px" |
|
10 |
> |
6e7f22
|
11 |
<el-form-item label="编号" prop="itemno"> |
7462da
|
12 |
<el-input |
6e7f22
|
13 |
v-model="queryParams.itemno" |
潘 |
14 |
placeholder="请输入编号" |
|
15 |
clearable |
|
16 |
@keyup.enter="handleQuery" |
|
17 |
class="!w-240px" |
|
18 |
/> |
|
19 |
</el-form-item> |
|
20 |
<el-form-item label="预测项名" prop="itemname"> |
|
21 |
<el-input |
|
22 |
v-model="queryParams.itemname" |
|
23 |
placeholder="请输入预测项名" |
7462da
|
24 |
clearable |
L |
25 |
@keyup.enter="handleQuery" |
|
26 |
class="!w-240px" |
|
27 |
/> |
|
28 |
</el-form-item> |
|
29 |
<el-form-item> |
|
30 |
<el-button @click="handleQuery"> |
6e7f22
|
31 |
<Icon icon="ep:search" class="mr-5px"/> |
7462da
|
32 |
搜索 |
L |
33 |
</el-button> |
|
34 |
<el-button @click="resetQuery"> |
6e7f22
|
35 |
<Icon icon="ep:refresh" class="mr-5px"/> |
7462da
|
36 |
重置 |
L |
37 |
</el-button> |
|
38 |
<el-button |
|
39 |
type="primary" |
|
40 |
plain |
|
41 |
@click="openForm('create')" |
cd9f11
|
42 |
v-hasPermi="['model:pre-item:create']" |
7462da
|
43 |
> |
6e7f22
|
44 |
<Icon icon="ep:plus" class="mr-5px"/> |
7462da
|
45 |
新增 |
L |
46 |
</el-button> |
|
47 |
</el-form-item> |
|
48 |
</el-form> |
|
49 |
</ContentWrap> |
|
50 |
|
|
51 |
<!-- 列表 --> |
|
52 |
<ContentWrap> |
|
53 |
<el-table v-loading="loading" :data="list"> |
e7b6da
|
54 |
<el-table-column label="编号" align="center" min-width="150" prop="itemno"/> |
d3ee81
|
55 |
<el-table-column label="预测项名" header-align="center" align="left" min-width="200" prop="itemname"/> |
潘 |
56 |
<el-table-column label="类型名称" align="center" prop="itemtypename"> |
|
57 |
<template #default="scope"> |
|
58 |
<el-tag v-if="scope.row.itemtypename === 'NormalItem'" size="small" type="success">{{scope.row.itemtypename}}</el-tag> |
|
59 |
<el-tag v-else size="small" type="primary">{{scope.row.itemtypename}}</el-tag> |
|
60 |
</template> |
|
61 |
</el-table-column> |
|
62 |
<el-table-column label="预测长度" align="center" prop="predictlength"/> |
|
63 |
<el-table-column label="粒度" align="center" prop="granularity"> |
|
64 |
<template #default="scope"> |
e7b6da
|
65 |
<dict-tag :type="DICT_TYPE.PRED_GRANULARITY" :value="scope.row.granularity" /> |
d3ee81
|
66 |
</template> |
潘 |
67 |
</el-table-column> |
|
68 |
<el-table-column label="是否融合" align="center" prop="isfuse"> |
|
69 |
<template #default="scope"> |
|
70 |
<dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.isfuse" /> |
|
71 |
</template> |
|
72 |
</el-table-column> |
|
73 |
<el-table-column label="是否检查" align="center" prop="workchecked"> |
|
74 |
<template #default="scope"> |
|
75 |
<dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.workchecked" /> |
|
76 |
</template> |
|
77 |
</el-table-column> |
|
78 |
<el-table-column label="是否启用" align="center" prop="status"> |
|
79 |
<template #default="scope"> |
|
80 |
<dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.status" /> |
|
81 |
</template> |
|
82 |
</el-table-column> |
e7b6da
|
83 |
<el-table-column label="运行时间" align="center" prop="lastTime"/> |
潘 |
84 |
<el-table-column label="运行状态" align="center" prop="runStatus"/> |
|
85 |
<el-table-column label="运行耗时" align="center" prop="duration"/> |
|
86 |
<el-table-column label="操作" align="center" min-width="120" fixed="right"> |
7462da
|
87 |
<template #default="scope"> |
L |
88 |
<el-button |
|
89 |
link |
|
90 |
type="primary" |
e7b6da
|
91 |
size="mini" |
6e7f22
|
92 |
@click="openForm('update', scope.row.id, scope.row.itemtypename)" |
cd9f11
|
93 |
v-hasPermi="['model:pre-item:update']" |
7462da
|
94 |
> |
L |
95 |
编辑 |
|
96 |
</el-button> |
e7b6da
|
97 |
<el-button link size="mini" type="primary" @click="chartHandle(scope.row)">数据</el-button> |
7462da
|
98 |
<el-button |
L |
99 |
link |
|
100 |
type="danger" |
e7b6da
|
101 |
size="mini" |
7462da
|
102 |
@click="handleDelete(scope.row.id)" |
cd9f11
|
103 |
v-hasPermi="['model:pre-item:delete']" |
7462da
|
104 |
> |
L |
105 |
删除 |
|
106 |
</el-button> |
|
107 |
</template> |
|
108 |
</el-table-column> |
|
109 |
</el-table> |
|
110 |
<!-- 分页 --> |
|
111 |
<Pagination |
|
112 |
:total="total" |
|
113 |
v-model:page="queryParams.pageNo" |
|
114 |
v-model:limit="queryParams.pageSize" |
|
115 |
@pagination="getList" |
|
116 |
/> |
|
117 |
</ContentWrap> |
|
118 |
|
|
119 |
<!-- 表单弹窗:添加/修改 --> |
6e7f22
|
120 |
<MmPredictItemForm ref="formRef" @success="getList"/> |
7462da
|
121 |
|
e7b6da
|
122 |
<!-- 表单弹窗:数据 --> |
潘 |
123 |
<MmPredictItemChart ref="chartView" @success="getList"/> |
|
124 |
|
7462da
|
125 |
</template> |
L |
126 |
<script lang="ts" setup> |
6e7f22
|
127 |
import MmPredictItemForm from './MmPredictItemForm.vue' |
e7b6da
|
128 |
import MmPredictItemChart from './MmPredictItemChart.vue' |
6e7f22
|
129 |
import * as MmPredictItem from '@/api/model/pre/predict' |
d3ee81
|
130 |
import {DICT_TYPE} from "@/utils/dict"; |
7462da
|
131 |
|
6e7f22
|
132 |
defineOptions({name: 'DataMmPredictItem'}) |
7462da
|
133 |
|
6e7f22
|
134 |
const message = useMessage() // 消息弹窗 |
潘 |
135 |
const {t} = useI18n() // 国际化 |
7462da
|
136 |
|
6e7f22
|
137 |
const loading = ref(true) // 列表的加载中 |
潘 |
138 |
const total = ref(0) // 列表的总页数 |
|
139 |
const list = ref([]) // 列表的数据 |
|
140 |
const queryParams = reactive({ |
|
141 |
pageNo: 1, |
|
142 |
pageSize: 10, |
|
143 |
itemno: undefined, |
|
144 |
itemname: undefined, |
|
145 |
}) |
|
146 |
const isList = ref([ |
|
147 |
{ |
|
148 |
code: 0, |
|
149 |
name: '否' |
|
150 |
}, |
|
151 |
{ |
|
152 |
code: 1, |
|
153 |
name: '是' |
|
154 |
}]) |
|
155 |
const queryFormRef = ref() // 搜索的表单 |
|
156 |
const exportLoading = ref(false) // 导出的加载中 |
7462da
|
157 |
|
6e7f22
|
158 |
/** 查询列表 */ |
潘 |
159 |
const getList = async () => { |
|
160 |
loading.value = true |
|
161 |
try { |
|
162 |
const page = await MmPredictItem.getMmPredictItemPage(queryParams) |
|
163 |
list.value = page.list |
|
164 |
total.value = page.total |
|
165 |
} finally { |
|
166 |
loading.value = false |
7462da
|
167 |
} |
6e7f22
|
168 |
} |
7462da
|
169 |
|
6e7f22
|
170 |
/** 搜索按钮操作 */ |
潘 |
171 |
const handleQuery = () => { |
|
172 |
queryParams.pageNo = 1 |
|
173 |
getList() |
|
174 |
} |
7462da
|
175 |
|
6e7f22
|
176 |
/** 重置按钮操作 */ |
潘 |
177 |
const resetQuery = () => { |
|
178 |
queryFormRef.value.resetFields() |
|
179 |
handleQuery() |
|
180 |
} |
7462da
|
181 |
|
e7b6da
|
182 |
/** 查看数据操作 */ |
潘 |
183 |
const chartView = ref() |
|
184 |
const chartHandle = (raw: object) => { |
|
185 |
chartView.value.open(raw) |
|
186 |
} |
|
187 |
|
6e7f22
|
188 |
/** 添加/修改操作 */ |
潘 |
189 |
const formRef = ref() |
|
190 |
const openForm = (type: string, id?: number, itemtypename?: string) => { |
|
191 |
formRef.value.open(type, id, itemtypename) |
|
192 |
} |
7462da
|
193 |
|
6e7f22
|
194 |
/** 删除按钮操作 */ |
潘 |
195 |
const handleDelete = async (id: number) => { |
|
196 |
try { |
|
197 |
// 删除的二次确认 |
|
198 |
await message.delConfirm() |
|
199 |
// 发起删除 |
|
200 |
await MmPredictItem.deleteMmPredictItem(id) |
|
201 |
message.success(t('common.delSuccess')) |
|
202 |
// 刷新列表 |
7462da
|
203 |
await getList() |
6e7f22
|
204 |
} catch { |
潘 |
205 |
} |
|
206 |
} |
|
207 |
|
|
208 |
/** 初始化 **/ |
|
209 |
onMounted(async () => { |
|
210 |
await getList() |
|
211 |
}) |
7462da
|
212 |
</script> |