This commit is contained in:
xiaofajia 2024-12-20 19:32:47 +08:00
parent ccfa2f6ce2
commit 78fe46bfec
10 changed files with 103 additions and 90 deletions

View File

@ -1,8 +1,8 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
// baseUrl: 'https://www.nuoyunr.com/admin-api', // baseUrl: 'https://www.nuoyunr.com/admin-api',
baseUrl: 'http://127.0.0.1:48080/admin-api', // baseUrl: 'http://127.0.0.1:48080/admin-api',
// baseUrl: 'http://xp5ane.natappfree.cc/admin-api', baseUrl: 'http://uncs3q.natappfree.cc/admin-api',
imagesUrl: 'http://www.nuoyunr.com/lananRsc', imagesUrl: 'http://www.nuoyunr.com/lananRsc',
baseImageUrl: 'https://www.nuoyunr.com/minio', baseImageUrl: 'https://www.nuoyunr.com/minio',
wsUrl: 'ws://127.0.0.1:48080', wsUrl: 'ws://127.0.0.1:48080',

View File

@ -47,12 +47,12 @@
:previewFullImage="true" :previewFullImage="true"
:maxCount="1" :maxCount="1"
></u-upload> ></u-upload>
<view v-if="type === 'null'" class="tinput" style="display: flex;justify-content: space-between"> <view v-if="type === 'null'" class="tinput" style="display: flex;align-items: center">
<text class="text1">设置可见</text> <text class="text1" style="flex-shrink: 0;">设置可见</text>
<view> <view class="radio-group">
<radio :checked="!ifShow" @click="changeShow(null)">全部可见</radio> <radio :checked="!ifShow" @click="changeShow(null)">全部可见</radio>
<radio :checked="ifShow === '01'" style="margin-left: 0.5rem" @click="changeShow('01')">员工可见</radio> <radio :checked="ifShow === '01'" @click="changeShow('01')">员工可见</radio>
<radio :checked="ifShow === '02'" style="margin-left: 0.5rem" @click="changeShow('02')">用户可见</radio> <radio :checked="ifShow === '02'" @click="changeShow('02')">用户可见</radio>
</view> </view>
</view> </view>
<view class="xinput"> <view class="xinput">
@ -460,4 +460,10 @@ export default {
margin-top: 20px; margin-top: 20px;
color: white; color: white;
} }
.radio-group {
display: flex;
flex-direction: column; /* 让 radio 按钮垂直排列 */
gap: 8px; /* 为 radio 按钮之间添加间距 */
}
</style> </style>

View File

