zhouwenxuan
2023-11-29 88d7869b422a1070a0ea8efd22613997e9dbe2fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
    <div class="app-container">
        <div style="margin-bottom: 10px">
            <el-button
                type="primary"
                plain
                icon="Plus"
                @click="openDialog('add',{})"
            >新增</el-button>
        </div>
        <!-- 表格数据 -->
        <el-table v-loading="loading" :data="dataList" :border="true">
            <el-table-column label="业务范围" prop="business" align="center"  />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
                <template #default="scope">
                    <el-button link type="primary"  @click="openDialog('edit',scope.row)" v-hasPermi="['system:role:edit']">编辑</el-button>
                    <el-button link type="danger"  @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
 
        <pagination
            v-show="total > 0"
            :total="total"
            v-model:page="queryParams.pageNum"
            v-model:limit="queryParams.pageSize"
            @pagination="getList"
        />
        <business-dialog ref="busRef" @getList=getList></business-dialog>
    </div>
</template>
 
<script setup>
import {getCurrentInstance, reactive, ref, toRefs} from "vue";
import businessDialog from "./components/businessDialog.vue"
import {ElMessageBox} from "element-plus";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const busRef = ref();
const data = reactive({
    queryParams: {
        pageNum: 1,
        pageSize: 10,
    },
    total: 0,
    dataList: [
    ]
 
 
});
 
const { queryParams, total, dataList } = toRefs(data);
 
const getList = () => {
    loading.value = true;
    console.log("获取数据")
    loading.value = false;
}
 
const openDialog = (type, value) => {
    busRef.value.openDialog(type, value);
}
 
/** 重置新增的表单以及其他数据  */
function reset() {
    proxy.resetForm("roleRef");
}
const handleDelete = (val) => {
    ElMessageBox.confirm(
        '确定删除此条数据?',
        '提示',
        {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
        })
        .then( async() => {
 
        })
}
 
</script>