Your Name
2022-07-04 41b20b89eb03e1a7e52e7e31ce3fd3f240f67c46
src/views/doublePreventSystem/riskLevelManage/productionDevice/index.vue
@@ -13,7 +13,7 @@
                    <el-icon>
                        <ele-FolderAdd />
                    </el-icon>
                    新增角色
                    新增装置
                </el-button>
            </div>
            <el-table :data="productionDeviceData.data" style="width: 100%">
@@ -36,15 +36,15 @@
                </el-table-column>
            </el-table>
        </el-card>
        <roleDialog ref="roleDialogRef" @refreshRoleList="initRoleTableData"/>
        <productionDeviceDialog ref="productionDeviceDialogRef" @refreshRoleList="initRoleTableData"/>
    </div>
</template>
<script lang="ts">
    import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
    import { ElMessageBox, ElMessage } from 'element-plus';
    import roleDialog from '/@/views/system/role/component/roleDialog.vue';
    import {productionDeviceApi} from "/@/api/productionDevice";
    import productionDeviceDialog from './components/productionDeviceDialog.vue';
    import {productionDeviceApi} from "/@/api/doubleProventSystem/productionDevice";
    // 定义接口来定义对象的类型
    interface TableData {
@@ -74,9 +74,9 @@
    export default defineComponent({
        name: 'productionDevice',
        components: { roleDialog },
        components: { productionDeviceDialog },
        setup() {
            const roleDialogRef = ref();
            const productionDeviceDialogRef = ref();
            const state = reactive<TableDataState>({
                productionDeviceData: {
                    data: [],
@@ -105,9 +105,9 @@
                    })
                }
            };
            // 打开新增角色弹窗
            // 打开生产装置弹窗
            const onOpenDialogRef = (type: string, value: any) => {
                roleDialogRef.value.openDialog(type, value);
                productionDeviceDialogRef.value.openProductionDeviceDialog(type, value);
            };
            // 删除角色
            const onRowDel = (row: any) => {
@@ -124,11 +124,11 @@
            }
            // 分页改变
            const onHandleSizeChange = (val: number) => {
                state.productionDeviceData.param.pageSize = val;
                state.productionDeviceData.params.pageSize = val;
            };
            // 分页改变
            const onHandleCurrentChange = (val: number) => {
                state.productionDeviceData.param.pageNum = val;
                state.productionDeviceData.params.pageIndex = val;
            };
            // 页面加载时
            onMounted(() => {
@@ -136,13 +136,13 @@
            });
            return {
                onRowDel,
                roleDialog,
                handleSearch,
                roleDialogRef,
                onOpenDialogRef,
                initProductionDeviceTableData,
                onHandleSizeChange,
                onHandleCurrentChange,
                productionDeviceDialog,
                productionDeviceDialogRef,
                initProductionDeviceTableData,
                ...toRefs(state),
            };
        },