refactor: 删除 docs 模块的全部代码
- 移除了 DocsContentController、DocsController、DocsUserController 三个控制器 - 删除了 DocsContent、Docs、DocsUser三个实体类 - 移除了 DocsContentMapper、DocsMapper、DocsUserMapper 三个 Mapper 接口 - 删除了 DocsContentParam、DocsParam、DocsUserParam 三个查询参数类 - 移除了 DocsContentServiceImpl 服务实现类- 删除了相关的 XML 映射文件
This commit is contained in:
@@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
* 商品文章控制器
|
* 商品文章控制器
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:36
|
* @since 2025-08-13 05:01:55
|
||||||
*/
|
*/
|
||||||
@Tag(name = "商品文章管理")
|
@Tag(name = "商品文章管理")
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 商品文章
|
* 商品文章
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:36
|
* @since 2025-08-13 05:01:54
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
* 商品文章Mapper
|
* 商品文章Mapper
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:36
|
* @since 2025-08-13 05:01:54
|
||||||
*/
|
*/
|
||||||
public interface ShopArticleMapper extends BaseMapper<ShopArticle> {
|
public interface ShopArticleMapper extends BaseMapper<ShopArticle> {
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 商品文章查询参数
|
* 商品文章查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:35
|
* @since 2025-08-13 05:01:53
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
* 商品文章Service
|
* 商品文章Service
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:36
|
* @since 2025-08-13 05:01:55
|
||||||
*/
|
*/
|
||||||
public interface ShopArticleService extends IService<ShopArticle> {
|
public interface ShopArticleService extends IService<ShopArticle> {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
* 商品文章Service实现
|
* 商品文章Service实现
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-08-13 04:38:36
|
* @since 2025-08-13 05:01:55
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ShopArticleServiceImpl extends ServiceImpl<ShopArticleMapper, ShopArticle> implements ShopArticleService {
|
public class ShopArticleServiceImpl extends ServiceImpl<ShopArticleMapper, ShopArticle> implements ShopArticleService {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, ref, computed } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
@@ -97,54 +97,26 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格列配置 - 使用 hideInTable 控制默认显示
|
// 完整的列配置(包含所有字段)
|
||||||
const columns = ref<ColumnItem[]>([
|
const allColumns = ref<ColumnItem[]>([
|
||||||
<% var coreFieldCount = 0; %>
|
|
||||||
<% for(field in table.fields) { %>
|
<% for(field in table.fields) { %>
|
||||||
<% if(field.propertyName != 'tenantId'){ %>
|
<% if(field.propertyName != 'tenantId'){ %>
|
||||||
<%
|
|
||||||
// 判断是否为核心字段(默认显示)
|
|
||||||
var isCoreField = field.keyFlag ||
|
|
||||||
field.propertyName == 'name' ||
|
|
||||||
field.propertyName == 'title' ||
|
|
||||||
field.propertyName == 'code' ||
|
|
||||||
field.propertyName == 'status' ||
|
|
||||||
field.propertyName == 'sort' ||
|
|
||||||
field.propertyName == 'createTime';
|
|
||||||
|
|
||||||
// 限制核心字段数量,避免显示过多列
|
|
||||||
if(isCoreField && coreFieldCount >= 5) {
|
|
||||||
isCoreField = false;
|
|
||||||
}
|
|
||||||
if(isCoreField) {
|
|
||||||
coreFieldCount = coreFieldCount + 1;
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
{
|
{
|
||||||
title: '${field.comment!field.propertyName}',
|
title: '${field.comment!field.propertyName}',
|
||||||
dataIndex: '${field.propertyName}',
|
dataIndex: '${field.propertyName}',
|
||||||
key: '${field.propertyName}',
|
key: '${field.propertyName}',
|
||||||
align: 'center',
|
|
||||||
<% if(!isCoreField){ %>
|
|
||||||
hideInTable: true, // 非核心字段默认隐藏,用户可通过列设置显示
|
|
||||||
<% } %>
|
|
||||||
<% if(field.keyFlag){ %>
|
<% if(field.keyFlag){ %>
|
||||||
width: 90,
|
width: 90,
|
||||||
<% } else if(field.propertyName == 'createTime' || field.propertyName == 'updateTime'){ %>
|
<% } else if(field.propertyName == 'createTime' || field.propertyName == 'updateTime'){ %>
|
||||||
width: 120,
|
width: 200,
|
||||||
|
align: 'center',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
<% } else if(field.propertyType == 'String' && (field.propertyName.contains('remark') || field.propertyName.contains('description') || field.propertyName.contains('content'))){ %>
|
|
||||||
width: 200,
|
|
||||||
ellipsis: true
|
|
||||||
<% } else if(field.propertyType == 'String'){ %>
|
<% } else if(field.propertyType == 'String'){ %>
|
||||||
width: 150,
|
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
<% } else if(field.propertyName == 'status'){ %>
|
<% } else if(field.propertyName == 'status'){ %>
|
||||||
width: 80
|
width: 120
|
||||||
<% } else if(field.propertyName == 'sort'){ %>
|
|
||||||
width: 80
|
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
width: 120
|
width: 120
|
||||||
<% } %>
|
<% } %>
|
||||||
@@ -161,6 +133,26 @@
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// 默认显示的核心列(最多5个主要字段)
|
||||||
|
const defaultVisibleColumns = [
|
||||||
|
<% var count = 0; %>
|
||||||
|
<% for(field in table.fields) { %>
|
||||||
|
<% if(field.keyFlag || field.propertyName == 'name' || field.propertyName == 'title' || field.propertyName == 'status' || field.propertyName == 'createTime'){ %>
|
||||||
|
'${field.propertyName}',
|
||||||
|
<% count = count + 1; %>
|
||||||
|
<% if(count >= 5) break; %>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
'action'
|
||||||
|
];
|
||||||
|
|
||||||
|
// 根据默认可见列过滤显示的列
|
||||||
|
const columns = computed(() => {
|
||||||
|
return allColumns.value.filter(col =>
|
||||||
|
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const reload = (where?: ${entity}Param) => {
|
const reload = (where?: ${entity}Param) => {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user