@ -40,13 +40,15 @@
<label> <label>
<checkbox :value="item.id+''" color="#FFCC33" style="transform:scale(0.7)"/> <checkbox :value="item.id+''" color="#FFCC33" style="transform:scale(0.7)"/>
</label> </label>
<view style="display: flex;align-items: center;width: 85%">
<view class="s-img"> <view class="s-img">
<image :src="item.avatar" mode="aspectFill"></image> <image :src="item.avatar" mode="aspectFill"></image>
</view> </view>
<view class="s-right"> <view class="s-right">
<view class="s-title">{{ item.nickname || item.username }}</view> <view class="s-title">{{ item.nickname || item.username }}</view>
<view class="s-hui">岗位{{ item.roleName }}</view> <view class="s-hui">岗位{{ item.roleName }}</view>
<view class="s-hui">电话{{ item.mobile || item.username }}</view> <view class="s-hui" style="white-space: nowrap; ">电话{{ item.mobile || item.username }}</view>
</view>
</view> </view>
<view> <view>
<view class="bottom-box" @click="gettel(item)"> <view class="bottom-box" @click="gettel(item)">
@ -56,7 +58,7 @@
<!-- <text>删除</text> --> <!-- <text>删除</text> -->
</view> </view>
<view class="bottom-box" style="margin-top: 1rem" @click="toInfo(item)"> <view class="bottom-box" style="margin-top: 1rem" @click="toInfo(item)">
<text>查看详情</text> <text>查看</text>
</view> </view>
</view> </view>
</view> </view>
@ -89,7 +91,7 @@
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">学历</view> <view class="s-huix">学历</view>
<view class="" @click="showEducation = true"><input v-model="educationText" type="text" <view class="" @click="showEducation = true"><input disabled v-model="educationText" type="text"
placeholder="请选择学历"></view> placeholder="请选择学历"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
@ -98,22 +100,22 @@
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">入职时间</view> <view class="s-huix">入职时间</view>
<view class="" @click="showJoinedDate = true"><input :value="formattedJoinedDate" type="text" <view class="" @click="showJoinedDate = true"><input disabled :value="formattedJoinedDate" type="text"
placeholder="请选择入职时间"></view> placeholder="请选择入职时间"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">转正时间</view> <view class="s-huix">转正时间</view>
<view class="" @click="showFormalDate = true"><input :value="formattedFormalDate" type="text" <view class="" @click="showFormalDate = true"><input disabled :value="formattedFormalDate" type="text"
placeholder="请选择转正时间"></view> placeholder="请选择转正时间"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">购买保险时间</view> <view class="s-huix">购买保险时间</view>
<view class="" @click="showSafeDate = true"><input :value="formattedSafeDate" type="text" <view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
placeholder="请选择购买保险时间"></view> placeholder="请选择购买保险时间"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">附件</view> <view class="s-huix">附件</view>
<view class="" @click="addFile"><input type="text" placeholder="添加附件"></view> <view class="" @click="addFile"><input disabled type="text" placeholder="添加附件"></view>
</view> </view>
<view v-for="(item, index) in files"> <view v-for="(item, index) in files">
<view class="on-input"> <view class="on-input">
@ -362,9 +364,9 @@ export default {
this.workids = e.detail.value this.workids = e.detail.value
}, },
showpopup() { async showpopup() {
this.show = true this.show = true
this.educations = [getDictDataByType("company_staff_edu")] this.educations = [await getDictDataByType("company_staff_edu")]
}, },
async getindex() { async getindex() {
if (this.workName != '') { if (this.workName != '') {
@ -391,6 +393,11 @@ export default {
} else { } else {
this.goodsList = res.rows 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 let total = res.total
this.totalPages = Math.ceil(total / this.pageSize); this.totalPages = Math.ceil(total / this.pageSize);
} }
@ -636,7 +643,8 @@ export default {
} }
.tap-box { .tap-box {
width: 20%; //width: 20%;
margin-left: 1rem;
height: 100%; height: 100%;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
@ -677,13 +685,12 @@ export default {
} }
.s-img { .s-img {
width: 50px; width: 40px;
height: 50px; height: 40px;
border-radius: 50%; border-radius: 50%;
margin-right: 15px; margin-right: 15px;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -807,7 +814,7 @@ export default {
} }
.tap-box { .tap-box {
width: 20%; //width: 20%;
display: inline-block; display: inline-block;
text-align: center; text-align: center;

View File

@ -121,9 +121,9 @@ export default {
maskClick() { maskClick() {
this.handleReset() this.handleReset()
}, },
getDictData() { async getDictData() {
if (!this.payTypes || this.payTypes.length === 0) { if (!this.payTypes || this.payTypes.length === 0) {
this.payTypes = getDictDataByType("pay_type") this.payTypes = await getDictDataByType("pay_type")
} }
}, },
getPayType(type) { getPayType(type) {

View File

@ -65,7 +65,7 @@
<!-- <text style="color: #6FA1CD;">检测站的信息管理</text> --> <!-- <text style="color: #6FA1CD;">检测站的信息管理</text> -->
<text>检测站的信息管理</text> <text>检测站的信息管理</text>
</view> </view>
<view class="icon-img"> <view class="icon-img" style="flex-shrink: 0">
<image src="../../static/detection/xxgl.png" mode=""></image> <image src="../../static/detection/xxgl.png" mode=""></image>
</view> </view>
</view> </view>
@ -79,20 +79,20 @@
<text>检测站的业务统计</text> <text>检测站的业务统计</text>
</view> </view>
<view class="icon-img"> <view class="icon-img" style="flex-shrink: 0">
<image src="../../static/detection/ywgl.png" mode=""></image> <image src="../../static/detection/ywgl.png" mode=""></image>
</view> </view>
</view> </view>
<view class="ang-box3" @click="goxiaoxi()"> <view class="ang-box3" @click="goxiaoxi()">
<view class="bs-di"> <view class="bs-di">
<text>通知提醒</text> <text>通知提醒</text>
<uni-icons type="arrow-right" color="#775FAE" size="20"></uni-icons> <uni-icons type="arrow-right" color="#775FAE" size="20"></uni-icons>
</view> </view>
<view class="xzi"> <view class="xzi">
<!-- <text style="color: #775FAE;">查看监管机构下达的通知</text> --> <!-- <text style="color: #775FAE;">查看监管机构下达的通知</text> -->
<text>查看监管机构下达的通知</text> <text>查看通知提醒</text>
</view> </view>
<view class="icon-img"> <view class="icon-img" style="flex-shrink: 0">
<image src="../../static/detection/jgtz.png" mode=""></image> <image src="../../static/detection/jgtz.png" mode=""></image>
</view> </view>
</view> </view>
@ -105,7 +105,7 @@
<!-- <text style="color: #FFFFFF ;">详细的操作手册</text> --> <!-- <text style="color: #FFFFFF ;">详细的操作手册</text> -->
<text>方便 简单 快捷</text> <text>方便 简单 快捷</text>
</view> </view>
<view class="icon-img"> <view class="icon-img" style="flex-shrink: 0">
<image src="../../static/detection/gsjj.png" mode=""></image> <image src="../../static/detection/gsjj.png" mode=""></image>
</view> </view>
</view> </view>

View File

@ -45,7 +45,7 @@
设备类别 设备类别
</view> </view>
<view class="you"> <view class="you">
<input type="text" placeholder="请选择设备类别" v-model="typeName"> <input type="text" disabled placeholder="请选择设备类别" v-model="typeName">
</view> </view>
</view> </view>
<view class="tinput"> <view class="tinput">
@ -164,9 +164,9 @@ export default {
this.typeName = e.value[0].label this.typeName = e.value[0].label
this.typeShow = false this.typeShow = false
}, },
getInsType(){ async getInsType(){
if (!this.columns || this.columns.length === 0){ if (!this.columns || this.columns.length === 0){
this.columns = [getDictDataByType("ins_equ_type")] this.columns = [await getDictDataByType("ins_equ_type")]
} }
console.log(this.columns) console.log(this.columns)
}, },

View File

@ -86,6 +86,7 @@ import config from '@/config'
import code from '../../uni_modules/uview-ui/libs/config/props/code'; import code from '../../uni_modules/uview-ui/libs/config/props/code';
import request from '../../utils/request'; import request from '../../utils/request';
import {getDictDataByType} from "../../utils/utils"; import {getDictDataByType} from "../../utils/utils";
import {getStorageWithExpiry} from "../../utils/auth";
export default { export default {
data() { data() {
@ -117,7 +118,6 @@ export default {
}, },
onShow() { onShow() {
this.getlistindex() this.getlistindex()
}, },
onReachBottom() { onReachBottom() {
if (this.pageNum >= this.totalPages) { if (this.pageNum >= this.totalPages) {
@ -137,11 +137,9 @@ export default {
this.type = value === '0' ? null : value this.type = value === '0' ? null : value
this.getlistindex() this.getlistindex()
}, },
getTab(){ async getTab(){
if (!this.tabList || this.tabList.length === 1){ const data = await getDictDataByType("ins_equ_type");
this.tabList = [...this.tabList, ...getDictDataByType("ins_equ_type")] this.tabList = [...this.tabList, ...data];
}
console.log(this.tabList)
}, },
dialogToggle(id) { dialogToggle(id) {
this.deleteid = id this.deleteid = id

View File

@ -18,7 +18,7 @@
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">学历</view> <view class="s-huix">学历</view>
<view class="" @click="showEducation = true"><input :value="getEducation" type="text" <view class="" @click="showEducation = true"><input disabled :value="getEducation" type="text"
placeholder="请选择学历"></view> placeholder="请选择学历"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
@ -27,17 +27,17 @@
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">入职时间</view> <view class="s-huix">入职时间</view>
<view class="" @click="showJoinedDate = true"><input :value="formattedJoinedDate" type="text" <view class="" @click="showJoinedDate = true"><input disabled :value="formattedJoinedDate" type="text"
placeholder="请选择入职时间"></view> placeholder="请选择入职时间"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">转正时间</view> <view class="s-huix">转正时间</view>
<view class="" @click="showFormalDate = true"><input :value="formattedFormalDate" type="text" <view class="" @click="showFormalDate = true"><input disabled :value="formattedFormalDate" type="text"
placeholder="请选择转正时间"></view> placeholder="请选择转正时间"></view>
</view> </view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">购买保险时间</view> <view class="s-huix">购买保险时间</view>
<view class="" @click="showSafeDate = true"><input :value="formattedSafeDate" type="text" <view class="" @click="showSafeDate = true"><input disabled :value="formattedSafeDate" type="text"
placeholder="请选择购买保险时间"></view> placeholder="请选择购买保险时间"></view>
</view> </view>
<view class=""> <view class="">
@ -219,8 +219,8 @@ export default {
// this.staff['education'] = e.value[0].value // this.staff['education'] = e.value[0].value
this.showEducation = false this.showEducation = false
}, },
getEducations(){ async getEducations(){
this.educations = getDictDataByType("company_staff_edu") this.educations = await getDictDataByType("company_staff_edu")
}, },
async getInfoByUserId(){ async getInfoByUserId(){
const res = await request({ const res = await request({
@ -230,9 +230,9 @@ export default {
const data = res.data const data = res.data
this.staff = data?.staff || this.staff this.staff = data?.staff || this.staff
this.user = data?.user 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
if (!data?.staff){
this.staff.name = this.user?.nickname || this.user?.username this.staff.name = this.user?.nickname || this.user?.username
if (!data?.staff){
this.staff.tel = this.user?.username || this.user?.mobile this.staff.tel = this.user?.username || this.user?.mobile
this.staff.userId = this.user.id this.staff.userId = this.user.id
} }

View File

@ -13,11 +13,16 @@
<view class="sou" @click="getList()">搜索</view> <view class="sou" @click="getList()">搜索</view>
</view> </view>
<view class="tap"> <view class="tap">
<view class="tap-box msg-box" v-for="(item,index) in tapList" :key="index" @click="tapqh(index)"> <scroll-view scroll-x="true" style="width: 100%;">
<view class="xhuihui" :class="{'xzhei':tapindex == index}">{{ item.text }}</view> <view style="display: flex; align-items: center; white-space: nowrap;">
<view class="gang" v-if="tapindex == index"></view> <view class="tap-box" v-for="(item, index) in tapList" :key="index" @click="tapqh(index)">
<view class="msg-num">{{countMap.get(index+"")}}</view> <view class="xhuihui" :class="{'xzhei': tapindex == index}" style="white-space: nowrap;margin-right: 0.5rem">
{{ item.text }}{{ countMap.length !== 0 ? ('(' + countMap.get(index + "") + ')') : '' }}
</view> </view>
<view class="gang" v-if="tapindex == index"></view>
</view>
</view>
</scroll-view>
</view> </view>
<view class="mub"> <view class="mub">
@ -474,7 +479,7 @@ export default {
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
margin-left: 0.5rem; //margin-left: 0.5rem;
} }
.gang { .gang {
@ -641,23 +646,19 @@ export default {
word-break: break-all; /* 长单词或 URL 会在必要时断开 */ word-break: break-all; /* 长单词或 URL 会在必要时断开 */
} }
.msg-box { .msg-num {
position: relative;
margin-right: 40rpx;
.msg-num {
position: absolute; position: absolute;
right: -29rpx; right: -29rpx;
top: -20rpx;
color: white; color: white;
background: #d74a43; background: #d74a43;
width: 35rpx; padding: 5rpx 10rpx; /* 使用 padding 确保有足够的空间 */
height: 35rpx; min-width: 35rpx; /* 最小宽度 */
line-height: 35rpx; line-height: 1.2; /* 调整行高以适应不同内容 */
text-align: center; text-align: center;
font-weight: 800; font-weight: 800;
font-size: 11px; font-size: 11px;
border-radius: 50%; border-radius: 20rpx; /* 椭圆效果 */
top: -20rpx; white-space: nowrap; /* 确保文本不换行 */
}
} }
</style> </style>

View File

@ -4,22 +4,23 @@ import {
getStorageWithExpiry getStorageWithExpiry
} from './auth' } from './auth'
export function getDictDataByType(type) { export async function getDictDataByType(type) {
let data = getStorageWithExpiry(type) let data = getStorageWithExpiry(type);
if (data === null || data === undefined) { if (data === null || data === undefined) {
request({ try {
const response = await request({
url: '/system/dict-data/type', url: '/system/dict-data/type',
method: 'get', method: 'get',
params: {type: type} params: { type }
}).then(res => { });
setStorageWithExpiry(type, res.data, 3600) data = response.data;
return res.data setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
}).catch(() => { } catch (error) {
console.log("出现了异常") console.error("请求字典数据时出现了异常:", error);
}) throw error; // 确保错误能够被外部捕获
} else {
return data
} }
}
return data;
} }
export function formatDate(timestamp) { export function formatDate(timestamp) {