|
@@ -16,7 +16,8 @@
|
|
|
<el-button type="primary" icon="Search" @click="getSearch">搜索</el-button>
|
|
|
<el-button icon="Refresh" @click="getRefresh">重置</el-button>
|
|
|
<el-button type="warning" plain icon="Download" @click="getExport" :disabled="ids === ''">导出</el-button>
|
|
|
- <el-button type="primary" plain icon="Plus" @click="getDialog()" v-hasPermi="['business:list:add']">新增</el-button>
|
|
|
+ <el-button type="primary" plain icon="Plus" @click="getDialog()"
|
|
|
+ v-hasPermi="['business:list:add']">新增</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 列表 -->
|
|
@@ -37,9 +38,12 @@
|
|
|
<el-table-column label="创建时间" prop="createTimeStr" align="center"></el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="primary" link @click="getDialog(scope.row.id, '编辑')" v-hasPermi="['business:list:edit']">编辑</el-button>
|
|
|
- <el-button type="primary" link @click="getReset(scope.row)" v-hasPermi="['business:list:refresh']">重置密码</el-button>
|
|
|
- <el-button type="danger" link @click="getDelete(scope.row)" v-hasPermi="['business:list:delete']">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="getDialog(scope.row.id, '编辑')"
|
|
|
+ v-hasPermi="['business:list:edit']">编辑</el-button>
|
|
|
+ <el-button type="primary" link @click="getReset(scope.row)"
|
|
|
+ v-hasPermi="['business:list:refresh']">重置密码</el-button>
|
|
|
+ <el-button type="danger" link @click="getDelete(scope.row)"
|
|
|
+ v-hasPermi="['business:list:delete']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -76,8 +80,9 @@
|
|
|
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand">展开/折叠</el-checkbox>
|
|
|
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll">全选/全不选</el-checkbox>
|
|
|
<el-checkbox v-model="menuCheckStrictly" @change="handleCheckedTreeConnect">父子联动</el-checkbox>
|
|
|
- <el-tree class="tree-border" :data="data.treeOptions" :props="{ label: 'label', children: 'children' }"
|
|
|
- show-checkbox ref="menuRef" node-key="id" :check-strictly="!menuCheckStrictly" empty-text="加载中,请稍候" />
|
|
|
+ <el-tree class="tree-border" :data="data.treeOptions" show-checkbox ref="menuRef" node-key="id"
|
|
|
+ :check-strictly="!menuCheckStrictly" empty-text="加载中,请稍候"
|
|
|
+ :props="{ label: 'label', children: 'children' }" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -152,7 +157,7 @@ const data = reactive({
|
|
|
|
|
|
const menuExpand = ref(false)
|
|
|
const menuNodeAll = ref(false)
|
|
|
-const menuCheckStrictly = ref(false)
|
|
|
+const menuCheckStrictly = ref(true)
|
|
|
|
|
|
// 总数据
|
|
|
const total = ref(0)
|
|
@@ -221,8 +226,8 @@ const dialogVisible = ref(false)
|
|
|
const title = ref("新增")
|
|
|
|
|
|
// 打开弹窗
|
|
|
-function getDialog(id, key) {
|
|
|
- getTree()
|
|
|
+const getDialog = async (id, key) => {
|
|
|
+ await getTree()
|
|
|
dialogVisible.value = true
|
|
|
title.value = '新增'
|
|
|
if (id) {
|
|
@@ -247,8 +252,8 @@ function getDetail(id) {
|
|
|
}
|
|
|
|
|
|
// 新增的菜单权限
|
|
|
-function getTree() {
|
|
|
- treeselect().then(res => {
|
|
|
+const getTree = async () => {
|
|
|
+ await treeselect().then(res => {
|
|
|
if (res.code === 0) {
|
|
|
data.treeOptions = res.data
|
|
|
}
|
|
@@ -264,12 +269,12 @@ function upload(e) {
|
|
|
function getClose() {
|
|
|
dialogVisible.value = false
|
|
|
data.dialogForm = {}
|
|
|
- menuExpand.value = false
|
|
|
- menuNodeAll.value = false
|
|
|
- menuCheckStrictly.value = false
|
|
|
if (proxy.$refs.menuRef != undefined) {
|
|
|
proxy.$refs.menuRef.setCheckedKeys([]);
|
|
|
}
|
|
|
+ menuExpand.value = false
|
|
|
+ menuNodeAll.value = false
|
|
|
+ menuCheckStrictly.value = true
|
|
|
proxy.$refs.dialogForm.resetFields()
|
|
|
}
|
|
|
|