mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gin-vue-admin",
|
||||
"version": "2.5.4",
|
||||
"version": "2.5.5",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "node openDocument.js && vite --host --mode development",
|
||||
@@ -49,4 +49,4 @@
|
||||
"vite-plugin-banner": "^0.1.3",
|
||||
"vite-plugin-importer": "^0.2.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
import service from '@/utils/request'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const handleFileError = (res, fileName) => {
|
||||
if (typeof (res.data) !== 'undefined') {
|
||||
if (res.data.type === 'application/json') {
|
||||
const reader = new FileReader()
|
||||
reader.onload = function() {
|
||||
const message = JSON.parse(reader.result).msg
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
reader.readAsText(new Blob([res.data]))
|
||||
}
|
||||
} else {
|
||||
var downloadUrl = window.URL.createObjectURL(new Blob([res]))
|
||||
var a = document.createElement('a')
|
||||
a.style.display = 'none'
|
||||
a.href = downloadUrl
|
||||
a.download = fileName
|
||||
var event = new MouseEvent('click')
|
||||
a.dispatchEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
// @Tags excel
|
||||
// @Summary 导出Excel
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Produce application/octet-stream
|
||||
// @Param data body model.ExcelInfo true "导出Excel文件信息"
|
||||
// @Success 200
|
||||
// @Router /excel/exportExcel [post]
|
||||
export const exportExcel = (tableData, fileName) => {
|
||||
service({
|
||||
url: '/excel/exportExcel',
|
||||
method: 'post',
|
||||
data: {
|
||||
fileName: fileName,
|
||||
infoList: tableData
|
||||
},
|
||||
responseType: 'blob'
|
||||
}).then((res) => {
|
||||
handleFileError(res, fileName)
|
||||
})
|
||||
}
|
||||
|
||||
// @Tags excel
|
||||
// @Summary 导入Excel文件
|
||||
// @Security ApiKeyAuth
|
||||
// @accept multipart/form-data
|
||||
// @Produce application/json
|
||||
// @Param file formData file true "导入Excel文件"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"导入成功"}"
|
||||
// @Router /excel/importExcel [post]
|
||||
export const loadExcelData = () => {
|
||||
return service({
|
||||
url: '/excel/loadExcel',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// @Tags excel
|
||||
// @Summary 下载模板
|
||||
// @Security ApiKeyAuth
|
||||
// @accept multipart/form-data
|
||||
// @Produce application/json
|
||||
// @Param fileName query fileName true "模板名称"
|
||||
// @Success 200
|
||||
// @Router /excel/downloadTemplate [get]
|
||||
export const downloadTemplate = (fileName) => {
|
||||
return service({
|
||||
url: '/excel/downloadTemplate',
|
||||
method: 'get',
|
||||
params: {
|
||||
fileName: fileName
|
||||
},
|
||||
responseType: 'blob'
|
||||
}).then((res) => {
|
||||
handleFileError(res, fileName)
|
||||
})
|
||||
}
|
||||
+1
-1
@@ -72,7 +72,7 @@ export const getMenuAuthority = (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary 获取用户menu关联关系
|
||||
// @Summary 删除menu
|
||||
// @Produce application/json
|
||||
// @Param ID float64
|
||||
// @Router /menu/deleteBaseMenu [post]
|
||||
|
||||
+48
-48
@@ -3,56 +3,56 @@
|
||||
*/
|
||||
|
||||
const config = {
|
||||
appName: 'Gin-Vue-Admin',
|
||||
appLogo: 'https://www.gin-vue-admin.com/img/logo.png',
|
||||
showViteLogo: true
|
||||
appName: 'Gin-Vue-Admin',
|
||||
appLogo: 'https://www.gin-vue-admin.com/img/logo.png',
|
||||
showViteLogo: true
|
||||
}
|
||||
|
||||
export const viteLogo = (env) => {
|
||||
if (config.showViteLogo) {
|
||||
const chalk = require('chalk')
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 当前版本:v2.5.4`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 加群方式:微信:shouzi_1994 QQ群:622360840`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> GVA讨论社区:https://support.qq.com/products/371961`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 插件市场:https://plugin.gin-vue-admin.com`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html`
|
||||
)
|
||||
)
|
||||
console.log('\n')
|
||||
}
|
||||
if (config.showViteLogo) {
|
||||
const chalk = require('chalk')
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 当前版本:v2.5.5`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 加群方式:微信:shouzi_1994 QQ群:622360840`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> GVA讨论社区:https://support.qq.com/products/371961`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 插件市场:https://plugin.gin-vue-admin.com`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`
|
||||
)
|
||||
)
|
||||
console.log(
|
||||
chalk.green(
|
||||
`> 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html`
|
||||
)
|
||||
)
|
||||
console.log('\n')
|
||||
}
|
||||
}
|
||||
|
||||
export default config
|
||||
export default config
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
register(app)
|
||||
console.log(`
|
||||
欢迎使用 Gin-Vue-Admin
|
||||
当前版本:v2.5.4b
|
||||
当前版本:v2.5.5
|
||||
加群方式:微信:shouzi_1994 QQ群:622360840
|
||||
GVA讨论社区:https://support.qq.com/products/371961
|
||||
插件市场:https://plugin.gin-vue-admin.com
|
||||
|
||||
@@ -105,6 +105,12 @@
|
||||
.el-pagination__total {
|
||||
line-height: 32px !important;
|
||||
}
|
||||
//小屏幕不显示
|
||||
@media (max-width: 750px) {
|
||||
.el-pagination__sizes{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
.btn-prev {
|
||||
padding-right: 6px;
|
||||
display: inline-flex;
|
||||
|
||||
@@ -5,3 +5,15 @@ export const getDict = async(type) => {
|
||||
await dictionaryStore.getDictionary(type)
|
||||
return dictionaryStore.dictionaryMap[type]
|
||||
}
|
||||
|
||||
// 字典文字展示方法
|
||||
export const showDictLabel = (dict, code) => {
|
||||
if (!dict) {
|
||||
return ''
|
||||
}
|
||||
const dictMap = {}
|
||||
dict.forEach(item => {
|
||||
dictMap[item.value] = item.label
|
||||
})
|
||||
return dictMap[code]
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ service.interceptors.request.use(
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
closeLoading()
|
||||
if (!error.config.donNotShowLoading) {
|
||||
closeLoading()
|
||||
}
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: error,
|
||||
@@ -59,7 +61,9 @@ service.interceptors.request.use(
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const userStore = useUserStore()
|
||||
closeLoading()
|
||||
if (!response.config.donNotShowLoading) {
|
||||
closeLoading()
|
||||
}
|
||||
if (response.headers['new-token']) {
|
||||
userStore.setToken(response.headers['new-token'])
|
||||
}
|
||||
@@ -83,7 +87,9 @@ service.interceptors.response.use(
|
||||
}
|
||||
},
|
||||
error => {
|
||||
closeLoading()
|
||||
if (!error.config.donNotShowLoading) {
|
||||
closeLoading()
|
||||
}
|
||||
|
||||
if (!error.response) {
|
||||
ElMessageBox.confirm(`
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
<template>
|
||||
<div class="upload">
|
||||
<div class="gva-table-box">
|
||||
|
||||
<div class="gva-btn-list">
|
||||
<el-upload
|
||||
class="excel-btn"
|
||||
:action="`${path}/excel/importExcel`"
|
||||
:headers="{'x-token':userStore.token}"
|
||||
:on-success="loadExcel"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<el-button size="small" type="primary" icon="upload">导入</el-button>
|
||||
</el-upload>
|
||||
<el-button class="excel-btn" size="small" type="primary" icon="download" @click="handleExcelExport('ExcelExport.xlsx')">导出</el-button>
|
||||
<el-button class="excel-btn" size="small" type="success" icon="download" @click="downloadExcelTemplate()">下载模板</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" row-key="ID">
|
||||
<el-table-column align="left" label="ID" min-width="100" prop="ID" />
|
||||
<el-table-column align="left" show-overflow-tooltip label="路由Name" min-width="160" prop="name" />
|
||||
<el-table-column align="left" show-overflow-tooltip label="路由Path" min-width="160" prop="path" />
|
||||
<el-table-column align="left" label="是否隐藏" min-width="100" prop="hidden">
|
||||
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.hidden?"隐藏":"显示" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="父节点" min-width="90" prop="parentId" />
|
||||
<el-table-column align="left" label="排序" min-width="70" prop="sort" />
|
||||
<el-table-column align="left" label="文件路径" min-width="360" prop="component" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Excel',
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import { useUserStore } from '@/pinia/modules/user'
|
||||
import { exportExcel, loadExcelData, downloadTemplate } from '@/api/excel'
|
||||
import { getMenuList } from '@/api/menu'
|
||||
import { ref } from 'vue'
|
||||
const path = ref(import.meta.env.VITE_BASE_API)
|
||||
|
||||
const page = ref(1)
|
||||
const total = ref(0)
|
||||
const pageSize = ref(999)
|
||||
const tableData = ref([])
|
||||
|
||||
// 查询
|
||||
const getTableData = async(f = () => {}) => {
|
||||
const table = await f({ page: page.value, pageSize: pageSize.value })
|
||||
if (table.code === 0) {
|
||||
tableData.value = table.data.list
|
||||
total.value = table.data.total
|
||||
page.value = table.data.page
|
||||
pageSize.value = table.data.pageSize
|
||||
}
|
||||
}
|
||||
getTableData(getMenuList)
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const handleExcelExport = (fileName) => {
|
||||
if (!fileName || typeof fileName !== 'string') {
|
||||
fileName = 'ExcelExport.xlsx'
|
||||
}
|
||||
exportExcel(tableData.value, fileName)
|
||||
}
|
||||
const loadExcel = () => {
|
||||
getTableData(loadExcelData)
|
||||
}
|
||||
const downloadExcelTemplate = () => {
|
||||
downloadTemplate('ExcelTemplate.xlsx')
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn-list{
|
||||
display: flex;
|
||||
margin-bottom: 12px;
|
||||
justify-content: flex-end;
|
||||
|
||||
}
|
||||
.excel-btn+.excel-btn{
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
+54
-31
@@ -19,12 +19,15 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="hello > 0 " :class="[(hello > 0 && !out)? 'slide-in-left' : '' , out ? 'slide-out-right' : '']" class="form">
|
||||
<div v-if="hello > 0 " :class="[(hello > 0 && !out)? 'slide-in-left' : '' , out ? 'slide-out-right' : '']"
|
||||
class="form">
|
||||
<el-form ref="formRef" :model="form" label-width="100px">
|
||||
<el-form-item label="数据库类型">
|
||||
<el-select v-model="form.dbType" placeholder="请选择" @change="changeDB">
|
||||
<el-option key="mysql" label="mysql" value="mysql" />
|
||||
<el-option key="pgsql" label="pgsql(测试版)" value="pgsql" />
|
||||
<el-option key="pgsql" label="pgsql" value="pgsql" />
|
||||
<el-option key="oracle" label="oracle" value="oracle" />
|
||||
<el-option key="mssql" label="mssql" value="mssql" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="host">
|
||||
@@ -37,10 +40,7 @@
|
||||
<el-input v-model="form.userName" placeholder="请输入数据库用户名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="password">
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
placeholder="请输入数据库密码(没有则为空)"
|
||||
/>
|
||||
<el-input v-model="form.password" placeholder="请输入数据库密码(没有则为空)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="dbName">
|
||||
<el-input v-model="form.dbName" placeholder="请输入数据库名称" />
|
||||
@@ -63,6 +63,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
// @ts-ignore
|
||||
import { initDB } from '@/api/initdb'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElLoading, ElMessage } from 'element-plus'
|
||||
@@ -87,7 +88,7 @@ const form = reactive({
|
||||
port: '3306',
|
||||
userName: 'root',
|
||||
password: '',
|
||||
dbName: 'gva'
|
||||
dbName: 'gva',
|
||||
})
|
||||
const changeDB = (val) => {
|
||||
switch (val) {
|
||||
@@ -98,7 +99,7 @@ const changeDB = (val) => {
|
||||
port: '3306',
|
||||
userName: 'root',
|
||||
password: '',
|
||||
dbName: 'gva'
|
||||
dbName: 'gva',
|
||||
})
|
||||
break
|
||||
case 'pgsql':
|
||||
@@ -108,7 +109,27 @@ const changeDB = (val) => {
|
||||
port: '5432',
|
||||
userName: 'postgres',
|
||||
password: '',
|
||||
dbName: 'gva'
|
||||
dbName: 'gva',
|
||||
})
|
||||
break
|
||||
case 'oracle':
|
||||
Object.assign(form, {
|
||||
dbType: 'oracle',
|
||||
host: '127.0.0.1',
|
||||
port: '1521',
|
||||
userName: 'oracle',
|
||||
password: '',
|
||||
dbName: 'gva',
|
||||
})
|
||||
break
|
||||
case 'mssql':
|
||||
Object.assign(form, {
|
||||
dbType: 'mssql',
|
||||
host: '127.0.0.1',
|
||||
port: '1433',
|
||||
userName: 'mssql',
|
||||
password: '',
|
||||
dbName: 'gva',
|
||||
})
|
||||
break
|
||||
default:
|
||||
@@ -118,16 +139,16 @@ const changeDB = (val) => {
|
||||
port: '3306',
|
||||
userName: 'root',
|
||||
password: '',
|
||||
dbName: 'gva'
|
||||
dbName: 'gva',
|
||||
})
|
||||
}
|
||||
}
|
||||
const onSubmit = async() => {
|
||||
const onSubmit = async () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在初始化数据库,请稍候',
|
||||
spinner: 'loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
try {
|
||||
const res = await initDB(form)
|
||||
@@ -135,7 +156,7 @@ const onSubmit = async() => {
|
||||
out.value = true
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
message: res.msg,
|
||||
})
|
||||
router.push({ name: 'Login' })
|
||||
}
|
||||
@@ -147,26 +168,26 @@ const onSubmit = async() => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.init_page{
|
||||
.init_page {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-image: url("@/assets/login_background.jpg");
|
||||
background-image: url('@/assets/login_background.jpg');
|
||||
background-size: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
.init_page_panel{
|
||||
.init_page_panel {
|
||||
position: absolute;
|
||||
top: 3vh;
|
||||
left: 2vw;
|
||||
width: 96vw;
|
||||
height: 94vh;
|
||||
background-color: rgba(255,255,255,.8);
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
.hello{
|
||||
.hello {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
@@ -176,22 +197,22 @@ const onSubmit = async() => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
.hello_title{
|
||||
.hello_title {
|
||||
font-size: 32px;
|
||||
line-height: 98px;
|
||||
}
|
||||
.in-two{
|
||||
.in-two {
|
||||
font-size: 22px;
|
||||
}
|
||||
.init_p{
|
||||
.init_p {
|
||||
margin-top: 20px;
|
||||
color: #777777;
|
||||
}
|
||||
.init_btn{
|
||||
.init_btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
.form{
|
||||
.form {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
margin-top: 60px;
|
||||
@@ -204,16 +225,19 @@ const onSubmit = async() => {
|
||||
}
|
||||
|
||||
.slide-in-fwd-top {
|
||||
-webkit-animation: slide-in-fwd-top 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
||||
animation: slide-in-fwd-top 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
||||
-webkit-animation: slide-in-fwd-top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)
|
||||
both;
|
||||
animation: slide-in-fwd-top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
||||
}
|
||||
.slide-out-right {
|
||||
-webkit-animation: slide-out-right 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
||||
animation: slide-out-right 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
||||
-webkit-animation: slide-out-right 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53)
|
||||
both;
|
||||
animation: slide-out-right 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
|
||||
}
|
||||
.slide-in-left {
|
||||
-webkit-animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
||||
animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
||||
-webkit-animation: slide-in-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94)
|
||||
both;
|
||||
animation: slide-in-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
||||
}
|
||||
@-webkit-keyframes slide-in-fwd-top {
|
||||
0% {
|
||||
@@ -288,10 +312,9 @@ const onSubmit = async() => {
|
||||
}
|
||||
}
|
||||
@media (max-width: 750px) {
|
||||
.form{
|
||||
.form {
|
||||
width: 94vw !important;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:closable="!(historys.length === 1 && $route.name === defaultRouter)"
|
||||
type="card"
|
||||
@contextmenu.prevent="openContextMenu($event)"
|
||||
@tab-change="changeTab"
|
||||
@tab-click="changeTab"
|
||||
@tab-remove="removeTab"
|
||||
>
|
||||
<el-tab-pane
|
||||
@@ -209,7 +209,9 @@ const setTab = (route) => {
|
||||
|
||||
const historyMap = ref({})
|
||||
|
||||
const changeTab = (name) => {
|
||||
const changeTab = (TabsPaneContext) => {
|
||||
const name = TabsPaneContext?.props?.name
|
||||
if (!name) return
|
||||
const tab = historyMap.value[name]
|
||||
router.push({
|
||||
name: tab.name,
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="10" :lg="14" :md="14" :sm="9" :xl="14" :pull="1">
|
||||
<el-breadcrumb class="breadcrumb">
|
||||
<!-- 修改为手机端不显示顶部标签 -->
|
||||
<el-breadcrumb v-show="!isMobile" class="breadcrumb">
|
||||
<el-breadcrumb-item
|
||||
v-for="item in matched.slice(1,matched.length)"
|
||||
:key="item.path"
|
||||
@@ -41,7 +42,7 @@
|
||||
<div class="dp-flex justify-content-center align-items height-full width-full">
|
||||
<span class="header-avatar" style="cursor: pointer">
|
||||
<CustomPic />
|
||||
<span style="margin-left: 5px">{{ userStore.userInfo.nickName }}</span>
|
||||
<span v-show="!isMobile" style="margin-left: 5px">{{ userStore.userInfo.nickName }}</span>
|
||||
<el-icon>
|
||||
<arrow-down />
|
||||
</el-icon>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
v-if="btnShow"
|
||||
class="user-box"
|
||||
>
|
||||
<div class="gvaIcon gvaIcon-customer-service" @click="toService" />
|
||||
<div class="service gvaIcon-customer-service" @click="toService" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -110,4 +110,20 @@ const toService = () => {
|
||||
75%{-webkit-transform:rotate(270deg);}
|
||||
100%{-webkit-transform:rotate(360deg);}
|
||||
}
|
||||
|
||||
|
||||
.service {
|
||||
font-family: "gvaIcon" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
//小屏幕不显示
|
||||
@media (max-width: 750px) {
|
||||
.service {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha">
|
||||
<el-form-item prop="captcha" v-if="loginFormData.openCaptcha">
|
||||
<div class="vPicBox">
|
||||
<el-input
|
||||
v-model="loginFormData.captcha"
|
||||
@@ -151,6 +151,7 @@ const loginVerify = () => {
|
||||
})
|
||||
picPath.value = ele.data.picPath
|
||||
loginFormData.captchaId = ele.data.captchaId
|
||||
loginFormData.openCaptcha = ele.data.openCaptcha
|
||||
})
|
||||
}
|
||||
loginVerify()
|
||||
@@ -168,6 +169,7 @@ const loginFormData = reactive({
|
||||
password: '123456',
|
||||
captcha: '',
|
||||
captchaId: '',
|
||||
openCaptcha: false,
|
||||
})
|
||||
const rules = reactive({
|
||||
username: [{ validator: checkUsername, trigger: 'blur' }],
|
||||
|
||||
@@ -302,6 +302,12 @@ const rules = ref({
|
||||
nickName: [
|
||||
{ required: true, message: '请输入用户昵称', trigger: 'blur' }
|
||||
],
|
||||
phone: [
|
||||
{ pattern: /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/, message: "请输入合法手机号", trigger: "blur" },
|
||||
],
|
||||
email: [
|
||||
{ pattern: /^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g, message: "请输入正确的邮箱", trigger: "blur" },
|
||||
],
|
||||
authorityId: [
|
||||
{ required: true, message: '请选择用户角色', trigger: 'blur' }
|
||||
]
|
||||
|
||||
@@ -150,21 +150,81 @@
|
||||
</div>
|
||||
<el-table :data="form.fields">
|
||||
<el-table-column align="left" type="index" label="序列" width="60" />
|
||||
<el-table-column align="left" prop="fieldName" label="Field名" />
|
||||
<el-table-column align="left" prop="fieldDesc" label="中文名" />
|
||||
<el-table-column align="left" prop="require" label="是否必填">
|
||||
<template #default="{row}">{{ row.require?"是":"否" }}</template>
|
||||
<el-table-column align="left" prop="fieldName" label="Field名" width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.fieldName" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="sort" label="是否排序">
|
||||
<template #default="{row}">{{ row.sort?"是":"否" }}</template>
|
||||
<el-table-column align="left" prop="fieldDesc" label="中文名" width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.fieldDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="require" label="必填">
|
||||
<template #default="{row}"> <el-checkbox v-model="row.require" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="sort" label="排序">
|
||||
<template #default="{row}"> <el-checkbox v-model="row.sort" /> </template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="fieldJson" width="160px" label="FieldJson">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.fieldJson" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="fieldType" label="Field数据类型" width="160">
|
||||
<template #default="{row}">
|
||||
<el-select
|
||||
v-model="row.fieldType"
|
||||
style="width:100%"
|
||||
placeholder="请选择field数据类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="dataTypeLong" label="数据库字段长度" width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.dataTypeLong" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="columnName" label="数据库字段" width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.columnName" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="comment" label="数据库字段描述" width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.columnName" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="fieldSearchType" label="搜索条件" width="130">
|
||||
<template #default="{row}">
|
||||
<el-select
|
||||
v-model="row.fieldSearchType"
|
||||
style="width:100%"
|
||||
placeholder="请选择Field查询条件"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeSearchOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="
|
||||
(row.fieldType!=='string'&&item.value==='LIKE')||
|
||||
((row.fieldType!=='int'&&row.fieldType!=='time.Time'&&row.fieldType!=='float64')&&(item.value==='BETWEEN' || item.value==='NOT BETWEEN'))
|
||||
"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column align="left" prop="fieldJson" min-width="120px" label="FieldJson" />
|
||||
<el-table-column align="left" prop="fieldType" label="Field数据类型" width="130" />
|
||||
<el-table-column align="left" prop="dataTypeLong" label="数据库字段长度" width="130" />
|
||||
<el-table-column align="left" prop="columnName" label="数据库字段" width="130" />
|
||||
<el-table-column align="left" prop="comment" label="数据库字段描述" width="130" />
|
||||
<el-table-column align="left" prop="fieldSearchType" label="搜索条件" width="130" />
|
||||
<el-table-column align="left" prop="dictType" label="字典" width="130" />
|
||||
<el-table-column align="left" label="操作" width="300" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -173,7 +233,7 @@
|
||||
link
|
||||
icon="edit"
|
||||
@click="editAndAddField(scope.row)"
|
||||
>编辑</el-button>
|
||||
>高级编辑</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@@ -248,6 +308,64 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import WarningBar from '@/components/warningBar/warningBar.vue'
|
||||
|
||||
const typeOptions = ref([
|
||||
{
|
||||
label: '字符串',
|
||||
value: 'string'
|
||||
},
|
||||
{
|
||||
label: '整型',
|
||||
value: 'int'
|
||||
},
|
||||
{
|
||||
label: '布尔值',
|
||||
value: 'bool'
|
||||
},
|
||||
{
|
||||
label: '浮点型',
|
||||
value: 'float64'
|
||||
},
|
||||
{
|
||||
label: '时间',
|
||||
value: 'time.Time'
|
||||
},
|
||||
{
|
||||
label: '枚举',
|
||||
value: 'enum'
|
||||
}
|
||||
])
|
||||
|
||||
const typeSearchOptions = ref([
|
||||
{
|
||||
label: '=',
|
||||
value: '='
|
||||
},
|
||||
{
|
||||
label: '<>',
|
||||
value: '<>'
|
||||
},
|
||||
{
|
||||
label: '>',
|
||||
value: '>'
|
||||
},
|
||||
{
|
||||
label: '<',
|
||||
value: '<'
|
||||
},
|
||||
{
|
||||
label: 'LIKE',
|
||||
value: 'LIKE'
|
||||
},
|
||||
{
|
||||
label: 'BETWEEN',
|
||||
value: 'BETWEEN'
|
||||
},
|
||||
{
|
||||
label: 'NOT BETWEEN',
|
||||
value: 'NOT BETWEEN'
|
||||
}
|
||||
])
|
||||
|
||||
const fieldTemplate = {
|
||||
fieldName: '',
|
||||
fieldDesc: '',
|
||||
|
||||
@@ -145,6 +145,15 @@
|
||||
<el-form-item label="数据库">
|
||||
<el-input v-model="config.mysql['db-name']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="前缀">
|
||||
<el-input v-model="config.mysql['refix']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="复数表">
|
||||
<el-switch v-model="config.mysql['singular']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="引擎">
|
||||
<el-input v-model="config.mysql['engine']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="maxIdleConns">
|
||||
<el-input v-model.number="config.mysql['max-idle-conns']" />
|
||||
</el-form-item>
|
||||
@@ -171,6 +180,15 @@
|
||||
<el-form-item label="数据库">
|
||||
<el-input v-model="config.pgsql.dbname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="前缀">
|
||||
<el-input v-model="config.pgsql['refix']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="复数表">
|
||||
<el-switch v-model="config.pgsql['singular']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="引擎">
|
||||
<el-input v-model="config.pgsql['engine']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="maxIdleConns">
|
||||
<el-input v-model.number="config.pgsql['max-idle-conns']" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user