<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="type" 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"
|
/>
|
<type-dialog ref="typeRef" @getList=getList></type-dialog>
|
</div>
|
</template>
|
|
<script setup>
|
import {getCurrentInstance, reactive, ref, toRefs} from "vue";
|
import typeDialog from "./components/typeDialog.vue"
|
import {ElMessageBox} from "element-plus";
|
const { proxy } = getCurrentInstance();
|
const loading = ref(false);
|
const typeRef = 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) => {
|
typeRef.value.openDialog(type, value);
|
}
|
|
/** 重置新增的表单以及其他数据 */
|
function reset() {
|
proxy.resetForm("roleRef");
|
}
|
const handleDelete = (val) => {
|
ElMessageBox.confirm(
|
'确定删除此条数据?',
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then( async() => {
|
|
})
|
}
|
|
</script>
|