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 = {
// 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',

View File

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

View File

@ -40,13 +40,15 @@
<label>
<checkbox :value="item.id+''" color="#FFCC33" style="transform:scale(0.7)"/>
</label>
<view style="display: flex;align-items: center;width: 85%">
<view class="s-img">
<image :src="item.avatar" mode="aspectFill"></image>
</view>
<view class="s-right">
<view class="s-title">{{ item.nickname || item.username }}</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 class="bottom-box" @click="gettel(item)">
@ -56,7 +58,7 @@
<!-- <text>删除</text> -->
</view>
<view class="bottom-box" style="margin-top: 1rem" @click="toInfo(item)">
<text>查看详情</text>
<text>查看</text>
</view>
</view>
</view>
@ -89,7 +91,7 @@
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
@ -98,22 +100,22 @@
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
<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 v-for="(item, index) in files">
<view class="on-input">
@ -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;

View File

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

View File

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

View File

@ -45,7 +45,7 @@
设备类别
</view>
<view class="you">
<input type="text" placeholder="请选择设备类别" v-model="typeName">
<input type="text" disabled placeholder="请选择设备类别" v-model="typeName">
</view>
</view>
<view class="tinput">
@ -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)
},

View File

@ -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

View File

@ -18,7 +18,7 @@
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
@ -27,17 +27,17 @@
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
<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>
</view>
<view class="on-input">
<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>
</view>
<view class="">
@ -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
if (!data?.staff){
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.tel = this.user?.username || this.user?.mobile
this.staff.userId = this.user.id
}

View File

@ -13,11 +13,16 @@
<view class="sou" @click="getList()">搜索</view>
</view>
<view class="tap">
<view class="tap-box msg-box" v-for="(item,index) in tapList" :key="index" @click="tapqh(index)">
<view class="xhuihui" :class="{'xzhei':tapindex == index}">{{ item.text }}</view>
<view class="gang" v-if="tapindex == index"></view>
<view class="msg-num">{{countMap.get(index+"")}}</view>
<scroll-view scroll-x="true" style="width: 100%;">
<view style="display: flex; align-items: center; white-space: nowrap;">
<view class="tap-box" v-for="(item, index) in tapList" :key="index" @click="tapqh(index)">
<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 class="gang" v-if="tapindex == index"></view>
</view>
</view>
</scroll-view>
</view>
<view class="mub">
@ -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 {
.msg-num {
position: absolute;
right: -29rpx;
top: -20rpx;
color: white;
background: #d74a43;
width: 35rpx;
height: 35rpx;
line-height: 35rpx;
padding: 5rpx 10rpx; /* 使用 padding 确保有足够的空间 */
min-width: 35rpx; /* 最小宽度 */
line-height: 1.2; /* 调整行高以适应不同内容 */
text-align: center;
font-weight: 800;
font-size: 11px;
border-radius: 50%;
top: -20rpx;
}
border-radius: 20rpx; /* 椭圆效果 */
white-space: nowrap; /* 确保文本不换行 */
}
</style>

View File

@ -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({
try {
const response = await 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
params: { type }
});
data = response.data;
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
} catch (error) {
console.error("请求字典数据时出现了异常:", error);
throw error; // 确保错误能够被外部捕获
}
}
return data;
}
export function formatDate(timestamp) {