New file |
| | |
| | | <template> |
| | | <div class="center"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="action" |
| | | :headers="headers" |
| | | :data="{ staffId: staffId, orgId: orgId }" |
| | | :on-exceed="handleExceed" |
| | | :on-success="fileSuccess" |
| | | :on-error="fileSuccess" |
| | | :file-list="fileList" |
| | | :show-file-list="true" |
| | | multiple |
| | | :limit="limit" |
| | | accept=".xls,.xlsx" |
| | | :before-upload="beforeAvatarUpload" |
| | | > |
| | | <slot></slot> |
| | | <slot name="tip"></slot> |
| | | </el-upload> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | msg: "æå¨ä¸ä¼ ", |
| | | fileList: [], |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | }; |
| | | }, |
| | | props: { |
| | | limit: { |
| | | type: Number, |
| | | }, |
| | | action: { |
| | | type: String, |
| | | }, |
| | | type: { |
| | | type: String, |
| | | }, |
| | | orgId: { |
| | | type: Number, |
| | | }, |
| | | staffId: { |
| | | type: Number, |
| | | }, |
| | | }, |
| | | methods: { |
| | | // è¶
åºæä»¶ä¸ä¼ 个æ°åè° |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`å½åéå¶éæ© 1 个æä»¶`); |
| | | }, |
| | | // ç§»é¤æä»¶å¼¹åºå± |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`ç¡®å®ç§»é¤ ${file.name}ï¼`); |
| | | }, |
| | | // ä¸ä¼ æååè° |
| | | fileSuccess(res, f, fl) { |
| | | this.$emit("fileSuccess", res, this.type); |
| | | }, |
| | | |
| | | // è¿æ»¤æä»¶ |
| | | beforeAvatarUpload(file) { |
| | | let fileName = file.name.substring(file.name.lastIndexOf(".") + 1); |
| | | const extension = fileName === "xls"; |
| | | const extension2 = fileName === "xlsx"; |
| | | if (!extension && !extension2) { |
| | | this.$message({ |
| | | message: "ä¸ä¼ æä»¶åªè½æ¯ xlsãxlsxæ ¼å¼!", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .center { |
| | | float: left; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <!-- <h3 style="position: fixed; top: 0; font-size: 16px; color: #5a5e66; " :style="'right:' + orgCss() ">{{ getOrgName() }}</h3> --> |
| | | |
| | | <div class="right-menu"> |
| | | <el-dropdown |
| | | trigger="click" |
| | | ref="eldrop" |
| | | style="margin-right: 20px" |
| | | > |
| | | <el-dropdown trigger="click" ref="eldrop" style="margin-right: 20px"> |
| | | <div class="avatar-wrapper" style="font-size: 20px"> |
| | | {{ selectStaff.org.name }} |
| | | <i class="el-icon-caret-bottom"></i> |
| | |
| | | </el-dropdown> |
| | | <el-dropdown class="avatar-container" trigger="click"> |
| | | <div class="avatar-wrapper"> |
| | | {{ 'æ¨å¥½ï¼' + getUserName() }} |
| | | {{ "æ¨å¥½ï¼" + getUserName() }} |
| | | <i class="el-icon-caret-bottom"></i> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown" class="user-dropdown"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import Breadcrumb from '@/components/Breadcrumb' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import { mapGetters } from "vuex"; |
| | | import Breadcrumb from "@/components/Breadcrumb"; |
| | | import Hamburger from "@/components/Hamburger"; |
| | | |
| | | export default { |
| | | inject: ['reload'], // ä¾èµæ³¨å
¥ |
| | | inject: ["reload"], // ä¾èµæ³¨å
¥ |
| | | data() { |
| | | return { |
| | | selectStaff: JSON.parse(localStorage.getItem("selectStaff")), |
| | | staffs: JSON.parse(localStorage.getItem("staffs")) |
| | | } |
| | | selectStaff: { org: {} }, |
| | | staffs: [], |
| | | }; |
| | | }, |
| | | components: { |
| | | Breadcrumb, |
| | | Hamburger |
| | | Hamburger, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'sidebar', |
| | | 'avatar' |
| | | ]) |
| | | ...mapGetters(["sidebar", "avatar"]), |
| | | }, |
| | | methods: { |
| | | changeStaff(item) { |
| | | this.selectStaff = item |
| | | localStorage.setItem("selectStaff", JSON.stringify(item)) |
| | | this.selectStaff = item; |
| | | localStorage.setItem("selectStaff", JSON.stringify(item)); |
| | | // this.$router.go(0) |
| | | this.reload() |
| | | this.reload(); |
| | | }, |
| | | orgCss() { |
| | | return JSON.parse(localStorage.getItem("user")).name.length * 20 + 100 + 'px'; |
| | | return ( |
| | | JSON.parse(localStorage.getItem("user")).name.length * 20 + 100 + "px" |
| | | ); |
| | | }, |
| | | getOrgName() { |
| | | return JSON.parse(localStorage.getItem("user")).staffs[0].org.name; |
| | | return JSON.parse(localStorage.getItem("selectStaff")).org.name; |
| | | }, |
| | | getUserName() { |
| | | return JSON.parse(localStorage.getItem("user")).name; |
| | | }, |
| | | toggleSideBar() { |
| | | this.$store.dispatch('app/toggleSideBar') |
| | | this.$store.dispatch("app/toggleSideBar"); |
| | | }, |
| | | async logout() { |
| | | // await this.$store.dispatch('user/logout') |
| | | this.$router.push(`/login`) |
| | | this.$router.push(`/login`); |
| | | }, |
| | | }, |
| | | created() { |
| | | const selectStaff = JSON.parse(localStorage.getItem("selectStaff")); |
| | | if (selectStaff) { |
| | | this.selectStaff = selectStaff; |
| | | } |
| | | const staffs = JSON.parse(localStorage.getItem("staffs")); |
| | | if (staffs) { |
| | | this.staffs = staffs; |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | const sessionCache = { |
| | | set (key, value) { |
| | | if (!sessionStorage) { |
| | | if (!localStorage) { |
| | | return |
| | | } |
| | | if (key != null && value != null) { |
| | | sessionStorage.setItem(key, value) |
| | | localStorage.setItem(key, value) |
| | | } |
| | | }, |
| | | get (key) { |
| | | if (!sessionStorage) { |
| | | if (!localStorage) { |
| | | return null |
| | | } |
| | | if (key == null) { |
| | | return null |
| | | } |
| | | return sessionStorage.getItem(key) |
| | | return localStorage.getItem(key) |
| | | }, |
| | | setJSON (key, jsonValue) { |
| | | if (jsonValue != null) { |
| | |
| | | } |
| | | }, |
| | | remove (key) { |
| | | sessionStorage.removeItem(key); |
| | | localStorage.removeItem(key); |
| | | } |
| | | } |
| | | const localCache = { |
| | |
| | | login({ |
| | | code: code, |
| | | }).then((res) => { |
| | | sessionStorage.setItem("user", JSON.stringify(res)); |
| | | sessionStorage.setItem("staffs", JSON.stringify(res.staffs)); |
| | | sessionStorage.setItem("selectStaff", JSON.stringify(res.staffs[0])); |
| | | localStorage.setItem("user", JSON.stringify(res)); |
| | | localStorage.setItem("staffs", JSON.stringify(res.staffs)); |
| | | localStorage.setItem("selectStaff", JSON.stringify(res.staffs[0])); |
| | | this.$router.push("/student"); |
| | | }); |
| | | }, |
New file |
| | |
| | | <template> |
| | | <el-form class="demo-ruleForm"> |
| | | <el-form-item label="" style="display: inline-block"> |
| | | <div class="uploading-center"> |
| | | <div class="uploading"> |
| | | <dragUpload |
| | | :limit="1" |
| | | :orgId="parseInt(orgId)" |
| | | :staffId="parseInt(staffId)" |
| | | @fileSuccess="fatherMethod" |
| | | :type="'AUDIENCE'" |
| | | :action="'/dream_test/player/importPlayer'" |
| | | > |
| | | <div class="uploading-btn-to"> |
| | | <i class="iconfont iconAdd"></i> ä¸ä¼ |
| | | </div> |
| | | <div class="el-upload__tip" slot="tip">åªè½ä¸ä¼ .xls,.xlsxæä»¶</div> |
| | | </dragUpload> |
| | | </div> |
| | | <div class="download-file"> |
| | | <i class="iconfont iconFile"></i> |
| | | <a href="/static/å¦å导å
¥æ¨¡æ¿.xlsx" download>ä¸è½½å¦å模æ¿</a> |
| | | </div> |
| | | </div> |
| | | <div style="font-size: 12px; color: #6993ff" v-if="hasAudience"> |
| | | å·²ä¸ä¼ ,å¦éä¿®æ¹ç´æ¥ç¹å»ä¸ä¼ |
| | | <i class="el-icon-close" title="å é¤" @click="clearaudience"></i> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script> |
| | | import dragUpload from "@/components/drag-upload"; |
| | | export default { |
| | | inject: ["reload"], |
| | | name: "Creation", |
| | | data() { |
| | | return { |
| | | orgId: 0, |
| | | staffId: 0, |
| | | hasAudience: false, |
| | | }; |
| | | }, |
| | | components: { dragUpload }, |
| | | methods: { |
| | | downloadlist() { |
| | | window.open("../../../assets/å¦å导å
¥æ¨¡æ¿.xlsx", "_blank"); |
| | | // this.download('downPlayerTemplate', 'å¦å导å
¥æ¨¡æ¿.xlsx') |
| | | }, |
| | | clearaudience() { |
| | | this.hasAudience = false; |
| | | }, |
| | | fatherMethod(res, type) { |
| | | if (res.falseLst === null) { |
| | | this.$message.success("ä¸ä¼ æ°æ®æå"); |
| | | this.$emit("load-success"); |
| | | } else if (res.falseLst.length >= 1) { |
| | | let errortips = ""; |
| | | res.falseLst.map((item) => { |
| | | errortips += `${item.cause} \r\n`; |
| | | }); |
| | | this.$message({ |
| | | message: `导å
¥æ°æ®æå导å
¥${res.successNum}æ¡,é误信æ¯:${errortips}`, |
| | | type: "error", |
| | | duration: 6000, |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | const selectStaff = JSON.parse(localStorage.getItem("selectStaff")); |
| | | this.orgId = selectStaff.org.id; |
| | | this.staffId = selectStaff.id; |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .demo-ruleForm { |
| | | text-align: center; |
| | | } |
| | | .creation-center { |
| | | padding: 40px 40px 40px 40px; |
| | | } |
| | | .uploading-center { |
| | | display: flex; |
| | | flex-direction: row; |
| | | > .uploading { |
| | | min-height: 40px; |
| | | line-height: 40px; |
| | | box-sizing: border-box; |
| | | border-radius: 4px; |
| | | } |
| | | .uploading-btn-to { |
| | | width: 100px; |
| | | line-height: 38px; |
| | | height: 38px; |
| | | border-radius: 3px; |
| | | text-align: center; |
| | | padding: 0 0px; |
| | | cursor: pointer; |
| | | user-select: none; |
| | | margin-left: 0; |
| | | color: #ffa800; |
| | | font-size: 14px; |
| | | border: 1px solid #ffbe41; |
| | | > i { |
| | | color: #ffbe41; |
| | | font-size: 12px; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | > .download-file { |
| | | float: left; |
| | | display: flex; |
| | | flex-direction: row; |
| | | margin-left: 20px; |
| | | color: #6993ff; |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | user-select: none; |
| | | height: 40px; |
| | | > div { |
| | | width: 117px; |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | } |
| | | .uploading-center-style { |
| | | ::v-deep .upload-demo { |
| | | ::v-deep .el-upload { |
| | | line-height: 38px; |
| | | } |
| | | } |
| | | } |
| | | ::v-deep .uploading-center > .uploading { |
| | | line-height: 37px; |
| | | } |
| | | </style> |
| | |
| | | </el-tabs> |
| | | <div style="display: flex; justify-content: space-between"> |
| | | <!-- <el-button type="primary" size="small" @click="showCreate">æ°å»ºå¦å</el-button> --> |
| | | <div> |
| | | <el-button type="primary" size="small" @click="handleExport" |
| | | >导åºå¦å</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="handleImport" |
| | | >导å
¥å¦å</el-button |
| | | > |
| | | </div> |
| | | <div style="width: 500px"> |
| | | <!-- <el-date-picker v-model="dateRange" type="daterange" range-separator="è³" start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" value-format="yyyy-MM-dd" style="margin-right: 10px"> |
| | |
| | | v-if="activeName !== 'deactivated'" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.gender == 'FEMALE' ? '女' : 'ç·' }} |
| | | {{ scope.row.gender == "FEMALE" ? "女" : "ç·" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | v-if="activeName !== 'deactivated'" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.mobile ? scope.row.mobile : '--' }} |
| | | {{ scope.row.mobile ? scope.row.mobile : "--" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | v-if="activeName !== 'deactivated'" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.user ? 'æ¯' : 'å¦' }} |
| | | {{ scope.row.user ? "æ¯" : "å¦" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | v-if="activeName == 'deactivated'" |
| | | > |
| | | <template slot-scope=""> |
| | | <el-link type="primary" :underline="false" |
| | | >å é¤</el-link |
| | | > |
| | | <el-link type="primary" :underline="false">å é¤</el-link> |
| | | |
| | | <el-link type="primary" :underline="false" |
| | | >æ¢å¤</el-link |
| | | > |
| | | <el-link type="primary" :underline="false">æ¢å¤</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <StudentCreate ref="studentCreate" /> |
| | | <el-dialog :visible.sync="dialogVisible" width="560px" title="导å
¥å¦å"> |
| | | <UploadStudent |
| | | v-if="dialogVisible" |
| | | @load-success="reloadData" |
| | | ></UploadStudent> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getData, getRenew, getExpire, getDeleted, handleExport } from "@/api/student"; |
| | | import StudentCreate from "./components/create.vue"; |
| | | |
| | | import { getData, getRenew, getExpire, getDeleted } from "@/api/student"; |
| | | import UploadStudent from "./components/upload-student.vue"; |
| | | |
| | | export default { |
| | | filters: { |
| | |
| | | }, |
| | | }, |
| | | components: { |
| | | StudentCreate, |
| | | UploadStudent, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | dialogVisible: false, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | handleExport() { |
| | | this.download('exportPlayer?orgId=' + JSON.parse(localStorage.getItem("user")).staffs[0].org.id, { |
| | | }, `导åº_${new Date().getTime()}.xlsx`) |
| | | this.download( |
| | | "exportPlayer?orgId=" + |
| | | JSON.parse(localStorage.getItem("selectStaff")).org.id, |
| | | {}, |
| | | `导åº_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | handleExport2() { |
| | | if (this.dateRange.length == 0) { |
| | | this.$message.warning("è¯·éæ©æ¥æèå´"); |
| | | return; |
| | | } |
| | | this.download('exportReport?startDate=' + this.dateRange[0] + '&endDate=' + this.dateRange[1], { |
| | | }, `导åº_${new Date().getTime()}.xlsx`) |
| | | this.download( |
| | | "exportReport?startDate=" + |
| | | this.dateRange[0] + |
| | | "&endDate=" + |
| | | this.dateRange[1], |
| | | {}, |
| | | `导åº_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | handleImport() { |
| | | this.dialogVisible = true; |
| | | }, |
| | | reloadData() { |
| | | this.dialogVisible = false; |
| | | this.fetchData(); |
| | | }, |
| | | fetchData() { |
| | | this.listLoading = true; |
| | |
| | | this.list = response.data.findPlayerByStaff.ls; |
| | | this.total = response.data.findPlayerByStaff.pageOut.total; |
| | | this.listLoading = false; |
| | | }) |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.data.pageIn.size = val; |
| | |
| | | this.handleClick(); |
| | | }, |
| | | handleClick(tab, event) { |
| | | this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id |
| | | this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id; |
| | | if (this.activeName == "pendingFees") { |
| | | this.listLoading = true; |
| | | getRenew(this.data).then((response) => { |
| | |
| | | proxy: { |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | // å¹é
ææä»¥ '/dev-api'å¼å¤´ç请æ±è·¯å¾ |
| | | target: "http://localhost:18081/dream_test", //类似äºNginxåå代ç |
| | | target: "http://localhost:18080/dream_test", //类似äºNginxåå代ç |
| | | changeOrigin: true, // æ¯æè·¨å |
| | | pathRewrite: { |
| | | // éåè·¯å¾: å»æè·¯å¾ä¸å¼å¤´ç'/dev-api' |