Browse Source

dd

shibei_master
13176889840 4 years ago
parent
commit
66215bc144
  1. 35
      src/js/store/index.js
  2. 61
      src/views/main-content.vue
  3. 10
      src/views/modules/base/resi.vue
  4. 12
      src/views/tips.vue

35
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)
})
}
}
});

61
src/views/main-content.vue

@ -70,9 +70,13 @@
</keep-alive>
</template>
<Tips v-for="item in $store.state.tipsList" :key="item" @look="handleLook(item)" />
<template v-for="(item, index) in $store.state.tipsList">
<Tips :key="item.memoId"
:info="item"
@look="handleLook(item)" @close="handleClose(item, index)" />
</template>
<el-dialog title="收货地址" :visible.sync="dialogFormVisible" :close-on-click-modal="false" append-to-body>
<el-dialog title="提示信息" :visible.sync="dialogFormVisible" :close-on-click-modal="false" append-to-body>
<el-form :model="form">
<el-form-item label="活动名称" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input>
@ -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
}
},
};

10
src/views/modules/base/resi.vue

@ -12,11 +12,12 @@
@click="handleAdd">新增</el-button>
<el-button class="diy-button--export"
size="small"
@click="handleExportModule('room')">下载人口模板</el-button>
@click="handleExportModule('room')">下载模板</el-button>
<el-upload ref="upload"
class="upload-demo"
action="uploadUlr"
:limit="1"
:accept="'.xls,xlsx'"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
@ -62,7 +63,8 @@
align="center"
:fixed="item.columnName == 'NAME' ? 'left' : false"
:show-overflow-tooltip="true"
:width="item.itemType === 'radio' ? computedWidth(item.label) : 180">
>
<!-- :width="item.itemType === 'radio' ? computedWidth(item.label) : 180" -->
<template slot-scope="scope">
<a v-if="item.columnName == 'NAME'"
class="name-a"
@ -277,7 +279,7 @@ export default {
return {
exportBtn: false,
exportBtnTitle: '导出',
importBtnTitle: '导入人员数据',
importBtnTitle: '导入',
importLoading: false,
rowVisible: false,
tableLoading: false,
@ -659,7 +661,7 @@ export default {
// this.$message.error('')
// })
this.importLoading = false
this.importBtnTitle = '导入人员数据'
this.importBtnTitle = '导入'
this.$refs.upload.clearFiles()
},
handleClick (tab, event) {

12
src/views/tips.vue

@ -3,9 +3,9 @@
<el-card class="tips-card">
<div class="tips-wr">
<div class="tips-wr-title">通知提醒</div>
<div class="tips-wr-name">工作日志</div>
<div class="tips-wr-desc">内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</div>
<div class="tips-wr-time">2022-03-15</div>
<div class="tips-wr-name">{{ info.typeName }}</div>
<div class="tips-wr-desc">{{ info.content }}</div>
<div class="tips-wr-time">{{ info.remindTime }}</div>
<div class="tips-btn">
<el-button type="text" size="small" @click="handleClose">我知道了</el-button>
<el-button class="diy-button--search" size="small" @click="handleLook">查看详情</el-button>
@ -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;

Loading…
Cancel
Save