提交 | 用户 | 时间
|
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"> |
6e7f22
|
54 |
<el-table-column label="编号" align="center" prop="itemno"/> |
潘 |
55 |
<el-table-column label="预测项名" align="center" prop="itemname"/> |
|
56 |
<!-- <el-table-column label="类型ID" align="center" prop="itemtypeid" />--> |
|
57 |
<el-table-column label="类型名称" align="center" prop="itemtypename"/> |
|
58 |
<el-table-column label="粒度" align="center" prop="granularity"/> |
|
59 |
<el-table-column label="是否融合" align="center" prop="isfuse"/> |
|
60 |
<el-table-column label="是否检查" align="center" prop="workchecked"/> |
|
61 |
<!-- <el-table-column label="模块ID" align="center" prop="moduleid" />--> |
|
62 |
<!-- <el-table-column label="排序" align="center" prop="itemorder" />--> |
|
63 |
<el-table-column label="是否启用" align="center" prop="status"/> |
|
64 |
<!-- <el-table-column label="类别ID" align="center" prop="categoryid" />--> |
|
65 |
<!-- <el-table-column label="数据点ID" align="center" prop="pointid" />--> |
|
66 |
<el-table-column label="数据点名称" align="center" prop="tagname"/> |
|
67 |
<!-- <el-table-column label="存放表ID" align="center" prop="resulttableid" />--> |
|
68 |
<el-table-column label="存放表" align="center" prop="tablename"/> |
7462da
|
69 |
|
L |
70 |
<el-table-column label="操作" align="center" min-width="110" fixed="right"> |
|
71 |
<template #default="scope"> |
|
72 |
<el-button |
|
73 |
link |
|
74 |
type="primary" |
6e7f22
|
75 |
@click="openForm('update', scope.row.id, scope.row.itemtypename)" |
cd9f11
|
76 |
v-hasPermi="['model:pre-item:update']" |
7462da
|
77 |
> |
L |
78 |
编辑 |
|
79 |
</el-button> |
|
80 |
<el-button |
|
81 |
link |
|
82 |
type="danger" |
|
83 |
@click="handleDelete(scope.row.id)" |
cd9f11
|
84 |
v-hasPermi="['model:pre-item:delete']" |
7462da
|
85 |
> |
L |
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 |
<!-- 表单弹窗:添加/修改 --> |
6e7f22
|
101 |
<MmPredictItemForm ref="formRef" @success="getList"/> |
7462da
|
102 |
|
L |
103 |
</template> |
|
104 |
<script lang="ts" setup> |
6e7f22
|
105 |
import MmPredictItemForm from './MmPredictItemForm.vue' |
潘 |
106 |
import * as MmPredictItem from '@/api/model/pre/predict' |
7462da
|
107 |
|
6e7f22
|
108 |
defineOptions({name: 'DataMmPredictItem'}) |
7462da
|
109 |
|
6e7f22
|
110 |
const message = useMessage() // 消息弹窗 |
潘 |
111 |
const {t} = useI18n() // 国际化 |
7462da
|
112 |
|
6e7f22
|
113 |
const loading = ref(true) // 列表的加载中 |
潘 |
114 |
const total = ref(0) // 列表的总页数 |
|
115 |
const list = ref([]) // 列表的数据 |
|
116 |
const queryParams = reactive({ |
|
117 |
pageNo: 1, |
|
118 |
pageSize: 10, |
|
119 |
itemno: undefined, |
|
120 |
itemname: undefined, |
|
121 |
}) |
|
122 |
const isList = ref([ |
|
123 |
{ |
|
124 |
code: 0, |
|
125 |
name: '否' |
|
126 |
}, |
|
127 |
{ |
|
128 |
code: 1, |
|
129 |
name: '是' |
|
130 |
}]) |
|
131 |
const queryFormRef = ref() // 搜索的表单 |
|
132 |
const exportLoading = ref(false) // 导出的加载中 |
7462da
|
133 |
|
6e7f22
|
134 |
/** 查询列表 */ |
潘 |
135 |
const getList = async () => { |
|
136 |
loading.value = true |
|
137 |
try { |
|
138 |
const page = await MmPredictItem.getMmPredictItemPage(queryParams) |
|
139 |
list.value = page.list |
|
140 |
total.value = page.total |
|
141 |
} finally { |
|
142 |
loading.value = false |
7462da
|
143 |
} |
6e7f22
|
144 |
} |
7462da
|
145 |
|
6e7f22
|
146 |
/** 搜索按钮操作 */ |
潘 |
147 |
const handleQuery = () => { |
|
148 |
queryParams.pageNo = 1 |
|
149 |
getList() |
|
150 |
} |
7462da
|
151 |
|
6e7f22
|
152 |
/** 重置按钮操作 */ |
潘 |
153 |
const resetQuery = () => { |
|
154 |
queryFormRef.value.resetFields() |
|
155 |
handleQuery() |
|
156 |
} |
7462da
|
157 |
|
6e7f22
|
158 |
/** 添加/修改操作 */ |
潘 |
159 |
const formRef = ref() |
|
160 |
const openForm = (type: string, id?: number, itemtypename?: string) => { |
|
161 |
formRef.value.open(type, id, itemtypename) |
|
162 |
} |
7462da
|
163 |
|
6e7f22
|
164 |
/** 删除按钮操作 */ |
潘 |
165 |
const handleDelete = async (id: number) => { |
|
166 |
try { |
|
167 |
// 删除的二次确认 |
|
168 |
await message.delConfirm() |
|
169 |
// 发起删除 |
|
170 |
await MmPredictItem.deleteMmPredictItem(id) |
|
171 |
message.success(t('common.delSuccess')) |
|
172 |
// 刷新列表 |
7462da
|
173 |
await getList() |
6e7f22
|
174 |
} catch { |
潘 |
175 |
} |
|
176 |
} |
|
177 |
|
|
178 |
/** 初始化 **/ |
|
179 |
onMounted(async () => { |
|
180 |
await getList() |
|
181 |
}) |
7462da
|
182 |
</script> |