diff --git a/odf-uniapp/components/add-note-dialog.vue b/odf-uniapp/components/add-note-dialog.vue
index d09b3f7..9edb005 100644
--- a/odf-uniapp/components/add-note-dialog.vue
+++ b/odf-uniapp/components/add-note-dialog.vue
@@ -202,6 +202,7 @@ function onSubmit() {
.scroll-area {
flex: 1;
+ width: 90%;
max-height: 60vh;
}
diff --git a/odf-uniapp/components/port-edit-dialog.vue b/odf-uniapp/components/port-edit-dialog.vue
index 4d38cd1..1a33018 100644
--- a/odf-uniapp/components/port-edit-dialog.vue
+++ b/odf-uniapp/components/port-edit-dialog.vue
@@ -1,564 +1,595 @@
-
-
-
-
- loading...
-
+
+
+
+
+ loading...
+
-
-
-
-
- 位置:{{ portData.frameName }}{{ portData.name }}
-
-
- {{ portData.status === 1 ? '已连接' : '已断开' }}
-
-
-
+
+
+
+
+ 位置:{{ portData.frameName }}{{ portData.name }}
+
+
+ {{ portData.status === 1 ? '已连接' : '已断开' }}
+
+
+
-
-
- 备注说明
-
-
+
+
+ 备注说明
+
+
-
-
- 光衰信息
-
-
+
+
+ 光衰信息
+
+
-
-
- 历史障碍记录
-
-
-
-
-
-
- {{ item.faultTime || '选择日期' }}
-
-
-
-
-
- -
-
-
-
-
-
- 添加新记录
-
-
+
+
+ 历史障碍记录
+
+
+
+
+
+
+ {{ item.faultTime || '选择日期' }}
+
+
+
+
+
+ -
+
+
+
+
+
+ 添加新记录
+
+
-
-
- 光缆段信息
-
-
+
+
+ 光缆段信息
+
+
-
-
- 改变状态
-
-
- 连接
-
-
- 断开
-
-
- 断开后只清空备注说明,其他内容不影响
-
+
+
+ 改变状态
+
+
+ 连接
+
+
+ 断开
+
+
+ 断开后只清空备注说明,其他内容不影响
+
+
-
-
-
-
- 取消
-
-
- 提交
-
-
-
-
- 关闭
-
-
-
-
-
+
+
+
+
+ 取消
+
+
+ 提交
+
+
+
+
+ 关闭
+
+
+
+
-
-
-
+
+
+
+ .btn-text {
+ font-size: 28rpx;
+ color: #666;
+ }
+
+ .btn-text-white {
+ font-size: 28rpx;
+ color: #fff;
+ }
+
\ No newline at end of file
diff --git a/odf-uniapp/manifest.json b/odf-uniapp/manifest.json
index 3d5e0f8..1f0a611 100644
--- a/odf-uniapp/manifest.json
+++ b/odf-uniapp/manifest.json
@@ -17,7 +17,11 @@
"delay" : 0
},
/* 模块配置 */
- "modules" : {},
+ "modules" : {
+ "Barcode" : {},
+ "Geolocation" : {},
+ "Camera" : {}
+ },
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
@@ -45,7 +49,14 @@
"dSYMs" : false
},
/* SDK配置 */
- "sdkConfigs" : {},
+ "sdkConfigs" : {
+ "geolocation" : {
+ "system" : {
+ "__platform__" : [ "ios", "android" ]
+ }
+ },
+ "share" : {}
+ },
"icons" : {
"android" : {
"hdpi" : ""
diff --git a/odf-uniapp/pages.json b/odf-uniapp/pages.json
index e7df498..81a49e9 100644
--- a/odf-uniapp/pages.json
+++ b/odf-uniapp/pages.json
@@ -1,86 +1,145 @@
{
- "pages": [
- {
- "path": "pages/start/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/login/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/home/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "", "enablePullDownRefresh": true }
- },
- {
- "path": "pages/region/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/room/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "", "enablePullDownRefresh": true }
- },
- {
- "path": "pages/rack/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "", "enablePullDownRefresh": true }
- },
- {
- "path": "pages/rack-detail/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/search/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/settings/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/change-password/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/portal/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/checkin/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/trunk/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/cable/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/fault-list/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/fault-detail/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/fault-add/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/trunk-search/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- },
- {
- "path": "pages/route-plan/index",
- "style": { "navigationStyle": "custom", "navigationBarTitleText": "" }
- }
- ],
- "globalStyle": {
- "navigationBarTextStyle": "white",
- "navigationBarTitleText": "绥时录",
- "navigationBarBackgroundColor": "#1A73EC",
- "backgroundColor": "#F5F5F5"
- }
-}
+ "pages": [{
+ "path": "pages/start/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/route-plan/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/login/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/home/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": true
+ }
+ },
+ {
+ "path": "pages/region/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/room/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": true
+ }
+ },
+ {
+ "path": "pages/rack/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": true
+ }
+ },
+ {
+ "path": "pages/rack-detail/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/search/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/settings/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/change-password/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/portal/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/checkin/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/trunk/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/cable/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/fault-list/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/fault-detail/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/fault-add/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ },
+ {
+ "path": "pages/trunk-search/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": ""
+ }
+ }
+ ],
+ "globalStyle": {
+ "navigationBarTextStyle": "white",
+ "navigationBarTitleText": "绥时录",
+ "navigationBarBackgroundColor": "#1A73EC",
+ "backgroundColor": "#F5F5F5"
+ }
+}
\ No newline at end of file
diff --git a/odf-uniapp/pages/cable/index.vue b/odf-uniapp/pages/cable/index.vue
index 3dd6d58..f067faf 100644
--- a/odf-uniapp/pages/cable/index.vue
+++ b/odf-uniapp/pages/cable/index.vue
@@ -34,17 +34,21 @@
-
+
-
{{ item.cableName }}
+
+
+
+ 暂无光缆数据
+
@@ -58,12 +62,14 @@ const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
const cableList = ref([])
const deptId = ref('')
const keyword = ref('')
+const loaded = ref(false)
async function loadCableList() {
const res = await getCableList(deptId.value)
- if (res.code === 200) {
- cableList.value = res.data || []
+ if (res.code === 200 && res.data) {
+ cableList.value = res.data.result || []
}
+ loaded.value = true
}
function goBack() {
@@ -189,28 +195,30 @@ onPullDownRefresh(() => {
.cable-card {
display: flex;
- flex-direction: column;
align-items: center;
margin: 0 24rpx 20rpx;
- padding: 24rpx;
+ padding: 28rpx 24rpx;
background-color: #fff;
border-radius: 12rpx;
border: 1rpx solid #E8E8E8;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
-.cable-image {
- width: 100%;
- height: 160rpx;
- background: #F0F0F0;
- border-radius: 8rpx;
- margin-bottom: 16rpx;
-}
-
.cable-name {
font-size: 30rpx;
color: #333;
font-weight: 500;
- text-align: center;
+}
+
+.empty-state {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 200rpx 0;
+}
+
+.empty-text {
+ font-size: 28rpx;
+ color: #999;
}
diff --git a/odf-uniapp/pages/fault-add/index.vue b/odf-uniapp/pages/fault-add/index.vue
index f024f1b..2151717 100644
--- a/odf-uniapp/pages/fault-add/index.vue
+++ b/odf-uniapp/pages/fault-add/index.vue
@@ -159,6 +159,24 @@ function takePhoto() {
}
function getLocation() {
+ // #ifdef H5
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(
+ (pos) => {
+ form.latitude = pos.coords.latitude
+ form.longitude = pos.coords.longitude
+ uni.showToast({ title: '获取成功', icon: 'success' })
+ },
+ () => {
+ uni.showToast({ title: '获取位置失败,请检查浏览器定位权限', icon: 'none' })
+ },
+ { enableHighAccuracy: true, timeout: 10000 }
+ )
+ } else {
+ uni.showToast({ title: '当前浏览器不支持定位', icon: 'none' })
+ }
+ // #endif
+ // #ifndef H5
uni.getLocation({
type: 'gcj02',
success(res) {
@@ -170,6 +188,7 @@ function getLocation() {
uni.showToast({ title: '获取位置失败', icon: 'none' })
}
})
+ // #endif
}
async function handleSubmit() {
@@ -177,6 +196,10 @@ async function handleSubmit() {
uni.showToast({ title: '请至少拍摄一张照片', icon: 'none' })
return
}
+ if (!cableId.value) {
+ uni.showToast({ title: '所属光缆信息缺失,无法提交', icon: 'none' })
+ return
+ }
if (submitting.value) return
submitting.value = true
@@ -421,6 +444,7 @@ onLoad((options) => {
padding: 24rpx;
background: #fff;
box-sizing: border-box;
+ z-index: 100;
}
.submit-btn {
diff --git a/odf-uniapp/pages/home/index.vue b/odf-uniapp/pages/home/index.vue
index f51c12d..c9a1e46 100644
--- a/odf-uniapp/pages/home/index.vue
+++ b/odf-uniapp/pages/home/index.vue
@@ -8,17 +8,25 @@
公司列表
-
+
+
+
+
@@ -90,6 +98,15 @@ function handleRefresh() {
loadCompanyList()
}
+function goBack() {
+ uni.navigateBack({
+ fail() {
+ // H5下navigateBack失败时(如页面栈只有一层),回到portal
+ uni.reLaunch({ url: '/pages/portal/index' })
+ }
+ })
+}
+
function goSearch() {
uni.navigateTo({ url: '/pages/search/index' })
}
@@ -153,6 +170,15 @@ onPullDownRefresh(() => {
height: 44rpx;
}
+.nav-right {
+ display: flex;
+ align-items: center;
+}
+
+.nav-icon-ml {
+ margin-left: 24rpx;
+}
+
.nav-title {
font-size: 34rpx;
font-weight: 600;
diff --git a/odf-uniapp/pages/portal/index.vue b/odf-uniapp/pages/portal/index.vue
index d526e85..8ded968 100644
--- a/odf-uniapp/pages/portal/index.vue
+++ b/odf-uniapp/pages/portal/index.vue
@@ -30,7 +30,6 @@
:key="item.code"
@click="handleModuleClick(item)"
>
-
{{ item.name }}
@@ -136,23 +135,16 @@ onLoad(() => {
.module-card {
display: flex;
- flex-direction: column;
align-items: center;
justify-content: center;
- padding: 32rpx;
+ height: 160rpx;
background-color: #fff;
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
-.module-image {
- width: 120rpx;
- height: 120rpx;
- margin-bottom: 16rpx;
-}
-
.module-name {
- font-size: 30rpx;
+ font-size: 32rpx;
color: #333;
font-weight: 500;
text-align: center;
diff --git a/odf-uniapp/pages/start/index.vue b/odf-uniapp/pages/start/index.vue
index 30874e9..e40f7d2 100644
--- a/odf-uniapp/pages/start/index.vue
+++ b/odf-uniapp/pages/start/index.vue
@@ -14,10 +14,10 @@ onLoad(() => {
checkPermission().then((res) => {
if (res.code === 200) {
store.isPermission = true
- uni.reLaunch({ url: '/pages/home/index' })
+ uni.reLaunch({ url: '/pages/portal/index' })
} else if (res.code === 403) {
store.isPermission = false
- uni.reLaunch({ url: '/pages/home/index' })
+ uni.reLaunch({ url: '/pages/portal/index' })
} else if (res.code === 401) {
uni.reLaunch({ url: '/pages/login/index' })
}
diff --git a/odf-uniapp/pages/trunk-search/index.vue b/odf-uniapp/pages/trunk-search/index.vue
index 75c3b93..108182a 100644
--- a/odf-uniapp/pages/trunk-search/index.vue
+++ b/odf-uniapp/pages/trunk-search/index.vue
@@ -28,7 +28,6 @@
:key="item.id"
@click="goCableFaultList(item)"
>
-
{{ item.cableName }}
@@ -188,29 +187,19 @@ onLoad((options) => {
/* 光缆卡片 — 复用 cable 页样式 */
.cable-card {
display: flex;
- flex-direction: column;
align-items: center;
margin: 0 24rpx 20rpx;
- padding: 24rpx;
+ padding: 28rpx 24rpx;
background-color: #fff;
border-radius: 12rpx;
border: 1rpx solid #E8E8E8;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
-.cable-image {
- width: 100%;
- height: 160rpx;
- background: #F0F0F0;
- border-radius: 8rpx;
- margin-bottom: 16rpx;
-}
-
.cable-name {
font-size: 30rpx;
color: #333;
font-weight: 500;
- text-align: center;
}
/* 故障卡片 — 复用 fault-list 页样式 */
diff --git a/odf-uniapp/pages/trunk/index.vue b/odf-uniapp/pages/trunk/index.vue
index 6b0eb29..84e65b8 100644
--- a/odf-uniapp/pages/trunk/index.vue
+++ b/odf-uniapp/pages/trunk/index.vue
@@ -28,7 +28,6 @@
:key="item.deptId"
@click="goCable(item)"
>
-
{{ item.deptName }}
@@ -134,28 +133,18 @@ onPullDownRefresh(() => {
.company-card {
display: flex;
- flex-direction: column;
align-items: center;
margin: 0 24rpx 20rpx;
- padding: 24rpx;
+ padding: 28rpx 24rpx;
background-color: #fff;
border-radius: 12rpx;
border: 1rpx solid #E8E8E8;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
-.company-image {
- width: 100%;
- height: 160rpx;
- background: #F0F0F0;
- border-radius: 8rpx;
- margin-bottom: 16rpx;
-}
-
.company-name {
font-size: 30rpx;
color: #333;
font-weight: 500;
- text-align: center;
}
diff --git a/odf-uniapp/services/api.js b/odf-uniapp/services/api.js
index 28868ba..919ed09 100644
--- a/odf-uniapp/services/api.js
+++ b/odf-uniapp/services/api.js
@@ -3,7 +3,7 @@ import store from '@/store'
// const BASE_URL = 'http://49.233.115.141:11082'
// const BASE_URL = 'http://115.190.188.216:2861'
-const BASE_URL = 'https://api.wux.shhmkjgs.cn'
+export const BASE_URL = 'https://api.wux.shhmkjgs.cn'
const TIMEOUT = 20000
/**
diff --git a/odf-uniapp/services/trunk.js b/odf-uniapp/services/trunk.js
index 83ab69f..ee72331 100644
--- a/odf-uniapp/services/trunk.js
+++ b/odf-uniapp/services/trunk.js
@@ -1,8 +1,6 @@
-import { get } from './api'
+import { get, BASE_URL } from './api'
import store from '@/store'
-const BASE_URL = 'http://49.233.115.141:11082'
-
export const getCableList = (deptId) =>
get('/business/OdfCables/list', { deptId })
diff --git a/odf-uniapp/utils/watermark.js b/odf-uniapp/utils/watermark.js
index feb813f..0be68d7 100644
--- a/odf-uniapp/utils/watermark.js
+++ b/odf-uniapp/utils/watermark.js
@@ -2,54 +2,37 @@
* 在照片左下角叠加水印文字
* @param {string} imagePath - 原始图片路径
* @param {string} text - 水印文字(如 "2025/06/15 12:00 张三")
- * @returns {Promise} 带水印的临时文件路径
+ * @returns {Promise} 带水印的临时文件路径(H5 返回 base64 dataURL)
*/
export function addWatermark(imagePath, text) {
return new Promise((resolve, reject) => {
+ // #ifdef APP-PLUS
uni.getImageInfo({
src: imagePath,
success(imgInfo) {
- const canvasId = 'watermarkCanvas'
const width = imgInfo.width
const height = imgInfo.height
-
- // 使用 OffscreenCanvas(APP-PLUS 和 H5 均支持)
- // #ifdef APP-PLUS
const bitmap = new plus.nativeObj.Bitmap('watermark')
bitmap.load(imagePath, () => {
const canvas = new plus.nativeObj.View('watermarkView', {
left: '0px', top: '0px',
width: width + 'px', height: height + 'px'
})
-
- // 绘制原图
canvas.drawBitmap(bitmap, {}, { left: '0px', top: '0px', width: width + 'px', height: height + 'px' })
-
- // 水印参数
const fontSize = Math.max(Math.floor(width * 0.03), 14)
const padding = Math.floor(fontSize * 0.8)
const textX = padding
- const textY = height - padding
-
- // 绘制半透明背景
const bgHeight = fontSize + padding * 2
canvas.drawRect(
{ color: 'rgba(0,0,0,0.4)' },
{ left: '0px', top: (height - bgHeight) + 'px', width: width + 'px', height: bgHeight + 'px' }
)
-
- // 绘制水印文字
canvas.drawText(text, {
left: textX + 'px',
top: (height - bgHeight + padding) + 'px',
width: (width - textX * 2) + 'px',
height: fontSize + 'px'
- }, {
- size: fontSize + 'px',
- color: '#ffffff'
- })
-
- // 导出
+ }, { size: fontSize + 'px', color: '#ffffff' })
const tempPath = `_doc/watermark_${Date.now()}.jpg`
canvas.toBitmap(tempPath, {}, () => {
bitmap.clear()
@@ -58,51 +41,41 @@ export function addWatermark(imagePath, text) {
bitmap.clear()
reject(err)
})
- }, (err) => {
- reject(err)
- })
- // #endif
-
- // #ifndef APP-PLUS
- // H5 / 小程序端使用 Canvas 2D
- const canvas = uni.createOffscreenCanvas({ type: '2d', width, height })
- const ctx = canvas.getContext('2d')
- const img = canvas.createImage()
-
- img.onload = () => {
- // 绘制原图
- ctx.drawImage(img, 0, 0, width, height)
-
- // 水印参数
- const fontSize = Math.max(Math.floor(width * 0.03), 14)
- const padding = Math.floor(fontSize * 0.8)
-
- // 绘制半透明背景
- const bgHeight = fontSize + padding * 2
- ctx.fillStyle = 'rgba(0,0,0,0.4)'
- ctx.fillRect(0, height - bgHeight, width, bgHeight)
-
- // 绘制水印文字
- ctx.fillStyle = '#ffffff'
- ctx.font = `${fontSize}px sans-serif`
- ctx.textBaseline = 'middle'
- ctx.fillText(text, padding, height - bgHeight / 2)
-
- // 导出为临时文件
- const tempFilePath = canvas.toDataURL('image/jpeg', 0.9)
- resolve(tempFilePath)
- }
-
- img.onerror = (err) => {
- reject(err || new Error('图片加载失败'))
- }
-
- img.src = imagePath
- // #endif
+ }, (err) => reject(err))
},
- fail(err) {
- reject(err)
- }
+ fail: reject
})
+ // #endif
+
+ // #ifdef H5
+ const img = new Image()
+ img.crossOrigin = 'anonymous'
+ img.onload = () => {
+ const width = img.naturalWidth
+ const height = img.naturalHeight
+ const canvas = document.createElement('canvas')
+ canvas.width = width
+ canvas.height = height
+ const ctx = canvas.getContext('2d')
+ ctx.drawImage(img, 0, 0, width, height)
+ const fontSize = Math.max(Math.floor(width * 0.03), 14)
+ const padding = Math.floor(fontSize * 0.8)
+ const bgHeight = fontSize + padding * 2
+ ctx.fillStyle = 'rgba(0,0,0,0.4)'
+ ctx.fillRect(0, height - bgHeight, width, bgHeight)
+ ctx.fillStyle = '#ffffff'
+ ctx.font = `${fontSize}px sans-serif`
+ ctx.textBaseline = 'middle'
+ ctx.fillText(text, padding, height - bgHeight / 2)
+ resolve(canvas.toDataURL('image/jpeg', 0.9))
+ }
+ img.onerror = (err) => reject(err || new Error('图片加载失败'))
+ img.src = imagePath
+ // #endif
+
+ // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ
+ // 小程序端:跳过水印,直接返回原图
+ // resolve(imagePath)
+ // #endif
})
}
diff --git a/server/ZR.Vue/src/components/business/OdfCableForm.vue b/server/ZR.Vue/src/components/business/OdfCableForm.vue
index e846d74..d03a629 100644
--- a/server/ZR.Vue/src/components/business/OdfCableForm.vue
+++ b/server/ZR.Vue/src/components/business/OdfCableForm.vue
@@ -145,12 +145,29 @@ function loadData() {
}
}
+// 从部门树中查找部门名称
+function findDeptName(deptId, nodes) {
+ for (const node of nodes) {
+ if (node.id === deptId) return node.label
+ if (node.children && node.children.length > 0) {
+ const found = findDeptName(deptId, node.children)
+ if (found) return found
+ }
+ }
+ return null
+}
+
// 提交表单
function submitForm() {
proxy.$refs['formRef'].validate((valid) => {
if (valid) {
submitLoading.value = true
+ // 根据选中的 deptId 填充 deptName
+ if (form.value.deptId) {
+ form.value.deptName = findDeptName(form.value.deptId, deptOptions.value) || ''
+ }
+
if (isEdit.value) {
updateOdfCables(form.value)
.then((res) => {