文件名从 src/views/intellectInspectSystem/inspectBasic/inspectTargetManage/index.vue 修改 |
| | |
| | | <div class="system-role-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <div class="basic-line"></div> |
| | | <div class="basic-line"></div> |
| | | <div class="basic-line"> |
| | | <span>巡检指标名称:</span> |
| | | <el-input class="input-box" v-model="inspectTargetData.params.quotaName" placeholder="巡检指标名称"> </el-input> |
| | | </div> |
| | | <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> |
| | | <el-icon> |
| | | <ele-Search /> |
| | |
| | | <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> |
| | | <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> |
| | | <el-button size="small" text type="primary" :icon="Edit" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> |
| | | <el-button size="small" text type="danger" :icon="Delete" @click="onDelProductionDevice(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <br /> |
| | | <br /> |
| | | </el-card> |
| | | <inspectTargetDialog ref="inspectTargetDialogRef" @refreshProductionDevice="initProductionDeviceTableData" /> |
| | | <inspectTargetDialog ref="inspectTargetDialogRef" @refreshInspectTarget="initInspectTargetTableData" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { toRefs, reactive, onMounted, ref, defineComponent, computed } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import inspectTargetDialog from './components/inspectTargetDialog.vue'; |
| | | import { inspectTargetApi } from '/@/api/intellectInspectSystem/inspectTargetManage'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableData { |
| | |
| | | params: { |
| | | pageIndex: number; |
| | | pageSize: number; |
| | | quotaName: string; |
| | | }; |
| | | }; |
| | | quotaTypeList: []; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'productionDevice', |
| | | components: { inspectTargetDialog }, |
| | | components: { inspectTargetDialog, Edit, Delete }, |
| | | setup() { |
| | | const inspectTargetDialogRef = ref(); |
| | | const state = reactive<TableDataState>({ |
| | |
| | | loading: false, |
| | | params: { |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | pageSize: 10, |
| | | quotaName: '' |
| | | } |
| | | } |
| | | }, |
| | | quotaTypeList: [] |
| | | }); |
| | | |
| | | // 初始化表格数据 |
| | | const initInspectTargetTableData = async () => { |
| | | let res = await inspectTargetApi().getInspectTargetList(state.inspectTargetData.params); |
| | |
| | | } |
| | | }; |
| | | |
| | | //获取所有指标类型及单位 |
| | | const initQuotaType = async () => { |
| | | let res = await inspectTargetApi().getQuotaTypeList(); |
| | | if (res.data.code === '200') { |
| | | state.quotaTypeList = JSON.parse(JSON.stringify(res.data.data)); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 打开生产装置弹窗 |
| | | const onOpenDialogRef = (type: string, value: any) => { |
| | | inspectTargetDialogRef.value.openProductionDeviceDialog(type, value); |
| | | inspectTargetDialogRef.value.openInspectTargetDialog(type, value, state.quotaTypeList); |
| | | }; |
| | | // 删除角色 |
| | | const onDelProductionDevice = (row: any) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { |
| | | ElMessageBox.confirm(`此操作将永久删除该条巡检指标:“${row.quota}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initInspectTargetTableData(); |
| | | initQuotaType(); |
| | | }); |
| | | |
| | | return { |
| | | Edit, |
| | | Delete, |
| | | handleSearch, |
| | | onOpenDialogRef, |
| | | onHandleSizeChange, |