|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
<PageMain class="vh100">
|
|
<PageMain class="vh100">
|
|
|
|
|
+
|
|
|
<ElForm :inline="false" :model="formInline" class="demo-form-inline" label-width="100px">
|
|
<ElForm :inline="false" :model="formInline" class="demo-form-inline" label-width="100px">
|
|
|
<ElRow :gutter="20">
|
|
<ElRow :gutter="20">
|
|
|
<ElCol :md="8">
|
|
<ElCol :md="8">
|
|
@@ -29,18 +30,19 @@
|
|
|
<ElCol :md="6" :offset="10">
|
|
<ElCol :md="6" :offset="10">
|
|
|
<ElFormItem>
|
|
<ElFormItem>
|
|
|
<div class="flex j-end" style="width: 100%;">
|
|
<div class="flex j-end" style="width: 100%;">
|
|
|
- <el-button type="primary" @click="roleQuery">查询</el-button>
|
|
|
|
|
- <el-button type="primary" @click="resetForm">重置</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" v-auth="'organizationlist.view'" @click="roleQuery">查询</el-button>
|
|
|
|
|
+ <el-button type="primary" v-auth="'organizationlist.view'" @click="resetForm">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
</ElCol>
|
|
|
</ElRow>
|
|
</ElRow>
|
|
|
</ElForm>
|
|
</ElForm>
|
|
|
<Table :tableData="tableData" :columns="columns" :showIndex="false" :columnheight="200" :showSelect="true"
|
|
<Table :tableData="tableData" :columns="columns" :showIndex="false" :columnheight="200" :showSelect="true"
|
|
|
- :pageInfo="pageInfo" @getList="getList" @selectAllChange="handleSelectionChange">
|
|
|
|
|
|
|
+ :pageInfo="pageInfo" @getList="getList" @selectAllChange="handleSelectionChange"
|
|
|
|
|
+ @selectionChange="selectionChange">
|
|
|
<template v-slot:table-title-btn>
|
|
<template v-slot:table-title-btn>
|
|
|
<RouterLink :to="{ name: 'OrganizationAdd' }">
|
|
<RouterLink :to="{ name: 'OrganizationAdd' }">
|
|
|
- <el-button type="primary">
|
|
|
|
|
|
|
+ <el-button type="primary" v-auth="'organizationlist.add'">
|
|
|
添加机构
|
|
添加机构
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<el-icon>
|
|
<el-icon>
|
|
@@ -49,7 +51,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</RouterLink>
|
|
</RouterLink>
|
|
|
- <el-dropdown placement="bottom-start">
|
|
|
|
|
|
|
+ <el-dropdown placement="bottom-start" v-auth="'organizationlist.delete'">
|
|
|
<el-button> 批量操作<el-icon>
|
|
<el-button> 批量操作<el-icon>
|
|
|
<arrow-down />
|
|
<arrow-down />
|
|
|
</el-icon>
|
|
</el-icon>
|
|
@@ -64,17 +66,22 @@
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:operation="scope">
|
|
<template v-slot:operation="scope">
|
|
|
- <el-button type="primary" link @click="tenantUpdate(scope.operationData)"> 编辑 </el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" link @click="tenantUpdate(scope.operationData)" v-auth="'organizationlist.edit'"> 编辑
|
|
|
|
|
+ </el-button>
|
|
|
<el-dropdown placement="bottom-start">
|
|
<el-dropdown placement="bottom-start">
|
|
|
<span class="el-dropdown-link">
|
|
<span class="el-dropdown-link">
|
|
|
更 多
|
|
更 多
|
|
|
</span>
|
|
</span>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="del(scope.operationData.id)">删除</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item @click="disable(scope.operationData.id)">禁用</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item @click="enable(scope.operationData.id)">启用</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item @click="subOrganizationAdd(scope.operationData.sysCode)">添加子机构</el-dropdown-item>
|
|
|
|
|
|
|
+ <Auth :value="'organizationlist.delete'">
|
|
|
|
|
+ <el-dropdown-item @click="del(scope.operationData.id)">删除</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item @click="disable(scope.operationData.id)">禁用</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item @click="enable(scope.operationData.id)">启用</el-dropdown-item>
|
|
|
|
|
+ </Auth>
|
|
|
|
|
+ <Auth :value="'organizationlist.add'">
|
|
|
|
|
+ <el-dropdown-item @click="subOrganizationAdd(scope.operationData.sysCode)">添加子机构</el-dropdown-item>
|
|
|
|
|
+ </Auth>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
@@ -95,8 +102,9 @@ import { h } from 'vue'
|
|
|
import { RouterLink, useRouter } from "vue-router";
|
|
import { RouterLink, useRouter } from "vue-router";
|
|
|
import ImagePreview from '@/components/ImagePreview/index.vue';
|
|
import ImagePreview from '@/components/ImagePreview/index.vue';
|
|
|
import { regionData, codeToText } from "element-china-area-data";
|
|
import { regionData, codeToText } from "element-china-area-data";
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
|
|
|
|
|
+import useAuth from '@/utils/composables/useAuth'
|
|
|
|
|
+const { auth, authAll } = useAuth()
|
|
|
interface PageInfo {
|
|
interface PageInfo {
|
|
|
pageNum: number;
|
|
pageNum: number;
|
|
|
pageSize: number;
|
|
pageSize: number;
|
|
@@ -159,7 +167,9 @@ const formInline = reactive({
|
|
|
})
|
|
})
|
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
|
- findpage();
|
|
|
|
|
|
|
+ if (auth('organizationlist.view')) {
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
function findpage() {
|
|
function findpage() {
|
|
|
api.tenantApi.sysList({ pageNum: pageInfo.value.pageNum, pageSize: pageInfo.value.pageSize, ...formInline }).then((res: any) => {
|
|
api.tenantApi.sysList({ pageNum: pageInfo.value.pageNum, pageSize: pageInfo.value.pageSize, ...formInline }).then((res: any) => {
|
|
@@ -176,17 +186,18 @@ const deptCountformatter = (row: any, column: any, cellValue: any) => {
|
|
|
return () => h('div', {}, [
|
|
return () => h('div', {}, [
|
|
|
row.id
|
|
row.id
|
|
|
? h(RouterLink, {
|
|
? h(RouterLink, {
|
|
|
- to: { name: 'OrganizationDetail', query: { id: row.id, code: row.sysCode,typeName:'organization'} },
|
|
|
|
|
|
|
+ to: { name: auth('organizationlist.view') ? 'OrganizationDetail' : '', query: { id: row.id, code: row.sysCode, typeName: 'organization' } },
|
|
|
style: { color: '#3498db', textDecoration: 'none' },
|
|
style: { color: '#3498db', textDecoration: 'none' },
|
|
|
}, { default: () => row.deptCount || 'N/A' })
|
|
}, { default: () => row.deptCount || 'N/A' })
|
|
|
: h('span', { style: { color: 'gray' } }, 'Loading...') // 加载状态或占位符
|
|
: h('span', { style: { color: 'gray' } }, 'Loading...') // 加载状态或占位符
|
|
|
]);
|
|
]);
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
const sysNameformatter = (row: any, column: any, cellValue: any) => {
|
|
const sysNameformatter = (row: any, column: any, cellValue: any) => {
|
|
|
return () => h('div', {}, [
|
|
return () => h('div', {}, [
|
|
|
row.id
|
|
row.id
|
|
|
? h(RouterLink, {
|
|
? h(RouterLink, {
|
|
|
- to: { name: 'OrganizationDetail', query: { id: row.id, code: row.sysCode,typeName:'tenantInfo' } },
|
|
|
|
|
|
|
+ to: { name: auth('organizationlist.view') ? 'OrganizationDetail' : '', query: { id: row.id, code: row.sysCode, typeName: 'tenantInfo' } },
|
|
|
style: { color: '#3498db', textDecoration: 'none' },
|
|
style: { color: '#3498db', textDecoration: 'none' },
|
|
|
}, { default: () => row.sysName || 'N/A' })
|
|
}, { default: () => row.sysName || 'N/A' })
|
|
|
: h('span', { style: { color: 'gray' } }, 'Loading...') // 加载状态或占位符
|
|
: h('span', { style: { color: 'gray' } }, 'Loading...') // 加载状态或占位符
|
|
@@ -221,9 +232,9 @@ const cityformatter = (row: any, column: any, cellValue: any) => {
|
|
|
const statusformatter = (row: any, column: any, cellValue: any) => {
|
|
const statusformatter = (row: any, column: any, cellValue: any) => {
|
|
|
let available = row.available;
|
|
let available = row.available;
|
|
|
if (available) {
|
|
if (available) {
|
|
|
- return () => h('div', {}, '启用');
|
|
|
|
|
|
|
+ return () => h(ElTag, { type: 'primary' }, '启用');
|
|
|
} else {
|
|
} else {
|
|
|
- return () => h('div', {}, '禁用');
|
|
|
|
|
|
|
+ return () => h(ElTag, { type: 'danger' }, '禁用');
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const columns = [
|
|
const columns = [
|
|
@@ -253,6 +264,9 @@ function tenantUpdate(item: any) {
|
|
|
const handleSelectionChange = (val: any) => {
|
|
const handleSelectionChange = (val: any) => {
|
|
|
sysUpAndDownList.value = val;
|
|
sysUpAndDownList.value = val;
|
|
|
}
|
|
}
|
|
|
|
|
+const selectionChange = (val: any) => {
|
|
|
|
|
+ sysUpAndDownList.value = val;
|
|
|
|
|
+}
|
|
|
//删除
|
|
//删除
|
|
|
const del = (value: string) => {
|
|
const del = (value: string) => {
|
|
|
ElMessageBox.confirm(
|
|
ElMessageBox.confirm(
|
|
@@ -262,6 +276,7 @@ const del = (value: string) => {
|
|
|
confirmButtonText: '确定删除',
|
|
confirmButtonText: '确定删除',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
|
|
+ center:true,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
@@ -289,8 +304,8 @@ const disable = (value: string) => {
|
|
|
'禁用租户',
|
|
'禁用租户',
|
|
|
{
|
|
{
|
|
|
confirmButtonText: '确定禁用',
|
|
confirmButtonText: '确定禁用',
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'error',
|
|
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ center: true,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
@@ -314,6 +329,7 @@ const batchDel = () => {
|
|
|
confirmButtonText: '确定删除',
|
|
confirmButtonText: '确定删除',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
|
|
+ center:true,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
@@ -343,6 +359,7 @@ const batchdisable = () => {
|
|
|
confirmButtonText: '确定禁用',
|
|
confirmButtonText: '确定禁用',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
|
|
+ center:true,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(async () => {
|
|
.then(async () => {
|