feat:优化页面代码及版本升级报错处理

main
朱群锋 2025-02-11 08:57:04 +08:00
parent 15a5b4804b
commit 969d9f5d7d
8 changed files with 1008 additions and 931 deletions

View File

@ -1,6 +1,7 @@
<script setup lang="ts">
import {reactive, toRefs, watch} from 'vue'
import common from '@/utils/common'
import {Sort, Setting} from '@element-plus/icons-vue'
const prop = defineProps({
loading: {
@ -50,7 +51,9 @@
tableHeight: prop.tableHeight,
headerCellStyle: prop.headerCellStyle,
size: 'default',
columns: prop.column.map((item:any) => {return item.prop}),
columns: prop.column.map((item: any) => {
return item.prop
}),
checkColAll: true,
isIndeterminate: true,
cellStyle: function (e: any) {
@ -74,21 +77,26 @@
function onFind(arr: any, val: any) {
if (!arr) return 'info';
return arr.find((item:any)=>{ return item.value == val}).label;
return arr.find((item: any) => {
return item.value == val
}).label;
}
function onCheckColAll(val: boolean) {
const _columns = prop.column.map((item:any) => {return item.prop})
const _columns = prop.column.map((item: any) => {
return item.prop
})
state.columns = val ? _columns : []
state.isIndeterminate = false
}
function onCheckedCol(value: string[]) {
let checkedCount = value.length
state.checkColAll = checkedCount === prop.column.length
state.isIndeterminate = checkedCount > 0 && checkedCount < prop.column.length
}
watch(columns, (newValue, oldValue) =>{
watch(columns, (newValue) => {
prop.column.filter((item: any) => {
item.isShow = newValue.indexOf(item.prop) == -1;
})
@ -107,38 +115,46 @@
<el-popover placement="bottom" :width="80" trigger="click">
<template #reference>
<el-button link>
<el-icon :size="20"><Sort /></el-icon>
<el-icon :size="20">
<Sort/>
</el-icon>
</el-button>
</template>
<div>
<el-radio-group v-model="size">
<el-radio label="small">紧凑</el-radio>
<el-radio label="default">默认</el-radio>
<el-radio label="large">中等</el-radio>
<el-radio value="small">紧凑</el-radio>
<el-radio value="default">默认</el-radio>
<el-radio value="large">中等</el-radio>
</el-radio-group>
</div>
</el-popover>
<el-popover placement="bottom" :width="120" trigger="click">
<template #reference>
<el-button link>
<el-icon :size="20"><Setting /></el-icon>
<el-icon :size="20">
<Setting/>
</el-icon>
</el-button>
</template>
<div>
<el-checkbox v-model="checkColAll" :indeterminate="isIndeterminate" @change="onCheckColAll">/</el-checkbox>
<el-checkbox v-model="checkColAll" :indeterminate="isIndeterminate" @change="onCheckColAll">/
</el-checkbox>
<el-scrollbar height="400px">
<el-checkbox-group v-model="columns" @change="onCheckedCol">
<el-checkbox v-for="col in column" :key="col" :label="col.prop">{{col.label}}</el-checkbox>
<el-checkbox v-for="col in column" :key="col" :label="col.label" :value="col.prop">{{ col.label }}
</el-checkbox>
</el-checkbox-group>
</el-scrollbar>
</div>
</el-popover>
</div>
<el-table :data="data" border stripe :size="size" :height="tableHeight" :max-height="maxHeight" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
<el-table :data="data" border stripe :size="size" :height="tableHeight" :max-height="maxHeight" row-key="id"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
v-loading="loading" :header-cell-style="headerCellStyle" :cell-style="cellStyle"
@selection-change="$emit('onSelectionChange')" style="width: 100%;">
<template v-for="item in column" :key="item">
<el-table-column v-if="!item.prop && !item.label && !item.isShow" :fixed="item.fixed" type="selection" width="45"></el-table-column>
<el-table-column v-if="!item.prop && !item.label && !item.isShow" :fixed="item.fixed" type="selection"
width="45"></el-table-column>
<!-- color值 -->
<el-table-column v-else-if="item.type == 'color' && !item.isShow"
:label="item.label" :align="item.align != null ? item.align : 'center'" :width="item.width">
@ -170,7 +186,8 @@
<el-table-column v-else-if="item.type == 'image' && !item.isShow"
:label="item.label" :align="item.align != null ? item.align : 'center'" :width="item.width">
<template #default="scope">
<el-image :src="scope.row[item.prop]" :preview-src-list="[scope.row[item.prop]]" preview-teleported fit="cover" style="width: 50px; height: 50px"/>
<el-image :src="scope.row[item.prop]" :preview-src-list="[scope.row[item.prop]]" preview-teleported
fit="cover" style="width: 50px; height: 50px"/>
</template>
</el-table-column>
<!-- el-rate -->
@ -195,7 +212,8 @@
<el-table-column v-else-if="item.type == 'button' && !item.isShow" show-overflow-tooltip
:label="item.label" :align="item.align != null ? item.align : 'center'" :width="item.width">
<template #default="scope">
<el-button @click="$emit('onButtonClick',scope.row)" :type="item.option.type" link :size="item.option.size">
<el-button @click="$emit('onButtonClick',scope.row)" :type="item.option.type" link
:size="item.option.size">
{{ scope.row[item.alias == null ? item.prop : item.alias] }}
</el-button>
</template>
@ -205,8 +223,10 @@
:label="item.label" :align="item.align != null ? item.align : 'center'" :width="item.width">
<template #default="scope">
<el-switch @change="$emit('onSwitchChange',scope.row)" :inline-prompt="!item.option.inlinePrompt"
:active-value="item.option.activeValue" :active-color="item.option.activeColor" :active-text="item.option.activeText"
:inactive-value="item.option.inactiveValue" :inactive-color="item.option.inactiveColor" :inactive-text="item.option.inactiveText"
:active-value="item.option.activeValue" :active-color="item.option.activeColor"
:active-text="item.option.activeText"
:inactive-value="item.option.inactiveValue" :inactive-color="item.option.inactiveColor"
:inactive-text="item.option.inactiveText"
:size="item.option.size"
v-model="scope.row[item.prop]"
></el-switch>
@ -264,13 +284,16 @@
border-radius: var(--el-border-radius-base);
padding: 1rem;
}
.table-wrap {
padding: 1rem 0;
.header {
float: right;
padding-bottom: 0.4rem;
}
}
.pagination-wrap {
padding-bottom: 0.2rem;
float: right;
@ -281,10 +304,12 @@
width: 5px;
height: 1px;
}
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #909399;
border-radius: 5px;
}
.el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 5px;
background: #ededed;

View File

@ -8,8 +8,8 @@
import 'amis/lib/themes/default.css'
import 'amis/sdk/color-picker.js'
import 'amis/sdk/rest.js'
// import {InputCity} from 'amis/esm/renderers/Form/InputCity.js'
// import {InputColor} from 'amis/esm/renderers/Form/InputColor.js'
import InputCity from 'amis/lib/renderers/Form/InputCity'
import InputColor from 'amis/lib/renderers/Form/InputColor'
import axios from 'axios'
import copy from 'copy-to-clipboard'
import {getToken} from '@/api/auth'
@ -35,9 +35,10 @@
const boxRef = ref(null)
watch(() => props.formjson, (data) => {
if (Object.keys(data).length !== 0) {
onRendering(data)
},
{immediate: true,deep: true}
}
}, {immediate: true, deep: true}
)
function onRendering(data: any) {
@ -47,7 +48,8 @@
'#amisid',
data,
{
updateLocation: (to, replace) => {},
updateLocation: (to, replace) => {
},
},
{
//

View File

@ -85,21 +85,15 @@ function onCloseAllTab() {
</script>
<template>
<div class="tabs-menu">
<el-tabs type="card" v-model="tabsMenuValue" @tab-click="onTabMenuClick" @tab-remove="onTabMenuRemove">
<el-tab-pane v-for="item in tabsMenuList"
:key="item.path"
:path="item.path"
:label="item.title"
:name="item.path"
:closable="item.close"
@node-contextmenu="onTabMenuRemove">
<template #label>
<el-icon v-if="item.icon" style="vertical-align: middle;">
<component :is="item.icon"></component>
</el-icon>
<el-dropdown :id="item.path" trigger="contextmenu">
<span style="vertical-align: middle">{{ item.title }}</span>
<el-tabs type="card"
v-model="tabsMenuValue"
addable
@tab-add="onTabMenuRemove"
@tab-click="onTabMenuClick"
@tab-remove="onTabMenuRemove">
<template #add-icon>
<el-dropdown>
<el-icon><ArrowDown /></el-icon>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="CircleCloseFilled" @click="onCloseCurrentTab"></el-dropdown-item>
@ -109,9 +103,15 @@ function onCloseAllTab() {
</template>
</el-dropdown>
</template>
<el-tab-pane v-for="item in tabsMenuList"
:key="item.path"
:path="item.path"
:label="item.title"
:name="item.path"
:closable="item.close"
@node-contextmenu="onTabMenuRemove">
</el-tab-pane>
</el-tabs>
</div>
</template>
<style lang="scss">
.tabs-menu {

View File

@ -34,7 +34,7 @@
<div class="home-container">
<el-card shadow="never">
<template #header>
<span>公告</span>
<span>简介</span>
</template>
<div>
<div>
@ -42,10 +42,9 @@
</div>
<div class="text">
<el-space alignment="normal" direction="vertical">
<el-text tag="p">基于 SpringBoot2 + magic-api + Vue3 + Element Plus + amis3.0 快速开发管理系统</el-text>
<el-text tag="p">Tansci-Boot 是一个前后端分离后台管理系统 前端集成 amis 低代码前端框架后端集成 magic-api 的接口快速开发框架包含基础权限安全认证以及常用的一些组件功能项目易上手技术更综合能力更全面</el-text>
<el-text tag="p">基于 SpringBoot2 + Vue3 + Element Plus + amis3.0 快速开发管理系统</el-text>
<el-text tag="p">SCFS-UI 是一个前后端分离后台管理系统 前端集成 amis 低代码前端框架包含基础权限安全认证以及常用的一些组件功能项目易上手技术更综合能力更全面</el-text>
<el-text tag="p">amis 是一个低代码前端框架它使用 JSON 配置来生成页面可以减少页面开发工作量极大提升效率</el-text>
<el-text tag="p">magic-api 一个基于 Java 的接口快速开发框架通过 magic-api 提供的 UI 界面完成编写接口无需定义 ControllerServiceDaoMapperXMLVO Java 对象即可完成常见的 HTTP API 接口开发</el-text>
</el-space>
</div>
</div>

View File

@ -74,13 +74,16 @@
state.page.size = e;
onLcPages();
}
function onCurrentChange(e) {
state.page.current = e;
onLcPages();
}
function onSearch() {
onLcPages()
}
function onRefresh() {
state.search = {
parentId: null,
@ -127,6 +130,7 @@
})
})
}
function onBatchDelete() {
ElMessageBox.confirm('此操作会永久删除选中的所有数据, 是否继续?', '提示', {
confirmButtonText: '确定',
@ -156,6 +160,7 @@
state.menuVisible = true
})
}
function onContextMenuSubmit() {
ElMessageBox.confirm('此操作会将已绑定的菜单覆盖, 是否继续?', '提示', {
confirmButtonText: '确定',
@ -192,6 +197,7 @@
})
state.selectIds = selectIds
}
function onSelectAll() {
if (state.selectIds && state.selectIds.length === state.data.length) {
state.data.forEach(item => {
@ -331,7 +337,8 @@
<div class="lc-pages">
<div class="pages-classify">
<el-scrollbar height="45rem">
<el-tree :data="state.classifyData" :props="{children: 'children', label: 'name'}" highlight-current @node-click="onNodeClick" empty-text="">
<el-tree :data="state.classifyData" :props="{children: 'children', label: 'name'}" highlight-current
@node-click="onNodeClick" empty-text="暂无数据">
<template #default="{ node, data }">
<el-tooltip placement="right-start" effect="light" popper-class="classify-tooltip">
<span class="custom-tree-node">
@ -352,10 +359,15 @@
</el-tree>
</el-scrollbar>
<el-dialog v-model="state.classifyVisible" title="分类管理" :show-close="false" width="30%">
<el-form :model="state.classifyForm" ref="classifyFormRef" :rules="rules" label-width="60px" status-icon>
<el-form-item v-show="state.classifyForm.parentId !== '0'" label="父级" prop="parentId" :rules="[{required: true, message: '请选择父级', trigger: 'blur'}]">
<el-tree-select v-model="state.classifyForm.parentId" :data="state.classifyData" :props="{children: 'children', label: 'name'}" node-key="id"
check-strictly :render-after-expand="false" :default-checked-keys="[state.classifyForm.parentId]" :default-expanded-keys="[state.classifyForm.parentId]" placeholder="请选父级" style="width:100%"/>
<el-form :model="state.classifyForm" ref="classifyFormRef" label-width="60px" status-icon>
<el-form-item v-show="state.classifyForm.parentId !== '0'" label="父级" prop="parentId"
:rules="[{required: true, message: '请选择父级', trigger: 'blur'}]">
<el-tree-select v-model="state.classifyForm.parentId" :data="state.classifyData"
:props="{children: 'children', label: 'name'}" node-key="id"
check-strictly :render-after-expand="false"
:default-checked-keys="[state.classifyForm.parentId]"
:default-expanded-keys="[state.classifyForm.parentId]" placeholder="请选父级"
style="width:100%"/>
</el-form-item>
<el-form-item label="名称" prop="name" :rules="[{required: true, message: '请输入名称', trigger: 'blur'}]">
<el-input v-model="state.classifyForm.name" placeholder="请输入名称"/>
@ -380,20 +392,29 @@
<div class="main-operate">
<el-button @click="onSelectAll()"></el-button>
<el-button @click="onAdd()" type="primary">新增</el-button>
<el-button @click="onBatchDelete()" :disabled="state.selectIds && state.selectIds.length === 0" type="danger">批量删除</el-button>
<el-button v-if="state.search.parentId && state.search.parentId !== '0'" @click="onRefresh()" type="primary" icon="Back" style="float: right;"></el-button>
<el-button @click="onBatchDelete()" :disabled="state.selectIds && state.selectIds.length === 0"
type="danger">批量删除
</el-button>
<el-button v-if="state.search.parentId && state.search.parentId !== '0'" @click="onRefresh()" type="primary"
icon="Back" style="float: right;">返回
</el-button>
</div>
<div v-if="state.data" v-loading="state.loading" class="main-card">
<el-card v-for="item in state.data" :key="item" shadow="hover" :body-style="{ padding: '0px' }" :id="'page'+item.id" style="margin: 0.4rem;">
<el-card v-for="item in state.data" :key="item" shadow="hover" :body-style="{ padding: '0px' }"
:id="'page'+item.id" style="margin: 0.4rem;">
<template #header>
<div class="card-header">
<el-text tag="b">{{ item.title }}</el-text>
<el-checkbox @change="onSelecting()" v-model="item.checked" :true-label="1" :false-label="0"/>
<el-checkbox @change="onSelecting()" v-model="item.checked" :true-value="1" :false-value="0"/>
</div>
</template>
<div @click="onPageClick(item)" class="card-content">
<el-icon v-if="!item.menuIds || item.menuIds.length === 0" size="100" color="#E6A23C"><Setting /></el-icon>
<el-icon v-else size="100" color="#67C23A"><UploadFilled /></el-icon>
<el-icon v-if="!item.menuIds || item.menuIds.length === 0" size="100" color="#E6A23C">
<Setting/>
</el-icon>
<el-icon v-else size="100" color="#67C23A">
<UploadFilled/>
</el-icon>
<div class="content">
<div class="content-item">
<el-text truncated>{{ item.subtitle }}</el-text>
@ -403,21 +424,27 @@
</div>
</div>
<div>
<el-text truncated tag="sub" size="small" style="max-width:12rem;padding-top:0.4rem;font-size:12px;">{{item.remarks}}</el-text>
<el-text truncated tag="sub" size="small"
style="max-width:12rem;padding-top:0.4rem;font-size:12px;">{{ item.remarks }}
</el-text>
</div>
</div>
</div>
<div class="card-footer">
<el-button-group style="width:100%; display: flex;">
<el-button @click="onPageDesign(item)" icon="Edit" style="width:100%; border-left: none;">设计页面</el-button>
<el-button @click="onPageDesign(item)" icon="Edit" style="width:100%; border-left: none;">设计页面
</el-button>
<el-button @click="onRename(item)" icon="EditPen" style="width:100%">修改</el-button>
<el-button @click="onDelete(item)" icon="Delete" style="width:100%">删除</el-button>
<el-button @click="onContextMenu(item)" icon="Connection" style="width:100%; border-right: none;">关联菜单</el-button>
<el-button @click="onContextMenu(item)" icon="Connection" style="width:100%; border-right: none;">
关联菜单
</el-button>
</el-button-group>
</div>
</el-card>
</div>
<el-pagination v-if="state.data && state.data.length > 0" :current-page="state.page.current" :page-size="state.page.size" :total="state.page.total"
<el-pagination v-if="state.data && state.data.length > 0" :current-page="state.page.current"
:page-size="state.page.size" :total="state.page.total"
layout="total, prev, pager, next, jumper"
@size-change="onSizeChange"
@current-change="onCurrentChange" style="margin-top: 1.2rem;"/>
@ -426,9 +453,13 @@
</div>
</el-card>
<el-dialog v-model="state.menuVisible" title="关联菜单" :show-close="false" width="30%">
<el-form :model="state.menuForm" ref="menuFormRef" :rules="rules" label-width="60px" status-icon>
<el-form-item label="菜单" prop="menuId" :rules="[{required: true, message: '请选择菜单', trigger: 'blur'}]">
<el-tree-select v-model="state.menuForm.menuId" :data="state.menuList" :props="{children: 'children', label: 'chineseName'}" node-key="id" multiple :render-after-expand="false" :default-checked-keys="state.menuForm.menuId" :default-expanded-keys="state.menuForm.menuId" style="width:100%;"/>
<el-form :model="state.menuForm" ref="menuFormRef" label-width="60px" status-icon>
<el-form-item label="菜单" prop="menuId"
:rules="[{required: true, message: '请选择菜单', trigger: 'blur'}]">
<el-tree-select v-model="state.menuForm.menuId" :data="state.menuList"
:props="{children: 'children', label: 'chineseName'}" node-key="id" multiple
:render-after-expand="false" :default-checked-keys="state.menuForm.menuId"
:default-expanded-keys="state.menuForm.menuId" style="width:100%;"/>
</el-form-item>
</el-form>
<template #footer>
@ -439,19 +470,28 @@
</template>
</el-dialog>
<el-dialog v-model="state.addVisible" title="新增页面" :show-close="false" width="40%">
<el-form :model="state.addForm" ref="addFormRef" :rules="rules" label-width="100px" status-icon>
<el-form-item label="页面名称" prop="title" :rules="[{required: true, message: '请输入名称', trigger: 'blur'}]">
<el-form :model="state.addForm" ref="addFormRef" label-width="100px" status-icon>
<el-form-item label="页面名称" prop="title"
:rules="[{required: true, message: '请输入名称', trigger: 'blur'}]">
<el-input v-model="state.addForm.title" placeholder="请输入名称"/>
</el-form-item>
<el-form-item label="页面标题" prop="subtitle" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
<el-form-item label="页面标题" prop="subtitle"
:rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
<el-input v-model="state.addForm.subtitle" placeholder="请输入标题"/>
</el-form-item>
<el-form-item label="页面状态" prop="status" :rules="[{required: true, message: '请选择状态', trigger: 'blur'}]">
<el-switch v-model="state.addForm.status" inline-prompt active-text="" :active-value="0" inactive-text="" :inactive-value="1"/>
<el-form-item label="页面状态" prop="status"
:rules="[{required: true, message: '请选择状态', trigger: 'blur'}]">
<el-switch v-model="state.addForm.status" inline-prompt active-text="" :active-value="0"
inactive-text="否" :inactive-value="1"/>
</el-form-item>
<el-form-item label="页面分类" prop="status" :rules="[{required: true, message: '请选择分类', trigger: 'blur'}]">
<el-tree-select v-model="state.addForm.classify" :data="state.classifyData" :props="{children: 'children', label: 'name'}" node-key="id"
check-strictly :render-after-expand="false" :default-checked-keys="[state.addForm.classify]" :default-expanded-keys="[state.addForm.classify]" placeholder="请选父级" style="width:100%"/>
<el-form-item label="页面分类" prop="status"
:rules="[{required: true, message: '请选择分类', trigger: 'blur'}]">
<el-tree-select v-model="state.addForm.classify" :data="state.classifyData"
:props="{children: 'children', label: 'name'}" node-key="id"
check-strictly :render-after-expand="false"
:default-checked-keys="[state.addForm.classify]"
:default-expanded-keys="[state.addForm.classify]" placeholder="请选父级"
style="width:100%"/>
</el-form-item>
<el-form-item label="页面描述" prop="remarks">
<el-input v-model="state.addForm.remarks" placeholder="请输入描述" type="textarea" :rows="2"/>
@ -474,12 +514,15 @@
border: none !important;
padding: 0 !important;
}
.lc-pages {
display: flex;
.pages-classify {
border-right: 1px solid #e4e7ed;
margin: 0 1rem 0 1rem;
min-width: 12rem;
.el-tree-node:hover > .el-tree-node__content {
background-color: #fff !important;
color: var(--theme) !important;
@ -492,31 +535,39 @@
}
.pages-list {
width: 100%;
.pages-search {
display: flex;
}
.pages-main {
padding-top: 1rem;
.main-operate {
padding-bottom: 1rem;
}
.main-card {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.el-card {
// flex: 0 0 24%;
:deep(.el-card__header) {
padding: 1rem;
border: none;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.card-content {
display: flex;
align-items: center;
@ -524,22 +575,27 @@
color: #606266;
padding: 0 0.4rem 1rem 0.4rem;
cursor: pointer;
.content {
width: 100%;
padding-left: 1.2rem;
.content-item {
display: flex;
justify-content: space-between;
}
}
}
.card-footer {
.el-button {
border-bottom: none;
}
.el-button-group > .el-button:first-child {
border-top-left-radius: 0;
}
.el-button-group > .el-button:last-child {
border-top-right-radius: 0;
}

View File

@ -144,7 +144,7 @@
<template>
<div class="dict-container">
<Table :data="table.tableData" :column="table.tableTitle" :operation="table.operation" :page="false" :loading="table.loading">
<Table :data="table.tableData" :column="table.tableTitle" :operation="table.operation" :loading="table.loading">
<template #search>
<div><el-button @click="onAdd(null)" v-permission="'dict:save'" type="primary"></el-button></div>
</template>
@ -155,7 +155,7 @@
</template>
</Table>
<el-dialog title="字典信息" v-model="form.dictVisible" :show-close="false" width="40%">
<el-form :model="form.dictForm" ref="formRef" :rules="rules" label-width="80px" status-icon>
<el-form :model="form.dictForm" ref="formRef" label-width="80px" status-icon>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="分组名称" prop="groupName" :rules="[{required: true,message:'请输入分组名称',trigger: 'blur'}]">
@ -165,8 +165,8 @@
<el-col :span="12">
<el-form-item label="类型" prop="type" :rules="[{required: true,message:'请选择类型',trigger: 'blur'}]">
<el-radio-group v-model="form.dictForm.type">
<el-radio :label="0">系统</el-radio>
<el-radio :label="1">业务</el-radio>
<el-radio :value="0">系统</el-radio>
<el-radio :value="1">业务</el-radio>
</el-radio-group>
</el-form-item>
</el-col>

View File

@ -14,8 +14,7 @@
tableTitle: [
{prop:'code',label:'组织编码',align:'left'},
{prop:'name',label:'组织名称'},
{prop:'name',label:'组织名称'},
{prop:'sort',label:'排序'},
{prop:'sort',label:'组织级别'},
{prop:'createTime',label:'创建时间'},
{prop:'remarks',label:'描述'}
],
@ -126,8 +125,8 @@
</script>
<template>
<div class="org-container">
<Table :data="table.tableData" :column="table.tableTitle" :operation="table.operation" :page="false" :loading="table.loading">
<div>
<Table :data="table.tableData" :column="table.tableTitle" :operation="table.operation" :loading="table.loading">
<template #search>
<div><el-button @click="onAdd(null)" v-permission="'org:save'" type="primary"></el-button></div>
</template>
@ -138,7 +137,7 @@
</template>
</Table>
<el-dialog title="组织信息" v-model="form.orgVisible" :show-close="false" width="40%">
<el-form :model="form.orgForm" ref="formRef" :rules="rules" label-width="80px" status-icon>
<el-form :model="form.orgForm" ref="formRef" label-width="80px" status-icon>
<el-form-item label="名称" prop="name" :rules="[{required: true,message:'请输入名称',trigger: 'blur'}]">
<el-input v-model="form.orgForm.name" placeholder="请输入名称" style="width: 100%"/>
</el-form-item>
@ -158,8 +157,3 @@
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.org-container{
}
</style>

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import {onMounted, reactive, ref, unref} from 'vue'
import {onMounted, reactive, ref} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import type {FormInstance} from 'element-plus'
import Table from '@/components/Table.vue'
@ -8,7 +8,6 @@
const searchForm = reactive({
username: null
})
const table = reactive({
loading: false,
page: {
@ -158,6 +157,8 @@
form.userForm = {
id: val.column.row.id,
username: val.column.row.username,
password: '',
rePassword: '',
nickname: val.column.row.nickname,
type: val.column.row.type,
phone: val.column.row.phone,
@ -232,7 +233,7 @@
</template>
</Table>
<el-dialog title="用户信息" v-model="form.userVisible" :show-close="false" width="50%">
<el-form :model="form.userForm" ref="formRef" :rules="rules" label-width="80px" status-icon>
<el-form :model="form.userForm" ref="formRef" label-width="80px" status-icon>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="username" :rules="[
@ -264,16 +265,16 @@
<el-col :span="12">
<el-form-item label="类型" prop="type" :rules="[{required: true,message:'请选择类型',trigger: 'blur'}]">
<el-radio-group v-model="form.userForm.type">
<el-radio :label="1">管理员</el-radio>
<el-radio :label="2">普通用户</el-radio>
<el-radio :value="1">管理员</el-radio>
<el-radio :value="2">普通用户</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别" prop="gender">
<el-radio-group v-model="form.userForm.gender">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
<el-radio :value="0"></el-radio>
<el-radio :value="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -306,7 +307,7 @@
<el-col :span="12">
<el-form-item label="角色" prop="roleId" :rules="[{required: true,message:'请选择角色',trigger: 'change'}]">
<el-select v-model="form.userForm.roleId" placeholder="请选角色" style="width: 100%">
<el-option v-for="item in form.roleList" :key="item.id" :label="item.name" :value="item.id" />
<el-option v-for="item in form.roleList" :key="item['id']" :label="item['name']" :value="item['id']" />
</el-select>
</el-form-item>
</el-col>