Commit a382d27081754fddeb47cdf38ce4e4a865572d96
1 parent
bb87363d
新增设备查看会话记录功能,扩展相关实体和接口,更新文档以支持内容名称和设备名称的解析,优化前端页面以展示新字段。
Showing
11 changed files
with
183 additions
and
19 deletions
uniapp_jiju/pages/myDevice/detail.vue
| ... | ... | @@ -85,7 +85,9 @@ |
| 85 | 85 | </template> |
| 86 | 86 | |
| 87 | 87 | <script> |
| 88 | +import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 88 | 89 | export default { |
| 90 | + mixins: [viewRecordMixin], | |
| 89 | 91 | data() { |
| 90 | 92 | return { |
| 91 | 93 | detail: {}, |
| ... | ... | @@ -141,6 +143,7 @@ export default { |
| 141 | 143 | if (res && res.code === 200 && res.data) { |
| 142 | 144 | this.detail = res.data || {} |
| 143 | 145 | console.log('设备详情数据详情', this.detail) |
| 146 | + this.startViewTracking(deviceId, '我的设备', this.detail.sbmc, this.detail.sbmc) | |
| 144 | 147 | |
| 145 | 148 | // 设备图片:KhsbInfoOutput 中 sbtp 是 List<FileControlsModel> |
| 146 | 149 | // FileControlsModel: { name, fileId, url } | ... | ... |
uniapp_jiju/pages/new/bjzc/detail.vue
| ... | ... | @@ -185,7 +185,9 @@ |
| 185 | 185 | </template> |
| 186 | 186 | |
| 187 | 187 | <script> |
| 188 | + import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 188 | 189 | export default { |
| 190 | + mixins: [viewRecordMixin], | |
| 189 | 191 | data() { |
| 190 | 192 | return { |
| 191 | 193 | list: ['基础资料', '随机工具',"一年备件",'两年备件'], |
| ... | ... | @@ -253,6 +255,7 @@ |
| 253 | 255 | } |
| 254 | 256 | } |
| 255 | 257 | this.info = resData |
| 258 | + this.startViewTracking(this.info.id || data.id, '备件支持', this.info.mc, this.info.glcpmc) | |
| 256 | 259 | }).catch(err => { |
| 257 | 260 | uni.showToast({ title: err.msg || err.message || '无权限查看或加载失败', icon: 'none' }) |
| 258 | 261 | setTimeout(() => uni.navigateBack(), 1500) | ... | ... |
uniapp_jiju/pages/new/gzpc/detail.vue
| ... | ... | @@ -145,7 +145,9 @@ |
| 145 | 145 | </template> |
| 146 | 146 | |
| 147 | 147 | <script> |
| 148 | + import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 148 | 149 | export default { |
| 150 | + mixins: [viewRecordMixin], | |
| 149 | 151 | data() { |
| 150 | 152 | return { |
| 151 | 153 | list: ['故障信息', '故障排查'], |
| ... | ... | @@ -184,6 +186,7 @@ |
| 184 | 186 | } |
| 185 | 187 | } |
| 186 | 188 | this.info = res.data |
| 189 | + this.startViewTracking(this.info.id || data.id, '故障排查', this.info.code, this.info.sbmc) | |
| 187 | 190 | } |
| 188 | 191 | }).catch(err => { |
| 189 | 192 | uni.showToast({ title: err.msg || err.message || '无权限查看或加载失败', icon: 'none' }) | ... | ... |
uniapp_jiju/pages/new/pxzs/detail.vue
| ... | ... | @@ -74,7 +74,9 @@ |
| 74 | 74 | </template> |
| 75 | 75 | |
| 76 | 76 | <script> |
| 77 | + import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 77 | 78 | export default { |
| 79 | + mixins: [viewRecordMixin], | |
| 78 | 80 | data() { |
| 79 | 81 | return { |
| 80 | 82 | list: ['基础资料', '相关资料'], |
| ... | ... | @@ -111,6 +113,7 @@ |
| 111 | 113 | ) |
| 112 | 114 | } |
| 113 | 115 | this.info = res.data |
| 116 | + this.startViewTracking(this.info.id || data.id, '培训展示', this.info.pxmc, this.info.sbmc) | |
| 114 | 117 | } |
| 115 | 118 | }).catch(err => { |
| 116 | 119 | uni.showToast({ title: err.msg || err.message || '无权限查看或加载失败', icon: 'none' }) | ... | ... |
uniapp_jiju/pages/new/zlgl/detail.vue
| ... | ... | @@ -250,7 +250,9 @@ |
| 250 | 250 | </template> |
| 251 | 251 | |
| 252 | 252 | <script> |
| 253 | + import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 253 | 254 | export default { |
| 255 | + mixins: [viewRecordMixin], | |
| 254 | 256 | data() { |
| 255 | 257 | return { |
| 256 | 258 | list: ['基础资料','技术资料', '质量资料','其他资料'], |
| ... | ... | @@ -272,6 +274,7 @@ |
| 272 | 274 | this.info = res.data |
| 273 | 275 | // 处理附件字段 |
| 274 | 276 | this.processAttachments() |
| 277 | + this.startViewTracking(this.info.id, '资料管理', this.info.zlm, this.info.zlm) | |
| 275 | 278 | } |
| 276 | 279 | }).catch(err => { |
| 277 | 280 | console.error('获取资料管理详情失败:', err) |
| ... | ... | @@ -281,6 +284,7 @@ |
| 281 | 284 | } else { |
| 282 | 285 | // 如果没有 id,直接处理存储的数据 |
| 283 | 286 | this.processAttachments() |
| 287 | + if (this.info.id) this.startViewTracking(this.info.id, '资料管理', this.info.zlm, this.info.zlm) | |
| 284 | 288 | } |
| 285 | 289 | }, |
| 286 | 290 | methods: { | ... | ... |
uniapp_jiju/pages/new/zsk/detail.vue
| ... | ... | @@ -136,7 +136,9 @@ |
| 136 | 136 | |
| 137 | 137 | <script> |
| 138 | 138 | import service from '@/service/service.js' |
| 139 | +import viewRecordMixin from '@/common/mixins/viewRecordMixin.js' | |
| 139 | 140 | export default { |
| 141 | + mixins: [viewRecordMixin], | |
| 140 | 142 | data() { |
| 141 | 143 | return { |
| 142 | 144 | list: ['基础资料', '相关资料'], |
| ... | ... | @@ -183,6 +185,7 @@ methods: { |
| 183 | 185 | this.API.zskxq({ id: this.id, n: Date.now() }).then(res=>{ |
| 184 | 186 | console.log("知识详情数据:", res); |
| 185 | 187 | this.detail = res.data || { sbm: '', gg: '', gy: '', sbjs: '', fl: '', fj1: [], fj2: [] } |
| 188 | + this.startViewTracking(this.detail.id || this.id, '知识库', this.detail.sbm) | |
| 186 | 189 | |
| 187 | 190 | // 确保附件字段是数组 |
| 188 | 191 | if (!Array.isArray(this.detail.fj1)) { | ... | ... |
机具(服务端)/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/SbRecordsListOutput.cs
| ... | ... | @@ -48,7 +48,17 @@ namespace NCC.Extend.Entitys.Dto.SbRecords |
| 48 | 48 | public string type { get; set; } |
| 49 | 49 | |
| 50 | 50 | /// <summary> |
| 51 | - /// 关联设备(原关联记录,展示设备名称) | |
| 51 | + /// 查看内容(故障代码、知识名、资料名、备件名、培训名等) | |
| 52 | + /// </summary> | |
| 53 | + public string contentName { get; set; } | |
| 54 | + | |
| 55 | + /// <summary> | |
| 56 | + /// 设备名称(所属设备、关联产品名;优先 F_DeviceName,无则根据 reId 查表) | |
| 57 | + /// </summary> | |
| 58 | + public string deviceName { get; set; } | |
| 59 | + | |
| 60 | + /// <summary> | |
| 61 | + /// 关联设备(兼容旧逻辑,展示设备名称;优先使用 deviceName) | |
| 52 | 62 | /// </summary> |
| 53 | 63 | public string equipmentName { get; set; } |
| 54 | 64 | ... | ... |
机具(服务端)/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/SbRecordsEntity.cs
| ... | ... | @@ -70,6 +70,18 @@ namespace NCC.Extend.Entitys |
| 70 | 70 | /// </summary> |
| 71 | 71 | [SugarColumn(ColumnName = "F_Type")] |
| 72 | 72 | public string Type { get; set; } |
| 73 | + | |
| 74 | + /// <summary> | |
| 75 | + /// 查看内容(故障代码、知识名、资料名、备件名、培训名等) | |
| 76 | + /// </summary> | |
| 77 | + [SugarColumn(ColumnName = "F_ContentName")] | |
| 78 | + public string ContentName { get; set; } | |
| 79 | + | |
| 80 | + /// <summary> | |
| 81 | + /// 设备名称(所属设备、关联产品名,便于「记录类型+设备名称+查看内容」三字段定位) | |
| 82 | + /// </summary> | |
| 83 | + [SugarColumn(ColumnName = "F_DeviceName")] | |
| 84 | + public string DeviceName { get; set; } | |
| 73 | 85 | |
| 74 | 86 | } |
| 75 | 87 | } |
| 76 | 88 | \ No newline at end of file | ... | ... |
机具(服务端)/netcore/src/Modularity/Extend/NCC.Extend.Interfaces/ISbRecordsService.cs
| ... | ... | @@ -7,12 +7,14 @@ namespace NCC.Extend.Interfaces.SbRecords |
| 7 | 7 | /// <summary> |
| 8 | 8 | /// 开始一条设备查看会话记录(进入页面时调用)。 |
| 9 | 9 | /// </summary> |
| 10 | - /// <param name="reId">关联记录 Id,一般为设备 Id。</param> | |
| 11 | - /// <param name="type">记录类型,例如“查看设备”。</param> | |
| 10 | + /// <param name="reId">关联记录 Id,对应不同 type 下的业务表主键。</param> | |
| 11 | + /// <param name="type">记录类型,如:故障排查、知识库、我的设备、资料管理、备件支持、培训展示、查看设备。</param> | |
| 12 | + /// <param name="contentName">查看内容(故障代码、知识名、资料名等;可选);未传时根据 type+reId 从对应表自动查询。</param> | |
| 13 | + /// <param name="deviceName">设备名称(所属设备、关联产品名;可选);未传时根据 type+reId 从对应表自动查询。</param> | |
| 12 | 14 | /// <param name="item1">备用字段1,可选。</param> |
| 13 | 15 | /// <param name="item2">备用字段2,可选。</param> |
| 14 | 16 | /// <returns>返回新建记录的 Id(后续结束会话时使用)。</returns> |
| 15 | - Task<string> StartViewRecordAsync(string reId, string type, string item1 = null, string item2 = null); | |
| 17 | + Task<string> StartViewRecordAsync(string reId, string type, string contentName = null, string deviceName = null, string item1 = null, string item2 = null); | |
| 16 | 18 | |
| 17 | 19 | /// <summary> |
| 18 | 20 | /// 结束一条设备查看会话记录(离开页面时调用),并计算停留时长。 | ... | ... |
机具(服务端)/netcore/src/Modularity/Extend/NCC.Extend/SbRecordsService.cs
| ... | ... | @@ -52,15 +52,20 @@ namespace NCC.Extend.SbRecords |
| 52 | 52 | /// <summary> |
| 53 | 53 | /// 开始一条设备查看会话记录(进入页面时调用)。 |
| 54 | 54 | /// </summary> |
| 55 | - /// <param name="reId">关联记录 Id,一般为设备 Id。</param> | |
| 56 | - /// <param name="type">记录类型,例如“查看设备”。</param> | |
| 55 | + /// <param name="reId">关联记录 Id,对应不同 type 下的业务表主键。</param> | |
| 56 | + /// <param name="type">记录类型,如:故障排查、知识库、我的设备、资料管理、备件支持、培训展示、查看设备。</param> | |
| 57 | + /// <param name="contentName">查看内容(故障代码、知识名、资料名等;可选);未传时根据 type+reId 从对应表自动查询。</param> | |
| 58 | + /// <param name="deviceName">设备名称(所属设备、关联产品名;可选);未传时根据 type+reId 从对应表自动查询。</param> | |
| 57 | 59 | /// <param name="item1">备用字段1,可选。</param> |
| 58 | 60 | /// <param name="item2">备用字段2,可选。</param> |
| 59 | 61 | /// <returns>返回新建记录的 Id(后续结束会话时使用)。</returns> |
| 60 | 62 | [HttpPost("Actions/StartViewRecord")] |
| 61 | - public async Task<string> StartViewRecordAsync(string reId, string type, string item1 = null, string item2 = null) | |
| 63 | + public async Task<string> StartViewRecordAsync([FromForm] string reId, [FromForm] string type, [FromForm] string contentName = null, [FromForm] string deviceName = null, [FromForm] string item1 = null, [FromForm] string item2 = null) | |
| 62 | 64 | { |
| 63 | 65 | var now = DateTime.Now; |
| 66 | + var resolvedContentName = !string.IsNullOrWhiteSpace(contentName) ? contentName : await ResolveContentNameAsync(type, reId); | |
| 67 | + var resolvedDeviceName = !string.IsNullOrWhiteSpace(deviceName) ? deviceName : await ResolveDeviceNameAsync(type, reId); | |
| 68 | + | |
| 64 | 69 | var entity = new SbRecordsEntity |
| 65 | 70 | { |
| 66 | 71 | Id = YitIdHelper.NextId().ToString(), |
| ... | ... | @@ -72,7 +77,9 @@ namespace NCC.Extend.SbRecords |
| 72 | 77 | Enable = true, |
| 73 | 78 | Item1 = item1, |
| 74 | 79 | Item2 = item2, |
| 75 | - Type = type | |
| 80 | + Type = type, | |
| 81 | + ContentName = resolvedContentName, | |
| 82 | + DeviceName = resolvedDeviceName | |
| 76 | 83 | }; |
| 77 | 84 | |
| 78 | 85 | var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); |
| ... | ... | @@ -82,12 +89,119 @@ namespace NCC.Extend.SbRecords |
| 82 | 89 | } |
| 83 | 90 | |
| 84 | 91 | /// <summary> |
| 92 | + /// 根据 type 和 reId 从对应业务表解析内容名称。 | |
| 93 | + /// </summary> | |
| 94 | + private async Task<string> ResolveContentNameAsync(string type, string reId) | |
| 95 | + { | |
| 96 | + if (string.IsNullOrWhiteSpace(reId)) return null; | |
| 97 | + var t = (type ?? "").Trim(); | |
| 98 | + | |
| 99 | + if (t.Contains("故障排查") || t.Contains("故障查询")) | |
| 100 | + { | |
| 101 | + var gz = await _db.Queryable<GzcxEntity>().Where(x => x.Id == reId).Select(x => x.Code).FirstAsync(); | |
| 102 | + return gz; | |
| 103 | + } | |
| 104 | + if (t.Contains("知识库")) | |
| 105 | + { | |
| 106 | + var z = await _db.Queryable<ZskEntity>().Where(x => x.Id == reId).Select(x => x.Sbm).FirstAsync(); | |
| 107 | + return z; | |
| 108 | + } | |
| 109 | + if (t.Contains("我的设备")) | |
| 110 | + { | |
| 111 | + var k = await _db.Queryable<KhsbEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 112 | + return k; | |
| 113 | + } | |
| 114 | + if (t.Contains("资料管理")) | |
| 115 | + { | |
| 116 | + var zl = await _db.Queryable<ZlglEntity>().Where(x => x.Id == reId).Select(x => x.Zlm).FirstAsync(); | |
| 117 | + return zl; | |
| 118 | + } | |
| 119 | + if (t.Contains("备件支持")) | |
| 120 | + { | |
| 121 | + var b = await _db.Queryable<BjxxEntity>().Where(x => x.Id == reId).Select(x => x.Mc).FirstAsync(); | |
| 122 | + return b; | |
| 123 | + } | |
| 124 | + if (t.Contains("培训展示")) | |
| 125 | + { | |
| 126 | + var p = await _db.Queryable<PxzsEntity>().Where(x => x.Id == reId).Select(x => x.Pxmc ?? x.Sbmc).FirstAsync(); | |
| 127 | + return p; | |
| 128 | + } | |
| 129 | + if (t.Contains("查看设备")) | |
| 130 | + { | |
| 131 | + var zs = await _db.Queryable<ZsbtzEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 132 | + if (!string.IsNullOrEmpty(zs)) return zs; | |
| 133 | + var kh = await _db.Queryable<KhsbEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 134 | + return kh; | |
| 135 | + } | |
| 136 | + return null; | |
| 137 | + } | |
| 138 | + | |
| 139 | + /// <summary> | |
| 140 | + /// 根据 type 和 reId 从对应业务表解析设备名称(所属设备、关联产品名)。 | |
| 141 | + /// </summary> | |
| 142 | + private async Task<string> ResolveDeviceNameAsync(string type, string reId) | |
| 143 | + { | |
| 144 | + if (string.IsNullOrWhiteSpace(reId)) return null; | |
| 145 | + var t = (type ?? "").Trim(); | |
| 146 | + | |
| 147 | + if (t.Contains("故障排查") || t.Contains("故障查询")) | |
| 148 | + { | |
| 149 | + var gz = await _db.Queryable<GzcxEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 150 | + return gz; | |
| 151 | + } | |
| 152 | + if (t.Contains("知识库")) | |
| 153 | + { | |
| 154 | + var z = await _db.Queryable<ZskEntity>().Where(x => x.Id == reId).Select(x => x.Sssb).FirstAsync(); | |
| 155 | + if (string.IsNullOrEmpty(z)) return null; | |
| 156 | + var cp = await _db.Queryable<CpglEntity>().Where(c => c.Id == z || c.Cpid == z).Select(c => c.Cpmc).FirstAsync(); | |
| 157 | + return cp; | |
| 158 | + } | |
| 159 | + if (t.Contains("我的设备")) | |
| 160 | + { | |
| 161 | + var k = await _db.Queryable<KhsbEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 162 | + return k; | |
| 163 | + } | |
| 164 | + if (t.Contains("资料管理")) | |
| 165 | + { | |
| 166 | + var zl = await _db.Queryable<ZlglEntity>().Where(x => x.Id == reId).Select(x => x.Zlm).FirstAsync(); | |
| 167 | + return zl; | |
| 168 | + } | |
| 169 | + if (t.Contains("备件支持")) | |
| 170 | + { | |
| 171 | + var b = await _db.Queryable<BjxxEntity>().Where(x => x.Id == reId).Select(x => x.Sssb).FirstAsync(); | |
| 172 | + if (string.IsNullOrEmpty(b)) return null; | |
| 173 | + var cp = await _db.Queryable<CpglEntity>().Where(c => c.Id == b || c.Cpid == b).Select(c => c.Cpmc).FirstAsync(); | |
| 174 | + if (!string.IsNullOrEmpty(cp)) return cp; | |
| 175 | + var zl = await _db.Queryable<ZlglEntity>().Where(z => z.Id == b).Select(z => new { z.Zlm, z.Fl }).FirstAsync(); | |
| 176 | + if (zl != null && !string.IsNullOrEmpty(zl.Fl)) | |
| 177 | + { | |
| 178 | + var cpmc = await _db.Queryable<CpglEntity>().Where(c => c.Id == zl.Fl).Select(c => c.Cpmc).FirstAsync(); | |
| 179 | + if (!string.IsNullOrEmpty(cpmc)) return cpmc; | |
| 180 | + } | |
| 181 | + return zl?.Zlm; | |
| 182 | + } | |
| 183 | + if (t.Contains("培训展示")) | |
| 184 | + { | |
| 185 | + var p = await _db.Queryable<PxzsEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 186 | + return p; | |
| 187 | + } | |
| 188 | + if (t.Contains("查看设备")) | |
| 189 | + { | |
| 190 | + var zs = await _db.Queryable<ZsbtzEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 191 | + if (!string.IsNullOrEmpty(zs)) return zs; | |
| 192 | + var kh = await _db.Queryable<KhsbEntity>().Where(x => x.Id == reId).Select(x => x.Sbmc).FirstAsync(); | |
| 193 | + return kh; | |
| 194 | + } | |
| 195 | + return null; | |
| 196 | + } | |
| 197 | + | |
| 198 | + /// <summary> | |
| 85 | 199 | /// 结束一条设备查看会话记录(离开页面时调用),并计算停留时长。 |
| 86 | 200 | /// </summary> |
| 87 | 201 | /// <param name="recordId">开始会话时返回的记录 Id。</param> |
| 88 | 202 | /// <returns>返回是否更新成功。</returns> |
| 89 | 203 | [HttpPost("Actions/EndViewRecord")] |
| 90 | - public async Task<bool> EndViewRecordAsync(string recordId) | |
| 204 | + public async Task<bool> EndViewRecordAsync([FromForm] string recordId) | |
| 91 | 205 | { |
| 92 | 206 | var now = DateTime.Now; |
| 93 | 207 | |
| ... | ... | @@ -268,8 +382,10 @@ namespace NCC.Extend.SbRecords |
| 268 | 382 | .Select(it => new SbRecordsListOutput |
| 269 | 383 | { |
| 270 | 384 | id = it.Id, |
| 271 | - reId = SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc), | |
| 272 | - equipmentName = SqlFunc.IsNull(SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sbmc), SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc)), | |
| 385 | + reId = it.ReId, | |
| 386 | + contentName = it.ContentName, | |
| 387 | + deviceName = it.DeviceName, | |
| 388 | + equipmentName = SqlFunc.IsNull(it.DeviceName, SqlFunc.IsNull(SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sbmc), SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc))), | |
| 273 | 389 | customerName = SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sskh), |
| 274 | 390 | addTime = it.AddTime, |
| 275 | 391 | addUser = SqlFunc.Subqueryable<UserEntity>().Where(u => u.Id == it.AddUser).Select(u => u.RealName), |
| ... | ... | @@ -320,8 +436,10 @@ namespace NCC.Extend.SbRecords |
| 320 | 436 | .Select(it => new SbRecordsListOutput |
| 321 | 437 | { |
| 322 | 438 | id = it.Id, |
| 323 | - reId = SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc), | |
| 324 | - equipmentName = SqlFunc.IsNull(SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sbmc), SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc)), | |
| 439 | + reId = it.ReId, | |
| 440 | + contentName = it.ContentName, | |
| 441 | + deviceName = it.DeviceName, | |
| 442 | + equipmentName = SqlFunc.IsNull(it.DeviceName, SqlFunc.IsNull(SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sbmc), SqlFunc.Subqueryable<ZsbtzEntity>().Where(t => t.Id == it.ReId).Select(t => t.Sbmc))), | |
| 325 | 443 | customerName = SqlFunc.Subqueryable<KhsbEntity>().Where(k => k.Id == it.ReId).Select(k => k.Sskh), |
| 326 | 444 | addTime = it.AddTime, |
| 327 | 445 | addUser = SqlFunc.Subqueryable<UserEntity>().Where(u => u.Id == it.AddUser).Select(u => u.RealName), |
| ... | ... | @@ -357,7 +475,7 @@ namespace NCC.Extend.SbRecords |
| 357 | 475 | exportData[i].index = i + 1; |
| 358 | 476 | exportData[i].countNum = i + 1; |
| 359 | 477 | } |
| 360 | - List<ParamsModel> paramList = "[{\"value\":\"序号\",\"field\":\"index\"},{\"value\":\"客户\",\"field\":\"customerName\"},{\"value\":\"用户\",\"field\":\"addUser\"},{\"value\":\"设备\",\"field\":\"equipmentName\"},{\"value\":\"时间\",\"field\":\"addTime\"},{\"value\":\"次数\",\"field\":\"countNum\"},{\"value\":\"记录类型\",\"field\":\"type\"},{\"value\":\"关联设备\",\"field\":\"reId\"},{\"value\":\"有效状态\",\"field\":\"enable\"}]".ToList<ParamsModel>(); | |
| 478 | + List<ParamsModel> paramList = "[{\"value\":\"序号\",\"field\":\"index\"},{\"value\":\"客户\",\"field\":\"customerName\"},{\"value\":\"用户\",\"field\":\"addUser\"},{\"value\":\"记录类型\",\"field\":\"type\"},{\"value\":\"设备名称\",\"field\":\"deviceName\"},{\"value\":\"查看内容\",\"field\":\"contentName\"},{\"value\":\"设备\",\"field\":\"equipmentName\"},{\"value\":\"时间\",\"field\":\"addTime\"},{\"value\":\"次数\",\"field\":\"countNum\"},{\"value\":\"关联记录\",\"field\":\"reId\"},{\"value\":\"有效状态\",\"field\":\"enable\"}]".ToList<ParamsModel>(); | |
| 361 | 479 | ExcelConfig excelconfig = new ExcelConfig(); |
| 362 | 480 | excelconfig.FileName = "查看历史记录.xls"; |
| 363 | 481 | excelconfig.HeadFont = "微软雅黑"; | ... | ... |
机具(管理端)/src/views/sbRecords/index.vue
| ... | ... | @@ -92,13 +92,14 @@ |
| 92 | 92 | </div> |
| 93 | 93 | <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> |
| 94 | 94 | <el-table-column type="index" label="序号" width="60" align="center" :index="indexMethod" /> |
| 95 | - <el-table-column label="关联设备" align="left" min-width="120"> | |
| 96 | - <template slot-scope="scope">{{ scope.row.equipmentName || scope.row.reId || '-' }}</template> | |
| 95 | + <el-table-column prop="type" label="记录类型" align="left" width="100" /> | |
| 96 | + <el-table-column label="设备名称" align="left" min-width="120" show-overflow-tooltip> | |
| 97 | + <template slot-scope="scope">{{ scope.row.deviceName || scope.row.equipmentName || scope.row.reId || '-' }}</template> | |
| 97 | 98 | </el-table-column> |
| 99 | + <el-table-column prop="contentName" label="查看内容" align="left" min-width="120" show-overflow-tooltip /> | |
| 98 | 100 | <el-table-column prop="customerName" label="查看客户" align="left" min-width="100" show-overflow-tooltip /> |
| 99 | 101 | <el-table-column prop="addUser" label="查看用户" align="left" min-width="100" /> |
| 100 | 102 | <el-table-column prop="addTime" label="记录时间" align="left" width="160" :formatter="ncc.tableDateFormat" /> |
| 101 | - <el-table-column prop="type" label="记录类型" align="left" width="100" /> | |
| 102 | 103 | <el-table-column label="操作" fixed="right" width="100"> |
| 103 | 104 | <template slot-scope="scope"> |
| 104 | 105 | <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn">删除</el-button> |
| ... | ... | @@ -155,10 +156,12 @@ export default { |
| 155 | 156 | { prop: 'index', label: '序号' }, |
| 156 | 157 | { prop: 'customerName', label: '客户' }, |
| 157 | 158 | { prop: 'addUser', label: '用户' }, |
| 159 | + { prop: 'type', label: '记录类型' }, | |
| 160 | + { prop: 'deviceName', label: '设备名称' }, | |
| 161 | + { prop: 'contentName', label: '查看内容' }, | |
| 158 | 162 | { prop: 'equipmentName', label: '设备' }, |
| 159 | 163 | { prop: 'addTime', label: '时间' }, |
| 160 | - { prop: 'countNum', label: '次数' }, | |
| 161 | - { prop: 'type', label: '记录类型' } | |
| 164 | + { prop: 'countNum', label: '次数' } | |
| 162 | 165 | ], |
| 163 | 166 | reIdOptions: [] |
| 164 | 167 | } | ... | ... |