Browse Source

2025/6/9

master
Aoi_Tori 1 year ago
parent
commit
659eb1876c
  1. 1
      src/api/sampleManagement/technicalSpecificationList.js
  2. 37
      src/utils/directives.js
  3. 6
      src/views/common/filterSearch.vue
  4. 8
      src/views/modules/base/factoryInformation.vue
  5. 21
      src/views/modules/project/projectInfo/projectInfo.vue
  6. 4
      src/views/modules/sampleManagement/com_technical-add-or-update.vue
  7. 10
      src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue
  8. 4
      src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue
  9. 4
      src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue
  10. 4
      src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue
  11. 30
      src/views/modules/sampleManagement/technicalSpecificationList.vue

1
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)

37
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) {

6
src/views/common/filterSearch.vue

@ -438,7 +438,7 @@ export default {
</el-input>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="sortBy" show-overflow-tooltip width="80">
<el-table-column label="排序" align="center" prop="sortBy" show-overflow-tooltip width="140">
<template slot-scope="{row,$index}">
<el-select v-model="row.sortBy" clearable style="width: 100%">
<el-option value="asc" label="升序"></el-option>
@ -446,12 +446,12 @@ export default {
</el-select>
</template>
</el-table-column>
<el-table-column label="次序" align="center" prop="orderSeq" width="60">
<el-table-column label="次序" align="center" prop="orderSeq" width="100">
<template slot-scope="{row,$index}">
<el-input-number v-model="row.orderSeq" clearable style="width: 100%;" :controls="false"></el-input-number>
</template>
</el-table-column>
<el-table-column label="数据库字段" align="left" header-align="center" prop="originalField" show-overflow-tooltip width="120"></el-table-column>
<!-- <el-table-column label="数据库字段" align="left" header-align="center" prop="originalField" show-overflow-tooltip width="120"></el-table-column>-->
</el-table>
</div>
<div style="width: 15%;">

8
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)
},
}
</script>

21
src/views/modules/project/projectInfo/projectInfo.vue

@ -41,6 +41,7 @@
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
<el-button @click="filterVisible = true">搜索</el-button>
</el-form-item>
</el-form>
<el-table
@ -366,6 +367,7 @@
<projectUploadFile ref="projectUploadFile" @refreshPageTables="getFileContentData()" v-drag></projectUploadFile>
<add-or-update v-if="addOrUpdateVisible" v-model="addOrUpdate" ref="addOrUpdate" @refreshDataList="search2" v-drag></add-or-update>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<filter-search :visible.sync="filterVisible" @search="projectInfoSearchByAnyField"></filter-search>
</div>
</template>
@ -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() {

4
src/views/modules/sampleManagement/com_technical-add-or-update.vue

@ -1340,4 +1340,8 @@
color: #303133;
font-weight: 400;
}
input[readonly] {
cursor: text;
}
</style>

10
src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue

@ -10,13 +10,13 @@
<el-input v-model="bomData.bomType" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="BOM版本">
<el-input v-model="bomData.engChgLevel" readonly style="width: 120px"></el-input>
<el-input v-model="bomData.engChgLevel" readonly style="width: 60px"></el-input>
</el-form-item>
<el-form-item label="替代编码">
<el-input v-model="bomData.alternativeNo" readonly style="width: 120px"></el-input>
<el-input v-model="bomData.alternativeNo" readonly style="width: 60px"></el-input>
</el-form-item>
<el-form-item label="URL File">
<dict-data-select :site="searchData.site" v-if="searchData.site" v-model="bomData.urlFile" style="width: 120px" dict-type="bm_url_file"></dict-data-select>
<dict-data-select :site="searchData.site" v-if="searchData.site" v-model="bomData.urlFile" style="width: 240px" dict-type="bm_url_file"></dict-data-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable(true)" >刷新</el-button>
@ -689,5 +689,7 @@
</script>
<style scoped>
input[readonly] {
cursor: text;
}
</style>

4
src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue

@ -421,5 +421,7 @@
</script>
<style scoped>
input[readonly] {
cursor: text;
}
</style>

4
src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue

@ -1641,5 +1641,7 @@
</script>
<style scoped>
input[readonly] {
cursor: text;
}
</style>

4
src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue

@ -1340,4 +1340,8 @@
height: auto;
line-height: 1.5;
}
input[readonly] {
cursor: text;
}
</style>

30
src/views/modules/sampleManagement/technicalSpecificationList.vue

@ -72,7 +72,7 @@
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
<!-- <el-button @click="filterVisible = true">搜索</el-button>-->
<el-button @click="filterVisible = true">搜索</el-button>
<!-- <el-button @click="test()" type="primary" style="margin-left: 2px;margin-top:0px">测试</el-button>-->
</el-form-item>
</el-form>
@ -511,7 +511,8 @@
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- <filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>-->
<filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
</div>
</template>
@ -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
},
},
}
</script>
<style scoped>
input[readonly] {
cursor: text;
}
</style>
Loading…
Cancel
Save