- 弹窗提示
+
+
+
{{ list[0].typeName }}
+
{{ list[0].content }}
+
{{ list[0].remindTime }}
+
@@ -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')">下载模板
+ >
+
通知提醒
-
工作日志
-
内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容
-
2022-03-15
+
{{ info.typeName }}
+
{{ info.content }}
+
{{ info.remindTime }}
我知道了
查看详情
@@ -21,6 +21,10 @@ export default {
show: {
type: Boolean,
default: true
+ },
+ info: {
+ type: Object,
+ default: () => {}
}
},
data() {
@@ -34,6 +38,7 @@ export default {
methods: {
handleClose() {
this.showTips = false
+ this.$emit('close')
},
handleLook() {
this.$emit('look')
@@ -64,6 +69,7 @@ export default {
}
.tips-wr-desc {
width: 100%;
+ height: 33px;
margin-top: 10px;
padding-left: 20px;
display: -webkit-box;