From d351b0f396cc5d5460fb8ea5c5c19fbe66cdf6b7 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Wed, 16 Mar 2022 14:34:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/store/index.js | 2 +- src/views/main-content.vue | 54 +++++++++++++++++++++ src/views/tips.vue | 97 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 src/views/tips.vue diff --git a/src/js/store/index.js b/src/js/store/index.js index 483238a6..a803ca87 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -37,7 +37,7 @@ export default new Vuex.Store({ menuList: [], activeName: "", }, - + tipsList: [], inIframe: window.self !== window.top, }, modules: { diff --git a/src/views/main-content.vue b/src/views/main-content.vue index 08c7e249..5ce37b09 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -69,18 +69,48 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tips.vue b/src/views/tips.vue new file mode 100644 index 00000000..7e1092b3 --- /dev/null +++ b/src/views/tips.vue @@ -0,0 +1,97 @@ + + + + + \ No newline at end of file From 2bf2d2a06b99882f66163014ec957cf776af272e Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Wed, 16 Mar 2022 16:46:24 +0800 Subject: [PATCH 2/3] ssdfsf --- src/assets/scss/c/config.scss | 2 +- src/assets/scss/c/function.scss | 15 +- .../scss/modules/shujirizhi-notice.scss | 62 +++ src/views/main.vue | 44 ++- .../modules/secretaryLog/cpts/notice.vue | 360 ++++-------------- 5 files changed, 167 insertions(+), 316 deletions(-) create mode 100644 src/assets/scss/modules/shujirizhi-notice.scss diff --git a/src/assets/scss/c/config.scss b/src/assets/scss/c/config.scss index e3555368..10221912 100644 --- a/src/assets/scss/c/config.scss +++ b/src/assets/scss/c/config.scss @@ -11,7 +11,7 @@ $w1: 1200px; //网站主色 primary color bgcolor $c1: #ff4c52; // 红 dd000f -$c2: #3b7cff; +$c2: #3e8ef7; //灰度色 用于字体 $fc0: #010033; diff --git a/src/assets/scss/c/function.scss b/src/assets/scss/c/function.scss index 90fb9dae..74b02097 100644 --- a/src/assets/scss/c/function.scss +++ b/src/assets/scss/c/function.scss @@ -87,6 +87,15 @@ text-overflow: ellipsis; word-wrap: normal; } + +// 强制文本换行 多行 +@mixin toeM($num) { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: $num; + -webkit-box-orient: vertical; +} // 图片居中 @mixin img_hub { position: absolute; @@ -206,7 +215,7 @@ } //党员积分排行榜 @mixin img123 { - width:20px; + width: 20px; height: 20px; border-radius: 50%; position: absolute; @@ -225,7 +234,7 @@ width: 67.15px; height: 67.15px; position: absolute; - display: block; + display: block; top: 4px; border-radius: 100%; } @@ -258,11 +267,9 @@ display: block; z-index: 10; margin-top: 40px; - } @mixin list { list-style-type: none; position: absolute; padding: 0px; } - diff --git a/src/assets/scss/modules/shujirizhi-notice.scss b/src/assets/scss/modules/shujirizhi-notice.scss new file mode 100644 index 00000000..8d717a03 --- /dev/null +++ b/src/assets/scss/modules/shujirizhi-notice.scss @@ -0,0 +1,62 @@ +@import "../c/anime"; +@import "../c/config"; +@import "../c/function"; + +.m-notice { + position: fixed; + z-index: 10000; + bottom: 0; + right: 0; + background-color: #fff; + box-shadow: 0 0 10px 0 rgba(#000, 0.1); + width: 500px; + height: 300px; + box-sizing: border-box; + padding: 25px; + + .header { + margin-bottom: 20px; + font-size: 24px; + font-weight: bold; + color: #3e8ef7; + } + .type { + margin-bottom: 10px; + font-size: 20px; + font-weight: bold; + color: #333; + } + .content { + @include toeM(2); + margin-bottom: 10px; + font-size: 16px; + color: #333; + line-height: 30px; + } + .date { + margin-bottom: 30px; + font-size: 16px; + color: #999; + line-height: 30px; + } + .operate { + display: flex; + justify-content: space-around; + + .btn { + box-sizing: border-box; + padding: 0 20px; + width: 180px; + text-align: center; + font-size: 20px; + color: #3e8ef7; + line-height: 40px; + cursor: pointer; + + &.z-stress { + background-color: #3e8ef7; + color: #fff; + } + } + } +} diff --git a/src/views/main.vue b/src/views/main.vue index 9ecf523e..479c782f 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -1,24 +1,30 @@ @@ -28,16 +34,17 @@ import MainNavbar from "./main-navbar"; import MainSidebar from "./main-sidebar"; import MainContent from "./main-content"; import MainThemeTools from "./main-theme-tools"; +import SecretaryLogNotice from "./modules/secretaryLog/cpts/notice"; import debounce from "lodash/debounce"; import { mapGetters } from "vuex"; import nextTick from "dai-js/tools/nextTick"; import { requestPost } from "@/js/dai/request"; export default { - provide () { + provide() { return { // 刷新 - refresh () { + refresh() { this.$store.state.contentIsNeedRefresh = true; this.$nextTick(() => { this.$store.state.contentIsNeedRefresh = false; @@ -45,7 +52,7 @@ export default { }, }; }, - data () { + data() { return { loading: true, userType: localStorage.getItem("userType"), @@ -56,12 +63,13 @@ export default { MainSidebar, MainContent, MainThemeTools, + SecretaryLogNotice, }, watch: { $route: "routeHandle", }, - async created () { + async created() { this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"]; console.log(this.$store.state.sidebarMenuList); @@ -73,11 +81,11 @@ export default { }, computed: {}, methods: { - changeCustomerName (customerName) { + changeCustomerName(customerName) { this.$refs["ref_navbar"].changeCustomerName(customerName); }, // 窗口改变大小 - windowResizeHandle () { + windowResizeHandle() { this.$store.state.sidebarFold = document.documentElement["clientWidth"] <= 992 || false; window.addEventListener( @@ -89,7 +97,7 @@ export default { ); }, // 路由, 监听 - routeHandle (route) { + routeHandle(route) { if (!route.meta.isTab) { return false; } @@ -112,7 +120,7 @@ export default { this.$store.state.contentTabsActiveName = tab.name; this.syncLevelOneMenuActive(tab.menuId); }, - async syncLevelOneMenuActive (menuId) { + async syncLevelOneMenuActive(menuId) { await nextTick(); console.log( "*******************************", @@ -135,7 +143,7 @@ export default { idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : []; }, // 获取当前管理员信息 - async getWorkUserInfo () { + async getWorkUserInfo() { const url = "/epmetuser/customerstaff/staffbasicinfo"; let params = {}; const { data, code, msg } = await requestPost(url, params); diff --git a/src/views/modules/secretaryLog/cpts/notice.vue b/src/views/modules/secretaryLog/cpts/notice.vue index 6ddb547a..5fd0960f 100644 --- a/src/views/modules/secretaryLog/cpts/notice.vue +++ b/src/views/modules/secretaryLog/cpts/notice.vue @@ -1,6 +1,13 @@ @@ -9,320 +16,87 @@ import { requestPost } from "@/js/dai/request2"; import nextTick from "dai-js/tools/nextTick"; export default { - components: { }, + components: {}, data() { return { - agencyId: "", - - tableData: [], - - currentIndex: 0, + displayed: false, + + lastTime: 0, + + list: [ + { + memoId: "1", + type: "work_diary", + typeName: "工作日志", + content: + "提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容提醒内容", + remindTime: "2022-02-22 22:22", + }, + ], }; }, - computed: { - }, + computed: {}, watch: { - currentIndex() { - }, + currentIndex() {}, }, async mounted() { - await this.loadAgency(); - await this.getTableData(); + this.poll(); }, methods: { - async handleDel() { - if (!confirm("删除后不可恢复,确定删除?")) return; - - const item = this.tableData[this.currentIndex]; - const url = "/gov/org/icpartyservicecenter/del"; - - const { data, code, msg } = await requestPost(url, [ - item.partyServiceCenterId, - ]); + async poll() { + let nowTime = new Date().getTime(); + if (nowTime - this.lastTime > 60 * 1000) { + this.lastTime = nowTime; + this.getList(); + } + await nextTick(1000); + this.poll(); + }, - if (code === 0) { - this.$message.success("删除成功!"); - this.getTableData(); + checkInfo() { + const { memoId, type } = this.list[0]; + if (type == "work_diary") { + this.$router.push({ + path: `/main/visual-basicinfo-people/${uid}`, + }); + } else if (type == "concern") { + } else if (type == "difficulty") { } + + this.read(); }, - async getTableData() { - const oldLen = this.tableData.length; - const url = "/gov/org/icpartyservicecenter/partyservicecenterlist"; + async read() { + const item = this.list[0]; + const url = "/gov/project/memoAttr/setReaded"; + const { data, code, msg } = await requestPost(url, { - orgId: this.agencyId, - orgType: "agency", + memoId: item.memoId, }); - if (code === 0) { - console.log("列表请求成功!!!!!!!!!!!!!!"); - this.tableData = data; - - if (data.length > 0 && oldLen == 0) { - await nextTick(100); - this.initMap(); - this.setMap(); - } + if (code === 0) { + // this.$message.success("删除成功!"); + this.displayed = false; + this.getList(); } }, - //加载组织 - async loadAgency() { - const url = "/epmetuser/customerstaff/staffbasicinfo"; - let params = {}; - - const { data, code, msg } = await requestPost(url, params); - + async getList() { + const url = "/gov/project/memoAttr/memosToRemind"; + const { data, code, msg } = await requestPost(url, {}); if (code === 0) { - this.agencyId = data.agencyId; + console.log("列表请求成功!!!!!!!!!!!!!!"); + this.displayed = true; + this.lastTime = new Date().getTime(); + // this.list = data; } }, }, }; - + From 66215bc144895946d9f2ac9adc13da185f21b1ee Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Wed, 16 Mar 2022 16:54:21 +0800 Subject: [PATCH 3/3] dd --- src/js/store/index.js | 35 +++++++++++++++++++ src/views/main-content.vue | 61 ++++++++++++++++++++++++++------- src/views/modules/base/resi.vue | 10 +++--- src/views/tips.vue | 12 +++++-- 4 files changed, 99 insertions(+), 19 deletions(-) diff --git a/src/js/store/index.js b/src/js/store/index.js index a803ca87..7dfbb567 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -4,6 +4,7 @@ import cloneDeep from "lodash/cloneDeep"; import user from "./modules/user"; import app from "./modules/app"; import tagsView from "./modules/tagsView"; +import { requestPost } from "@/js/dai/request"; Vue.use(Vuex); @@ -38,6 +39,7 @@ export default new Vuex.Store({ activeName: "", }, tipsList: [], + tipsTime: [], inIframe: window.self !== window.top, }, modules: { @@ -52,5 +54,38 @@ export default new Vuex.Store({ state[key] = cloneDeep(window.SITE_CONFIG["storeState"][key]); }); }, + SET_TIPS_LIST(state, tipsList) { + let _list = state.tipsList + state.tipsList = _list.concat(tipsList) + }, + SET_TIPS_TIME(state, time) { + state.tipsTime = time + } }, + actions: { + setTipsList({ commit }, time) { + return new Promise(async (resolve, reject) => { + const url = '/gov/project/memoAttr/memosToRemind' + const params = { + remindTime: time || '' + } + const { data, code, msg } = await requestPost(url, params) + if (code === 0) { + commit('SET_TIPS_LIST', data) + resolve() + } else reject(msg) + }) + }, + setTipsTime({ commit }) { + return new Promise(async (resolve, reject) => { + const url = '/gov/project/memoAttr/memoTime' + + const { data, code, msg } = await requestPost(url) + if (code === 0) { + commit('SET_TIPS_TIME', data) + resolve() + } else reject(msg) + }) + } + } }); diff --git a/src/views/main-content.vue b/src/views/main-content.vue index 5ce37b09..c691d133 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -70,9 +70,13 @@ - + - + @@ -96,6 +100,7 @@ import { isURL } from "@/utils/validate"; import Cookie from "js-cookie"; import Tips from './tips.vue' +import { requestPost } from "@/js/dai/request"; export default { components: { Tips @@ -120,7 +125,7 @@ export default { this.token = localStorage.getItem("token"); this.customerId = localStorage.getItem("customerId"); - // this.loopTips() + this.loopTips() }, methods: { changeCustomerName(customerName) { @@ -207,17 +212,49 @@ export default { iframe.postMessage({ name: "lalalal" }, "*"); }, loopTips() { - let id = 1 - this.timer = setInterval(() => { - id = id + 1 - if (id == 5) clearInterval(this.timer) - this.tipsList.push(id) - console.log('id------0', id) - }, 1000) + this.$store.dispatch('setTipsList') + this.$store.dispatch('setTipsTime') + // let id = 1 + // this.timer = setInterval(() => { + // id = id + 1 + // if (id == 5) clearInterval(this.timer) + // this.tipsList.push(id) + // console.log('id------0', id) + // }, 1000) + }, + async closeTips(memoId) { + const url = '/gov/project/memoAttr/setReaded' + const params = { + memoId + } + const { data, code, msg } = await requestPost(url, params) + if (code != 0) this.$message.error(msg) + }, + async getInfo(item) { + const urls = { + work_diary: '/gov/project/memoWorkDiary', + concern: '/gov/project/memoConcern', + difficulty: '/gov/project/memoDifficulty/detail' + } + const params = { + id: item.memoId, + readFlag: 0 + } + const { data, code, msg } = await requestPost(urls[item.type], params) + if (code == 0) { + this.form = { ...data } + } else this.$message.error(msg) + }, + handleClose(item, index) { + console.log('close-----', item) + this.$store.state.tipsList.splice(index, 1) + this.closeTips(item.memoId) }, - handleLook(id) { - console.log('look-----', id) + async handleLook(item) { + console.log('look-----', item) + await this.getInfo(item) this.dialogFormVisible = true + } }, }; diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 2d9d49cf..63dce11e 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -12,11 +12,12 @@ @click="handleAdd">新增 下载人口模板 + @click="handleExportModule('room')">下载模板 + > +