diff --git a/src/api/fileManagement/sheep_file.js b/src/api/fileManagement/sheep_file.js index c0bb7f1..eb456a5 100644 --- a/src/api/fileManagement/sheep_file.js +++ b/src/api/fileManagement/sheep_file.js @@ -1,11 +1,11 @@ import request from '@/utils/request' -// 查询羊只档案列表 +// 羊只档案列表查询 export function listSheep_file(query) { return request({ url: '/sheep_file/sheep_file/list', - method: 'get', - params: query + method: 'post', // 改为 POST + data: query // 使用 data 而不是 params }) } @@ -26,6 +26,15 @@ export function delSheep_file(id) { }) } +// 羊只档案导出 +export function exportSheep_file(query) { + return request({ + url: '/sheep_file/sheep_file/export', + method: 'post', // 改为 POST + data: query, // 使用 data 而不是 params + responseType: 'blob' + }) +} // 在群总数 @@ -47,3 +56,22 @@ export function getVarietyStat() { export function getLactationParityStat() { return request({ url: '/sheep_file/sheep_file/stat/lactationParity', method: 'get' }) } + +/** + * 新增API:获取字段的唯一值列表 + * 用于前端筛选条件中的下拉选项数据 + * + * @param {string} fieldName 字段名(数据库列名) + * @returns 包含字段唯一值列表的Promise + * + * 使用示例: + * getFieldValues('bs_manage_tags').then(values => { + * console.log(values); // ["AF00001", "AF00002", "AF00003"] + * }); + */ +export function getFieldValues(fieldName) { + return request({ + url: '/sheep_file/sheep_file/field/' + fieldName, + method: 'get' + }) +} diff --git a/src/components/CustomFilter/index.vue b/src/components/CustomFilter/index.vue new file mode 100644 index 0000000..c7a0dca --- /dev/null +++ b/src/components/CustomFilter/index.vue @@ -0,0 +1,818 @@ + + + + + \ No newline at end of file diff --git a/src/views/fileManagement/sheep_file/index.vue b/src/views/fileManagement/sheep_file/index.vue index ad4f6e0..e465b4c 100644 --- a/src/views/fileManagement/sheep_file/index.vue +++ b/src/views/fileManagement/sheep_file/index.vue @@ -32,6 +32,15 @@ + + + + + 筛选条件已激活 + + + + + +
+
已应用筛选条件:
+ + {{ filter.text }} + + + 清除所有 + +
+
显示列
@@ -346,6 +373,40 @@ 当前体重 + + + + + + + + + + + + + + + + 繁殖状态 @@ -993,12 +1056,20 @@ @@ -1283,4 +1562,26 @@ getList() margin: 5px; width: calc(30% - 20px); } + + +.applied-filters { + padding: 12px 16px; + background-color: #f8f9fa; + border-radius: 4px; + border: 1px solid #e9ecef; +} + +.filter-title { + font-weight: 600; + margin-bottom: 8px; + color: #495057; +} + +.filter-active-tip { + display: inline-flex; + align-items: center; + margin-left: 8px; + font-size: 12px; + color: #67c23a; +} \ No newline at end of file