Dev273 (#1868)
* fixed: 修复addFunction下前端api.js无法创建的bug。 * feature: 增加严格角色模式 * Update system.vue * fixed: 多点登录拦截模式下,jwt换票期间不需要拉黑token。 * fixed: 修复使用ast时候产生无意义的换行的问题 * fixed: 修复跨级操作角色权限的越权问题 * feature: 优化严格模式角色鉴权操作。 * fixed: 增加菜单和api设置越权问题的限制 * feature: 增加插件打包前的自动化同步所需菜单和api的功能 * feature: 自动化代码可以默认生成导入导出 * feature: 自动化导入导出对模板进行回滚 * feature: 剔除无用的packfile代码包 * feature: 发布V2.7.3版本公测。 --------- Co-authored-by: task <ms.yangdan@gmail.com>
This commit is contained in:
@@ -55,6 +55,9 @@
|
||||
// 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取
|
||||
{{"{{"}} formData.{{.FieldJson}} {{"}}"}}
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<ArrayCtrl v-model="formData.{{ .FieldJson }}" editable/>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</el-form-item>
|
||||
{{- end }}
|
||||
@@ -88,9 +91,12 @@ import { useRoute, useRouter } from "vue-router"
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
{{- if .HasPic }}
|
||||
// 图片选择组件
|
||||
import SelectImage from '@/components/selectImage/selectImage.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasFile }}
|
||||
// 文件选择组件
|
||||
import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
{{- end }}
|
||||
|
||||
@@ -99,6 +105,12 @@ import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
import RichEdit from '@/components/richtext/rich-edit.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasArray}}
|
||||
// 数组控制组件
|
||||
import ArrayCtrl from '@/components/arrayCtrl/arrayCtrl.vue'
|
||||
{{- end }}
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
{{- $global := . }}
|
||||
{{- $templateID := printf "%s_%s" .Package .StructName }}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-search-box">
|
||||
@@ -152,6 +153,11 @@
|
||||
<div class="gva-btn-list">
|
||||
<el-button {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.add"{{ end }} type="primary" icon="plus" @click="openDialog">新增</el-button>
|
||||
<el-button {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.batchDelete"{{ end }} icon="delete" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="onDelete">删除</el-button>
|
||||
{{ if .HasExcel -}}
|
||||
<ExportTemplate {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.exportTemplate"{{ end }} template-id="{{$templateID}}" />
|
||||
<ExportExcel {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.exportExcel"{{ end }} template-id="{{$templateID}}" />
|
||||
<ImportExcel {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.importExcel"{{ end }} template-id="{{$templateID}}" @on-success="getTableData" />
|
||||
{{- end }}
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
@@ -244,6 +250,12 @@
|
||||
[JSON]
|
||||
</template>
|
||||
</el-table-column>
|
||||
{{- else if eq .FieldType "array" }}
|
||||
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
|
||||
<template #default="scope">
|
||||
<ArrayCtrl v-model="scope.row.{{ .FieldJson }}"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
{{- else }}
|
||||
<el-table-column {{- if .Sort}} sortable{{- end}} align="left" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
|
||||
{{- end }}
|
||||
@@ -309,9 +321,7 @@
|
||||
{{"{{"}} formData.{{.FieldJson}} {{"}}"}}
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<el-tag v-for="(item,key) in formData.{{.FieldJson}}" :key="key">
|
||||
{{ "{{ item }}" }}
|
||||
</el-tag>
|
||||
<ArrayCtrl v-model="formData.{{ .FieldJson }}" editable/>
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "int" }}
|
||||
<el-input v-model.number="formData.{{ .FieldJson }}" :clearable="{{.Clearable}}" placeholder="请输入{{.FieldDesc}}" />
|
||||
@@ -361,12 +371,15 @@
|
||||
{{- range .Fields}}
|
||||
{{- if .Desc }}
|
||||
<el-descriptions-item label="{{ .FieldDesc }}">
|
||||
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) }}
|
||||
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
|
||||
{{"{{"}} detailFrom.{{.FieldJson}} {{"}}"}}
|
||||
{{- else }}
|
||||
{{- if eq .FieldType "picture" }}
|
||||
<el-image style="width: 50px; height: 50px" :preview-src-list="returnArrImg(detailFrom.{{ .FieldJson }})" :src="getUrl(detailFrom.{{ .FieldJson }})" fit="cover" />
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<ArrayCtrl v-model="detailFrom.{{ .FieldJson }}"/>
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "pictures" }}
|
||||
<el-image style="width: 50px; height: 50px; margin-right: 10px" :preview-src-list="returnArrImg(detailFrom.{{ .FieldJson }})" :initial-index="index" v-for="(item,index) in detailFrom.{{ .FieldJson }}" :key="index" :src="getUrl(item)" fit="cover" />
|
||||
{{- end }}
|
||||
@@ -414,12 +427,16 @@ import SelectImage from '@/components/selectImage/selectImage.vue'
|
||||
import RichEdit from '@/components/richtext/rich-edit.vue'
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- if .HasFile }}
|
||||
// 文件选择组件
|
||||
import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasArray}}
|
||||
// 数组控制组件
|
||||
import ArrayCtrl from '@/components/arrayCtrl/arrayCtrl.vue'
|
||||
{{- end }}
|
||||
|
||||
// 全量引入格式化工具 请按需保留
|
||||
import { getDictFunc, formatDate, formatBoolean, filterDict ,filterDataSource, returnArrImg, onDownloadFile } from '@/utils/format'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -429,6 +446,16 @@ import { ref, reactive } from 'vue'
|
||||
import { useBtnAuth } from '@/utils/btnAuth'
|
||||
{{- end }}
|
||||
|
||||
{{if .HasExcel -}}
|
||||
// 导出组件
|
||||
import ExportExcel from '@/components/exportExcel/exportExcel.vue'
|
||||
// 导入组件
|
||||
import ImportExcel from '@/components/exportExcel/importExcel.vue'
|
||||
// 导出模板组件
|
||||
import ExportTemplate from '@/components/exportExcel/exportTemplate.vue'
|
||||
{{- end}}
|
||||
|
||||
|
||||
defineOptions({
|
||||
name: '{{.StructName}}'
|
||||
})
|
||||
@@ -779,6 +806,9 @@ const closeDialog = () => {
|
||||
{{- if eq .FieldType "json" }}
|
||||
{{.FieldJson}}: {},
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
{{.FieldJson}}: [],
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
@@ -55,6 +55,9 @@
|
||||
// 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取
|
||||
{{"{{"}} formData.{{.FieldJson}} {{"}}"}}
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<ArrayCtrl v-model="formData.{{ .FieldJson }}" editable/>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</el-form-item>
|
||||
{{- end }}
|
||||
@@ -88,9 +91,12 @@ import { useRoute, useRouter } from "vue-router"
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
{{- if .HasPic }}
|
||||
// 图片选择组件
|
||||
import SelectImage from '@/components/selectImage/selectImage.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasFile }}
|
||||
// 文件选择组件
|
||||
import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
{{- end }}
|
||||
|
||||
@@ -99,6 +105,11 @@ import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
import RichEdit from '@/components/richtext/rich-edit.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasArray}}
|
||||
// 数组控制组件
|
||||
import ArrayCtrl from '@/components/arrayCtrl/arrayCtrl.vue'
|
||||
{{- end }}
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
{{- $global := . }}
|
||||
{{- $templateID := printf "%s_%s" .Package .StructName }}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-search-box">
|
||||
@@ -152,6 +153,11 @@
|
||||
<div class="gva-btn-list">
|
||||
<el-button {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.add"{{ end }} type="primary" icon="plus" @click="openDialog">新增</el-button>
|
||||
<el-button {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.batchDelete"{{ end }} icon="delete" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="onDelete">删除</el-button>
|
||||
{{ if .HasExcel -}}
|
||||
<ExportTemplate {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.exportTemplate"{{ end }} template-id="{{$templateID}}" />
|
||||
<ExportExcel {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.exportExcel"{{ end }} template-id="{{$templateID}}" />
|
||||
<ImportExcel {{ if $global.AutoCreateBtnAuth }}v-auth="btnAuth.importExcel"{{ end }} template-id="{{$templateID}}" @on-success="getTableData" />
|
||||
{{- end }}
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
@@ -244,6 +250,12 @@
|
||||
[JSON]
|
||||
</template>
|
||||
</el-table-column>
|
||||
{{- else if eq .FieldType "array" }}
|
||||
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
|
||||
<template #default="scope">
|
||||
<ArrayCtrl v-model="scope.row.{{ .FieldJson }}"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
{{- else }}
|
||||
<el-table-column {{- if .Sort}} sortable{{- end}} align="left" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
|
||||
{{- end }}
|
||||
@@ -309,9 +321,7 @@
|
||||
{{"{{"}} formData.{{.FieldJson}} {{"}}"}}
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<el-tag v-for="(item,key) in formData.{{.FieldJson}}" :key="key">
|
||||
{{ "{{ item }}" }}
|
||||
</el-tag>
|
||||
<ArrayCtrl v-model="formData.{{ .FieldJson }}" editable/>
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "int" }}
|
||||
<el-input v-model.number="formData.{{ .FieldJson }}" :clearable="{{.Clearable}}" placeholder="请输入{{.FieldDesc}}" />
|
||||
@@ -363,12 +373,15 @@
|
||||
{{- range .Fields}}
|
||||
{{- if .Desc }}
|
||||
<el-descriptions-item label="{{ .FieldDesc }}">
|
||||
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) }}
|
||||
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
|
||||
{{"{{"}} detailFrom.{{.FieldJson}} {{"}}"}}
|
||||
{{- else }}
|
||||
{{- if eq .FieldType "picture" }}
|
||||
<el-image style="width: 50px; height: 50px" :preview-src-list="returnArrImg(detailFrom.{{ .FieldJson }})" :src="getUrl(detailFrom.{{ .FieldJson }})" fit="cover" />
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
<ArrayCtrl v-model="detailFrom.{{ .FieldJson }}"/>
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "pictures" }}
|
||||
<el-image style="width: 50px; height: 50px; margin-right: 10px" :preview-src-list="returnArrImg(detailFrom.{{ .FieldJson }})" :initial-index="index" v-for="(item,index) in detailFrom.{{ .FieldJson }}" :key="index" :src="getUrl(item)" fit="cover" />
|
||||
{{- end }}
|
||||
@@ -424,6 +437,11 @@ import RichEdit from '@/components/richtext/rich-edit.vue'
|
||||
import SelectFile from '@/components/selectFile/selectFile.vue'
|
||||
{{- end }}
|
||||
|
||||
{{- if .HasArray}}
|
||||
// 数组控制组件
|
||||
import ArrayCtrl from '@/components/arrayCtrl/arrayCtrl.vue'
|
||||
{{- end }}
|
||||
|
||||
// 全量引入格式化工具 请按需保留
|
||||
import { getDictFunc, formatDate, formatBoolean, filterDict ,filterDataSource, returnArrImg, onDownloadFile } from '@/utils/format'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -433,6 +451,16 @@ import { ref, reactive } from 'vue'
|
||||
import { useBtnAuth } from '@/utils/btnAuth'
|
||||
{{- end }}
|
||||
|
||||
{{if .HasExcel -}}
|
||||
// 导出组件
|
||||
import ExportExcel from '@/components/exportExcel/exportExcel.vue'
|
||||
// 导入组件
|
||||
import ImportExcel from '@/components/exportExcel/importExcel.vue'
|
||||
// 导出模板组件
|
||||
import ExportTemplate from '@/components/exportExcel/exportTemplate.vue'
|
||||
{{- end}}
|
||||
|
||||
|
||||
defineOptions({
|
||||
name: '{{.StructName}}'
|
||||
})
|
||||
@@ -783,6 +811,9 @@ const closeDialog = () => {
|
||||
{{- if eq .FieldType "json" }}
|
||||
{{.FieldJson}}: {},
|
||||
{{- end }}
|
||||
{{- if eq .FieldType "array" }}
|
||||
{{.FieldJson}}: [],
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
Reference in New Issue
Block a user