From e9cb25774133bd2261dd9252fcb5d0defa75b349 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 4 Jul 2022 17:51:55 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/main.css | 3 + src/libs/util.js | 28 +- src/router/index.js | 9 +- src/setting.js | 2 +- src/views/match/add/index.vue | 184 ++++--- src/views/match/manage/index.vue | 7 +- src/views/match/manage/matchDetail.vue | 666 ------------------------- src/views/match/preview/index.vue | 127 +++++ src/views/parner/staff.vue | 7 +- src/views/system/manageLog.vue | 2 +- src/views/system/staff.vue | 4 +- 11 files changed, 260 insertions(+), 779 deletions(-) delete mode 100644 src/views/match/manage/matchDetail.vue create mode 100644 src/views/match/preview/index.vue diff --git a/src/assets/css/main.css b/src/assets/css/main.css index b3b1a93..f369883 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -439,6 +439,9 @@ li { .m-b-20 { margin-bottom: 20px; } +.m-r-10 { + margin-right: 10px; +} @media (max-width: 720px) { .el-message { min-width: auto !important; diff --git a/src/libs/util.js b/src/libs/util.js index c20b25a..3123029 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -2,6 +2,13 @@ import cookies from './util.cookies' import {_local,_session} from './util.db' import { Message } from 'element-ui' +// 文件后缀集合 +const exts = { + video: 'mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv', + audio: 'mp3,aac,ape,flac,wav,wma,amr,mid', + img: 'jpg,jpeg,png,gif,svg,psd', + doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx' +} const util = { cookies, local: _local, @@ -61,23 +68,28 @@ const util = { }, // 传入文件后缀判断是否是视频 isVideo(ext) { - if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true - return false + if (exts.video.includes(ext)) return true; + return false; }, // 传入文件后缀判断是否是音频 isAudio(ext) { - if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true - return false + if (exts.audio.includes(ext)) return true; + return false; }, // 传入文件后缀判断是否是图片 isImg(ext) { - if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true - return false + if (exts.img.includes(ext)) return true; + return false; }, // 传入文件后缀判断是否是pdf以外的文档 isDoc(ext) { - if(!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != 'pdf') return true - return false + if (exts.doc.includes(ext)) return true; + return false; + }, + // 判断是否能够预览 + canPreview(ext) { + if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && !util.isDoc(ext)) return false + return true }, // 循环去除html标签 removeHtmlTag(list,attr) { diff --git a/src/router/index.js b/src/router/index.js index 4627f66..b6b0e63 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -187,12 +187,17 @@ let router = new Router({ { path: '/join', component: () => import('../views/join'), - // meta: { title: '个人中心' } + meta: { title: '城市合伙人运营管理平台' } + }, + { + path: '/matchPreview', + component: () => import( '../views/match/preview'), + // meta: { title: '数据管理' } }, { path: '/success', component: () => import('../views/join/success'), - // meta: { title: '个人中心' } + meta: { title: '城市合伙人运营管理平台' } }, { path: '*', diff --git a/src/setting.js b/src/setting.js index f555548..63ff7ba 100644 --- a/src/setting.js +++ b/src/setting.js @@ -10,7 +10,7 @@ let host = `${location.origin}/` if (isDev) { jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 host = 'http://121.37.12.51/' - host = 'http://192.168.31.151:9000/'// 榕 + // host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.137:9000/'// 赓 } else if (isPro) { jumpPath = 'https://www.huorantech.cn/judgmentPoint/' diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index 7873e21..739c015 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -1,11 +1,12 @@ @@ -185,9 +170,8 @@ export default { headers: { token: sessionStorage.getItem('token') }, - fileName: '', form: { - id: '', + id: this.$route.query.id, platformSource: 0, // 平台来源(0:中台,1:职站) ztOpen: 0, // 中台是否开启(0开启 1未开启 默认0) name: '', @@ -205,19 +189,21 @@ export default { playEndTime: '', description: '', }, + fileName: '', signupTime: '', playTime: '', sponsorList: [""], undertakerList: [""], + fileList: [], pickerOptions: { disabledDate: time => { return time.getTime() < new Date().getTime() - 86400000; } }, - provinceList: this.$store.state.provinceList, rangeVisible: false, + casVisible: true, range: [], - ranges: [], + rangeInit: [], rangeName: '', // 选择区域懒加载 props: { @@ -227,13 +213,15 @@ export default { lazyLoad (node, resolve) { const { level, value } = node // 省份 + console.log('lazy', node, that.range) if (!level) { that.$get(that.api.queryProvince).then(({ list }) => { const data = [] list.map(e => { data.push({ value: e.provinceId, - label: e.provinceName + label: e.provinceName, + children: [] }) }) resolve(data) @@ -277,7 +265,6 @@ export default { }, submiting: false, updateTime: 0, - previewVisible: false }; }, components: { @@ -313,12 +300,67 @@ export default { } }, mounted() { - + this.getData() }, methods: { + getData() { + const { id } = this.form + id && this.$post(`${this.api.getContest}?contestId=${id}`).then(({ contest }) => { + this.signupTime = [contest.signUpStartTime, contest.signUpEndTime] + this.playTime = [contest.playStartTime, contest.playEndTime] + this.sponsorList = contest.sponsor.split(",") + this.undertakerList = contest.undertaker.split(",") + // 附件 + const fileList = contest.contestAnnexList + if (fileList) { + const files = [] + fileList.map(e => { + files.push({ + name: e.fileName, + url: e.filePath + }) + }) + this.fileList = files + } else { + contest.contestAnnexList = [] + } + + // 选择范围 + const ranges = contest.contestRangeList + if (ranges) { + const range = [] + ranges.map(e => { + const item = [+e.provinceId] + e.cityId && item.push(+e.cityId) + e.schoolId && item.push(+e.schoolId) + range.push(item) + }) + this.range = range + console.log("🚀 ~ file: matchDetail.vue ~ line 327 ~ this.$post ~ this.range", this.range) + } + + // 选择范围name + const rangeName = contest.contestRangeRespList + if (rangeName) { + const range = [] + rangeName.map(e => { + range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName) + }) + this.rangeName = range.join(',') + } + this.form = contest + }).catch(err => {}) + }, // 选择范围 showRange() { this.rangeVisible = true + console.log("🚀 ~ file: index.vue ~ line 384 ~ showRange ~ rangeVisible", this.range) + // this.range = this.rangeInit + }, + // 范围模糊查询 + rangeFilter(node, keyword) { + console.log("🚀 ~ file: index.vue ~ line 363 ~ rangeFilter ~ node, keyword", node, keyword) + }, // 范围确定 rangeSubmit() { @@ -367,7 +409,6 @@ export default { fileName: this.fileName, filePath: file.fileUrl || file.fileId }) - console.log(44, this.form) }, // 附件上传前 beforeUpload(file) { @@ -401,20 +442,13 @@ export default { }).catch(res => {}) }, handleAnnexRemove(file, fileList) { - file.url && this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {}) - }, - // 预览附件 - previewFile(item) { - const { filePath } = item - const suffix = filePath.substr(filePath.lastIndexOf('.') + 1) - window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath) - }, - // 下载附件 - download(item) { - util.downloadFile(item.fileName, item.filePath) + const { url, name } = file + url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {}) + const id = this.form.contestAnnexList.find(e => e.fileName === name).id + id && this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {}) }, // 提交 - save(status) { + save(status, frame) { if (this.submiting) return false; const { form } = this form.sponsor = this.sponsorList.filter(d => d).join(); @@ -438,10 +472,11 @@ export default { form.publishStatus = status form.ztOpen = status ? 0 : 1 // 保存则禁用,发布则启用 if (this.form.id) { - this.$put(this.api.editContest, form).then(res => { + this.$post(this.api.editContest, form).then(res => { + this.updateTime = 1 this.submiting = false; util.successMsg("修改成功"); - this.$router.back(); + frame || this.$router.push(`/match?page=${this.$store.state.matchPage}`) // frame为1则表示是父页面调的,不作返回操作 }) .catch(err => { this.submiting = false; @@ -450,7 +485,7 @@ export default { this.$post(this.api.addContest, form).then(res => { this.submiting = false; util.successMsg("创建成功"); - this.$router.back(); + frame || this.$router.push(`/match?page=${this.$store.state.matchPage}`) // frame为1则表示是父页面调的,不作返回操作 }) .catch(err => { this.submiting = false; @@ -459,12 +494,14 @@ export default { }, // 预览 preview() { - this.previewVisible = true + util.local.set('match', this.form) + window.open(this.$router.resolve('/matchPreview').href) }, back() { const updateTime = this.updateTime + const { id } = this.form // 更改了信息才需要提示 - if (updateTime) { + if ((id && updateTime > 1) || (!id && updateTime)) { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { type: 'warning' }).then(() => { @@ -627,49 +664,4 @@ $upload-lg-height: 150px; font-weight: bold; } } -.match { - .l-title{ - display: flex; - align-items: center; - margin-bottom: 12px; - font-size: 18px; - color: #333; - img{ - margin-right: 5px; - } - } - .title{ - width: 67%; - margin: 0 auto; - font-size: 28px; - text-align: center; - color: #0B1D30; - } - .info .meta{ - padding: 16px 0; - font-size: 12px; - color: #999; - text-align: center; - } - .texts { - margin-bottom: 30px; - font-size: 14px; - line-height: 1.6; - text-indent: 2em; - overflow: hidden; - /deep/img{ - max-width: 100%; - } - } - .files { - li { - display: flex; - align-items: center; - margin: 10px 0; - } - .file-name { - margin-right: 10px; - } - } -} \ No newline at end of file diff --git a/src/views/match/manage/index.vue b/src/views/match/manage/index.vue index 1152a65..af9760b 100644 --- a/src/views/match/manage/index.vue +++ b/src/views/match/manage/index.vue @@ -24,7 +24,7 @@ - - \ No newline at end of file diff --git a/src/views/match/preview/index.vue b/src/views/match/preview/index.vue new file mode 100644 index 0000000..a1dd067 --- /dev/null +++ b/src/views/match/preview/index.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file diff --git a/src/views/parner/staff.vue b/src/views/parner/staff.vue index 626d984..9578c86 100644 --- a/src/views/parner/staff.vue +++ b/src/views/parner/staff.vue @@ -331,6 +331,9 @@ export default { }, // 添加部门 addOrg(node, data) { + const list = JSON.parse(JSON.stringify(this.orgList)) + this.handleOrg(list) + this.orgListDia = list this.typeForm = { id: '', parentId: data ? data.id : 1, @@ -338,7 +341,7 @@ export default { parentName: data ? data.partnerClassificationName : '', partnerClassificationName: '' } - this.orgListDia = this.orgList + this.cascaderValue = [] this.orgVisible = true }, // 编辑部门 @@ -564,7 +567,7 @@ export default { this.expireTime = `${date.getFullYear()}-${util.preZero(date.getMonth() + 1)}-${util.preZero(date.getDate())} ${util.preZero(date.getHours())}:${util.preZero(date.getMinutes())}:${util.preZero(date.getMinutes())}` this.parnerVisible = true const cur = transfer ? curRow.partnerClassificationId : this.$refs.orgTree.getCurrentKey() - const link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : '/nakadai'}/#/join?accountId=${accountId}&id=${cur || ''}${transfer ? '&admin=1' : '&isTeam=1'}` + const link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : '/backstage'}/#/join?accountId=${accountId}&id=${cur || ''}${transfer ? '&admin=1' : '&isTeam=1'}` // 生成二维码 this.link = link diff --git a/src/views/system/manageLog.vue b/src/views/system/manageLog.vue index 9c4188c..9a010d0 100644 --- a/src/views/system/manageLog.vue +++ b/src/views/system/manageLog.vue @@ -42,7 +42,7 @@
-