mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-25 05:50:19 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2c5988bea | ||
|
|
3d2e9ef063 | ||
|
|
28c7d178c4 | ||
|
|
024f461e94 | ||
|
|
a25823f5b5 | ||
|
|
4d4d8e4955 | ||
|
|
7488db81c1 | ||
|
|
e8c6d388f2 | ||
|
|
986406a880 | ||
|
|
2946c8ce34 | ||
|
|
fef12cb747 | ||
|
|
4d8d4b77c1 | ||
|
|
6f589d7af9 | ||
|
|
e28217e5ec |
@@ -84,7 +84,7 @@ func InitSysApi(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_apis表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Apis).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Apis).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -20,7 +20,7 @@ func InitSysAuthority(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_authorities表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Authorities).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Authorities).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -24,7 +24,7 @@ func InitSysDataAuthorityId(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_data_authority_id表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&DataAuthorityId).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&DataAuthorityId).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -72,7 +72,7 @@ func InitSysAuthorityMenus(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_authority_menus表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&AuthorityMenus).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&AuthorityMenus).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -153,16 +153,11 @@ var Carbines = []gormadapter.CasbinRule{
|
||||
|
||||
func InitCasbinModel(db *gorm.DB) (err error) {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
if !tx.Migrator().HasTable("casbin_rule") {
|
||||
if err := tx.Migrator().CreateTable(&gormadapter.CasbinRule{}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if tx.Where("p_type = ? AND v0 IN ?", "p", []string{"888", "8881", "9528"}).Find(&[]gormadapter.CasbinRule{}).RowsAffected == 142 {
|
||||
color.Danger.Println("casbin_rule表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Carbines).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Carbines).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -19,7 +19,7 @@ func InitExaCustomer(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("exa_customers表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Customers).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Customers).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -9,15 +9,6 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type SysDictionaryToPostgresql struct {
|
||||
global.GVA_MODEL
|
||||
Name string `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"`
|
||||
Type string `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"`
|
||||
Status *bool `json:"status" form:"status" gorm:"column:status;comment:状态"`
|
||||
Description string `json:"description" form:"description" gorm:"column:description;comment:'描述'"`
|
||||
SysDictionaryDetails []model.SysDictionaryDetail `json:"sysDictionaryDetails" form:"sysDictionaryDetails"`
|
||||
}
|
||||
|
||||
func InitSysDictionary(db *gorm.DB) (err error) {
|
||||
var status = new(bool)
|
||||
*status = true
|
||||
@@ -34,32 +25,9 @@ func InitSysDictionary(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_dictionaries表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Dictionaries).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Dictionaries).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func InitSysDictionaryToPostgresql(db *gorm.DB) (err error) {
|
||||
status := new(bool)
|
||||
*status = true
|
||||
Dictionaries := []SysDictionaryToPostgresql{
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "性别", Type: "sex", Status: status, Description: "性别字典"},
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库int类型", Type: "int", Status: status, Description: "int类型对应的数据库类型"},
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库时间日期类型", Type: "time.Time", Status: status, Description: "数据库时间日期类型"},
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库浮点型", Type: "float64", Status: status, Description: "数据库浮点型"},
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库字符串", Type: "string", Status: status, Description: "数据库字符串"},
|
||||
{GVA_MODEL: global.GVA_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库bool类型", Type: "bool", Status: status, Description: "数据库bool类型"},
|
||||
}
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
if tx.Where("id IN ?", []int{1, 6}).Find(&[]model.SysDictionary{}).RowsAffected == 2 {
|
||||
color.Danger.Println("sys_dictionaries表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Dictionaries).Error != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ func InitSysDictionaryDetail(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_dictionary_details表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&DictionaryDetail).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&DictionaryDetail).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -20,7 +20,7 @@ func InitExaFileUploadAndDownload(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("exa_file_upload_and_downloads表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Files).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Files).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -31,6 +31,9 @@ func InitMysqlData(db *gorm.DB) {
|
||||
|
||||
func InitMysqlTables(db *gorm.DB) {
|
||||
var err error
|
||||
if !db.Migrator().HasTable("casbin_rule") {
|
||||
err = db.Migrator().CreateTable(&gormadapter.CasbinRule{})
|
||||
}
|
||||
err = db.AutoMigrate(
|
||||
model.SysApi{},
|
||||
model.SysUser{},
|
||||
@@ -54,55 +57,4 @@ func InitMysqlTables(db *gorm.DB) {
|
||||
os.Exit(0)
|
||||
}
|
||||
color.Info.Println("[Mysql]-->初始化数据表成功")
|
||||
}
|
||||
|
||||
func InitPostgresqlData(db *gorm.DB) {
|
||||
var err error
|
||||
err = InitSysApi(db)
|
||||
err = InitSysUser(db)
|
||||
err = InitExaCustomer(db)
|
||||
err = InitCasbinModel(db)
|
||||
err = InitSysAuthority(db)
|
||||
err = InitSysBaseMenus(db)
|
||||
err = InitAuthorityMenu(db)
|
||||
err = InitSysAuthorityMenus(db)
|
||||
err = InitSysDataAuthorityId(db)
|
||||
err = InitSysDictionaryDetail(db)
|
||||
err = InitExaFileUploadAndDownload(db)
|
||||
err = InitSysDictionaryToPostgresql(db)
|
||||
if err != nil {
|
||||
color.Error.Printf("[Postgresql]-->初始化数据失败,err: %v\n", err)
|
||||
os.Exit(0)
|
||||
}
|
||||
color.Info.Println("[Postgresql]-->初始化数据成功")
|
||||
}
|
||||
|
||||
func InitPostgresqlTables(db *gorm.DB) {
|
||||
var err error
|
||||
if !db.Migrator().HasTable("casbin_rule") {
|
||||
err = db.Migrator().CreateTable(&gormadapter.CasbinRule{})
|
||||
}
|
||||
err = db.AutoMigrate(
|
||||
model.SysApi{},
|
||||
model.SysUser{},
|
||||
model.ExaFile{},
|
||||
model.ExaCustomer{},
|
||||
model.SysBaseMenu{},
|
||||
model.SysWorkflow{},
|
||||
model.SysAuthority{},
|
||||
model.JwtBlacklist{},
|
||||
model.ExaFileChunk{},
|
||||
model.ExaSimpleUploader{},
|
||||
model.SysOperationRecord{},
|
||||
model.SysWorkflowStepInfo{},
|
||||
model.SysDictionaryDetail{},
|
||||
model.SysBaseMenuParameter{},
|
||||
model.ExaFileUploadAndDownload{},
|
||||
SysDictionaryToPostgresql{},
|
||||
)
|
||||
if err != nil {
|
||||
color.Error.Printf("[Postgresql]-->初始化数据表失败,err: %v\n", err)
|
||||
os.Exit(0)
|
||||
}
|
||||
color.Info.Println("[Postgresql]-->初始化数据表成功")
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func InitSysBaseMenus(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_base_menus表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&BaseMenus).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&BaseMenus).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -21,7 +21,7 @@ func InitSysUser(db *gorm.DB) (err error) {
|
||||
color.Danger.Println("sys_users表的初始数据已存在!")
|
||||
return nil
|
||||
}
|
||||
if tx.Create(&Users).Error != nil { // 遇到错误时回滚事务
|
||||
if err := tx.Create(&Users).Error; err != nil { // 遇到错误时回滚事务
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -47,8 +47,7 @@ var initdbCmd = &cobra.Command{
|
||||
datas.InitMysqlTables(db)
|
||||
datas.InitMysqlData(db)
|
||||
case "postgresql":
|
||||
datas.InitPostgresqlTables(db)
|
||||
datas.InitPostgresqlData(db)
|
||||
color.Info.Println("postgresql功能开发中")
|
||||
case "sqlite":
|
||||
color.Info.Println("sqlite功能开发中")
|
||||
case "sqlserver":
|
||||
@@ -56,7 +55,6 @@ var initdbCmd = &cobra.Command{
|
||||
default:
|
||||
datas.InitMysqlTables(db)
|
||||
datas.InitMysqlData(db)
|
||||
color.Info.Println("sqlserver功能开发中")
|
||||
}
|
||||
frame, _ := cmd.Flags().GetString("frame")
|
||||
if frame == "gf" {
|
||||
|
||||
@@ -11,7 +11,7 @@ func Cors() gin.HandlerFunc {
|
||||
method := c.Request.Method
|
||||
origin := c.Request.Header.Get("Origin")
|
||||
c.Header("Access-Control-Allow-Origin", origin)
|
||||
c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id\"")
|
||||
c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id")
|
||||
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT")
|
||||
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type")
|
||||
c.Header("Access-Control-Allow-Credentials", "true")
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
func JWTAuth() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
// 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localSstorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录
|
||||
// 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localStorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录
|
||||
token := c.Request.Header.Get("x-token")
|
||||
if token == "" {
|
||||
response.Result(response.ERROR, gin.H{
|
||||
@@ -66,7 +66,7 @@ func JWTAuth() gin.HandlerFunc {
|
||||
if err!=nil {
|
||||
global.GVA_LOG.Error("get redis jwt failed", zap.Any("err", err))
|
||||
}else{
|
||||
service.JsonInBlacklist(model.JwtBlacklist{Jwt: RedisJwtToken})
|
||||
_ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: RedisJwtToken})
|
||||
//当之前的取成功时才进行拉黑操作
|
||||
}
|
||||
// 无论如何都要记录当前的活跃状态
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
{{ end }}
|
||||
<el-table-column label="按钮组">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="update{{.StructName}}(scope.row)" size="small" type="primary">变更</el-button>
|
||||
<el-button class="table-button" @click="update{{.StructName}}(scope.row)" size="small" type="primary" icon="el-icon-edit">变更</el-button>
|
||||
<el-popover placement="top" width="160" v-model="scope.row.visible">
|
||||
<p>确定要删除吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
@@ -92,7 +92,33 @@
|
||||
></el-pagination>
|
||||
|
||||
<el-dialog :before-close="closeDialog" :visible.sync="dialogFormVisible" title="弹窗操作">
|
||||
此处请使用表单生成器生成form填充 表单默认绑定 formData 如手动修改过请自行修改key
|
||||
<el-form :model="formData" label-position="right" label-width="80px">
|
||||
{{- range .Fields}}
|
||||
<el-form-item label="{{.FieldDesc}}:">
|
||||
{{- if eq .FieldType "bool" }}
|
||||
<el-switch active-color="#13ce66" inactive-color="#ff4949" active-text="是" inactive-text="否" v-model="formData.{{.FieldJson}}" clearable ></el-switch>
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "string" }}
|
||||
<el-input v-model="formData.{{.FieldJson}}" clearable placeholder="请输入" ></el-input>
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "int" }}
|
||||
{{- if .DictType}}
|
||||
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" clearable>
|
||||
<el-option v-for="(item,key) in {{ .DictType }}Options" :key="key" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
{{ else -}}
|
||||
<el-input v-model.number="formData.{{ .FieldJson }}" clearable placeholder="请输入"></el-input>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "time.Time" }}
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="formData.{{ .FieldJson }}" clearable></el-date-picker>
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "float64" }}
|
||||
<el-input-number v-model="formData.{{ .FieldJson }}" :precision="2" clearable></el-input-number>
|
||||
{{ end -}}
|
||||
</el-form-item>
|
||||
{{ end -}}
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="closeDialog">取 消</el-button>
|
||||
<el-button @click="enterDialog" type="primary">确 定</el-button>
|
||||
@@ -111,14 +137,13 @@ import {
|
||||
get{{.StructName}}List
|
||||
} from "@/api/{{.PackageName}}"; // 此处请自行替换地址
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
|
||||
import infoList from "@/mixins/infoList";
|
||||
export default {
|
||||
name: "{{.StructName}}",
|
||||
mixins: [infoList],
|
||||
data() {
|
||||
return {
|
||||
listApi: get{{.StructName}}List,
|
||||
listApi: get{{ .StructName }}List,
|
||||
dialogFormVisible: false,
|
||||
visible: false,
|
||||
type: "",
|
||||
@@ -126,11 +151,27 @@ export default {
|
||||
multipleSelection: [],
|
||||
{{- range .Fields}}
|
||||
{{- if .DictType }}
|
||||
{{.DictType}}Options:[],
|
||||
{{ .DictType }}Options:[],
|
||||
{{ end -}}
|
||||
{{end -}}
|
||||
formData: {
|
||||
{{range .Fields}}{{.FieldJson}}:null,{{ end }}
|
||||
{{range .Fields}}
|
||||
{{- if eq .FieldType "bool" -}}
|
||||
{{.FieldJson}}:false,
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "string" -}}
|
||||
{{.FieldJson}}:"",
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "int" -}}
|
||||
{{.FieldJson}}:0,
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "time.Time" -}}
|
||||
{{.FieldJson}}:new Date(),
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "float64" -}}
|
||||
{{.FieldJson}}:0,
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -192,8 +233,23 @@ export default {
|
||||
closeDialog() {
|
||||
this.dialogFormVisible = false;
|
||||
this.formData = {
|
||||
{{range .Fields}}
|
||||
{{.FieldJson}}:null,{{ end }}
|
||||
{{range .Fields}}
|
||||
{{- if eq .FieldType "bool" -}}
|
||||
{{.FieldJson}}:false,
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "string" -}}
|
||||
{{.FieldJson}}:"",
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "int" -}}
|
||||
{{.FieldJson}}:0,
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "time.Time" -}}
|
||||
{{.FieldJson}}:new Date(),
|
||||
{{ end -}}
|
||||
{{- if eq .FieldType "float64" -}}
|
||||
{{.FieldJson}}:0,
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
};
|
||||
},
|
||||
async delete{{.StructName}}(row) {
|
||||
@@ -236,11 +292,11 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
await this.getTableData();
|
||||
{{- range .Fields -}}
|
||||
{{- if .DictType -}}
|
||||
await this.getDict("{{.DictType}}")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ range .Fields -}}
|
||||
{{- if .DictType }}
|
||||
await this.getDict("{{.DictType}}");
|
||||
{{ end -}}
|
||||
{{- end }}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
type {{.StructName}} struct {
|
||||
global.GVA_MODEL {{- range .Fields}}
|
||||
{{- if eq .FieldType "bool" }}
|
||||
{{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
|
||||
{{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
|
||||
{{- else }}
|
||||
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
|
||||
{{- end }} {{- end }}
|
||||
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
|
||||
{{- end }} {{- end }}
|
||||
}
|
||||
|
||||
{{ if .TableName }}
|
||||
|
||||
@@ -28,10 +28,12 @@ export default {
|
||||
},
|
||||
async getTableData(page = this.page, pageSize = this.pageSize) {
|
||||
const table = await this.listApi({ page, pageSize, ...this.searchInfo })
|
||||
this.tableData = table.data.list
|
||||
this.total = table.data.total
|
||||
this.page = table.data.page
|
||||
this.pageSize = table.data.pageSize
|
||||
if(table.code == 0){
|
||||
this.tableData = table.data.list
|
||||
this.total = table.data.total
|
||||
this.page = table.data.page
|
||||
this.pageSize = table.data.pageSize
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1013,3 +1013,22 @@ li {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-input-number__decrease, .el-input-number__increase{
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 6px !important;
|
||||
width: 42px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
text-align: center;
|
||||
background: #F5F7FA;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
||||
.table-button{
|
||||
margin-right:8px !important;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ service.interceptors.request.use(
|
||||
message: error,
|
||||
type: 'error'
|
||||
})
|
||||
return Promise.reject(error);
|
||||
return error;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -73,7 +73,7 @@ service.interceptors.response.use(
|
||||
if (response.data.data && response.data.data.reload) {
|
||||
store.commit('user/LoginOut')
|
||||
}
|
||||
return Promise.reject(response.data.msg)
|
||||
return response.data.msg
|
||||
}
|
||||
},
|
||||
error => {
|
||||
@@ -83,7 +83,7 @@ service.interceptors.response.use(
|
||||
message: error,
|
||||
type: 'error'
|
||||
})
|
||||
return Promise.reject(error)
|
||||
return error
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ import {
|
||||
getExaCustomerList
|
||||
} from "@/api/customer";
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
|
||||
export default {
|
||||
name: "Customer",
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<script>
|
||||
const path = process.env.VUE_APP_BASE_API;
|
||||
import { mapGetters } from "vuex";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
import { getFileList, deleteFile } from "@/api/fileUploadAndDownload";
|
||||
import { downloadImage } from "@/utils/downloadImg";
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
|
||||
@@ -109,7 +109,7 @@ import {
|
||||
updateApi,
|
||||
deleteApi
|
||||
} from '@/api/api'
|
||||
import infoList from '@/components/mixins/infoList'
|
||||
import infoList from '@/mixins/infoList'
|
||||
import { toSQLLine } from '@/utils/stringFun'
|
||||
const methodOptions = [
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ import Menus from "@/view/superAdmin/authority/components/menus";
|
||||
import Apis from "@/view/superAdmin/authority/components/apis";
|
||||
import Datas from "@/view/superAdmin/authority/components/datas";
|
||||
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
export default {
|
||||
name: "Authority",
|
||||
mixins: [infoList],
|
||||
|
||||
@@ -118,7 +118,7 @@ import {
|
||||
getSysDictionaryList
|
||||
} from "@/api/sysDictionary"; // 此处请自行替换地址
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
export default {
|
||||
name: "SysDictionary",
|
||||
mixins: [infoList],
|
||||
|
||||
@@ -115,7 +115,7 @@ import {
|
||||
getSysDictionaryDetailList
|
||||
} from "@/api/sysDictionaryDetail"; // 此处请自行替换地址
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
|
||||
export default {
|
||||
name: "SysDictionaryDetail",
|
||||
|
||||
@@ -181,7 +181,7 @@ import {
|
||||
deleteBaseMenu,
|
||||
getBaseMenuById
|
||||
} from "@/api/menu";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
import icon from "@/view/superAdmin/menu/icon";
|
||||
export default {
|
||||
name: "Menus",
|
||||
|
||||
@@ -114,7 +114,7 @@ import {
|
||||
deleteSysOperationRecordByIds
|
||||
} from '@/api/sysOperationRecord' // 此处请自行替换地址
|
||||
import { formatTimeToStr } from '@/utils/date'
|
||||
import infoList from '@/components/mixins/infoList'
|
||||
import infoList from '@/mixins/infoList'
|
||||
|
||||
export default {
|
||||
name: 'SysOperationRecord',
|
||||
|
||||
@@ -98,7 +98,7 @@ import {
|
||||
deleteUser
|
||||
} from "@/api/user";
|
||||
import { getAuthorityList } from "@/api/authority";
|
||||
import infoList from "@/components/mixins/infoList";
|
||||
import infoList from "@/mixins/infoList";
|
||||
import { mapGetters } from "vuex";
|
||||
import CustomPic from "@/components/customPic";
|
||||
import ChooseImg from "@/components/chooseImg";
|
||||
|
||||
@@ -195,7 +195,6 @@ export default {
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getDbfdOptions();
|
||||
const dictRes = await getSysDictionaryList({
|
||||
page: 1,
|
||||
pageSize: 999999
|
||||
|
||||
Reference in New Issue
Block a user