JeecgBoot 3.6.0大版本发布

This commit is contained in:
zhangdaiscott
2023-10-18 15:04:41 +08:00
parent f342c93eec
commit 524cd4a3d1
267 changed files with 12894 additions and 49368 deletions

View File

@ -43,16 +43,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -69,6 +79,7 @@
import {columns, searchFormSchema} from './${entityName}.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
<#if list_need_pca>
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
</#if>
@ -81,6 +92,7 @@
import { startProcess } from '/@/api/common/api';
</#if>
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
//注册model
const [registerModal, {openModal}] = useModal();
//注册table数据
@ -121,7 +133,7 @@
],
},
actionColumn: {
width: 120,
width: 150,
fixed:'right'
},
},
@ -264,11 +276,10 @@
<#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
}
})
</#if>

View File

@ -22,13 +22,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -147,7 +144,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -169,7 +166,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -106,17 +106,26 @@
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -132,6 +141,7 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './${entityName}.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ${entityName}Modal from './components/${entityName}Modal.vue'
import { useUserStore } from '/@/store/modules/user';
<#include "/common/form/native/vue3NativeImport.ftl">
<#if need_category>
import { loadCategoryData } from '/@/api/common/api';
@ -149,6 +159,7 @@
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@ -158,7 +169,7 @@
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
width: 150,
fixed: 'right',
},
beforeFetch: (params) => {
@ -358,11 +369,10 @@
<#if po.classType=='cat_tree' && need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
}
});
</#if>

View File

@ -22,13 +22,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender: render.renderImage,
@ -145,7 +142,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -163,7 +160,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -48,18 +48,28 @@
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!--字典弹窗-->
<${entityName}Modal @register="registerModal" @success="handleSuccess"/>

View File

@ -26,13 +26,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -160,7 +157,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -187,7 +184,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -117,16 +117,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->

View File

@ -26,13 +26,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender: render.renderImage,
@ -162,7 +159,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -185,7 +182,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -43,16 +43,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!--子表表格tab-->
@ -76,6 +86,7 @@
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import ${entityName}Modal from './components/${entityName}Modal.vue'
import { useUserStore } from '/@/store/modules/user';
<#list subTables as sub>
import ${sub.entityName}List from './${sub.entityName}List.vue'
</#list>
@ -149,7 +160,7 @@
success: handleSuccess
},
})
const userStore = useUserStore();
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
@ -283,11 +294,10 @@
<#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
}
})
</#if>

View File

@ -22,13 +22,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -139,7 +136,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -161,7 +158,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>
@ -393,13 +390,10 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,

View File

@ -28,12 +28,22 @@
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list sub.originalColumns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>

View File

@ -57,16 +57,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -97,10 +107,12 @@
<#if bpm_flag==true>
import { startProcess } from '/@/api/common/api';
</#if>
import { useUserStore } from '/@/store/modules/user';
// 展开key
const expandedRowKeys = ref<any[]>([]);
//注册model
const [registerModal, {openModal}] = useModal();
const userStore = useUserStore();
//注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
@ -291,11 +303,10 @@
<#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
}
})
</#if>

View File

@ -23,13 +23,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -143,7 +140,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -165,7 +162,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>
@ -396,13 +393,10 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,

View File

@ -23,12 +23,22 @@
<!--引用表格-->
<BasicTable bordered size="middle" :loading="loading" rowKey="id" :canResize="false" :columns="${sub.entityName?uncap_first}Columns" :dataSource="dataSource" :pagination="false">
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list sub.originalColumns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
</div>
@ -39,6 +49,7 @@
import {BasicTable} from '/@/components/Table';
import {${sub.entityName?uncap_first}Columns} from '../${entityName}.data';
import {${sub.entityName?uncap_first}List} from '../${entityName}.api';
import { downloadFile } from '/@/utils/common/renderUtils';
const props = defineProps({
id: {

View File

@ -43,16 +43,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -69,6 +79,7 @@
import {columns, searchFormSchema} from './${entityName}.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
<#if list_need_pca>
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
</#if>
@ -81,6 +92,7 @@
import { startProcess } from '/@/api/common/api';
</#if>
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
//注册model
const [registerModal, {openModal}] = useModal();
//注册table数据
@ -265,11 +277,10 @@
<#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
}
})
</#if>

View File

@ -23,13 +23,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -143,7 +140,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -165,7 +162,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -111,16 +111,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -149,12 +159,13 @@
<#if bpm_flag==true>
import { startProcess } from '/@/api/common/api';
</#if>
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
//注册model
const [registerModal, {openModal}] = useModal();
const userStore = useUserStore();
//注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
@ -318,11 +329,10 @@
<#if po.classType=='cat_tree' && need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
}
})
</#if>

View File

@ -23,13 +23,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -142,7 +139,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -160,7 +157,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>

View File

@ -43,16 +43,26 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<template v-slot:bodyCell="{ column, record, index, text }">
<#list columns as po>
<#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
<template v-if="column.dataIndex==='${po.fieldName}'">
<#if po.classType=='umeditor'>
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</#if>
<#if po.classType=='pca'>
<!--省市区字段回显插槽-->
{{ getAreaTextByCode(text) }}
</#if>
<#if po.classType=='file'>
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</#if>
</template>
</#if>
</#list>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -69,6 +79,7 @@
import {columns, searchFormSchema} from './${entityName}.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
<#if list_need_pca>
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
</#if>
@ -80,6 +91,7 @@
<#if bpm_flag==true>
import { startProcess } from '/@/api/common/api';
</#if>
const userStore = useUserStore();
const checkedKeys = ref<Array<string | number>>([]);
//注册model
const [registerModal, {openModal}] = useModal();
@ -265,11 +277,10 @@
<#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
if (res) {
let allDictDate = getAuthCache(DB_DICT_DATA_KEY);
if(!allDictDate['${po.dictField?default("")}']){
Object.assign(allDictDate,{'${po.dictField?default("")}':res})
}
setAuthCache(DB_DICT_DATA_KEY,allDictDate)
const allDictDate = userStore.getAllDictItems;
if(!allDictDate['${po.dictField?default("")}']){
userStore.setAllDictItems({...allDictDate,'${po.dictField?default("")}':res});
}
}
})
</#if>

View File

@ -23,13 +23,10 @@ export const columns: BasicColumn[] = [
dataIndex: '${po.fieldName}String'
<#elseif po.classType=='umeditor'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'htmlSlot' },
<#elseif po.classType=='pca'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'pcaSlot' },
<#elseif po.classType=='file'>
dataIndex: '${po.fieldName}',
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderImage,
@ -143,7 +140,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input',
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
<#else>
{
@ -165,7 +162,7 @@ export const searchFormSchema: FormSchema[] = [
<#else>
component: 'Input', //TODO 范围查询
</#if>
colProps: {span: 6},
//colProps: {span: 6},
},
</#if>
</#if>