Showing
3 changed files
with
151 additions
and
26 deletions
src/api/flightInfoImport.js
0 → 100644
| ... | @@ -56,10 +56,7 @@ | ... | @@ -56,10 +56,7 @@ |
| 56 | <el-table-column prop="createUserName" label="操作人" align="center"> | 56 | <el-table-column prop="createUserName" label="操作人" align="center"> |
| 57 | </el-table-column> | 57 | </el-table-column> |
| 58 | 58 | ||
| 59 | - <el-table-column prop="createTime" label="更新时间" align="center"> | 59 | + <el-table-column prop="createTime" label="更新时间" align="center" :formatter="formatTimer"> |
| 60 | - <template slot-scope="scope"> | ||
| 61 | - {{ scope.row.createTime | formatTimer }} | ||
| 62 | - </template> | ||
| 63 | </el-table-column> | 60 | </el-table-column> |
| 64 | 61 | ||
| 65 | <el-table-column label="操作" prop="id" align="center"> | 62 | <el-table-column label="操作" prop="id" align="center"> |
| ... | @@ -223,31 +220,14 @@ export default { | ... | @@ -223,31 +220,14 @@ export default { |
| 223 | // let str = parseTime(date, 'yyyy-dd-mm'); | 220 | // let str = parseTime(date, 'yyyy-dd-mm'); |
| 224 | return str; | 221 | return str; |
| 225 | }, | 222 | }, |
| 226 | - }, | 223 | + formatTimer(data) { |
| 227 | - created() { | 224 | + let time1 = new Date(data.createTime.replace(/-/g, '/').replace('T', ' ')).toISOString() // 转为国际标准化时间 |
| 228 | - this.getList(); | ||
| 229 | - }, | ||
| 230 | - filters: { | ||
| 231 | - formatTimer: function (time) { | ||
| 232 | - | ||
| 233 | - let time1 = new Date(time.replace(/-/g, '/').replace('T', ' ')).toISOString() // 转为国际标准化时间 | ||
| 234 | - | ||
| 235 | return time1.split('T')[0] + " " + time1.split('T')[1].substring(0,8); | 225 | return time1.split('T')[0] + " " + time1.split('T')[1].substring(0,8); |
| 236 | - // let date = new Date(value); | ||
| 237 | - // let y = date.getFullYear(); | ||
| 238 | - // let MM = date.getMonth() + 1; | ||
| 239 | - // MM = MM < 10 ? "0" + MM : MM; | ||
| 240 | - // let d = date.getDate(); | ||
| 241 | - // d = d < 10 ? "0" + d : d; | ||
| 242 | - // let h = date.getHours(); | ||
| 243 | - // h = h < 10 ? "0" + h : h; | ||
| 244 | - // let m = date.getMinutes(); | ||
| 245 | - // m = m < 10 ? "0" + m : m; | ||
| 246 | - // let s = date.getSeconds(); | ||
| 247 | - // s = s < 10 ? "0" + s : s; | ||
| 248 | - // return y + "-" + MM + "-" + d + " " + h + ":" + m + ":" + s; | ||
| 249 | }, | 226 | }, |
| 250 | }, | 227 | }, |
| 228 | + created() { | ||
| 229 | + this.getList(); | ||
| 230 | + } | ||
| 251 | }; | 231 | }; |
| 252 | </script> | 232 | </script> |
| 253 | 233 | ... | ... |
src/views/systemConfig/roleConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div style="margin: 20px"> | ||
| 3 | + <el-form :inline="true" :model="form" class="demo-form-inline" size="small"> | ||
| 4 | + <el-form-item label="航班种类"> | ||
| 5 | + <el-select v-model="form.type" placeholder="航班种类"> | ||
| 6 | + <el-option v-for="item in flightType" :key="item.id" :label="item.englishName" :value="item.id" ></el-option> | ||
| 7 | + </el-select> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-upload | ||
| 11 | + action="https://jsonplaceholder.typicode.com/posts/" | ||
| 12 | + :on-remove="handleRemove" | ||
| 13 | + :limit="1" | ||
| 14 | + :on-exceed="handleExceed" | ||
| 15 | + :file-list="fileList" | ||
| 16 | + accept=".xlsx" | ||
| 17 | + class="upload-demo" | ||
| 18 | + > | ||
| 19 | + <el-button type="primary">点击上传</el-button> | ||
| 20 | + </el-upload> | ||
| 21 | + </el-form-item> | ||
| 22 | + <el-form-item> | ||
| 23 | + <el-button type="primary" @click="onSubmit">下载模板</el-button> | ||
| 24 | + </el-form-item> | ||
| 25 | + </el-form> | ||
| 26 | + | ||
| 27 | + <el-button @click="clearFilter" size="small">清除所有过滤器</el-button> | ||
| 28 | + | ||
| 29 | + <el-table | ||
| 30 | + ref="filterTable" | ||
| 31 | + :data="tableData" | ||
| 32 | + style="width: 100%; margin-top: 20px" | ||
| 33 | + size="small" | ||
| 34 | + border | ||
| 35 | + > | ||
| 36 | + <el-table-column label="行号" prop="line" fixed> </el-table-column> | ||
| 37 | + | ||
| 38 | + <el-table-column label="错误信息" prop="errorMessage" fixed> </el-table-column> | ||
| 39 | + | ||
| 40 | + <el-table-column label="index"></el-table-column> | ||
| 41 | + </el-table> | ||
| 42 | + </div> | ||
| 43 | +</template> | ||
| 44 | + </div> | ||
| 45 | +</template> | ||
| 46 | + | ||
| 47 | +<script> | ||
| 48 | +import { | ||
| 49 | + filghtKindData | ||
| 50 | +} from "@/api/flightInfoImport"; | ||
| 51 | + | ||
| 52 | +export default { | ||
| 53 | + data() { | ||
| 54 | + return { | ||
| 55 | + flightType:[], | ||
| 56 | + form: { | ||
| 57 | + type: "", | ||
| 58 | + region: "", | ||
| 59 | + }, | ||
| 60 | + fileList: [], | ||
| 61 | + tableData: [ | ||
| 62 | + {"line":"1","errorMessage":"error"}, | ||
| 63 | + {"line":"1","errorMessage":"error"}, | ||
| 64 | + {"line":"1","errorMessage":"error"}, | ||
| 65 | + {"line":"1","errorMessage":"error"}, | ||
| 66 | + {"line":"1","errorMessage":"error"}, | ||
| 67 | + {"line":"1","errorMessage":"error"}, | ||
| 68 | + {"line":"1","errorMessage":"error"}, | ||
| 69 | + {"line":"1","errorMessage":"error"}, | ||
| 70 | + {"line":"1","errorMessage":"error"}, | ||
| 71 | + {"line":"1","errorMessage":"error"}, | ||
| 72 | + {"line":"1","errorMessage":"error"}, | ||
| 73 | + {"line":"1","errorMessage":"error"}, | ||
| 74 | + {"line":"1","errorMessage":"error"}, | ||
| 75 | + {"line":"1","errorMessage":"error"}, | ||
| 76 | + {"line":"1","errorMessage":"error"}, | ||
| 77 | + {"line":"1","errorMessage":"error"}, | ||
| 78 | + {"line":"1","errorMessage":"error"}, | ||
| 79 | + {"line":"1","errorMessage":"error"}, | ||
| 80 | + ], | ||
| 81 | + }; | ||
| 82 | + }, | ||
| 83 | + methods: { | ||
| 84 | + onSubmit() { | ||
| 85 | + console.log("submit!"); | ||
| 86 | + }, | ||
| 87 | + handleRemove(file, fileList) { | ||
| 88 | + this.tableData = []; | ||
| 89 | + }, | ||
| 90 | + handleExceed(files) { | ||
| 91 | + let file = {}; | ||
| 92 | + file.file = files[0]; | ||
| 93 | + file.name = files[0].name; | ||
| 94 | + this.fileList = []; | ||
| 95 | + this.fileList.push(file); | ||
| 96 | + }, | ||
| 97 | + clearFilter() { | ||
| 98 | + this.$refs.filterTable.clearFilter(); | ||
| 99 | + }, | ||
| 100 | + formatter(row, column) { | ||
| 101 | + return row.address; | ||
| 102 | + }, | ||
| 103 | + filterTag(value, row) { | ||
| 104 | + return row.tag === value; | ||
| 105 | + }, | ||
| 106 | + filterHandler(value, row, column) { | ||
| 107 | + const property = column["property"]; | ||
| 108 | + return row[property] === value; | ||
| 109 | + }, | ||
| 110 | + }, | ||
| 111 | + created() { | ||
| 112 | + filghtKindData().then((response) => { | ||
| 113 | + if (response.code != 200) { | ||
| 114 | + this.$message({ | ||
| 115 | + showClose: true, | ||
| 116 | + message: response.msg, | ||
| 117 | + type: "error", | ||
| 118 | + }); | ||
| 119 | + } | ||
| 120 | + this.flightType = response.data; | ||
| 121 | + this.form.type = response.data[0].id; | ||
| 122 | + }); | ||
| 123 | + } | ||
| 124 | +}; | ||
| 125 | +</script> | ||
| 126 | + | ||
| 127 | +<style rel="stylesheet/scss" lang="scss"> | ||
| 128 | +.upload-demo { | ||
| 129 | + float: right; | ||
| 130 | +} | ||
| 131 | +.el-upload-list { | ||
| 132 | + display: inline-block; | ||
| 133 | + margin-left: 10px; | ||
| 134 | + vertical-align: top; | ||
| 135 | +} | ||
| 136 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment