¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <avue-crud :data="logsList" |
| | | :option="option"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | icon="el-icon-upload" |
| | | @click="send">ä¸ä¼ æå¡å¨</el-button> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | @click="clear">æ¸
空æ¬å°æ¥å¿</el-button> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="type"> |
| | | <el-tag type="danger" |
| | | size="small">{{scope.label}}</el-tag> |
| | | </template> |
| | | <template slot-scope="props" |
| | | slot="expand"> |
| | | <pre class="code"> |
| | | {{props.row.stack}} |
| | | </pre> |
| | | </template> |
| | | </avue-crud> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: "errLogs", |
| | | data() { |
| | | return { |
| | | option: { |
| | | menu: false, |
| | | addBtn: false, |
| | | page: false, |
| | | border: true, |
| | | expand: true, |
| | | refreshBtn: false, |
| | | headerAlign: "center", |
| | | column: [ |
| | | { |
| | | label: "ç±»å", |
| | | prop: "type", |
| | | width: 80, |
| | | align: "center", |
| | | slot: true, |
| | | dicData: [ |
| | | { |
| | | label: "bug", |
| | | value: "error" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "å°å", |
| | | width: 200, |
| | | prop: "url", |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "å
容", |
| | | prop: "message", |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "éè¯¯å æ ", |
| | | prop: "stack", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "æ¶é´", |
| | | align: "center", |
| | | prop: "time", |
| | | width: 200 |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | computed: { |
| | | ...mapGetters(["logsList"]) |
| | | }, |
| | | props: [], |
| | | methods: { |
| | | send() { |
| | | this.$confirm("ç¡®å®ä¸ä¼ æ¬å°æ¥å¿å°æå¡å¨?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.$store.dispatch("SendLogs").then(() => { |
| | | this.$parent.$parent.box = false; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "åéæå!" |
| | | }); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | clear() { |
| | | this.$confirm("ç¡®å®æ¸
空æ¬å°æ¥å¿è®°å½?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.$store.commit("CLEAR_LOGS"); |
| | | window.console.log(this); |
| | | this.$parent.$parent.box = false; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æ¸
空æå!" |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .code { |
| | | font-size: 12px; |
| | | display: block; |
| | | font-family: monospace; |
| | | white-space: pre; |
| | | margin: 1em 0px; |
| | | } |
| | | </style> |