logDetail.uvue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex:1">
  4. <!-- #endif -->
  5. <!-- 报告基础信息 -->
  6. <view class="section">
  7. <view class="info-item">
  8. <text class="label">日志信息</text>
  9. <text class="value">{{ log.title}}</text>
  10. </view>
  11. <view class="info-item">
  12. <text class="label">模块</text>
  13. <text class="value">{{ log.module}}</text>
  14. </view>
  15. </view>
  16. <view class="section">
  17. <view class="info-item">
  18. <text class="label">日志详细内容</text>
  19. </view>
  20. <view class="info-item">
  21. <text class="value">{{log.createuser}} 在 {{log.createtime}} {{log.content}}</text>
  22. </view>
  23. </view>
  24. <view class="section" v-if="log.msg !=null && log.msg != ''">
  25. <view class="info-item">
  26. <text class="label">日志错误信息</text>
  27. </view>
  28. <view class="info-item">
  29. <text class="value">{{log.msg}}</text>
  30. </view>
  31. </view>
  32. <view class="section">
  33. <view class="info-item">
  34. <text class="label">日志创建时间</text>
  35. <text class="value">{{ log.createtime}}</text>
  36. </view>
  37. </view>
  38. <!-- #ifdef APP -->
  39. </scroll-view>
  40. <!-- #endif -->
  41. </template>
  42. <script setup>
  43. import {
  44. ref,
  45. onMounted
  46. } from 'vue'
  47. import { getList, Download, TaskProcess, getRecordCalculate, RecordCalculate, statusDict } from '@/api/work';
  48. //自定义返回行为,覆盖系统默认返回按钮
  49. const backPressOptions = reactive({
  50. from: 'backbutton'
  51. } as OnBackPressOptions)
  52. const titleList = [{
  53. title1: "类型", title2: "操作结果", title3: "操作时间"
  54. }];
  55. type Log = {
  56. id : number,
  57. module : string,
  58. content : string,
  59. title ?: string,
  60. msg ?: string,
  61. createuser : string,
  62. createtime: string
  63. }
  64. const log = ref<Log>({
  65. id: 0,
  66. module: "",
  67. content: "",
  68. title: "",
  69. msg: "",
  70. createuser: "",
  71. createtime: "",
  72. })
  73. onLoad((options) => {
  74. const logId = options?.id ?? ""
  75. // 模拟数据加载,建议替换为后端接口请求
  76. // #ifdef APP-ANDROID
  77. //获取下载产品数据
  78. getList('app_operate_log', 'id', logId, null, null, null).then((res : UTSJSONObject) => {
  79. console.log(res)
  80. let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
  81. if (dataList != null && dataList.length > 0) {
  82. dataList.forEach(item => {
  83. if (item != null) {
  84. let data = JSON.parse<Log>(item.toJSONString());
  85. if (data != null) {
  86. log.value = data
  87. }
  88. }
  89. });
  90. }
  91. })
  92. // #endif
  93. })
  94. const goBack = () => {
  95. uni.navigateBack()
  96. }
  97. defineExpose({
  98. backPressOptions
  99. })
  100. </script>
  101. <style scoped>
  102. .container {
  103. padding: 40rpx;
  104. background-color: #f5f7fa;
  105. flex: 1;
  106. box-sizing: border-box;
  107. }
  108. .banner {
  109. background: linear-gradient(135deg, #2193b0, #6dd5ed);
  110. border-radius: 24rpx;
  111. padding: 40rpx 30rpx;
  112. margin-bottom: 40rpx;
  113. box-shadow: 0 8rpx 16rpx rgba(33, 147, 176, 0.3);
  114. }
  115. .banner-title {
  116. color: white;
  117. font-size: 36rpx;
  118. font-weight: bold;
  119. text-align: center;
  120. }
  121. .section {
  122. background-color: #fff;
  123. border-radius: 20rpx;
  124. padding: 30rpx;
  125. margin-bottom: 30rpx;
  126. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
  127. }
  128. .section-title {
  129. display: flex;
  130. flex-direction: row;
  131. flex: 1;
  132. }
  133. .info-item {
  134. display: flex;
  135. justify-content: space-between;
  136. /* #ifdef APP-NVUE */
  137. font-size: 28rpx;
  138. color: #666;
  139. /* #endif */
  140. margin-bottom: 18rpx;
  141. flex-direction: row;
  142. }
  143. .section-content {
  144. font-size: 28rpx;
  145. color: #444;
  146. line-height: 1.8;
  147. white-space: normal;
  148. }
  149. .grid-text {
  150. /* #ifdef APP-NVUE */
  151. font-size: 24rpx;
  152. color: #000;
  153. /* #endif */
  154. padding: 10rpx 0 10rpx 0rpx;
  155. box-sizing: border-box;
  156. margin: 5rpx 5rpx;
  157. min-width: 200rpx;
  158. }
  159. .footer-btn {
  160. margin-top: 40rpx;
  161. display: flex;
  162. justify-content: center;
  163. }
  164. .main-btn {
  165. width: 80%;
  166. padding: 28rpx 0;
  167. font-size: 30rpx;
  168. color: #fff;
  169. border: none;
  170. border-radius: 100rpx;
  171. background: linear-gradient(to right, #36d1dc, #5b86e5);
  172. box-shadow: 0 10rpx 24rpx rgba(91, 134, 229, 0.3);
  173. }
  174. .label {
  175. font-weight: bold;
  176. color: #102a43;
  177. min-width: 150rpx;
  178. margin-right: 30rpx;
  179. }
  180. .value {
  181. flex: 1;
  182. /* #ifdef APP-NVUE */
  183. white-space: nowrap;
  184. text-overflow: ellipsis;
  185. /* #endif */
  186. overflow: hidden;
  187. margin-left: 30rpx;
  188. }
  189. .my-radius {
  190. border-radius: 10rpx;
  191. }
  192. .bg-text {
  193. width: 150rpx;
  194. min-width: 150rpx;
  195. border-radius: 10rpx;
  196. text-align: center;
  197. }
  198. .bg-green {
  199. background-color: seagreen;
  200. color: #fff;
  201. }
  202. .bg-yellow {
  203. background-color: yellow;
  204. }
  205. .bg-black {
  206. background-color: #102a43;
  207. color: #fff;
  208. }
  209. .bg-red {
  210. background-color: red;
  211. color: #fff;
  212. }
  213. .ft-red {
  214. color: red;
  215. }
  216. </style>