优化跳转

This commit is contained in:
邱贞招 2024-11-07 11:28:10 +08:00
parent 0f1802049c
commit 45f09ac20a
9 changed files with 93 additions and 16 deletions

View File

@ -106,6 +106,34 @@ export const dynamicRoutes = [
}
]
},
{
path: '/user/user/userName',
component: Layout,
hidden: true,
permissions: ['user:user:list'],
children: [
{
path: 'index/:userName',
component: () => import('@/views/user/user'),
name: 'Data',
meta: { title: 'App用户列表', activeMenu: '/user/user' }
}
]
},
{
path: '/device/device/userName',
component: Layout,
hidden: true,
permissions: ['device:device:list'],
children: [
{
path: 'index/:userName',
component: () => import('@/views/device/device'),
name: 'Data',
meta: { title: '设备列表', activeMenu: '/device/device' }
}
]
},
{
path: '/system/role-auth',
component: Layout,

View File

@ -55,10 +55,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="用户昵称" prop="nickName">
<el-form-item label="用户" prop="userName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入用户昵称"
v-model="queryParams.userName"
placeholder="请输入用户"
clearable
@keyup.enter.native="handleQuery"
/>
@ -166,7 +166,13 @@
/>
</template>
</el-table-column>
<el-table-column label="用户" align="center" prop="nickName" />
<el-table-column label="用户" align="center" prop="userName" >
<template slot-scope="scope">
<router-link :to="'/user/user/userName/index/' + scope.row.userName" class="link-type">
<span>{{ scope.row.userName }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column
label="操作"
@ -691,7 +697,7 @@
selectableRange: '00:00:00 - 23:59:59'
}"
placeholder="请选择时间"></el-time-picker>
</el-time-picker>
<!-- </el-time-picker>-->
</div>
<div style="margin-bottom: 10px;">
<span style="margin-right: 10px;">浇水时长</span>
@ -701,7 +707,7 @@
selectableRange: '00:00:00 - 23:59:59'
}"
placeholder="请选择时间"></el-time-picker>
</el-time-picker>
<!-- </el-time-picker>-->
</div>
<div style="margin-bottom: 20px;">
<span style="margin-right: 10px;" >定时模式</span>
@ -960,6 +966,10 @@ export default {
};
},
created() {
const userName = this.$route.params && this.$route.params.userName;
if (userName != null) {
this.queryParams.userName = userName;
}
this.getList();
},
computed: {

View File

@ -1,6 +1,14 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -10,9 +18,13 @@
<el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="id" align="center" prop="id" />-->
<el-table-column label="用户ID" align="center" prop="userId" />
<!-- <el-table-column label="url" align="center" prop="url" />-->
<el-table-column label="用户" align="center" prop="userName" >
<template slot-scope="scope">
<router-link :to="'/user/user/userName/index/' + scope.row.userName" class="link-type">
<span>{{ scope.row.userName }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="图片" align="center" prop="url" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.url" :width="50" :height="50"/>

View File

@ -62,7 +62,13 @@
</template>
</el-table-column>
<el-table-column label="联系方式" align="center" prop="contactInfo" />
<el-table-column label="操作人" align="center" prop="createBy" />
<el-table-column label="操作人" align="center" prop="createBy">
<template slot-scope="scope">
<router-link :to="'/user/user/userName/index/' + scope.row.createBy" class="link-type">
<span>{{ scope.row.createBy }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>

View File

@ -137,7 +137,13 @@
></el-switch>
</template>
</el-table-column>
<el-table-column label="绑定设备数" align="center" key="bindDeviceNum" prop="bindDeviceNum" v-if="columns[7].visible" :show-overflow-tooltip="true" />
<el-table-column label="绑定设备数" align="center" key="bindDeviceNum" prop="bindDeviceNum" v-if="columns[7].visible" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<router-link :to="'/device/device/userName/index/' + scope.row.userName" class="link-type">
<span>{{ scope.row.bindDeviceNum }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
@ -412,6 +418,10 @@ export default {
};
},
created() {
const userName = this.$route.params && this.$route.params.userName;
if (userName != null) {
this.queryParams.userName = userName;
}
this.getList();
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;

View File

@ -1,5 +1,6 @@
package com.ruoyi.device.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
@ -33,6 +34,11 @@ public class AsPlantIdentifyLog extends BaseEntity
@Excel(name = "名称")
private String plantName;
/** 用户名 */
@Excel(name = "用户名")
@TableField(exist = false)
private String userName;
/** url */
@Excel(name = "url")
private String url;

View File

@ -625,7 +625,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
JSONObject paramsObj = JSON.parseObject(result);
String code = paramsObj.getString("code");
//记录命令
if (!HttpStatus.IOT_SUCCESS.equals(code))
if (!HttpStatus.IOT_SUCCESS.equals(code) && !HttpStatus.ERROR_CODE_DEVICE_ALREADY_EXISTS_MSG.equals(code))
{
throw new ServiceException(code+"-----"+ paramsObj.getString("msg"));
}

View File

@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mac != null and mac != ''"> and mac like concat('%', #{mac}, '%')</if>
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>

View File

@ -14,17 +14,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectAsPlantIdentifyLogVo">
select id, user_id, plant_name, url, response, msg, create_time from as_plant_identify_log
select l.id, l.user_id, l.plant_name, l.url, l.response, l.msg, l.create_time,u.user_name userName from as_plant_identify_log l
left join as_user u on l.user_id = u.user_id
</sql>
<select id="selectAsPlantIdentifyLogList" parameterType="AsPlantIdentifyLog" resultMap="AsPlantIdentifyLogResult">
<include refid="selectAsPlantIdentifyLogVo"/>
order by create_time desc
<where>
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
</where>
order by l.create_time desc
</select>
<select id="selectAsPlantIdentifyLogById" parameterType="Long" resultMap="AsPlantIdentifyLogResult">
<include refid="selectAsPlantIdentifyLogVo"/>
where id = #{id}
where l.id = #{id}
</select>
<insert id="insertAsPlantIdentifyLog" parameterType="AsPlantIdentifyLog" useGeneratedKeys="true" keyProperty="id">
@ -57,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="msg != null">msg = #{msg},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
where l.id = #{id}
</update>
<delete id="deleteAsPlantIdentifyLogById" parameterType="Long">