inleft
2022-02-09 9bcb19959eeb9da9bde2561e7278f6d0a55eb151
commit | author | age
9bcb19 1 <template>
I 2   <a-modal
3     title="日志详情"
4     :width="900"
5     :visible="visible"
6     :confirmLoading="confirmLoading"
7     @cancel="handleCancel"
8   >
9     <a-spin :spinning="confirmLoading">
10       <a-form :form="form">
11         <a-row :gutter="24">
12           <a-col :md="12" :sm="24">
13             <a-form-item
14               label="方法名称"
15               :labelCol="labelCol"
16               :wrapperCol="wrapperCol"
17             >
18               <a-input v-decorator="['methodName']" />
19             </a-form-item>
20           </a-col>
21           <a-col :md="12" :sm="24">
22             <a-form-item
23               label="地址"
24               :labelCol="labelCol"
25               :wrapperCol="wrapperCol"
26             >
27               <a-input v-decorator="['location']" />
28             </a-form-item>
29           </a-col>
30         </a-row>
31         <a-row :gutter="24">
32           <a-col :md="12" :sm="24">
33             <a-form-item
34               label="浏览器"
35               :labelCol="labelCol"
36               :wrapperCol="wrapperCol"
37             >
38               <a-input v-decorator="['browser']" />
39             </a-form-item>
40           </a-col>
41           <a-col :md="12" :sm="24">
42             <a-form-item
43               label="操作系统"
44               :labelCol="labelCol"
45               :wrapperCol="wrapperCol"
46             >
47               <a-input v-decorator="['os']" />
48             </a-form-item>
49           </a-col>
50         </a-row>
51         <a-row :gutter="24">
52           <a-col :md="12" :sm="24">
53             <a-form-item
54               label="类名称"
55               :labelCol="labelCol"
56               :wrapperCol="wrapperCol"
57             >
58               <a-textarea :rows="4" v-decorator="['className']"/>
59             </a-form-item>
60           </a-col>
61           <a-col :md="12" :sm="24">
62             <a-form-item
63               label="具体消息"
64               :labelCol="labelCol"
65               :wrapperCol="wrapperCol"
66             >
67               <a-textarea :rows="4" v-decorator="['message']"/>
68             </a-form-item>
69           </a-col>
70         </a-row>
71         <a-row :gutter="24">
72           <a-col :md="12" :sm="24">
73             <a-form-item
74               label="请求参数"
75               :labelCol="labelCol"
76               :wrapperCol="wrapperCol"
77             >
78               <a-textarea :rows="4" v-decorator="['param']"/>
79             </a-form-item>
80           </a-col>
81           <a-col :md="12" :sm="24">
82             <a-form-item
83               label="返回结果"
84               :labelCol="labelCol"
85               :wrapperCol="wrapperCol"
86             >
87               <a-textarea :rows="4" v-decorator="['result']"/>
88             </a-form-item>
89           </a-col>
90         </a-row>
91       </a-form>
92     </a-spin>
93   </a-modal>
94 </template>
95 <script>
96   export default {
97     data () {
98       return {
99         labelCol: {
100           xs: { span: 24 },
101           sm: { span: 5 }
102         },
103         wrapperCol: {
104           xs: { span: 24 },
105           sm: { span: 15 }
106         },
107         visible: false,
108         confirmLoading: false,
109         form: this.$form.createForm(this)
110       }
111     },
112     methods: {
113       // 初始化方法
114       details (record) {
115         this.visible = true
116         setTimeout(() => {
117           this.form.setFieldsValue(
118             {
119               location: record.location,
120               browser: record.browser,
121               os: record.os,
122               className: record.className,
123               methodName: record.methodName,
124               param: record.param,
125               result: record.result,
126               message: record.message
127             }
128           )
129         }, 100)
130       },
131       handleCancel () {
132         this.form.resetFields()
133         this.visible = false
134       }
135     }
136   }
137 </script>