From b622f2205f0866b801ee2d98ec4be92506783c54 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Wed, 1 Apr 2026 14:48:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/application/api/controller/Contract.php | 7 +- back/application/database.php | 6 +- front/config/dev.env.js | 6 +- front/config/prod.env.js | 6 +- .../views/contract-mgr/projectcontract.vue | 387 ++++++++------ front/src/views/customer-mgr/customerlist.vue | 132 ++++- front/src/views/customer-prj/projectlist.vue | 495 +++++++++++++----- 7 files changed, 736 insertions(+), 303 deletions(-) diff --git a/back/application/api/controller/Contract.php b/back/application/api/controller/Contract.php index 6b90f30..49d591c 100644 --- a/back/application/api/controller/Contract.php +++ b/back/application/api/controller/Contract.php @@ -291,7 +291,12 @@ class Contract extends Common $update['contract_name'] = $param['contract_name']; $update['contract_category'] = $param['contract_category']; $update['contract_number'] = $param['contract_number']; - $update['contract_des'] = $param['contract_des']; + + // Check if contract_des exists before using it + if (isset($param['contract_des'])) { + $update['contract_des'] = $param['contract_des']; + } + if($param['contract_url'] != '') { $update['contract_url'] = $param['contract_url']; diff --git a/back/application/database.php b/back/application/database.php index 8163f85..10ea0ca 100644 --- a/back/application/database.php +++ b/back/application/database.php @@ -13,15 +13,15 @@ return [ // 数据库类型 'type' => 'mysql', // 服务器地址 - 'hostname' => '192.168.81.251', + 'hostname' => '127.0.0.1', // 数据库名 'database' => 'oms', // 用户名 'username' => 'root', // 密码 - 'password' => 'P@ssw0rd.', + 'password' => '12356', // 端口 - 'hostport' => '', + 'hostport' => '3306', // 连接dsn 'dsn' => '', // 数据库连接参数 diff --git a/front/config/dev.env.js b/front/config/dev.env.js index ec8b85c..57b2ddf 100644 --- a/front/config/dev.env.js +++ b/front/config/dev.env.js @@ -1,7 +1,9 @@ module.exports = { NODE_ENV: '"development"', ENV_CONFIG: '"dev"', - BASE_WMS_API: '"http://127.0.0.1:8011/api"', - BASE_WMS_FILE: '"http://127.0.0.1:8011/"' + // BASE_WMS_API: '"http://127.0.0.1:8011/api"', + // BASE_WMS_FILE: '"http://127.0.0.1:8011/"' + BASE_WMS_API: '"http://47.111.78.178:8011/api"', + BASE_WMS_FILE: '"http://47.111.78.178:8011/"' // 47.101.147.253 } diff --git a/front/config/prod.env.js b/front/config/prod.env.js index 7fd7bf4..9e60f51 100644 --- a/front/config/prod.env.js +++ b/front/config/prod.env.js @@ -1,8 +1,10 @@ module.exports = { NODE_ENV: '"production"', ENV_CONFIG: '"prod"', - BASE_WMS_API: '"http://127.0.0.1:8011/api"', - BASE_WMS_FILE: '"http://127.0.0.1:8011/"' + // BASE_WMS_API: '"http://127.0.0.1:8011/api"', + // BASE_WMS_FILE: '"http://127.0.0.1:8011/"' + BASE_WMS_API: '"http://47.111.78.178:8011/api"', + BASE_WMS_FILE: '"http://47.111.78.178:8011/"' ////BASE_AGV_API: '"http://192.168.3.223:55200/v1"', //BASE_WMS_API: '"http://169.254.71.103/api"', //BASE_AGV_API: '"http://127.0.0.1:55200/v1"', diff --git a/front/src/views/contract-mgr/projectcontract.vue b/front/src/views/contract-mgr/projectcontract.vue index ad3c36e..bbd77f3 100644 --- a/front/src/views/contract-mgr/projectcontract.vue +++ b/front/src/views/contract-mgr/projectcontract.vue @@ -1,24 +1,38 @@ - - - - - - 项目合同 - - - - {{ node.label }} - - - - - + + + + + + 项目合同 + + + + + {{ node.label }} + + + + + - - - - + + - - - - - - 该文件类型({{ fileExtension }})需要下载后查看 - - 立即下载 {{ fileExtension.toUpperCase() }} 文件 - - - + + + + + + 该文件类型({{ fileExtension }})需要下载后查看 + + 立即下载 {{ fileExtension.toUpperCase() }} 文件 + + + - - + @@ -247,7 +268,43 @@ export default { align-items: center; justify-content: space-between; font-size: 14px; - padding-right: 8px; + padding: 8px; + width: 100%; + min-height: 40px; +} + +.tree-node-label { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + line-height: 1.4; +} + +/* 为树形组件添加节点间距 */ +.box-card .el-tree-node { + margin-bottom: 15px; +} + +.box-card .el-tree-node__content { + height: auto !important; + min-height: 40px; + padding: 12px 0; + border-radius: 4px; +} + +.box-card .el-tree-node__content:hover { + background-color: #f5f7fa; +} + +.box-card .el-tree-node.is-current > .el-tree-node__content { + background-color: #ecf5ff; + color: #409eff; +} + +.box-card .el-tree { + padding: 15px; } .upload-demo { diff --git a/front/src/views/customer-mgr/customerlist.vue b/front/src/views/customer-mgr/customerlist.vue index af35cc9..f15a1ac 100644 --- a/front/src/views/customer-mgr/customerlist.vue +++ b/front/src/views/customer-mgr/customerlist.vue @@ -1,21 +1,28 @@ - - + + 客户管理 + + + :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree"> - {{ node.label }} + {{ node.label }} - - + + + @@ -36,8 +43,8 @@ - - + + @@ -81,6 +88,9 @@ export default { currentNode: null, currentNodeLevel: 0, del_id: 0, + filterText: '', + leftWidth: 300, + isResizing: false }; }, mounted() { @@ -88,8 +98,19 @@ export default { }, created() { + }, + watch: { + filterText(val) { + this.$refs.tree.filter(val); + } }, methods: { + filterNode(value, data) { + if (!value) return true; + const trimmedValue = value.trim(); + if (!trimmedValue) return true; + return data.name.indexOf(trimmedValue) !== -1; + }, confirmAddPartner() { // this.newPartner.company_type = this.partner_type //如果是供应商,需要设置供应商的服务类型 @@ -191,6 +212,32 @@ export default { this.update_sub_component(); }, + startResize(e) { + this.isResizing = true; + document.addEventListener('mousemove', this.handleResize); + document.addEventListener('mouseup', this.stopResize); + e.preventDefault(); + }, + + handleResize(e) { + if (!this.isResizing) return; + const container = this.$el.querySelector('.resizable-container'); + const containerRect = container.getBoundingClientRect(); + let newWidth = e.clientX - containerRect.left; + + // 设置最小和最大宽度 + if (newWidth < 200) newWidth = 200; + if (newWidth > containerRect.width - 400) newWidth = containerRect.width - 400; + + this.leftWidth = newWidth; + }, + + stopResize() { + this.isResizing = false; + document.removeEventListener('mousemove', this.handleResize); + document.removeEventListener('mouseup', this.stopResize); + } + } } @@ -201,13 +248,51 @@ export default { height: 100%; } +.resizable-container { + display: flex; + height: 100%; + width: 100%; +} + +.left-panel { + flex-shrink: 0; + overflow: auto; +} + +.resize-divider { + width: 6px; + cursor: col-resize; + background-color: #f0f0f0; + transition: background-color 0.2s; + flex-shrink: 0; +} + +.resize-divider:hover { + background-color: #409EFF; +} + +.right-panel { + flex: 1; + overflow: auto; + padding-left: 10px; +} + .custom-tree-node { flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; - padding-right: 8px; + padding: 0; + width: 100%; + overflow: hidden; +} + +.tree-node-label { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .upload-demo { @@ -238,4 +323,33 @@ export default { background-color: #eee; cursor: pointer; } + +/* 调整树形结构节点间距和样式 */ +::v-deep .el-tree-node__content { + height: 36px; + line-height: 36px; + padding: 0 8px; + margin: 2px 0; +} + +/* 确保选中状态的背景色对齐 */ +::v-deep .el-tree-node__content:hover { + background-color: #f5f7fa; +} + +::v-deep .el-tree-node.is-current > .el-tree-node__content { + background-color: #e6f7ff; +} + +/* 调整展开/收起图标的位置 */ +::v-deep .el-tree-node__expand-icon { + padding: 6px; +} + +/* 防止文字溢出 */ +::v-deep .el-tree-node__label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/front/src/views/customer-prj/projectlist.vue b/front/src/views/customer-prj/projectlist.vue index f2e2f77..67b1fcc 100644 --- a/front/src/views/customer-prj/projectlist.vue +++ b/front/src/views/customer-prj/projectlist.vue @@ -1,58 +1,82 @@ - - - - + + + + - {{PageTitle}} + {{ PageTitle }} + + + + + + + + + + {{ node.label }} + {{ data.project_number }} + + + + + - - - {{ node.label }} - - - - - + - - - - - - + + + + + + + + + + - - - - - - + + - - - - 不支持的文件类型 + + + + 不支持的文件类型 - +
该文件类型({{ fileExtension }})需要下载后查看
不支持的文件类型