diff --git a/api/app/lib/controllers/means/index.js b/api/app/lib/controllers/means/index.js index 1698b08..11ca1e9 100644 --- a/api/app/lib/controllers/means/index.js +++ b/api/app/lib/controllers/means/index.js @@ -106,13 +106,17 @@ async function addFile (ctx, next) { async function folderFileList (ctx, next) { try { const models = ctx.fs.dc.models; - const { fileId, limit, page } = ctx.query; + const { fileId, limit, page, keyword } = ctx.query; let options = { where: {}, } if (JSON.parse(fileId).length) { options.where.fileId = { $in: JSON.parse(fileId) } } + if (keyword) { + options.where.name = { $ilike: `%${keyword}%` } + } + if (limit) { options.limit = Number(limit) } diff --git a/web/client/src/sections/means/containers/devOpsStandard.jsx b/web/client/src/sections/means/containers/devOpsStandard.jsx index 352f642..3ac4b91 100644 --- a/web/client/src/sections/means/containers/devOpsStandard.jsx +++ b/web/client/src/sections/means/containers/devOpsStandard.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import { Input, Button, Tree, Modal, Table, Upload, Pagination, Popconfirm } from '@douyinfe/semi-ui'; -import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle } from '@douyinfe/semi-icons'; +import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle, IconSearch } from '@douyinfe/semi-icons'; import SimpleBar from 'simplebar-react'; import FileModal from '../components/fileModal'; import moment from 'moment'; @@ -29,12 +29,12 @@ const Rest = (props) => { const [videoModalV, setVideoModalV] = useState(false); const [videoUrl, setvideoUrl] = useState(null); const [hint, setHint] = useState(false); - const [fileLists, setFileLists] = useState([]) + const [fileSearch, setFileSearch] = useState([]) //文件搜索 useEffect(() => { - dispatch(install.getProjectPoms({ global: 4 })).then((res => { + dispatch(install.getProjectPoms({ global: 1 })).then((res => { if (res.success) { let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) setPomsList(data) @@ -56,6 +56,9 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [projectSearch]) useEffect(() => { @@ -69,25 +72,29 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [overallProjectId]) useEffect(() => { if (fileId) { filfolderFileListe() setQuery({ limit: 10, page: 0 }) + setFileSearch('') } }, [fileId]) const fileList = (id) => { - - dispatch(means.fileList({ projectId: id, type: 1 })).then((res => { + + dispatch(means.fileList({ projectId: id, type: 4 })).then((res => { if (res.success) { let data = res.payload.data let oneLevel = res.payload.data?.filter(f => !f.higherFileId) || [] setHigherFile(data?.map(d => ({ name: d.fileName, value: d.id }))) dispatch(means.folderFileList({ fileId: JSON.stringify(data?.map(d => d.id)) })).then((s => { if (s.success) { - setFileLists(s.payload.data?.rows) + // setFileLists(s.payload.data?.rows) settreeData(listErgodic(oneLevel, data, s.payload.data?.rows)) } })) @@ -113,7 +120,7 @@ const Rest = (props) => { } treeDataList(treeData) let datas = params || query - dispatch(means.folderFileList({ fileId: JSON.stringify(fileIds), ...datas })).then((res => { + dispatch(means.folderFileList({ keyword: fileSearch, fileId: JSON.stringify(fileIds), ...datas, })).then((res => { if (res.success) { setDataSource(res.payload.data?.rows || []) setCount(res.payload.data?.count) @@ -277,6 +284,8 @@ const Rest = (props) => { onClick={() => { setPepProjectId(v.pepProjectId) fileList(v.pepProjectId) + setDataSource([]) + setFileId('') }}>
{v.pepProjectName}
@@ -301,7 +310,7 @@ const Rest = (props) => { editData={editData} higherFile={higherFile} pepProjectId={pepProjectId} - type={4} + type={1} close={() => { setIsFileModal(false) setEditData({}) @@ -315,10 +324,11 @@ const Rest = (props) => { { setFileId(selectedKey) + setFileSearch('') }} /> @@ -329,13 +339,27 @@ const Rest = (props) => { flex: 1, height: '100%', // border: '1px solid rgb(24 22 22)' }}> -
- -
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+
+
+ +
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+ } + value={fileSearch} + onChange={v => { + setFileSearch(v) + filfolderFileListe({ keyword: v, limit: 10, page: 0 }) + setQuery({ limit: 10, page: 0 }) + }} /> +
+ {uploadModal ? { style={{ display: 'inline-block' }} action="/_upload/attachments" accept={'.txt, .doc, .docx, .xls, .xlsx, .pdf, .png, .jpg, .rar, .zip'} - limit={1} + limit={4} maxSize={51200} onRemove={() => { setUploadData({}) @@ -441,6 +465,7 @@ const Rest = (props) => { total={count} showSizeChanger currentPage={(query?.page || 0) + 1} + pageSize={query?.limit || 10} pageSizeOpts={[10, 20, 50]} onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 }); diff --git a/web/client/src/sections/means/containers/faultInformation.jsx b/web/client/src/sections/means/containers/faultInformation.jsx index f1f759c..3723b3c 100644 --- a/web/client/src/sections/means/containers/faultInformation.jsx +++ b/web/client/src/sections/means/containers/faultInformation.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import { Input, Button, Tree, Modal, Table, Upload, Pagination, Popconfirm } from '@douyinfe/semi-ui'; -import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle } from '@douyinfe/semi-icons'; +import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle, IconSearch } from '@douyinfe/semi-icons'; import SimpleBar from 'simplebar-react'; import FileModal from '../components/fileModal'; import moment from 'moment'; @@ -29,12 +29,12 @@ const Rest = (props) => { const [videoModalV, setVideoModalV] = useState(false); const [videoUrl, setvideoUrl] = useState(null); const [hint, setHint] = useState(false); - const [fileLists, setFileLists] = useState([]) + const [fileSearch, setFileSearch] = useState([]) //文件搜索 useEffect(() => { - dispatch(install.getProjectPoms({ global: 3 })).then((res => { + dispatch(install.getProjectPoms({ global: 1 })).then((res => { if (res.success) { let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) setPomsList(data) @@ -56,6 +56,9 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [projectSearch]) useEffect(() => { @@ -69,25 +72,29 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [overallProjectId]) useEffect(() => { if (fileId) { filfolderFileListe() setQuery({ limit: 10, page: 0 }) + setFileSearch('') } }, [fileId]) const fileList = (id) => { - - dispatch(means.fileList({ projectId: id, type: 1 })).then((res => { + + dispatch(means.fileList({ projectId: id, type: 3 })).then((res => { if (res.success) { let data = res.payload.data let oneLevel = res.payload.data?.filter(f => !f.higherFileId) || [] setHigherFile(data?.map(d => ({ name: d.fileName, value: d.id }))) dispatch(means.folderFileList({ fileId: JSON.stringify(data?.map(d => d.id)) })).then((s => { if (s.success) { - setFileLists(s.payload.data?.rows) + // setFileLists(s.payload.data?.rows) settreeData(listErgodic(oneLevel, data, s.payload.data?.rows)) } })) @@ -113,7 +120,7 @@ const Rest = (props) => { } treeDataList(treeData) let datas = params || query - dispatch(means.folderFileList({ fileId: JSON.stringify(fileIds), ...datas })).then((res => { + dispatch(means.folderFileList({ keyword: fileSearch, fileId: JSON.stringify(fileIds), ...datas, })).then((res => { if (res.success) { setDataSource(res.payload.data?.rows || []) setCount(res.payload.data?.count) @@ -277,6 +284,8 @@ const Rest = (props) => { onClick={() => { setPepProjectId(v.pepProjectId) fileList(v.pepProjectId) + setDataSource([]) + setFileId('') }}>
{v.pepProjectName}
@@ -301,7 +310,7 @@ const Rest = (props) => { editData={editData} higherFile={higherFile} pepProjectId={pepProjectId} - type={3} + type={1} close={() => { setIsFileModal(false) setEditData({}) @@ -315,10 +324,11 @@ const Rest = (props) => { { setFileId(selectedKey) + setFileSearch('') }} /> @@ -329,13 +339,27 @@ const Rest = (props) => { flex: 1, height: '100%', // border: '1px solid rgb(24 22 22)' }}> -
- -
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+
+
+ +
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+ } + value={fileSearch} + onChange={v => { + setFileSearch(v) + filfolderFileListe({ keyword: v, limit: 10, page: 0 }) + setQuery({ limit: 10, page: 0 }) + }} /> +
+ {uploadModal ? { style={{ display: 'inline-block' }} action="/_upload/attachments" accept={'.txt, .doc, .docx, .xls, .xlsx, .pdf, .png, .jpg, .rar, .zip'} - limit={1} + limit={3} maxSize={51200} onRemove={() => { setUploadData({}) @@ -441,6 +465,7 @@ const Rest = (props) => { total={count} showSizeChanger currentPage={(query?.page || 0) + 1} + pageSize={query?.limit || 10} pageSizeOpts={[10, 20, 50]} onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 }); diff --git a/web/client/src/sections/means/containers/projectMeans.jsx b/web/client/src/sections/means/containers/projectMeans.jsx index d052bd8..b1582fd 100644 --- a/web/client/src/sections/means/containers/projectMeans.jsx +++ b/web/client/src/sections/means/containers/projectMeans.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import { Input, Button, Tree, Modal, Table, Upload, Pagination, Popconfirm } from '@douyinfe/semi-ui'; -import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle } from '@douyinfe/semi-icons'; +import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle, IconSearch } from '@douyinfe/semi-icons'; import SimpleBar from 'simplebar-react'; import FileModal from '../components/fileModal'; import moment from 'moment'; @@ -29,7 +29,7 @@ const Rest = (props) => { const [videoModalV, setVideoModalV] = useState(false); const [videoUrl, setvideoUrl] = useState(null); const [hint, setHint] = useState(false); - const [fileLists, setFileLists] = useState([]) + const [fileSearch, setFileSearch] = useState([]) //文件搜索 @@ -56,6 +56,9 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [projectSearch]) useEffect(() => { @@ -69,17 +72,21 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [overallProjectId]) useEffect(() => { if (fileId) { filfolderFileListe() setQuery({ limit: 10, page: 0 }) + setFileSearch('') } }, [fileId]) const fileList = (id) => { - + dispatch(means.fileList({ projectId: id, type: 1 })).then((res => { if (res.success) { let data = res.payload.data @@ -87,7 +94,7 @@ const Rest = (props) => { setHigherFile(data?.map(d => ({ name: d.fileName, value: d.id }))) dispatch(means.folderFileList({ fileId: JSON.stringify(data?.map(d => d.id)) })).then((s => { if (s.success) { - setFileLists(s.payload.data?.rows) + // setFileLists(s.payload.data?.rows) settreeData(listErgodic(oneLevel, data, s.payload.data?.rows)) } })) @@ -113,7 +120,7 @@ const Rest = (props) => { } treeDataList(treeData) let datas = params || query - dispatch(means.folderFileList({ fileId: JSON.stringify(fileIds), ...datas })).then((res => { + dispatch(means.folderFileList({ keyword: fileSearch, fileId: JSON.stringify(fileIds), ...datas, })).then((res => { if (res.success) { setDataSource(res.payload.data?.rows || []) setCount(res.payload.data?.count) @@ -277,6 +284,8 @@ const Rest = (props) => { onClick={() => { setPepProjectId(v.pepProjectId) fileList(v.pepProjectId) + setDataSource([]) + setFileId('') }}>
{v.pepProjectName}
@@ -315,10 +324,11 @@ const Rest = (props) => { { setFileId(selectedKey) + setFileSearch('') }} /> @@ -329,13 +339,27 @@ const Rest = (props) => { flex: 1, height: '100%', // border: '1px solid rgb(24 22 22)' }}> -
- -
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+
+
+ +
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+ } + value={fileSearch} + onChange={v => { + setFileSearch(v) + filfolderFileListe({ keyword: v, limit: 10, page: 0 }) + setQuery({ limit: 10, page: 0 }) + }} /> +
+ {uploadModal ? { total={count} showSizeChanger currentPage={(query?.page || 0) + 1} + pageSize={query?.limit || 10} pageSizeOpts={[10, 20, 50]} onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 }); diff --git a/web/client/src/sections/means/containers/repairFQA.jsx b/web/client/src/sections/means/containers/repairFQA.jsx index 436a444..4172fee 100644 --- a/web/client/src/sections/means/containers/repairFQA.jsx +++ b/web/client/src/sections/means/containers/repairFQA.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import { Input, Button, Tree, Modal, Table, Upload, Pagination, Popconfirm } from '@douyinfe/semi-ui'; -import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle } from '@douyinfe/semi-icons'; +import { IconDeleteStroked, IconEditStroked, IconUpload, IconAlertCircle, IconSearch } from '@douyinfe/semi-icons'; import SimpleBar from 'simplebar-react'; import FileModal from '../components/fileModal'; import moment from 'moment'; @@ -29,7 +29,7 @@ const Rest = (props) => { const [videoModalV, setVideoModalV] = useState(false); const [videoUrl, setvideoUrl] = useState(null); const [hint, setHint] = useState(false); - const [fileLists, setFileLists] = useState([]) + const [fileSearch, setFileSearch] = useState([]) //文件搜索 @@ -56,6 +56,9 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [projectSearch]) useEffect(() => { @@ -69,17 +72,21 @@ const Rest = (props) => { setShowPomsList(data) setPepProjectId(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId) + setDataSource([]) + setFileId('') + setFileSearch('') }, [overallProjectId]) useEffect(() => { if (fileId) { filfolderFileListe() setQuery({ limit: 10, page: 0 }) + setFileSearch('') } }, [fileId]) const fileList = (id) => { - + dispatch(means.fileList({ projectId: id, type: 2 })).then((res => { if (res.success) { let data = res.payload.data @@ -87,7 +94,7 @@ const Rest = (props) => { setHigherFile(data?.map(d => ({ name: d.fileName, value: d.id }))) dispatch(means.folderFileList({ fileId: JSON.stringify(data?.map(d => d.id)) })).then((s => { if (s.success) { - setFileLists(s.payload.data?.rows) + // setFileLists(s.payload.data?.rows) settreeData(listErgodic(oneLevel, data, s.payload.data?.rows)) } })) @@ -113,7 +120,7 @@ const Rest = (props) => { } treeDataList(treeData) let datas = params || query - dispatch(means.folderFileList({ fileId: JSON.stringify(fileIds), ...datas })).then((res => { + dispatch(means.folderFileList({ keyword: fileSearch, fileId: JSON.stringify(fileIds), ...datas, })).then((res => { if (res.success) { setDataSource(res.payload.data?.rows || []) setCount(res.payload.data?.count) @@ -277,6 +284,8 @@ const Rest = (props) => { onClick={() => { setPepProjectId(v.pepProjectId) fileList(v.pepProjectId) + setDataSource([]) + setFileId('') }}>
{v.pepProjectName}
@@ -315,10 +324,11 @@ const Rest = (props) => { { setFileId(selectedKey) + setFileSearch('') }} /> @@ -329,13 +339,27 @@ const Rest = (props) => { flex: 1, height: '100%', // border: '1px solid rgb(24 22 22)' }}> -
- -
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+
+
+ +
当前文件夹:{higherFile?.filter(c => c.value == fileId)[0]?.name ||
请选择文件夹
}
+
+ } + value={fileSearch} + onChange={v => { + setFileSearch(v) + filfolderFileListe({ keyword: v, limit: 10, page: 0 }) + setQuery({ limit: 10, page: 0 }) + }} /> +
+ {uploadModal ? { total={count} showSizeChanger currentPage={(query?.page || 0) + 1} + pageSize={query?.limit || 10} pageSizeOpts={[10, 20, 50]} onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 });