diff --git a/config.js b/config.js index 87431d7..01b2edd 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ // 应用全局配置 module.exports = { // baseUrl: 'https://www.nuoyunr.com/admin-api', - baseUrl: 'http://127.0.0.1:48080/admin-api', - // baseUrl: 'http://xp5ane.natappfree.cc/admin-api', + // baseUrl: 'http://127.0.0.1:48080/admin-api', + baseUrl: 'http://uncs3q.natappfree.cc/admin-api', imagesUrl: 'http://www.nuoyunr.com/lananRsc', baseImageUrl: 'https://www.nuoyunr.com/minio', wsUrl: 'ws://127.0.0.1:48080', diff --git a/pages/authority/newadd.vue b/pages/authority/newadd.vue index 561b41a..bc64b15 100644 --- a/pages/authority/newadd.vue +++ b/pages/authority/newadd.vue @@ -47,12 +47,12 @@ :previewFullImage="true" :maxCount="1" > - - 设置可见 - + + 设置可见 + 全部可见 - 员工可见 - 用户可见 + 员工可见 + 用户可见 @@ -460,4 +460,10 @@ export default { margin-top: 20px; color: white; } + +.radio-group { + display: flex; + flex-direction: column; /* 让 radio 按钮垂直排列 */ + gap: 8px; /* 为 radio 按钮之间添加间距 */ +} diff --git a/pages/index/Staffmanagement.vue b/pages/index/Staffmanagement.vue index 1a11a96..4813b0f 100644 --- a/pages/index/Staffmanagement.vue +++ b/pages/index/Staffmanagement.vue @@ -40,13 +40,15 @@ - - - - - {{ item.nickname || item.username }} - 岗位:{{ item.roleName }} - 电话:{{ item.mobile || item.username }} + + + + + + {{ item.nickname || item.username }} + 岗位:{{ item.roleName }} + 电话:{{ item.mobile || item.username }} + @@ -56,7 +58,7 @@ - 查看详情 + 查看 @@ -89,7 +91,7 @@ 学历: - @@ -98,22 +100,22 @@ 入职时间: - 转正时间: - 购买保险时间: - 附件: - + @@ -362,9 +364,9 @@ export default { this.workids = e.detail.value }, - showpopup() { + async showpopup() { this.show = true - this.educations = [getDictDataByType("company_staff_edu")] + this.educations = [await getDictDataByType("company_staff_edu")] }, async getindex() { if (this.workName != '') { @@ -391,6 +393,11 @@ export default { } else { this.goodsList = res.rows } + this.goodsList.forEach(item => { + if (item.avatar && !item.avatar.includes(config.baseImageUrl)){ + item.avatar = config.baseImageUrl + (item.avatar[0] === '/' ? item.avatar : '/' + item.avatar) + } + }) let total = res.total this.totalPages = Math.ceil(total / this.pageSize); } @@ -636,7 +643,8 @@ export default { } .tap-box { - width: 20%; + //width: 20%; + margin-left: 1rem; height: 100%; text-align: center; font-size: 16px; @@ -677,13 +685,12 @@ export default { } .s-img { - width: 50px; - height: 50px; + width: 40px; + height: 40px; border-radius: 50%; margin-right: 15px; overflow: hidden; flex-shrink: 0; - image { width: 100%; height: 100%; @@ -807,7 +814,7 @@ export default { } .tap-box { - width: 20%; + //width: 20%; display: inline-block; text-align: center; diff --git a/pages/index/TodayTable.vue b/pages/index/TodayTable.vue index 12838df..98ed8b7 100644 --- a/pages/index/TodayTable.vue +++ b/pages/index/TodayTable.vue @@ -121,9 +121,9 @@ export default { maskClick() { this.handleReset() }, - getDictData() { + async getDictData() { if (!this.payTypes || this.payTypes.length === 0) { - this.payTypes = getDictDataByType("pay_type") + this.payTypes = await getDictDataByType("pay_type") } }, getPayType(type) { diff --git a/pages/index/synthesis.vue b/pages/index/synthesis.vue index 7c70b96..7ffcad7 100644 --- a/pages/index/synthesis.vue +++ b/pages/index/synthesis.vue @@ -65,7 +65,7 @@ 检测站的信息管理 - + @@ -79,20 +79,20 @@ 检测站的业务统计 - + - 通知、提醒 + 通知提醒 - 查看监管机构下达的通知 + 查看通知、提醒 - + @@ -105,7 +105,7 @@ 方便 简单 快捷 - + diff --git a/pages/manage/informationAdd.vue b/pages/manage/informationAdd.vue index 6c807db..61c10c9 100644 --- a/pages/manage/informationAdd.vue +++ b/pages/manage/informationAdd.vue @@ -45,7 +45,7 @@ 设备类别 - + @@ -164,9 +164,9 @@ export default { this.typeName = e.value[0].label this.typeShow = false }, - getInsType(){ + async getInsType(){ if (!this.columns || this.columns.length === 0){ - this.columns = [getDictDataByType("ins_equ_type")] + this.columns = [await getDictDataByType("ins_equ_type")] } console.log(this.columns) }, diff --git a/pages/manage/informationManage.vue b/pages/manage/informationManage.vue index 2bf868b..7f69774 100644 --- a/pages/manage/informationManage.vue +++ b/pages/manage/informationManage.vue @@ -86,6 +86,7 @@ import config from '@/config' import code from '../../uni_modules/uview-ui/libs/config/props/code'; import request from '../../utils/request'; import {getDictDataByType} from "../../utils/utils"; +import {getStorageWithExpiry} from "../../utils/auth"; export default { data() { @@ -117,7 +118,6 @@ export default { }, onShow() { this.getlistindex() - }, onReachBottom() { if (this.pageNum >= this.totalPages) { @@ -137,11 +137,9 @@ export default { this.type = value === '0' ? null : value this.getlistindex() }, - getTab(){ - if (!this.tabList || this.tabList.length === 1){ - this.tabList = [...this.tabList, ...getDictDataByType("ins_equ_type")] - } - console.log(this.tabList) + async getTab(){ + const data = await getDictDataByType("ins_equ_type"); + this.tabList = [...this.tabList, ...data]; }, dialogToggle(id) { this.deleteid = id diff --git a/pages/staff/StaffInfo.vue b/pages/staff/StaffInfo.vue index d083360..4a457de 100644 --- a/pages/staff/StaffInfo.vue +++ b/pages/staff/StaffInfo.vue @@ -18,7 +18,7 @@ 学历: - @@ -27,17 +27,17 @@ 入职时间: - 转正时间: - 购买保险时间: - @@ -219,8 +219,8 @@ export default { // this.staff['education'] = e.value[0].value this.showEducation = false }, - getEducations(){ - this.educations = getDictDataByType("company_staff_edu") + async getEducations(){ + this.educations = await getDictDataByType("company_staff_edu") }, async getInfoByUserId(){ const res = await request({ @@ -230,9 +230,9 @@ export default { const data = res.data this.staff = data?.staff || this.staff this.user = data?.user - this.topName = this.staff?.name || this.user?.nickname || this.user?.username + this.topName = this.user?.nickname || this.staff?.name || this.user?.username + this.staff.name = this.user?.nickname || this.user?.username if (!data?.staff){ - this.staff.name = this.user?.nickname || this.user?.username this.staff.tel = this.user?.username || this.user?.mobile this.staff.userId = this.user.id } diff --git a/pages/staff/staff.vue b/pages/staff/staff.vue index c58ef0b..4f1ec3d 100644 --- a/pages/staff/staff.vue +++ b/pages/staff/staff.vue @@ -13,11 +13,16 @@ 搜索 - - {{ item.text }} - - {{countMap.get(index+"")}} - + + + + + {{ item.text }}{{ countMap.length !== 0 ? ('(' + countMap.get(index + "") + ')') : '' }} + + + + + @@ -474,7 +479,7 @@ export default { font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-weight: 400; color: #666666; - margin-left: 0.5rem; + //margin-left: 0.5rem; } .gang { @@ -641,23 +646,19 @@ export default { word-break: break-all; /* 长单词或 URL 会在必要时断开 */ } -.msg-box { - position: relative; - margin-right: 40rpx; - - .msg-num { - position: absolute; - right: -29rpx; - color: white; - background: #d74a43; - width: 35rpx; - height: 35rpx; - line-height: 35rpx; - text-align: center; - font-weight: 800; - font-size: 11px; - border-radius: 50%; - top: -20rpx; - } +.msg-num { + position: absolute; + right: -29rpx; + top: -20rpx; + color: white; + background: #d74a43; + padding: 5rpx 10rpx; /* 使用 padding 确保有足够的空间 */ + min-width: 35rpx; /* 最小宽度 */ + line-height: 1.2; /* 调整行高以适应不同内容 */ + text-align: center; + font-weight: 800; + font-size: 11px; + border-radius: 20rpx; /* 椭圆效果 */ + white-space: nowrap; /* 确保文本不换行 */ } diff --git a/utils/utils.js b/utils/utils.js index 80b8cf6..a8935db 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -4,22 +4,23 @@ import { getStorageWithExpiry } from './auth' -export function getDictDataByType(type) { - let data = getStorageWithExpiry(type) +export async function getDictDataByType(type) { + let data = getStorageWithExpiry(type); if (data === null || data === undefined) { - request({ - url: '/system/dict-data/type', - method: 'get', - params: {type: type} - }).then(res => { - setStorageWithExpiry(type, res.data, 3600) - return res.data - }).catch(() => { - console.log("出现了异常") - }) - } else { - return data + try { + const response = await request({ + url: '/system/dict-data/type', + method: 'get', + params: { type } + }); + data = response.data; + setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间 + } catch (error) { + console.error("请求字典数据时出现了异常:", error); + throw error; // 确保错误能够被外部捕获 + } } + return data; } export function formatDate(timestamp) {