diff --git a/src/api/sampleManagement/technicalSpecificationList.js b/src/api/sampleManagement/technicalSpecificationList.js index a0a90da..c5c1d2d 100644 --- a/src/api/sampleManagement/technicalSpecificationList.js +++ b/src/api/sampleManagement/technicalSpecificationList.js @@ -1,6 +1,7 @@ import { createAPI } from "@/utils/httpRequest.js"; export const technicalSpecificationListSearch = data => createAPI(`/technicalSpecification/technicalSpecificationListSearch`,'post',data) +export const technicalSpecificationListSearchByAnyField = data => createAPI(`/technicalSpecification/technicalSpecificationListSearch/any`,'post',data) export const saveTechnicalSpecificationSheet = data => createAPI(`/technicalSpecification/saveTechnicalSpecificationSheet`,'post',data) export const searchTechnicalSpecificationTeamStr = data => createAPI(`/technicalSpecification/searchTechnicalSpecificationTeamStr`,'post',data) export const deleteTechnicalSpecificationList = data => createAPI(`/technicalSpecification/deleteTechnicalSpecificationList`,'post',data) diff --git a/src/utils/directives.js b/src/utils/directives.js index 9d62237..1c27a70 100644 --- a/src/utils/directives.js +++ b/src/utils/directives.js @@ -19,6 +19,8 @@ Vue.directive('drag', { })() dialogHeaderEl.onmousedown = (e) => { + // 获取鼠标按下时的坐标 + e.preventDefault(); // 鼠标按下,计算当前元素距离可视区的距离 const disX = e.clientX - dialogHeaderEl.offsetLeft; const disY = e.clientY - dialogHeaderEl.offsetTop; @@ -50,12 +52,14 @@ Vue.directive('drag', { }; document.onmousemove = function (e) { + // 移动时禁止默认事件 + e.preventDefault(); // 通过事件委托,计算移动的距离 let left = e.clientX - disX; let top = e.clientY - disY; // 边界处理 - if (-(left) > minDragDomLeft) { +/* if (-(left) > minDragDomLeft) { left = -(minDragDomLeft); } else if (left > maxDragDomLeft) { left = maxDragDomLeft; @@ -65,10 +69,39 @@ Vue.directive('drag', { top = -(minDragDomTop); } else if (top > maxDragDomTop) { top = maxDragDomTop; + }*/ + // 设置最大和最小可拖动范围 + const viewportWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + const viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; + + let minLeft = 0; + let maxLeft = viewportWidth - dragDom.offsetWidth; + + let minTop = 0; + let maxTop = viewportHeight - dragDom.offsetHeight; + + if (dragDom.offsetHeight > viewportHeight) { + // 只有当内容过高时才放宽顶部限制 + minTop = Math.max( + -(dragDom.offsetHeight - 100), // 至少保留 100px 高度可见 + -(dragDom.offsetHeight - viewportHeight) + ); + maxTop = 0; } +// 应用边界限制 +// left = Math.max(minLeft, Math.min(left, maxLeft)); + top = Math.max(minTop, Math.min(top, maxTop)); + + // 应用新的边界限制 + // left = Math.max(minLeft, Math.min(left, maxLeft)); + top = Math.max(minTop, Math.min(top, maxTop)); + // 移动当前元素 - dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`; + // dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`; + dragDom.style.transform = `translate(${left + styL}px, ${top + styT}px)`; + // 让拖动更平滑 + // dragDom.style.cssText += ';top:0px;position:relative;transition: transform 0.2s ease;'; }; document.onmouseup = function (e) { diff --git a/src/views/common/filterSearch.vue b/src/views/common/filterSearch.vue index 62ea2b0..114b135 100644 --- a/src/views/common/filterSearch.vue +++ b/src/views/common/filterSearch.vue @@ -438,7 +438,7 @@ export default { - + - + - +
diff --git a/src/views/modules/base/factoryInformation.vue b/src/views/modules/base/factoryInformation.vue index 58992e7..c583ffd 100644 --- a/src/views/modules/base/factoryInformation.vue +++ b/src/views/modules/base/factoryInformation.vue @@ -999,18 +999,16 @@ export default { }) }, getSiteDataDemo(params){ - params.no = 1 - params.size = 1 - // this.$message.success(params) siteList(params).then(({data})=>{ if (data && data.code === 0){ - this.$message.success(data.msg) + this.dataList = data.data }else { this.$message.warning(data.msg) } }).catch((error)=>{ this.$message.error(error) }) + this.filterVisible = false }, }, @@ -1020,7 +1018,7 @@ export default { //获取按钮的权限 this.getButtonAuthData(); this.getTableUserColumn() - this.$store.commit("sift/commitSearchFunction",this.getSiteDataDemo) + // this.$store.commit("sift/commitSearchFunction",this.getSiteDataDemo) }, } diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue index d5d7174..44840d9 100644 --- a/src/views/modules/project/projectInfo/projectInfo.vue +++ b/src/views/modules/project/projectInfo/projectInfo.vue @@ -41,6 +41,7 @@ class="el-button el-button--primary el-button--medium"> {{ '导出' }} + 搜索 +
@@ -412,9 +414,12 @@ import ProjectQuotation from "./com_project_puotation.vue"; import ProjectPartQuote from "../projectPart/projectPartQuote.vue"; import {isAuth} from "../../../../utils"; + import FilterSearch from "../../../common/filterSearch.vue"; + import {siteList} from "../../../../api/base/site"; /*組件*/ export default { components: { + FilterSearch, ProjectPartQuote, ProjectQuotation, Quote, @@ -446,6 +451,7 @@ fileContentList: [], activeName: 'info', addOrUpdateVisible:false, + filterVisible:false, searchData:{ page: 1, limit: 100, @@ -1988,7 +1994,20 @@ }else { this.$router.push({name:`changeManagement-changeRecord`,params:{changeNo:changeNo},}) } - } + }, + + projectInfoSearchByAnyField(params){ + mtdnm(params).then(({data})=>{ + if (data && data.code === 0){ + this.dataList1 = data.data + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + this.filterVisible = false + }, }, activated() { diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue index ba8206a..77a931c 100644 --- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue +++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue @@ -1340,4 +1340,8 @@ color: #303133; font-weight: 400; } + + input[readonly] { + cursor: text; + } diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue index 8a75c6b..ac2502c 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue @@ -10,13 +10,13 @@ - + - + - + 刷新 @@ -689,5 +689,7 @@ diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue index 8ba0901..931c1ab 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue @@ -421,5 +421,7 @@ diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue index 070f16e..63b4e54 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue @@ -1641,5 +1641,7 @@ diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue index 35a1fa1..8d57277 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue @@ -1340,4 +1340,8 @@ height: auto; line-height: 1.5; } + +input[readonly] { + cursor: text; +} diff --git a/src/views/modules/sampleManagement/technicalSpecificationList.vue b/src/views/modules/sampleManagement/technicalSpecificationList.vue index 1e96887..f6d2929 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationList.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationList.vue @@ -72,7 +72,7 @@ class="el-button el-button--primary el-button--medium"> {{ '导出' }} - + 搜索 @@ -511,7 +511,8 @@ - + + @@ -541,6 +542,8 @@ import ChangeLog from "./technicalSpecificationDetail/changeLog.vue"; import FilterSearch from "../../common/filterSearch.vue"; import OssComponents from "../oss/ossComponents.vue"; + import {siteList} from "../../../api/base/site"; + import {technicalSpecificationListSearchByAnyField} from "../../../api/sampleManagement/technicalSpecificationList"; export default { components: { OssComponents, @@ -1551,12 +1554,31 @@ }).catch(error => { this.$message.error('请求失败:' + error); }); - } + }, + + queryByAnyField(params){ + params.site = this.$store.state.user.site + params.username = this.$store.state.user.name + params.no = this.pageIndex + params.size = this.pageSize + technicalSpecificationListSearchByAnyField(params).then(({data})=>{ + if (data && data.code === 0){ + this.dataList1 = data.page.list + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + this.filterVisible = false + }, }, }