mg
2022-11-01 1445c7e1f76c4628f4619cf67150a63d6f8f5e90
src/views/operate/lawEnforcement/index.vue
@@ -1,11 +1,20 @@
<template>
    <div class="law-enforcement">
        <MyTable :tableData="list" :tableOption="tableOption" @openDialog="changeDialog">
        <!-- table表格展示 -->
        <MyTable :tableData="list" :tableOption="tableOption" :totalNum="totalNum" @getCurrentPage="getCurrentPage"
            @openDialog="changeDialog">
            <template #operation="{info}">
                <div class="btn">
                    <!-- 操作区域 -->
                    <!-- {{getData(info)}} -->
                    <span @click="dataView(info)">查看</span>
                </div>
            </template>
        </MyTable>
        <!-- 组件区 -->
        <!-- 弹窗 -->
        <div class="dialog">
            <el-dialog v-if="visible" :visible.async="visible" title="问题登记" width="60%" :before-close="handleClose">
                <MyView  :viewData=showData   />
                <MyView :viewData=showData />
            </el-dialog>
        </div>
    </div>
@@ -15,7 +24,7 @@
import MyView from './components/dataView'
export default {
    components: {
        MyTable,MyView
        MyTable, MyView
    },
    data() {
        return {
@@ -63,21 +72,25 @@
                        children: [
                            {
                                operationName: '查看',
                                mykey : 'look',
                                mykey: 'look',
                            },
                            {
                                operationName: '修改',
                                mykey:'update',
                                mykey: 'update',
                            }
                        ]
                    },
                ]
            },
            visible:false,
            showData:{},
            visible: false,
            totalNum: '',
            showData: {},
        }
    },
    methods:{
    created() {
        this.totalNum = this.list.length;
    },
    methods: {
        // 关闭对话框
        handleClose(done) {
            this.$confirm('确认关闭?')
@@ -88,10 +101,18 @@
                .catch(_ => { });
        },
        // 获取操作结果
        changeDialog({index,mykey}){
            console.log(index,mykey);
        changeDialog({ index, mykey }) {
            console.log(index, mykey);
            this.showData = this.list[index];
            this.visible = true;
        },
        // 数据展示
        dataView(data) {
            console.log(data);
        },
        // 获取当前页数据
        getCurrentPage(current) {
            console.log(current);
        }
    }
}