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