| | |
| | | "axios": "0.24.0", |
| | | "clipboard": "2.0.8", |
| | | "core-js": "3.25.3", |
| | | "cos-js-sdk-v5": "^1.4.18", |
| | | "dayjs": "^1.11.7", |
| | | "echarts": "5.4.0", |
| | | "element-ui": "2.15.12", |
| | | "file-saver": "2.0.5", |
| | | "file-saver": "^2.0.5", |
| | | "fuse.js": "6.4.3", |
| | | "highlight.js": "9.18.5", |
| | | "js-beautify": "1.13.0", |
| | |
| | | "vue-meta": "2.4.0", |
| | | "vue-router": "3.4.9", |
| | | "vuedraggable": "2.24.3", |
| | | "vuex": "3.6.0" |
| | | "vuex": "3.6.0", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "4.4.6", |
| | |
| | | "sass": "1.32.13", |
| | | "sass-loader": "10.1.1", |
| | | "script-ext-html-webpack-plugin": "2.1.5", |
| | | "script-loader": "^0.7.2", |
| | | "svg-sprite-loader": "5.1.1", |
| | | "vue-template-compiler": "2.6.12" |
| | | }, |
| | |
| | | $light-blue:#3A71A8; |
| | | $red:#C03639; |
| | | $pink: #E65D6E; |
| | | $green: #30B08F; |
| | | $green: #2ef0bf; |
| | | $tiffany: #4AB7BD; |
| | | $yellow:#FEC171; |
| | | $panGreen: #30B08F; |
| | |
| | | <!-- é¡¶é¨è·¯å¾ --> |
| | | <template> |
| | | <el-breadcrumb class="app-breadcrumb" separator="/"> |
| | | <transition-group name="breadcrumb"> |
| | | <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> |
| | | <span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span> |
| | | <el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path"> |
| | | <span |
| | | v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" |
| | | class="no-redirect" |
| | | >{{ item.meta.title }}</span |
| | | > |
| | | <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a> |
| | | </el-breadcrumb-item> |
| | | </transition-group> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | levelList: null |
| | | } |
| | | levelList: null, |
| | | }; |
| | | }, |
| | | watch: { |
| | | $route(route) { |
| | | // if you go to the redirect page, do not update the breadcrumbs |
| | | if (route.path.startsWith('/redirect/')) { |
| | | return |
| | | if (route.path.startsWith("/redirect/")) { |
| | | return; |
| | | } |
| | | this.getBreadcrumb() |
| | | } |
| | | this.getBreadcrumb(); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getBreadcrumb() |
| | | this.getBreadcrumb(); |
| | | }, |
| | | methods: { |
| | | getBreadcrumb() { |
| | | // only show routes with meta.title |
| | | let matched = this.$route.matched.filter(item => item.meta && item.meta.title) |
| | | const first = matched[0] |
| | | let matched = this.$route.matched.filter( |
| | | (item) => item.meta && item.meta.title |
| | | ); |
| | | const first = matched[0]; |
| | | |
| | | if (!this.isDashboard(first)) { |
| | | matched = [{ path: '/index', meta: { title: 'é¦é¡µ' }}].concat(matched) |
| | | matched = [{ path: "/index", meta: { title: "é¦é¡µ" } }].concat(matched); |
| | | } |
| | | |
| | | this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | this.levelList = matched.filter( |
| | | (item) => item.meta && item.meta.title && item.meta.breadcrumb !== false |
| | | ); |
| | | }, |
| | | isDashboard(route) { |
| | | const name = route && route.name |
| | | const name = route && route.name; |
| | | if (!name) { |
| | | return false |
| | | return false; |
| | | } |
| | | return name.trim() === 'Index' |
| | | return name.trim() === "Index"; |
| | | }, |
| | | handleLink(item) { |
| | | const { redirect, path } = item |
| | | const { redirect, path } = item; |
| | | if (redirect) { |
| | | this.$router.push(redirect) |
| | | return |
| | | this.$router.push(redirect); |
| | | return; |
| | | } |
| | | this.$router.push(path) |
| | | } |
| | | } |
| | | } |
| | | this.$router.push(path); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | }, |
| | | computed: { |
| | | values() { |
| | | if (this.value !== null && typeof this.value !== 'undefined') { |
| | | if (this.value !== null && typeof this.value !== "undefined") { |
| | | return Array.isArray(this.value) ? this.value : [String(this.value)]; |
| | | } else { |
| | | return []; |
| | |
| | | .el-tag + .el-tag { |
| | | margin-left: 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <!-- ä¸ä¼ å¾çs --> |
| | | <template> |
| | | <div> |
| | | <el-upload |
| | |
| | | <!-- ä¸ä¼ æä»¶ --> |
| | | <template> |
| | | <div class="upload-file"> |
| | | <el-upload |
| | |
| | | <!-- ä¸ä¼ æç¤º --> |
| | | <div class="el-upload__tip" slot="tip" v-if="showTip"> |
| | | 请ä¸ä¼ |
| | | <template v-if="fileSize"> 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> |
| | | <template v-if="fileType"> æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> |
| | | <template v-if="fileSize"> |
| | | 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> |
| | | </template> |
| | | <template v-if="fileType"> |
| | | æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> |
| | | </template> |
| | | çæä»¶ |
| | | </div> |
| | | </el-upload> |
| | | |
| | | <!-- æä»¶å表 --> |
| | | <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> |
| | | <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList"> |
| | | <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank"> |
| | | <transition-group |
| | | class="upload-file-list el-upload-list el-upload-list--text" |
| | | name="el-fade-in-linear" |
| | | tag="ul" |
| | | > |
| | | <li |
| | | :key="file.url" |
| | | class="el-upload-list__item ele-upload-list__item-content" |
| | | v-for="(file, index) in fileList" |
| | | > |
| | | <el-link |
| | | :href="`${baseUrl}${file.url}`" |
| | | :underline="false" |
| | | target="_blank" |
| | | > |
| | | <span class="el-icon-document"> {{ getFileName(file.name) }} </span> |
| | | </el-link> |
| | | <div class="ele-upload-list__item-content-action"> |
| | | <el-link :underline="false" @click="handleDelete(index)" type="danger">å é¤</el-link> |
| | | <el-link :underline="false" @click="handleDelete(index)" type="danger" |
| | | >å é¤</el-link |
| | | > |
| | | </div> |
| | | </li> |
| | | </transition-group> |
| | |
| | | // æ¯å¦æ¾ç¤ºæç¤º |
| | | isShowTip: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | default: true, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | if (val) { |
| | | let temp = 1; |
| | | // é¦å
å°å¼è½¬ä¸ºæ°ç» |
| | | const list = Array.isArray(val) ? val : this.value.split(','); |
| | | const list = Array.isArray(val) ? val : this.value.split(","); |
| | | // ç¶åå°æ°ç»è½¬ä¸ºå¯¹è±¡æ°ç» |
| | | this.fileList = list.map(item => { |
| | | this.fileList = list.map((item) => { |
| | | if (typeof item === "string") { |
| | | item = { name: item, url: item }; |
| | | } |
| | |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | computed: { |
| | | // æ¯å¦æ¾ç¤ºæç¤º |
| | |
| | | handleBeforeUpload(file) { |
| | | // æ ¡æ£æä»¶ç±»å |
| | | if (this.fileType) { |
| | | const fileName = file.name.split('.'); |
| | | const fileName = file.name.split("."); |
| | | const fileExt = fileName[fileName.length - 1]; |
| | | const isTypeOk = this.fileType.indexOf(fileExt) >= 0; |
| | | if (!isTypeOk) { |
| | | this.$modal.msgError(`æä»¶æ ¼å¼ä¸æ£ç¡®, 请ä¸ä¼ ${this.fileType.join("/")}æ ¼å¼æä»¶!`); |
| | | this.$modal.msgError( |
| | | `æä»¶æ ¼å¼ä¸æ£ç¡®, 请ä¸ä¼ ${this.fileType.join("/")}æ ¼å¼æä»¶!` |
| | | ); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | // ä¸ä¼ 失败 |
| | | handleUploadError(err) { |
| | | this.$modal.msgError("ä¸ä¼ æä»¶å¤±è´¥ï¼è¯·éè¯"); |
| | | this.$modal.closeLoading() |
| | | this.$modal.closeLoading(); |
| | | }, |
| | | // ä¸ä¼ æååè° |
| | | handleUploadSuccess(res, file) { |
| | |
| | | for (let i in list) { |
| | | strs += list[i].url + separator; |
| | | } |
| | | return strs != '' ? strs.substr(0, strs.length - 1) : ''; |
| | | } |
| | | } |
| | | return strs != "" ? strs.substr(0, strs.length - 1) : ""; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | <!-- svg徿 å°è£
--> |
| | | <template> |
| | | <div style="padding: 0 15px;" @click="toggleClick"> |
| | | <svg |
| | |
| | | <!-- 使ç¨å
¨å±svgicon徿 --> |
| | | <template> |
| | | <div :class="{'show':show}" class="header-search"> |
| | | <svg-icon class-name="search-icon" icon-class="search" @click.stop="click" /> |
| | |
| | | <!-- @author zhengjie --> |
| | | <!-- èªå®ä¹å¾æ åç§°å°è£
--> |
| | | <template> |
| | | <div class="icon-body"> |
| | | <el-input v-model="name" style="position: relative;" clearable placeholder="请è¾å
¥å¾æ åç§°" @clear="filterIcons" @input.native="filterIcons"> |
| | | <el-input |
| | | v-model="name" |
| | | style="position: relative" |
| | | clearable |
| | | placeholder="请è¾å
¥å¾æ åç§°" |
| | | @clear="filterIcons" |
| | | @input.native="filterIcons" |
| | | > |
| | | <i slot="suffix" class="el-icon-search el-input__icon" /> |
| | | </el-input> |
| | | <div class="icon-list"> |
| | | <div v-for="(item, index) in iconList" :key="index" @click="selectedIcon(item)"> |
| | | <svg-icon :icon-class="item" style="height: 30px;width: 16px;" /> |
| | | <div |
| | | v-for="(item, index) in iconList" |
| | | :key="index" |
| | | @click="selectedIcon(item)" |
| | | > |
| | | <svg-icon :icon-class="item" style="height: 30px; width: 16px" /> |
| | | <span>{{ item }}</span> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import icons from './requireIcons' |
| | | import icons from "./requireIcons"; |
| | | export default { |
| | | name: 'IconSelect', |
| | | name: "IconSelect", |
| | | data() { |
| | | return { |
| | | name: '', |
| | | iconList: icons |
| | | } |
| | | name: "", |
| | | iconList: icons, |
| | | }; |
| | | }, |
| | | methods: { |
| | | filterIcons() { |
| | | this.iconList = icons |
| | | this.iconList = icons; |
| | | if (this.name) { |
| | | this.iconList = this.iconList.filter(item => item.includes(this.name)) |
| | | this.iconList = this.iconList.filter((item) => |
| | | item.includes(this.name) |
| | | ); |
| | | } |
| | | }, |
| | | selectedIcon(name) { |
| | | this.$emit('selected', name) |
| | | document.body.click() |
| | | this.$emit("selected", name); |
| | | document.body.click(); |
| | | }, |
| | | reset() { |
| | | this.name = '' |
| | | this.iconList = icons |
| | | } |
| | | } |
| | | } |
| | | this.name = ""; |
| | | this.iconList = icons; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style rel="stylesheet/scss" lang="scss" scoped> |
| | | .icon-body { |
| | | width: 100%; |
| | | padding: 10px; |
| | | .icon-list { |
| | | height: 200px; |
| | | overflow-y: scroll; |
| | | div { |
| | | height: 30px; |
| | | line-height: 30px; |
| | | margin-bottom: -5px; |
| | | cursor: pointer; |
| | | width: 33%; |
| | | float: left; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | | vertical-align: -0.15em; |
| | | fill: currentColor; |
| | | overflow: hidden; |
| | | } |
| | | .icon-body { |
| | | width: 100%; |
| | | padding: 10px; |
| | | .icon-list { |
| | | height: 200px; |
| | | overflow-y: scroll; |
| | | div { |
| | | height: 30px; |
| | | line-height: 30px; |
| | | margin-bottom: -5px; |
| | | cursor: pointer; |
| | | width: 33%; |
| | | float: left; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | | vertical-align: -0.15em; |
| | | fill: currentColor; |
| | | overflow: hidden; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <!-- imageå¾ç容å¨å°è£
--> |
| | | <template> |
| | | <el-image |
| | | :src="`${realSrc}`" |
| | |
| | | <!-- ä¸ä¼ æä»¶å°è£
--> |
| | | <template> |
| | | <div class="component-upload-image"> |
| | | <el-upload |
| | |
| | | :headers="headers" |
| | | :file-list="fileList" |
| | | :on-preview="handlePictureCardPreview" |
| | | :class="{hide: this.fileList.length >= this.limit}" |
| | | :class="{ hide: this.fileList.length >= this.limit }" |
| | | > |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | |
| | | |
| | | <!-- ä¸ä¼ æç¤º --> |
| | | <div class="el-upload__tip" slot="tip" v-if="showTip"> |
| | | 请ä¸ä¼ |
| | | <template v-if="fileSize"> 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> |
| | | <template v-if="fileType"> æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> |
| | | <template v-if="fileSize"> |
| | | 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> |
| | | </template> |
| | | <template v-if="fileType"> |
| | | æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> |
| | | </template> |
| | | çæä»¶ |
| | | </div> |
| | | |
| | |
| | | }, |
| | | // 大å°éå¶(MB) |
| | | fileSize: { |
| | | type: Number, |
| | | type: Number, |
| | | default: 5, |
| | | }, |
| | | // æä»¶ç±»å, ä¾å¦['png', 'jpg', 'jpeg'] |
| | |
| | | // æ¯å¦æ¾ç¤ºæç¤º |
| | | isShowTip: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | default: true, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | headers: { |
| | | Authorization: "Bearer " + getToken(), |
| | | }, |
| | | fileList: [] |
| | | fileList: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | handler(val) { |
| | | if (val) { |
| | | // é¦å
å°å¼è½¬ä¸ºæ°ç» |
| | | const list = Array.isArray(val) ? val : this.value.split(','); |
| | | const list = Array.isArray(val) ? val : this.value.split(","); |
| | | // ç¶åå°æ°ç»è½¬ä¸ºå¯¹è±¡æ°ç» |
| | | this.fileList = list.map(item => { |
| | | this.fileList = list.map((item) => { |
| | | if (typeof item === "string") { |
| | | if (item.indexOf(this.baseUrl) === -1) { |
| | | item = { name: this.baseUrl + item, url: this.baseUrl + item }; |
| | | item = { name: this.baseUrl + item, url: this.baseUrl + item }; |
| | | } else { |
| | | item = { name: item, url: item }; |
| | | item = { name: item, url: item }; |
| | | } |
| | | } |
| | | return item; |
| | |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | computed: { |
| | | // æ¯å¦æ¾ç¤ºæç¤º |
| | |
| | | if (file.name.lastIndexOf(".") > -1) { |
| | | fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1); |
| | | } |
| | | isImg = this.fileType.some(type => { |
| | | isImg = this.fileType.some((type) => { |
| | | if (file.type.indexOf(type) > -1) return true; |
| | | if (fileExtension && fileExtension.indexOf(type) > -1) return true; |
| | | return false; |
| | |
| | | } |
| | | |
| | | if (!isImg) { |
| | | this.$modal.msgError(`æä»¶æ ¼å¼ä¸æ£ç¡®, 请ä¸ä¼ ${this.fileType.join("/")}å¾çæ ¼å¼æä»¶!`); |
| | | this.$modal.msgError( |
| | | `æä»¶æ ¼å¼ä¸æ£ç¡®, 请ä¸ä¼ ${this.fileType.join("/")}å¾çæ ¼å¼æä»¶!` |
| | | ); |
| | | return false; |
| | | } |
| | | if (this.fileSize) { |
| | |
| | | }, |
| | | // å é¤å¾ç |
| | | handleDelete(file) { |
| | | const findex = this.fileList.map(f => f.name).indexOf(file.name); |
| | | if(findex > -1) { |
| | | const findex = this.fileList.map((f) => f.name).indexOf(file.name); |
| | | if (findex > -1) { |
| | | this.fileList.splice(findex, 1); |
| | | this.$emit("input", this.listToString(this.fileList)); |
| | | } |
| | |
| | | strs += list[i].url.replace(this.baseUrl, "") + separator; |
| | | } |
| | | } |
| | | return strs != '' ? strs.substr(0, strs.length - 1) : ''; |
| | | } |
| | | } |
| | | return strs != "" ? strs.substr(0, strs.length - 1) : ""; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | // .el-upload--picture-card æ§å¶å å·é¨å |
| | | ::v-deep.hide .el-upload--picture-card { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | // 廿å¨ç»ææ |
| | | ::v-deep .el-list-enter-active, |
| | | ::v-deep .el-list-leave-active { |
| | | transition: all 0s; |
| | | transition: all 0s; |
| | | } |
| | | |
| | | ::v-deep .el-list-enter, .el-list-leave-active { |
| | | opacity: 0; |
| | | transform: translateY(0); |
| | | ::v-deep .el-list-enter, |
| | | .el-list-leave-active { |
| | | opacity: 0; |
| | | transform: translateY(0); |
| | | } |
| | | </style> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- tagæ ç¾å°è£
--> |
| | | <template> |
| | | <el-card class="box-card"> |
| | | <el-row type="flex"> |
| | | <el-col> |
| | | <el-tag v-if="isShowLeft"> |
| | | <i :class="leftIon"></i> |
| | | <slot name="left-tag" /> |
| | | </el-tag> |
| | | </el-col> |
| | | <el-col> |
| | | <el-row type="flex" justify="end"> |
| | | <slot name="right" /> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "PageTools", |
| | | data() { |
| | | return {}; |
| | | }, |
| | | props: { |
| | | leftIon: { |
| | | type: String, |
| | | default: "el-icon-info", |
| | | }, |
| | | isShowLeft: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | }, |
| | | created() {}, |
| | | |
| | | methods: {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped></style> |
| | |
| | | |
| | | <!-- åºé¨å页ç»ä»¶å°è£
--> |
| | | <template> |
| | | <div :class="{'hidden':hidden}" class="pagination-container"> |
| | | <el-pagination |
| | |
| | | <!-- å¾çå±ç¤ºé¡µé¢ --> |
| | | <template> |
| | | <div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item"> |
| | | <div class="pan-info"> |
| | |
| | | <!-- é¼ æ 触åå¼¹åºæ --> |
| | | <template> |
| | | <div class="top-right-btn" :style="style"> |
| | | <el-row> |
| | | <el-tooltip class="item" effect="dark" :content="showSearch ? 'éèæç´¢' : 'æ¾ç¤ºæç´¢'" placement="top" v-if="search"> |
| | | <el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" /> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="showSearch ? 'éèæç´¢' : 'æ¾ç¤ºæç´¢'" |
| | | placement="top" |
| | | v-if="search" |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | circle |
| | | icon="el-icon-search" |
| | | @click="toggleSearch()" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="å·æ°" placement="top"> |
| | | <el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" /> |
| | | <el-button |
| | | size="mini" |
| | | circle |
| | | icon="el-icon-refresh" |
| | | @click="refresh()" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="æ¾éå" placement="top" v-if="columns"> |
| | | <el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" /> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | content="æ¾éå" |
| | | placement="top" |
| | | v-if="columns" |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | circle |
| | | icon="el-icon-menu" |
| | | @click="showColumn()" |
| | | /> |
| | | </el-tooltip> |
| | | </el-row> |
| | | <el-dialog :title="title" :visible.sync="open" append-to-body> |
| | |
| | | ret.marginRight = `${this.gutter / 2}px`; |
| | | } |
| | | return ret; |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | // æ¾éååå§é»è®¤éèå |
| | |
| | | <!-- 徿 ç¹å»æ¾å¤§ --> |
| | | <template> |
| | | <div> |
| | | <svg-icon :icon-class="isFullscreen?'exit-fullscreen':'fullscreen'" @click="click" /> |
| | |
| | | <!-- 䏿èåå°è£
--> |
| | | <template> |
| | | <el-dropdown trigger="click" @command="handleSetSize"> |
| | | <div> |
| | | <svg-icon class-name="size-icon" icon-class="size" /> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value"> |
| | | <el-dropdown-item |
| | | v-for="item of sizeOptions" |
| | | :key="item.value" |
| | | :disabled="size === item.value" |
| | | :command="item.value" |
| | | > |
| | | {{ item.label }} |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | |
| | | data() { |
| | | return { |
| | | sizeOptions: [ |
| | | { label: 'Default', value: 'default' }, |
| | | { label: 'Medium', value: 'medium' }, |
| | | { label: 'Small', value: 'small' }, |
| | | { label: 'Mini', value: 'mini' } |
| | | ] |
| | | } |
| | | { label: "Default", value: "default" }, |
| | | { label: "Medium", value: "medium" }, |
| | | { label: "Small", value: "small" }, |
| | | { label: "Mini", value: "mini" }, |
| | | ], |
| | | }; |
| | | }, |
| | | computed: { |
| | | size() { |
| | | return this.$store.getters.size |
| | | } |
| | | return this.$store.getters.size; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleSetSize(size) { |
| | | this.$ELEMENT.size = size |
| | | this.$store.dispatch('app/setSize', size) |
| | | this.refreshView() |
| | | this.$ELEMENT.size = size; |
| | | this.$store.dispatch("app/setSize", size); |
| | | this.refreshView(); |
| | | this.$message({ |
| | | message: 'Switch Size Success', |
| | | type: 'success' |
| | | }) |
| | | message: "Switch Size Success", |
| | | type: "success", |
| | | }); |
| | | }, |
| | | refreshView() { |
| | | // In order to make the cached page re-rendered |
| | | this.$store.dispatch('tagsView/delAllCachedViews', this.$route) |
| | | this.$store.dispatch("tagsView/delAllCachedViews", this.$route); |
| | | |
| | | const { fullPath } = this.$route |
| | | const { fullPath } = this.$route; |
| | | |
| | | this.$nextTick(() => { |
| | | this.$router.replace({ |
| | | path: '/redirect' + fullPath |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | path: "/redirect" + fullPath, |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <!-- svgå°è£
--> |
| | | <template> |
| | | <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" /> |
| | | <div |
| | | v-if="isExternal" |
| | | :style="styleExternalIcon" |
| | | class="svg-external-icon svg-icon" |
| | | v-on="$listeners" |
| | | /> |
| | | <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners"> |
| | | <use :xlink:href="iconName" /> |
| | | </svg> |
| | | </template> |
| | | |
| | | <script> |
| | | import { isExternal } from '@/utils/validate' |
| | | import { isExternal } from "@/utils/validate"; |
| | | |
| | | export default { |
| | | name: 'SvgIcon', |
| | | name: "SvgIcon", |
| | | props: { |
| | | iconClass: { |
| | | type: String, |
| | | required: true |
| | | required: true, |
| | | }, |
| | | className: { |
| | | type: String, |
| | | default: '' |
| | | } |
| | | default: "", |
| | | }, |
| | | }, |
| | | computed: { |
| | | isExternal() { |
| | | return isExternal(this.iconClass) |
| | | return isExternal(this.iconClass); |
| | | }, |
| | | iconName() { |
| | | return `#icon-${this.iconClass}` |
| | | return `#icon-${this.iconClass}`; |
| | | }, |
| | | svgClass() { |
| | | if (this.className) { |
| | | return 'svg-icon ' + this.className |
| | | return "svg-icon " + this.className; |
| | | } else { |
| | | return 'svg-icon' |
| | | return "svg-icon"; |
| | | } |
| | | }, |
| | | styleExternalIcon() { |
| | | return { |
| | | mask: `url(${this.iconClass}) no-repeat 50% 50%`, |
| | | '-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%` |
| | | } |
| | | } |
| | | } |
| | | } |
| | | "-webkit-mask": `url(${this.iconClass}) no-repeat 50% 50%`, |
| | | }; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | |
| | | .svg-external-icon { |
| | | background-color: currentColor; |
| | | mask-size: cover!important; |
| | | mask-size: cover !important; |
| | | display: inline-block; |
| | | } |
| | | </style> |
| | |
| | | <!-- é¢è²éæ©å¨ --> |
| | | <template> |
| | | <el-color-picker |
| | | v-model="theme" |
| | |
| | | <!-- é¡¶é¨å¯¼èªå°è£
--> |
| | | <template> |
| | | <el-menu |
| | | :default-active="activeMenu" |
| | |
| | | @select="handleSelect" |
| | | > |
| | | <template v-for="(item, index) in topMenus"> |
| | | <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber" |
| | | <el-menu-item |
| | | :style="{ '--theme': theme }" |
| | | :index="item.path" |
| | | :key="index" |
| | | v-if="index < visibleNumber" |
| | | ><svg-icon :icon-class="item.meta.icon" /> |
| | | {{ item.meta.title }}</el-menu-item |
| | | > |
| | | </template> |
| | | |
| | | <!-- é¡¶é¨èåè¶
åºæ°éæå --> |
| | | <el-submenu :style="{'--theme': theme}" index="more" v-if="topMenus.length > visibleNumber"> |
| | | <el-submenu |
| | | :style="{ '--theme': theme }" |
| | | index="more" |
| | | v-if="topMenus.length > visibleNumber" |
| | | > |
| | | <template slot="title">æ´å¤èå</template> |
| | | <template v-for="(item, index) in topMenus"> |
| | | <el-menu-item |
| | |
| | | import { constantRoutes } from "@/router"; |
| | | |
| | | // éèä¾§è¾¹æ è·¯ç± |
| | | const hideList = ['/index', '/user/profile']; |
| | | const hideList = ["/index", "/user/profile"]; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | // 顶鍿 åå§æ° |
| | | visibleNumber: 5, |
| | | // å½åæ¿æ´»èåç index |
| | | currentIndex: undefined |
| | | currentIndex: undefined, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | if (menu.hidden !== true) { |
| | | // å
¼å®¹é¡¶é¨æ ä¸çº§èåå
é¨è·³è½¬ |
| | | if (menu.path === "/") { |
| | | topMenus.push(menu.children[0]); |
| | | topMenus.push(menu.children[0]); |
| | | } else { |
| | | topMenus.push(menu); |
| | | topMenus.push(menu); |
| | | } |
| | | } |
| | | }); |
| | |
| | | this.routers.map((router) => { |
| | | for (var item in router.children) { |
| | | if (router.children[item].parentPath === undefined) { |
| | | if(router.path === "/") { |
| | | if (router.path === "/") { |
| | | router.children[item].path = "/" + router.children[item].path; |
| | | } else { |
| | | if(!this.ishttp(router.children[item].path)) { |
| | | router.children[item].path = router.path + "/" + router.children[item].path; |
| | | if (!this.ishttp(router.children[item].path)) { |
| | | router.children[item].path = |
| | | router.path + "/" + router.children[item].path; |
| | | } |
| | | } |
| | | router.children[item].parentPath = router.path; |
| | |
| | | activeMenu() { |
| | | const path = this.$route.path; |
| | | let activePath = path; |
| | | if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) { |
| | | if ( |
| | | path !== undefined && |
| | | path.lastIndexOf("/") > 0 && |
| | | hideList.indexOf(path) === -1 |
| | | ) { |
| | | const tmpPath = path.substring(1, path.length); |
| | | activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); |
| | | if (!this.$route.meta.link) { |
| | | this.$store.dispatch('app/toggleSideBarHide', false); |
| | | this.$store.dispatch("app/toggleSideBarHide", false); |
| | | } |
| | | } else if(!this.$route.children) { |
| | | } else if (!this.$route.children) { |
| | | activePath = path; |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | | this.$store.dispatch("app/toggleSideBarHide", true); |
| | | } |
| | | this.activeRoutes(activePath); |
| | | return activePath; |
| | | }, |
| | | }, |
| | | beforeMount() { |
| | | window.addEventListener('resize', this.setVisibleNumber) |
| | | window.addEventListener("resize", this.setVisibleNumber); |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.setVisibleNumber) |
| | | window.removeEventListener("resize", this.setVisibleNumber); |
| | | }, |
| | | mounted() { |
| | | this.setVisibleNumber(); |
| | |
| | | // èåéæ©äºä»¶ |
| | | handleSelect(key, keyPath) { |
| | | this.currentIndex = key; |
| | | const route = this.routers.find(item => item.path === key); |
| | | const route = this.routers.find((item) => item.path === key); |
| | | if (this.ishttp(key)) { |
| | | // http(s):// è·¯å¾æ°çªå£æå¼ |
| | | window.open(key, "_blank"); |
| | | } else if (!route || !route.children) { |
| | | // 没æåè·¯ç±è·¯å¾å
é¨æå¼ |
| | | this.$router.push({ path: key }); |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | | this.$store.dispatch("app/toggleSideBarHide", true); |
| | | } else { |
| | | // æ¾ç¤ºå·¦ä¾§èå¨èå |
| | | this.activeRoutes(key); |
| | | this.$store.dispatch('app/toggleSideBarHide', false); |
| | | this.$store.dispatch("app/toggleSideBarHide", false); |
| | | } |
| | | }, |
| | | // å½åæ¿æ´»çè·¯ç± |
| | |
| | | } |
| | | }); |
| | | } |
| | | if(routes.length > 0) { |
| | | if (routes.length > 0) { |
| | | this.$store.commit("SET_SIDEBAR_ROUTERS", routes); |
| | | } else { |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | | this.$store.dispatch("app/toggleSideBarHide", true); |
| | | } |
| | | }, |
| | | ishttp(url) { |
| | | return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 |
| | | } |
| | | return url.indexOf("http://") !== -1 || url.indexOf("https://") !== -1; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | margin: 0 10px !important; |
| | | } |
| | | |
| | | .topmenu-container.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-submenu.is-active .el-submenu__title { |
| | | border-bottom: 2px solid #{'var(--theme)'} !important; |
| | | .topmenu-container.el-menu--horizontal > .el-menu-item.is-active, |
| | | .el-menu--horizontal > .el-submenu.is-active .el-submenu__title { |
| | | border-bottom: 2px solid #{"var(--theme)"} !important; |
| | | color: #303133; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- excelæä»¶ä¸ä¼ --> |
| | | <template> |
| | | <div class="upload-excel"> |
| | | <div class="btn-upload"> |
| | | <el-button |
| | | :loading="loading" |
| | | size="mini" |
| | | type="primary" |
| | | @click="handleUpload" |
| | | > |
| | | ç¹å»ä¸ä¼ |
| | | </el-button> |
| | | </div> |
| | | |
| | | <input |
| | | ref="excel-upload-input" |
| | | class="excel-upload-input" |
| | | type="file" |
| | | accept=".xlsx, .xls" |
| | | @change="handleClick" |
| | | /> |
| | | <div |
| | | class="drop" |
| | | @drop="handleDrop" |
| | | @dragover="handleDragover" |
| | | @dragenter="handleDragover" |
| | | > |
| | | <i class="el-icon-upload" /> |
| | | <span>å°æä»¶æå°æ¤å¤</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import XLSX from "xlsx"; |
| | | export default { |
| | | name: "UploadExcel", |
| | | props: { |
| | | beforeUpload: Function, // eslint-disable-line |
| | | onSuccess: Function, // eslint-disable-line |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | excelData: { |
| | | header: null, |
| | | results: null, |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | generateData({ header, results }) { |
| | | this.excelData.header = header; |
| | | this.excelData.results = results; |
| | | this.onSuccess && this.onSuccess(this.excelData); |
| | | }, |
| | | handleDrop(e) { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | if (this.loading) return; |
| | | const files = e.dataTransfer.files; |
| | | if (files.length !== 1) { |
| | | this.$message.error("Only support uploading one file!"); |
| | | return; |
| | | } |
| | | const rawFile = files[0]; // only use files[0] |
| | | if (!this.isExcel(rawFile)) { |
| | | this.$message.error( |
| | | "Only supports upload .xlsx, .xls, .csv suffix files" |
| | | ); |
| | | return false; |
| | | } |
| | | this.upload(rawFile); |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | }, |
| | | handleDragover(e) { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | e.dataTransfer.dropEffect = "copy"; |
| | | }, |
| | | handleUpload() { |
| | | this.$refs["excel-upload-input"].click(); |
| | | }, |
| | | handleClick(e) { |
| | | const files = e.target.files; |
| | | const rawFile = files[0]; // only use files[0] |
| | | if (!rawFile) return; |
| | | this.upload(rawFile); |
| | | }, |
| | | upload(rawFile) { |
| | | this.$refs["excel-upload-input"].value = null; // fix can't select the same excel |
| | | if (!this.beforeUpload) { |
| | | this.readerData(rawFile); |
| | | return; |
| | | } |
| | | const before = this.beforeUpload(rawFile); |
| | | if (before) { |
| | | this.readerData(rawFile); |
| | | } |
| | | }, |
| | | readerData(rawFile) { |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | const reader = new FileReader(); |
| | | reader.onload = (e) => { |
| | | const data = e.target.result; |
| | | const workbook = XLSX.read(data, { type: "array" }); |
| | | const firstSheetName = workbook.SheetNames[0]; |
| | | const worksheet = workbook.Sheets[firstSheetName]; |
| | | const header = this.getHeaderRow(worksheet); |
| | | const results = XLSX.utils.sheet_to_json(worksheet); |
| | | this.generateData({ header, results }); |
| | | this.loading = false; |
| | | resolve(); |
| | | }; |
| | | reader.readAsArrayBuffer(rawFile); |
| | | }); |
| | | }, |
| | | getHeaderRow(sheet) { |
| | | const headers = []; |
| | | const range = XLSX.utils.decode_range(sheet["!ref"]); |
| | | let C; |
| | | const R = range.s.r; |
| | | /* start in the first row */ |
| | | for (C = range.s.c; C <= range.e.c; ++C) { |
| | | /* walk every column in the range */ |
| | | const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]; |
| | | /* find the cell in the first row */ |
| | | let hdr = "UNKNOWN " + C; // <-- replace with your desired default |
| | | if (cell && cell.t) hdr = XLSX.utils.format_cell(cell); |
| | | headers.push(hdr); |
| | | } |
| | | return headers; |
| | | }, |
| | | isExcel(file) { |
| | | return /\.(xlsx|xls|csv)$/.test(file.name); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .upload-excel { |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 100px; |
| | | .excel-upload-input { |
| | | display: none; |
| | | z-index: -9999; |
| | | } |
| | | .btn-upload, |
| | | .drop { |
| | | border: 1px dashed #bbb; |
| | | width: 350px; |
| | | height: 160px; |
| | | text-align: center; |
| | | line-height: 160px; |
| | | } |
| | | .drop { |
| | | line-height: 80px; |
| | | color: #bbb; |
| | | i { |
| | | font-size: 60px; |
| | | display: block; |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- å¾çä¸ä¼ å°è£
--> |
| | | <template> |
| | | <div> |
| | | <el-upload |
| | | :file-list="filelist" |
| | | v-loading="loading" |
| | | element-loading-text="æ¼å½å è½½ä¸" |
| | | element-loading-spinner="el-icon-loading" |
| | | element-loading-background="rgba(0, 0, 0, 0.8)" |
| | | action="https://jsonplaceholder.typicode.com/posts/" |
| | | :http-request="uoloadimg" |
| | | :on-change="onChange" |
| | | :on-remove="onRemove" |
| | | :on-preview="onPreview" |
| | | :before-upload="onBeforeUpload" |
| | | list-type="picture-card" |
| | | :limit="1" |
| | | :class="filelist.length === 1 ? 'father' : ''" |
| | | class="custom-upload" |
| | | > |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="fileonPreview"> |
| | | <img :src="fileimg" alt="" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import COS from "cos-js-sdk-v5"; |
| | | var cos = new COS({ |
| | | SecretId: "AKIDxlNmyua2FDwSjmeHGVVHxNYVghSyFhus", |
| | | SecretKey: "nPp8D5mKgomaBawHPI1avzuhJhqombCZ", |
| | | }); |
| | | console.log(cos); |
| | | export default { |
| | | name: "UploadImg", |
| | | data() { |
| | | return { |
| | | filelist: [], |
| | | fileimg: "", |
| | | fileonPreview: false, |
| | | loading: false, |
| | | }; |
| | | }, |
| | | |
| | | created() {}, |
| | | |
| | | methods: { |
| | | // åéå¾çä¸ä¼ |
| | | uoloadimg({ file }) { |
| | | this.loading = true; |
| | | cos.putObject( |
| | | { |
| | | Bucket: "hmhr-31-1313341522" /* å¿
é¡» */, |
| | | Region: "ap-shanghai" /* å卿¡¶æå¨å°åï¼å¿
须忮µ */, |
| | | Key: file.name /* å¿
é¡» */, |
| | | StorageClass: "STANDARD", |
| | | Body: file, // ä¸ä¼ æä»¶å¯¹è±¡ |
| | | onProgress: function (progressData) { |
| | | console.log(JSON.stringify(progressData)); |
| | | }, |
| | | }, |
| | | (err, data) => { |
| | | this.loading = false; |
| | | if (err || data.statusCode != 200) { |
| | | return this.$$message.error(""); |
| | | } |
| | | this.$emit("onSuccess", { |
| | | url: "https://" + data.Location, |
| | | }); |
| | | } |
| | | ); |
| | | }, |
| | | // åå¨å¾çå表 |
| | | onChange(file, filelist) { |
| | | this.filelist = filelist; |
| | | }, |
| | | //å é¤ |
| | | onRemove(file, filelist) { |
| | | this.filelist = filelist; |
| | | }, |
| | | // é¢è§ |
| | | onPreview(file) { |
| | | console.log(file); |
| | | this.fileonPreview = true; |
| | | this.fileimg = file.url; |
| | | }, |
| | | // ä¸ä¼ å夿 |
| | | onBeforeUpload(file) { |
| | | console.log(file); |
| | | const types = ["image/jpeg", "image/png", "image/gif"]; |
| | | if (!types.includes(file.type)) { |
| | | this.$message.error("è¯·éæ©" + types.join(", ") + "æ ¼å¼å¾ç"); |
| | | return false; |
| | | } |
| | | const maxSize = 1024 * 1024 * 2; |
| | | if (file.size > maxSize) { |
| | | this.$message.error("éæ©å¾çä¸è¶
è¿2mb"); |
| | | return false; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .father .el-upload--picture-card { |
| | | display: none; |
| | | } |
| | | .custom-upload { |
| | | width: 148px; |
| | | height: 148px; |
| | | overflow: hidden; |
| | | } |
| | | </style> |
| | |
| | | <!-- 页é¢å
åµå
¥å°è£
--> |
| | | <template> |
| | | <div v-loading="loading" :style="'height:' + height"> |
| | | <iframe |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import PageTools from "@/components/PageTools" |
| | | import UploadExcel from "@/components/UploadExcel" |
| | | import UploadImg from "@/components/UploadImg" |
| | | const component=[PageTools,UploadExcel,UploadImg] |
| | | export default{ |
| | | install(Vue){ |
| | | component.forEach((component)=>{ |
| | | Vue.component(component.name,component) |
| | | }) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // åå·¥ |
| | | export default { |
| | | // èç¨å½¢å¼ |
| | | hireType: [ |
| | | { |
| | | id: 1, |
| | | value: 'æ£å¼' |
| | | }, |
| | | { |
| | | id: 2, |
| | | value: '鿣å¼' |
| | | } |
| | | ], |
| | | // 管çå½¢å¼ |
| | | subjection: [ |
| | | { |
| | | id: '1', |
| | | value: 'æ»é¨' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'ååå¸' |
| | | } |
| | | ], |
| | | // å¨èç¶æ |
| | | workingState: [ |
| | | { |
| | | id: '1', |
| | | value: 'å¨è' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: '离è' |
| | | } |
| | | ], |
| | | // 离èç±»å |
| | | leaveType: [ |
| | | { |
| | | id: '1', |
| | | value: '主å¨ç¦»è' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: '被å¨ç¦»è' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'éä¼' |
| | | } |
| | | ], |
| | | // ååæ |
| | | attritionMonth: [ |
| | | { |
| | | id: '1', |
| | | value: 'ç¦»èæ¥æ¬æ' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'ç¦»èæ¥æ¬¡æ' |
| | | } |
| | | ], |
| | | // èç¨å½¢å¼ |
| | | informaltype: [ |
| | | { |
| | | id: '2', |
| | | value: 'å®ä¹ ' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'å³å¡' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: '顾é®' |
| | | }, |
| | | { |
| | | id: '5', |
| | | value: 'è¿è' |
| | | }, |
| | | { |
| | | id: '6', |
| | | value: 'å¤å
' |
| | | } |
| | | ], |
| | | // æé«å¦å |
| | | highestDegree: [ |
| | | { |
| | | id: '1', |
| | | value: 'åä¸' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'é«ä¸' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'ä¸ä¸' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: '大ä¸' |
| | | }, |
| | | { |
| | | id: '5', |
| | | value: 'æ¬ç§' |
| | | }, |
| | | { |
| | | id: '6', |
| | | value: 'ç¡å£«' |
| | | }, |
| | | { |
| | | id: '7', |
| | | value: 'å士' |
| | | }, |
| | | { |
| | | id: '8', |
| | | value: 'å
¶ä»' |
| | | } |
| | | ], |
| | | // å½å®¶/å°åº |
| | | isOverseas: [ |
| | | { |
| | | id: '1', |
| | | value: 'ä¸å½å¤§é' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: '港澳å°å½å¤' |
| | | } |
| | | ], |
| | | // æ§å« |
| | | gender: [ |
| | | { |
| | | id: '1', |
| | | value: 'ç·' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: '女' |
| | | } |
| | | ], |
| | | // å©å§»ç¶åµ |
| | | maritaStatus: [ |
| | | { |
| | | id: '1', |
| | | value: 'æªå©' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'å·²å©' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: '离å¼' |
| | | } |
| | | ], |
| | | // çè |
| | | animalSymbol: [ |
| | | { |
| | | id: '1', |
| | | value: 'é¼ ' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'ç' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'è' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: 'å
' |
| | | }, |
| | | { |
| | | id: '5', |
| | | value: 'é¾' |
| | | }, |
| | | { |
| | | id: '6', |
| | | value: 'è' |
| | | }, |
| | | { |
| | | id: '7', |
| | | value: '马' |
| | | }, |
| | | { |
| | | id: '8', |
| | | value: 'ç¾' |
| | | }, |
| | | { |
| | | id: '9', |
| | | value: 'ç´' |
| | | }, |
| | | { |
| | | id: '10', |
| | | value: '鸡' |
| | | }, |
| | | { |
| | | id: '11', |
| | | value: 'ç' |
| | | }, |
| | | { |
| | | id: '12', |
| | | value: 'çª' |
| | | } |
| | | ], |
| | | // æåº§ |
| | | constellation: [ |
| | | { |
| | | code: 1, |
| | | value: 'æ°´ç¶åº§' |
| | | }, |
| | | { |
| | | code: 2, |
| | | value: 'å鱼座' |
| | | }, |
| | | { |
| | | code: 3, |
| | | value: 'ç½ç¾åº§' |
| | | }, |
| | | { |
| | | code: 4, |
| | | value: 'éç座' |
| | | }, |
| | | { |
| | | code: 5, |
| | | value: 'åå座' |
| | | }, |
| | | { |
| | | code: 6, |
| | | value: 'å·¨è¹åº§' |
| | | }, |
| | | { |
| | | code: 7, |
| | | value: 'ç®å座' |
| | | }, |
| | | { |
| | | code: 8, |
| | | value: 'å¤å¥³åº§' |
| | | }, |
| | | { |
| | | code: 9, |
| | | value: '天秤座' |
| | | }, |
| | | { |
| | | code: 10, |
| | | value: '天è座' |
| | | }, |
| | | { |
| | | code: 11, |
| | | value: 'å°æåº§' |
| | | }, |
| | | { |
| | | code: 12, |
| | | value: 'æ©ç¾¯åº§' |
| | | } |
| | | ], |
| | | // è¡å |
| | | bloodType: [ |
| | | { |
| | | id: '1', |
| | | value: 'Aå' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'Bå' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'Oå' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: 'ABå' |
| | | } |
| | | ], |
| | | // å¦å |
| | | educationType: [ |
| | | { |
| | | id: '1', |
| | | value: 'ç»æ' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'èªè' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'æè' |
| | | } |
| | | ], |
| | | // è½¬æ£ |
| | | positiveType: [ |
| | | { |
| | | id: '1', |
| | | value: '已转æ£' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'æªè½¬æ£' |
| | | } |
| | | ], |
| | | // ååæé |
| | | contractPeriod: [ |
| | | { |
| | | id: '1', |
| | | value: '6æ' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: '12æ' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: '24æ' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: '36æ' |
| | | }, |
| | | { |
| | | id: '5', |
| | | value: 'å
¶ä»' |
| | | } |
| | | ], |
| | | // ç¾çº¦æ¬¡æ° |
| | | renewalCount: [ |
| | | { |
| | | id: 1, |
| | | value: '0次' |
| | | }, |
| | | { |
| | | id: 2, |
| | | value: '1次' |
| | | }, |
| | | { |
| | | id: 3, |
| | | value: '2次' |
| | | }, |
| | | { |
| | | id: 4, |
| | | value: '3次' |
| | | }, |
| | | { |
| | | id: 5, |
| | | value: '4次æä»¥ä¸' |
| | | } |
| | | ], |
| | | // ç®åæ¥æº |
| | | resumeSource: [ |
| | | { |
| | | id: '1', |
| | | value: 'æºèæè' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'æå¾ç½' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: 'åç¨æ å¿§' |
| | | }, |
| | | { |
| | | id: '4', |
| | | value: 'çèç½' |
| | | }, |
| | | { |
| | | id: '5', |
| | | value: 'æ ¡å宣讲' |
| | | }, |
| | | { |
| | | id: '6', |
| | | value: 'ç头' |
| | | }, |
| | | { |
| | | id: '7', |
| | | value: 'å
鍿¨è' |
| | | } |
| | | ], |
| | | // 社æ/æ ¡æ |
| | | hireSourceType: [ |
| | | { |
| | | id: '1', |
| | | value: '社æ' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'æ ¡æ' |
| | | } |
| | | ], |
| | | // æ°å |
| | | // é¨é¨ |
| | | departments: [ |
| | | { |
| | | id: '1', |
| | | value: 'æ»è£å' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'ç ç©¶é¢' |
| | | } |
| | | ], |
| | | // èä½ç¶æ |
| | | stausInfos: [ |
| | | { |
| | | id: '1', |
| | | value: 'å¨è' |
| | | }, |
| | | { |
| | | id: '2', |
| | | value: 'å
¥è' |
| | | }, |
| | | { |
| | | id: '3', |
| | | value: '离è' |
| | | } |
| | | ], |
| | | // ä¸ä¼ æ°æ®è¡¨å¤´ |
| | | importMapKeyPath: { |
| | | å
¥èæ¥æ: 'timeOfEntry', |
| | | å§å: "username", |
| | | å·¥å·: "workNumber", |
| | | ææºå·: "mobile", |
| | | è½¬æ£æ¥æ: "correctionTime" |
| | | } |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs'; |
| | | // è¿æ»¤å¨ |
| | | export const formatTime=(val)=>{ |
| | | return dayjs(val).format('YYYY-MM-DD') |
| | | } |
| | |
| | | import VueMeta from 'vue-meta' |
| | | // åå
¸æ°æ®ç»ä»¶ |
| | | import DictData from '@/components/DictData' |
| | | // ç»ä»¶å°è£
éæ |
| | | import components from './components' |
| | | // 注åè¿æ»¤å¨ |
| | | import * as filters from './filters' |
| | | for(let key in filters){ |
| | | Vue.filter(key, filters[key]) |
| | | } |
| | | |
| | | |
| | | // å
¨å±æ¹æ³æè½½ |
| | | Vue.prototype.getDicts = getDicts |
| | |
| | | Vue.use(plugins) |
| | | Vue.use(VueMeta) |
| | | DictData.install() |
| | | Vue.use(components) |
| | | |
| | | /** |
| | | * If you don't want to use mock-server |
| | |
| | | const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' |
| | | const state = { |
| | | title: '', |
| | | theme: storageSetting.theme || '#409EFF', |
| | | theme: storageSetting.theme || '#2ef0bf', |
| | | sideTheme: storageSetting.sideTheme || sideTheme, |
| | | showSettings: showSettings, |
| | | topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <UploadExcel :deforeUpload="excelSuccess" :onSuccess="onSuccess" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | //çå¾
apiæ¥å£ |
| | | // import { importEmployee } from "@/api/index"; |
| | | import employees from "@/constant/employees"; |
| | | import formatTime from "@/filters/index"; |
| | | const { importMapKeyPath } = employees; |
| | | export default { |
| | | data() { |
| | | return {}; |
| | | }, |
| | | |
| | | created() {}, |
| | | |
| | | methods: { |
| | | // ä¸ä¼ å触å |
| | | excelSuccess({ name }) { |
| | | if (!name.endsWith(".xlsx")) { |
| | | return this.$message("è¯·éæ©xlsxæä»¶"); |
| | | } |
| | | return true; |
| | | }, |
| | | // è§£ææåå触å |
| | | async onSuccess({ results, header }) { |
| | | const neWArr = results.map((item) => { |
| | | const obj = {}; |
| | | for (let key in importMapKeyPath) { |
| | | if (key === "å
¥èæ¶é´" || key === "è½¬æ£æ¶é´") { |
| | | // excelæ¶é´æ³ |
| | | const timestamp = item[key]; |
| | | // è½¬æ ¼å¼ï¼å¹¶å¯¹æ¯æéªå·®æ¶é´ |
| | | const date = new Date((timestamp - 1) * 24 * 3600000); |
| | | date.setFullYear(data.setFullYear() - 70); |
| | | obj[importMapKeyPath[key]] = formatTime(date); |
| | | } else { |
| | | obj[importMapKeyPath[key]] = item[key]; |
| | | } |
| | | } |
| | | return obj; |
| | | }); |
| | | // await importEmployee(neWArr); |
| | | this.$message.success("导å
¥æå"); |
| | | this.$router.go(-1); |
| | | console.log(neWArr); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped></style> |