选煤厂生产管理平台前端代码
dongyukun
2024-12-11 121bafb30d19c8951812713f6a81d440d1149a97
提交 | 用户 | 时间
5d2541 1 <template>
J 2   <el-card shadow="never" class="aui-card--fill">
3     <div class="mod-outDetection-concentrate">
4       <el-form :inline="true" :model="queryParams" >
5         <el-form-item>
6           <el-date-picker
7             v-model="queryParams.ny"
8             type="month"
9             format="yyyy-MM"
10             value-format="yyyy-MM"
11             placeholder="年月"/>
12         </el-form-item>
13         <el-form-item>
14           <el-button @click="getList">
15             <Icon icon="ep:search" class="mr-5px" />
16             查询
17           </el-button>
18           <el-button type="primary" plain @click="openForm('create')">
19             <Icon icon="ep:plus" class="mr-5px" />
20             新增
21           </el-button>
22           <el-button type="warning" plain @click="handleImport">
23             <Icon icon="ep:upload" /> 导出
24           </el-button>
25         </el-form-item>
26       </el-form>
27       <el-table
28           ref="myTable"
29           v-loading="dataListLoading"
30           :data="dataList"
31           border
32           highlight-current-row
33           @selection-change="dataListSelectionChangeHandle"
34           @sort-change="dataListSortChangeHandle"
35           style="width: 100%;">
36         <el-table-column prop="ny" label="年月" header-align="center" align="left"
37                          min-width="100"/>
38         <el-table-column prop="mzName" label="煤种" header-align="center" align="center"
39                          min-width="120"/>
40         <el-table-column prop="ymdw" label="用煤单位" header-align="center" align="center"
41                          min-width="180"/>
42         <el-table-column prop="cpl" label="产品量(t)" header-align="center" align="center"
43                          min-width="150"/>
44         <el-table-column label="原煤指标" header-align="center">
45           <el-table-column prop="ymSf" label="Mt%" header-align="center" align="center"
46                            min-width="80"/>
47           <el-table-column prop="ymHf" label="Ad%" header-align="center" align="center"
48                            min-width="80"/>
49           <el-table-column prop="ymLf" label="St.d%" header-align="center" align="center"
50                            min-width="80"/>
51         </el-table-column>
52         <el-table-column label="精煤指标" header-align="center">
53           <el-table-column prop="jmSf" label="Ad%" header-align="center" align="center"
54                            min-width="80"/>
55           <el-table-column prop="jmHff" label="Vdaf%" header-align="center" align="center"
56                            min-width="80"/>
57           <el-table-column prop="jmLf" label="St.d%" header-align="center" align="center"
58                            min-width="80"/>
59           <el-table-column prop="jmNj" label="GR.I" header-align="center" align="center"
60                            min-width="80"/>
61           <el-table-column prop="jmJzc" label="胶质层Y" header-align="center" align="center"
62                            min-width="80"/>
63         </el-table-column>
64         <el-table-column label="中煤指标" header-align="center">
65           <el-table-column prop="zmHf" label="Ad%" header-align="center" align="center"
66                            min-width="80"/>
67           <el-table-column prop="zmLf" label="St.d%" header-align="center" align="center"
68                            min-width="80"/>
69         </el-table-column>
70         <el-table-column label=" 矸石指标" header-align="center">
71           <el-table-column prop="gsHf" label="Ad%" header-align="center" align="center"
72                            min-width="80"/>
73         </el-table-column>
74         <el-table-column label="操作" fixed="right" header-align="center" align="center" width="120">
75           <template #default="scope">
76             <el-button v-hasPermi="['data:ind-item:update']" link type="primary" @click="openForm('update', scope.row.id)">
77               修改
78             </el-button>
79             <el-button v-hasPermi="['data:ind-item:delete']" link type="danger" @click="handleDelete(scope.row.id)">
80               删除
81             </el-button>
82           </template>
83         </el-table-column>
84       </el-table>
85       <Pagination
86         v-model:limit="queryParams.pageSize"
87         v-model:page="queryParams.pageNo"
88         :total="total"
89         @pagination="getList"
90       />
91     </div>
92   </el-card>
93   <WashTargetForm ref="washTargetFormRef" @success="getList" />
94 </template>
95
96 <script lang="ts" setup>
97   import * as WashTargetApi from '@/api/xmcpms/coal-quality/analysis/wash/target'
98   import WashTargetForm from './WashTargetForm.vue'
99   import * as WashCurvesApi from "@/api/xmcpms/coal-quality/analysis/wash-curves";
100
101   const message = useMessage() // 消息弹窗
102   const { t } = useI18n() // 国际化
103   defineOptions({ name: 'Analysis' })
104   const loading = ref(true) // 列表的加载中
105   const total = ref(0) // 列表的总页数
106   const dataList = ref([]) // 字典表格数据
107   const queryFormRef = ref() // 搜索的表单
108   const exportLoading = ref(false)
109
110   const queryParams = reactive({
111     pageNo: 1,
112     pageSize: 10,
113     startTime: '',
114     endTime: '',
115     mz: '',
116     fcfa: ''
117   })
118
119   const getList = async () => {
120     loading.value = true
121     try {
122       const data = await WashTargetApi.getWashTargetPage(queryParams)
123       dataList.value = data.list
124       total.value = data.total
125     } finally {
126       loading.value = false
127     }
128   }
129
130   /** 添加/修改操作 */
131   const washTargetFormRef = ref()
132   const openForm = (type: string, id?: string) => {
133     washTargetFormRef.value.open(type, id)
134   }
135
136
137   /** 删除按钮操作 */
138   const handleDelete = async (id: string) => {
139     try {
140       // 删除的二次确认
141       await message.delConfirm()
142       // 发起删除
143       await WashTargetApi.deleteWashTarget(id)
144       message.success(t('common.delSuccess'))
145       // 刷新列表
146       await getList()
147     } catch {
148     }
149   }
150
151   /** 初始化 **/
152   onMounted(async () => {
153     await getList()
154   })
155
156 </script>