Commit 45ed63cd authored by yaobeibei's avatar yaobeibei

merge reset

parents 6e08fd27 8d26b437
......@@ -15,9 +15,13 @@ RUN npm i --only=production --registry https://registry.npm.taobao.org
ENV SERVICE_PORT=8082
ENV PROJECT_LEVEL=production
# ENV MONGO='mongodb://mongo-adpro-ssp-v2-rs-2.localhost:1301/remarketing?replicaSet=adpro_ssp_v2_rs'
ENV MONGO='mongodb://mongo-adpro-ssp-v2-rs-1.localhost:1301,mongo-adpro-ssp-v2-rs-2.localhost:1301,mongo-adpro-ssp-v2-rs-3.localhost:1301/remarketingAgent?replicaSet=adpro_ssp_v2_rs&adpro_ssp_v2_rs=SECONDARY'
ENV MONGO_OEM='mongodb://bjwjh-admin:c9yJ2gBFkp7U6@mongo-bjwjh-rs-1.localhost:1302,mongo-bjwjh-rs-2.localhost:1302,mongo-bjwjh-rs-3.localhost:1302/oem_maitian_remarketingAgent?replicaSet=bjwjh-rs&authSource=admin'
ENV MONGO='mongodb://mongo-adpro-ssp-v2-rs-2.localhost:1301/remarketing?replicaSet=adpro_ssp_v2_rs'
# ENV MONGO='mongodb://10.11.3.123:1301,10.11.3.127:1301,10.12.1.9:1301/remarketing?replicaSet=adpro_ssp_v2_rs&adpro_ssp_v2_rs=SECONDARY'
# ENV MONGO_OEM='mongodb://bjwjh-admin:c9yJ2gBFkp7U6@mongo-bjwjh-rs-1.localhost:1302,mongo-bjwjh-rs-2.localhost:1302,mongo-bjwjh-rs-3.localhost:1302/oem_maitian_remarketingAgent?replicaSet=bjwjh-rs&authSource=admin'
ENV MONGO_OEM='mongodb://bjwjh-admin:c9yJ2gBFkp7U6@mongo-bjwjh-rs-1.localhost:1302,mongo-bjwjh-rs-2.localhost:1302,mongo-bjwjh-rs-3.localhost:1302/oem_mtty_remarketing?replicaSet=bjwjh-rs&authSource=admin'
ENV NODE_ENV='production'
EXPOSE 8082
CMD node server.js
This diff is collapsed.
......@@ -10,7 +10,9 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
proxyTable: {
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
......@@ -51,7 +53,7 @@ module.exports = {
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
/**
* Source Maps
*/
......
This diff is collapsed.
......@@ -26,9 +26,11 @@
"http": "0.0.0",
"moment": "^2.22.1",
"mongo": "^0.1.0",
"mongodb": "^3.1.0",
"node-xlsx": "^0.12.1",
"path": "^0.12.7",
"qs": "^6.5.1",
"request": "^2.87.0",
"server": "^1.0.18",
"vue": "^2.5.16",
"vue-router": "^3.0.1",
......
<template>
<el-date-picker
class="Date"
v-model="valueRange"
type="daterange"
unlink-panelss
@change="timeChange"
range-separator="至"
:start-placeholder="startTime"
:end-placeholder="endTime"
value-format='yyyy-MM-dd'
format='yyyy-MM-dd'
:picker-options="pickerOptions"
>
</el-date-picker>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
name: "DatePicker",
props: [
'startTime',
'endTime'
],
data() {
return {
valueRange: [],
pickerOptions: {
shortcuts: [
{
text: "昨天",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24);
picker.$emit("pick", [start, end]);
}
},
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
}
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
}
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
}
}
]
}
};
},
computed() {},
methods: {
timeChange() {
console.log(1)
console.log(this.valueRange)
this.$emit('timeChange', this.valueRange);
}
}
};
</script>
<style>
.Date {
display: inline-block;
vertical-align: top;
}
</style>
<template>
<el-pagination
class="pagination"
:current-page="currentPage"
:page-size="pageSize"
:page-sizes="[10, 20, 50 ,100]"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change='sizeChange'
@current-change='currentChange'
>
</el-pagination>
</template>
<script>
export default {
name: 'Pagination',
props: [
'currentPage',
'pageSize',
'total'
],
data () {
return {
}
},
methods: {
currentChange (value) {
console.log(value)
this.currentPage = value
this.$emit('currentChange', this.currentPage)
},
sizeChange (value) {
console.log(value)
this.pageSize = value
this.$emit('sizeChange', this.pageSize)
}
}
}
</script>
<style>
.pagination {
float: right;
margin-top: 20px;
}
</style>
This diff is collapsed.
<template>
<el-container>
<el-header>
<h4>url审核</h4>
</el-header>
<el-main>
<el-row type="flex" justify="space-between" style="margin-bottom: 10px">
<el-col :span="8">
<DatePicker :startTime='startTime' :endTime='endTime' @timeChange='timeChange'></DatePicker>
</el-col>
<el-col :span="4"><Drop @dropChange='dropChange' :chooseArray='chooseArray'></Drop></el-col>
</el-row>
<el-table :data="datas" border style="width:100%">
<el-table-column label="序号" type="index" style='width: 60px'></el-table-column>
<el-table-column v-for="(value, key) in tables" :label="value" :prop="key"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size='mini' type="text" :disabled="scope.row.status !== '未审核'" @click="check(scope, 2)">通过</el-button>
<el-button size='mini' type="text" :disabled="scope.row.status !== '未审核'" @click="check(scope, 1)">拒绝</el-button>
<el-button type='text' @click='check(scope, 8)' icon='el-icon-refresh'></el-button>
</template>
</el-table-column>
</el-table>
<Pagination :currentPage='currentPage' :pageSize='pageSize' :total='total' @sizeChange='sizeChange' @currentChange='currentChange'></Pagination>
</el-main>
</el-container>
</template>
<script>
import DatePicker from './DatePicker'
import Pagination from './Pagination'
import Drop from './dropDown'
import moment from 'moment'
import { mapActions, mapGetters } from 'vuex'
export default {
name: 'checkUrl',
components: {
DatePicker,
Pagination,
Drop
},
data () {
return {
url: '/api/getUrlData',
tables: {
slotId: 'ID',
email: '账户名称',
company: '公司名称',
slotName: 'Url名称',
slot: 'Url位置',
time: 'Url创建时间',
status: 'Url状态'
},
chooseArray: {
'全部状态': '全部状态',
'未审核': '未审核',
'已拒绝': '已拒绝',
'已通过': '已通过'
},
datas: null,
currentPage: 1,
pageSize: 10,
total: 1000,
startTime: null,
endTime: null,
status: '未审核'
}
},
mounted () {
this.getTime()
this.getData({
url: this.url,
choose: {
startTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageSize,
currentPage: this.currentPage,
status: this.status
},
callback: this.formatData
})
},
methods: {
...mapActions({
getData: 'GET_DATA',
send: 'SEND'
}),
check (scope, status){
this.send({
url: '/api/checkUrl',
choose: {
slotId: scope.row.slotId,
status: status
},
callback: (err, data) => {
if (data.status === 700) {
this.$message({
message: data.message,
type: 'error'
})
}
if (data.status === 200) {
switch(status) {
case 1: scope.row.status = '已拒绝'; break;
case 2: scope.row.status = '已通过'; break;
case 8: scope.row.status = '未审核'; break;
default: scope.row.status = '未审核';
}
this.$message({
message: data.message,
type: 'success'
})
}
}
})
},
getTime () {
this.endTime = moment().format('YYYY-MM-DD')
this.startTime = moment().subtract(7, 'days').format('YYYY-MM-DD')
},
sizechange (value) {
console.log(value)
this.pageSize = value
this.getData({
url: this.url,
choose: {
startTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageSize,
currentPage: this.currentPage,
status: this.status
},
callback: this.formatData
})
},
currentPage (value) {
console.log(value)
this.currentPage = value
this.getData({
url: this.url,
choose: {
startTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageSize,
currentPage: this.currentPage,
status: this.status
},
callback: this.formatData
})
},
dropChange (value) {
console.log(value)
this.status = value
this.getData({
url: this.url,
choose: {
startTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageSize,
currentPage: this.currentPage,
status: this.status
},
callback: this.formatData
})
},
timeChange (value) {
console.log(2)
console.log(value)
this.startTime = value[0]
this.endTime = value[1]
this.getData({
url: this.url,
choose: {
startTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageSize,
currentPage: this.currentPage,
status: this.status
},
callback: this.formatData
})
},
formatData (err, data) {
if (err) {
return console.log(err)
}
console.log(data)
this.datas = data.datas
if (data.total <= 1000) {
this.total = data.total
}
}
}
}
</script>
<style>
</style>
<template>
<el-dropdown style='float: right' @command='handleCommand'>
<el-button class="el-dropdown-link">
{{choose}}<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(value, key) in chooseArray" :command='key'>{{value}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
export default {
name: 'Drop',
props: [
'chooseArray'
],
data () {
return {
choose: '状态选择'
}
},
methods: {
handleCommand (value) {
console.log(value)
this.$emit('dropChange', value)
}
}
}
</script>
<style>
.el-dropdown {
vertical-align: top;
}
.el-dropdown + .el-dropdown {
margin-left: 15px;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>
......@@ -80,6 +80,9 @@
<el-menu-item index='/checkNote' @click="routeTo">
短信审核
</el-menu-item>
<el-menu-item index='/checkUrl' @click="routeTo">
Url审核
</el-menu-item>
</el-submenu>
<el-submenu index=5>
......
......@@ -18,6 +18,8 @@ import leadPoolTask from '@/components/leadPoolTask'
import exportPoolTask from '@/components/exportPoolTask'
import agent from '@/components/agent'
import welcome from '@/components/welcome'
import checkUrl from '@/components/checkUrl'
Vue.use(Router)
......@@ -44,7 +46,8 @@ export default new Router({
{name: 'leadPoolTask', path: '/leadPoolTask', meta: {requiresId: false}, component: leadPoolTask},
{name: 'exportPoolTask', path: '/exportPoolTask', meta: {requiresId: false}, component: exportPoolTask},
{name: 'distributor', path: '/distributor', meta: {requiresId: false}, component: distributor},
{name: 'agent', path: '/agent', meta: {requiresId: false}, component: agent}
{name: 'agent', path: '/agent', meta: {requiresId: false}, component: agent},
{name: 'checkUrl', path: '/checkUrl', meta: {requiresId: false}, component: checkUrl},
]
},
{
......
const type = {
GET_DATA: 'GET_DATA',
SEND: 'SEND',
GET_EMAIL: 'GET_EMAIL'
}
const state = {
datas: [],
allDatas: [],
emails: []
}
const getters = {
getDatas () {
return state.datas
},
getAccount () {
return state.emails
}
}
const mutations = {
[type.GET_DATA] (state, data) {
state.datas = data
},
[type.GET_EMAIL] (state, data) {
state.emails = data
}
}
const actions = {
[type.GET_DATA] ({commit}, {url, choose, callback}) {
console.log(url, choose)
fetch(url, {
method: 'POST',
headers: {'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify(choose)
}).then(res => {
return res.json()
}).then(data => {
commit(type.GET_DATA, data)
callback(null, data)
}).catch(err => {
callback(err, null)
})
},
[type.SEND] ({commit}, {url, choose, callback}) {
console.log(url, choose)
fetch(url, {
method: 'POST',
headers: {'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify(choose)
}).then(res => {
return res.json()
}).then(data => {
console.log(data)
callback(null, data)
}).catch(err => {
console.log(err)
callback(err, null)
})
},
[type.GET_EMAIL] ({commit}) {
fetch('/api/getEmail', {
method: 'POST',
headers: {'Content-Type': 'application/json;charset=UTF-8'},
body: null
}).then(res => {
return res.json()
}).then(data => {
console.log(data)
commit(type.GET_EMAIL, data.emailArr)
}).catch(err => {
return console.log(err)
})
}
}
export default {
state,
getters,
mutations,
actions
}
import Vue from 'vue'
import vuex from 'vuex'
import dataList from './dataList'
import data from './data'
import login from './login'
......@@ -8,7 +8,7 @@ Vue.use(vuex)
export default new vuex.Store({
modules: {
dataList,
data,
login
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment