mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
fix: machine file bug
This commit is contained in:
@@ -12,30 +12,25 @@
|
|||||||
|
|
||||||
/* Form 表单
|
/* Form 表单
|
||||||
------------------------------- */
|
------------------------------- */
|
||||||
.el-form {
|
// .el-form {
|
||||||
|
|
||||||
// 用于修改弹窗时表单内容间隔太大问题,如系统设置的新增菜单弹窗里的表单内容
|
// // 修复行内表单最后一个 el-form-item 位置下移问题
|
||||||
.el-form-item:last-of-type {
|
// &.el-form--inline {
|
||||||
margin-bottom: 0 !important;
|
// .el-form-item--large.el-form-item:last-of-type {
|
||||||
}
|
// margin-bottom: 22px !important;
|
||||||
|
// }
|
||||||
|
|
||||||
// 修复行内表单最后一个 el-form-item 位置下移问题
|
// .el-form-item--default.el-form-item:last-of-type,
|
||||||
&.el-form--inline {
|
// .el-form-item--small.el-form-item:last-of-type {
|
||||||
.el-form-item--large.el-form-item:last-of-type {
|
// margin-bottom: 18px !important;
|
||||||
margin-bottom: 22px !important;
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
.el-form-item--default.el-form-item:last-of-type,
|
|
||||||
.el-form-item--small.el-form-item:last-of-type {
|
|
||||||
margin-bottom: 18px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I5K1PM
|
// .el-form-item .el-form-item__label .el-icon {
|
||||||
.el-form-item .el-form-item__label .el-icon {
|
// margin-right: 0px;
|
||||||
margin-right: 0px;
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
/* Alert 警告
|
/* Alert 警告
|
||||||
------------------------------- */
|
------------------------------- */
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const searchItems = [
|
|||||||
|
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
TableColumn.new('db', 'db.db'),
|
TableColumn.new('db', 'db.db'),
|
||||||
TableColumn.new('table', 'db.type'),
|
TableColumn.new('table', 'db.table'),
|
||||||
TableColumn.new('type', 'db.stmtType').typeTag(DbSqlExecTypeEnum).setAddWidth(10),
|
TableColumn.new('type', 'db.stmtType').typeTag(DbSqlExecTypeEnum).setAddWidth(10),
|
||||||
TableColumn.new('creator', 'db.execUser'),
|
TableColumn.new('creator', 'db.execUser'),
|
||||||
TableColumn.new('sql', 'SQL').canBeautify(),
|
TableColumn.new('sql', 'SQL').canBeautify(),
|
||||||
|
|||||||
@@ -273,8 +273,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="type" :label="$t('common.type')">
|
<el-form-item prop="type" :label="$t('common.type')">
|
||||||
<el-radio-group v-model="createFileDialog.type">
|
<el-radio-group v-model="createFileDialog.type">
|
||||||
<el-radio value="d" label="d">{{ $t('machine.file') }}</el-radio>
|
<el-radio value="d" label="d">{{ $t('machine.folder') }}</el-radio>
|
||||||
<el-radio value="-" label="-">{{ $t('machine.folder') }}</el-radio>
|
<el-radio value="-" label="-">{{ $t('machine.file') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
<el-dialog :title="title" :destroy-on-close="true" v-model="dialogVisible" width="800px">
|
<el-dialog :title="title" :destroy-on-close="true" v-model="dialogVisible" width="800px">
|
||||||
<el-form :model="form" :inline="true" ref="menuForm" :rules="rules" label-width="auto">
|
<el-form :model="form" :inline="true" ref="menuForm" :rules="rules" label-width="auto">
|
||||||
<el-row :gutter="35">
|
<el-row :gutter="35">
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
||||||
<el-form-item class="w100" prop="type" :label="$t('common.type')" required>
|
<el-form-item class="w100" prop="type" :label="$t('common.type')" required>
|
||||||
<enum-select :enums="ResourceTypeEnum" v-model="form.type" :disabled="typeDisabled" />
|
<enum-select :enums="ResourceTypeEnum" v-model="form.type" :disabled="typeDisabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
||||||
<el-form-item class="w100" prop="name" :label="$t('common.name')" required>
|
<el-form-item class="w100" prop="name" :label="$t('common.name')" required>
|
||||||
<el-input v-model.trim="form.name" auto-complete="off"></el-input>
|
<el-input v-model.trim="form.name" auto-complete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
||||||
<el-form-item class="w100" prop="code" label="path|code">
|
<el-form-item class="w100" prop="code" label="path|code">
|
||||||
<template #label>
|
<template #label>
|
||||||
path|code
|
path|code
|
||||||
@@ -26,12 +26,12 @@
|
|||||||
<el-input v-model.trim="form.code" :placeholder="$t('system.menu.menuCodePlaceholder')" auto-complete="off"></el-input>
|
<el-input v-model.trim="form.code" :placeholder="$t('system.menu.menuCodePlaceholder')" auto-complete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100" :label="$t('system.menu.icon')">
|
<el-form-item class="w100" :label="$t('system.menu.icon')">
|
||||||
<icon-selector v-model="form.meta.icon" />
|
<icon-selector v-model="form.meta.icon" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100">
|
<el-form-item class="w100">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ $t('system.menu.routerName') }}
|
{{ $t('system.menu.routerName') }}
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<el-input v-model.trim="form.meta.routeName"></el-input>
|
<el-input v-model.trim="form.meta.routeName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100" prop="code">
|
<el-form-item class="w100" prop="code">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ $t('system.menu.componentPath') }}
|
{{ $t('system.menu.componentPath') }}
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<el-input v-model.trim="form.meta.component"></el-input>
|
<el-input v-model.trim="form.meta.component"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100" prop="isKeepAlive">
|
<el-form-item class="w100" prop="isKeepAlive">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ $t('system.menu.isCache') }}
|
{{ $t('system.menu.isCache') }}
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100">
|
<el-form-item class="w100">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ $t('system.menu.isHide') }}
|
{{ $t('system.menu.isHide') }}
|
||||||
@@ -87,14 +87,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100" prop="code" :label="$t('system.menu.tagIsDelete')">
|
<el-form-item class="w100" prop="code" :label="$t('system.menu.tagIsDelete')">
|
||||||
<el-select v-model="form.meta.isAffix" class="w100">
|
<el-select v-model="form.meta.isAffix" class="w100">
|
||||||
<el-option v-for="item in trueFalseOption" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
<el-option v-for="item in trueFalseOption" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue">
|
||||||
<el-form-item class="w100" prop="linkType">
|
<el-form-item class="w100" prop="linkType">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ $t('system.menu.externalLink') }}
|
{{ $t('system.menu.externalLink') }}
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="form.type === menuTypeValue && form.meta.linkType > 0">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="form.type === menuTypeValue && form.meta.linkType > 0">
|
||||||
<el-form-item prop="code" :label="$t('system.menu.linkAddress')" class="w100">
|
<el-form-item prop="code" :label="$t('system.menu.linkAddress')" class="w100">
|
||||||
<el-input v-model.trim="form.meta.link" :placeholder="$t('system.menu.linkPlaceholder')"></el-input>
|
<el-input v-model.trim="form.meta.link" :placeholder="$t('system.menu.linkPlaceholder')"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ func (d *dbAppImpl) DumpDb(ctx context.Context, reqParam *dto.DumpDb) error {
|
|||||||
}
|
}
|
||||||
if len(tbs) <= 0 {
|
if len(tbs) <= 0 {
|
||||||
log(fmt.Sprintf("failed to get table [%s] information: No table information was retrieved", tableName))
|
log(fmt.Sprintf("failed to get table [%s] information: No table information was retrieved", tableName))
|
||||||
return errorx.NewBiz(fmt.Sprintf("Failed to get table information: %s", tableName))
|
return errorx.NewBiz("Failed to get table information: %s", tableName)
|
||||||
}
|
}
|
||||||
|
|
||||||
tableInfo := tbs[0]
|
tableInfo := tbs[0]
|
||||||
|
|||||||
@@ -446,11 +446,11 @@ func (d *dbSqlExecAppImpl) doUpdate(ctx context.Context, sqlExecParam *sqlExecPa
|
|||||||
}
|
}
|
||||||
execRecord.Table = tableName
|
execRecord.Table = tableName
|
||||||
|
|
||||||
whereStr := updatestmt.Where.GetText()
|
if updatestmt.Where == nil {
|
||||||
if whereStr == "" {
|
|
||||||
logx.ErrorContext(ctx, "update SQL - there is no where condition")
|
logx.ErrorContext(ctx, "update SQL - there is no where condition")
|
||||||
return d.doExec(ctx, dbConn, sqlExecParam.Sql)
|
return d.doExec(ctx, dbConn, sqlExecParam.Sql)
|
||||||
}
|
}
|
||||||
|
whereStr := updatestmt.Where.GetText()
|
||||||
|
|
||||||
// 获取表主键列名,排除使用别名
|
// 获取表主键列名,排除使用别名
|
||||||
primaryKey, err := dbConn.GetMetadata().GetPrimaryKey(tableName)
|
primaryKey, err := dbConn.GetMetadata().GetPrimaryKey(tableName)
|
||||||
|
|||||||
@@ -441,23 +441,27 @@ func (v *MysqlVisitor) VisitInPredicate(ctx *mysqlparser.InPredicateContext) int
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *MysqlVisitor) VisitBetweenPredicate(ctx *mysqlparser.BetweenPredicateContext) interface{} {
|
func (v *MysqlVisitor) VisitBetweenPredicate(ctx *mysqlparser.BetweenPredicateContext) interface{} {
|
||||||
node := sqlstmt.NewNode(ctx.GetParser(), ctx)
|
predicate := new(sqlstmt.PredicateLike)
|
||||||
return node
|
predicate.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||||
|
return predicate
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *MysqlVisitor) VisitIsNullPredicate(ctx *mysqlparser.IsNullPredicateContext) interface{} {
|
func (v *MysqlVisitor) VisitIsNullPredicate(ctx *mysqlparser.IsNullPredicateContext) interface{} {
|
||||||
node := sqlstmt.NewNode(ctx.GetParser(), ctx)
|
predicate := new(sqlstmt.PredicateLike)
|
||||||
return node
|
predicate.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||||
|
return predicate
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *MysqlVisitor) VisitLikePredicate(ctx *mysqlparser.LikePredicateContext) interface{} {
|
func (v *MysqlVisitor) VisitLikePredicate(ctx *mysqlparser.LikePredicateContext) interface{} {
|
||||||
node := sqlstmt.NewNode(ctx.GetParser(), ctx)
|
likePredicate := new(sqlstmt.PredicateLike)
|
||||||
return node
|
likePredicate.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||||
|
return likePredicate
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *MysqlVisitor) VisitRegexpPredicate(ctx *mysqlparser.RegexpPredicateContext) interface{} {
|
func (v *MysqlVisitor) VisitRegexpPredicate(ctx *mysqlparser.RegexpPredicateContext) interface{} {
|
||||||
node := sqlstmt.NewNode(ctx.GetParser(), ctx)
|
predicate := new(sqlstmt.PredicateLike)
|
||||||
return node
|
predicate.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||||
|
return predicate
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *MysqlVisitor) VisitUnaryExpressionAtom(ctx *mysqlparser.UnaryExpressionAtomContext) interface{} {
|
func (v *MysqlVisitor) VisitUnaryExpressionAtom(ctx *mysqlparser.UnaryExpressionAtomContext) interface{} {
|
||||||
|
|||||||
@@ -59,6 +59,14 @@ type (
|
|||||||
|
|
||||||
ExprAtom IExprAtom
|
ExprAtom IExprAtom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PredicateLike struct {
|
||||||
|
Predicate
|
||||||
|
|
||||||
|
InPredicate IPredicate
|
||||||
|
Exprs []IExpr
|
||||||
|
SelectStmt ISelectStmt
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (*Predicate) isPredicate() {}
|
func (*Predicate) isPredicate() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user