This commit is contained in:
张成
2026-04-13 14:27:40 +08:00
parent a6db441c4f
commit 602fed8f0c

View File

@@ -2,7 +2,7 @@
<div class="content-view"> <div class="content-view">
<Alert type="warning" show-icon style="margin-bottom: 12px"> <Alert type="warning" show-icon style="margin-bottom: 12px">
<strong>平台租户</strong>is_platform=1可维护租户列表普通租户登录后本页仅能看到自身租户信息 <strong>平台租户</strong>is_platform=1可维护租户列表普通租户登录后本页仅能看到自身租户信息
新增租户<strong>租户编码由服务端自动生成</strong>列表中可查看需在数据库执行迁移脚本创建 <code>sys_tenant</code> 表及默认数据 新增时<strong>租户编码可留空</strong>留空则由服务端自动生成填写则使用自定义编码须唯一需在数据库执行迁移脚本创建 <code>sys_tenant</code> 表及默认数据
</Alert> </Alert>
<div class="table-head-tool"> <div class="table-head-tool">
<Button type="primary" @click="showAddWarp">新增租户</Button> <Button type="primary" @click="showAddWarp">新增租户</Button>
@@ -26,12 +26,18 @@ export default {
editRow: {}, editRow: {},
columns: [ columns: [
{ title: 'id', key: 'id' }, { title: 'id', key: 'id' },
{ title: '名称', key: 'name' }, { title: '名称', key: 'name', name: 'name', required: true },
{ title: '编码', key: 'code', name: 'code', display: true }, {
{ title: '备注', key: 'remark' }, title: '租户编码',
key: 'code',
name: 'code',
placeholder: '留空则保存时自动生成;填写则使用自定义编码(须唯一)'
},
{ title: '备注', key: 'remark', name: 'remark' },
{ {
title: '状态', title: '状态',
key: 'status', key: 'status',
name: 'status',
com: 'Radio', com: 'Radio',
source: [ source: [
{ key: 1, value: '启用' }, { key: 1, value: '启用' },
@@ -44,6 +50,7 @@ export default {
{ {
title: '平台租户', title: '平台租户',
key: 'is_platform', key: 'is_platform',
name: 'is_platform',
com: 'Switch', com: 'Switch',
render(h, p) { render(h, p) {
return h('span', Number(p.row.is_platform) === 1 ? '是' : '否') return h('span', Number(p.row.is_platform) === 1 ? '是' : '否')
@@ -82,6 +89,9 @@ export default {
normalizeTenantRow(row) { normalizeTenantRow(row) {
const r = { ...row } const r = { ...row }
r.is_platform = r.is_platform === true || r.is_platform === 1 || r.is_platform === '1' ? 1 : 0 r.is_platform = r.is_platform === true || r.is_platform === 1 || r.is_platform === '1' ? 1 : 0
if (r.code != null && typeof r.code === 'string' && !r.code.trim()) {
delete r.code
}
return r return r
}, },
async init() { async init() {