Browse Source

增加工作日志页面

origin/feature/monitoring
ZhaoTongYao 5 years ago
parent
commit
998cf472fa
  1. 4
      public/index.html
  2. 30
      src/views/modules/worklog/worklog.vue
  3. 10
      src/views/pages/login.vue

4
public/index.html

@ -37,24 +37,28 @@
<script>
// window.SITE_CONFIG['apiURL'] = 'http://localhost:9094/epdc-api'
window.SITE_CONFIG['apiURL'] = 'https://epdc-api-test.elinkservice.cn/epdc-api'
window.SITE_CONFIG['workLogURL'] = 'https://epdc-api-test.elinkservice.cn/plugin-wrf' //工作日志引用外链地址
</script>
<% } %>
<!-- 集成测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://219.146.91.110:9094/epdc-api'
window.SITE_CONFIG['workLogURL'] = 'https://epdc-api-test.elinkservice.cn/plugin-wrf' //工作日志引用外链地址
</script>
<% } %>
<!-- 验收测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://localhost:9094/epdc-api'
window.SITE_CONFIG['workLogURL'] = 'https://epdc-api-test.elinkservice.cn/plugin-wrf' //工作日志引用外链地址
</script>
<% } %>
<!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'https://epdc-yushan.elinkservice.cn/epdc-api'
window.SITE_CONFIG['workLogURL'] = 'https://epdc-yushan.elinkservice.cn/plugin-wrf' //工作日志引用外链地址
</script>
<% } %>
</head>

30
src/views/modules/worklog/worklog.vue

@ -0,0 +1,30 @@
<template>
<el-card class="worklog">
<iframe :src="url" class="iframe"/>
</el-card>
</template>
<script>
import Cookies from 'js-cookie'
export default {
data() {
return {
url: ''
}
},
created () {
const _token = Cookies.get('token') || localStorage.getItem('token')
const _customerId = Cookies.get('customerId') || localStorage.getItem('customerId')
this.url = `${window.SITE_CONFIG['workLogURL']}/#/NoteTaking?token=${_token}&customerId=${_customerId}`
}
}
</script>
<style lang="scss" scoped>
.worklog {
min-height: calc(calc(100vh - 50px - 38px - 30px) - 2px);
}
.iframe {
width: 100%;
min-height: calc(calc(100vh - 50px - 38px - 30px) - 2px);
}
</style>

10
src/views/pages/login.vue

@ -151,6 +151,16 @@ export default {
// localStorage
this.checkLocakStorage()
}).catch(() => { })
this.$http.get(`/api/plugins/workLog/getCustomId`)
.then(res => {
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
Cookies.set('customerId',res.data.data)
})
.catch((err) => {
console.log(err)
})
})
}, 1000, { 'leading': true, 'trailing': false }),
checkLocakStorage () {

Loading…
Cancel
Save