|
@@ -58,7 +58,7 @@
|
|
:pagination="false"
|
|
:pagination="false"
|
|
>
|
|
>
|
|
<span slot="action" slot-scope="text, record">
|
|
<span slot="action" slot-scope="text, record">
|
|
- <a @click="handleEdit(record)">推送</a>
|
|
|
|
|
|
+ <a @click="handleEdit(record)" :disabled="record.status !== 4">推送</a>
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
<a @click="handleDelete(record)">删除</a>
|
|
<a @click="handleDelete(record)">删除</a>
|
|
</span>
|
|
</span>
|
|
@@ -101,7 +101,7 @@
|
|
:wrapper-col="wrapperCol"
|
|
:wrapper-col="wrapperCol"
|
|
>
|
|
>
|
|
<a-form-model-item label="匹配类型" prop="resource">
|
|
<a-form-model-item label="匹配类型" prop="resource">
|
|
- <a-radio-group v-model="personForm.resource">
|
|
|
|
|
|
+ <a-radio-group v-model="personForm.resource" :disabled="personResourceDisabled">
|
|
<a-radio v-for="item in mateTypeTasks" :key="item.label" :value="item.label">{{ item.value }}</a-radio>
|
|
<a-radio v-for="item in mateTypeTasks" :key="item.label" :value="item.label">{{ item.value }}</a-radio>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
@@ -109,6 +109,7 @@
|
|
<a-input
|
|
<a-input
|
|
v-model="personForm.name"
|
|
v-model="personForm.name"
|
|
placeholder="请输入人群包名称"
|
|
placeholder="请输入人群包名称"
|
|
|
|
+ :disabled="personNameDisabled"
|
|
/>
|
|
/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item label="选择账户">
|
|
<a-form-model-item label="选择账户">
|
|
@@ -123,7 +124,9 @@
|
|
>
|
|
>
|
|
<a-button><a-icon type="upload" />文件上传</a-button>
|
|
<a-button><a-icon type="upload" />文件上传</a-button>
|
|
</a-upload>
|
|
</a-upload>
|
|
- <p class="upload-txt-rules">1、文件格式:支持上传*.txt(utf-8)文本;也支持将单个/多个*.txt文件经过Zip格式压缩上传</p>
|
|
|
|
|
|
+ <p class="upload-txt-rules">
|
|
|
|
+ 1、文件格式:支持上传*.txt(utf-8)文本;也支持将单个/多个*.txt文件经过Zip格式压缩上传
|
|
|
|
+ </p>
|
|
<p class="upload-txt-rules">2、文件大小:单个文件大小不能超过1G</p>
|
|
<p class="upload-txt-rules">2、文件大小:单个文件大小不能超过1G</p>
|
|
<p class="upload-txt-rules">3、内容编排:每行一条记录</p>
|
|
<p class="upload-txt-rules">3、内容编排:每行一条记录</p>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
@@ -157,7 +160,7 @@
|
|
</div>
|
|
</div>
|
|
</a-modal>
|
|
</a-modal>
|
|
<a-modal
|
|
<a-modal
|
|
- title="相关项目"
|
|
|
|
|
|
+ title="失败原因"
|
|
v-if="causeVisible"
|
|
v-if="causeVisible"
|
|
:visible="causeVisible"
|
|
:visible="causeVisible"
|
|
:confirm-loading="causeConfirmLoading"
|
|
:confirm-loading="causeConfirmLoading"
|
|
@@ -178,7 +181,7 @@
|
|
</div>
|
|
</div>
|
|
</a-modal>
|
|
</a-modal>
|
|
<a-modal
|
|
<a-modal
|
|
- title="相关项目"
|
|
|
|
|
|
+ :title="relaxStatus === 'dep' ? '相关项目' : '相关账户'"
|
|
v-if="relaxVisible"
|
|
v-if="relaxVisible"
|
|
:visible="relaxVisible"
|
|
:visible="relaxVisible"
|
|
:confirm-loading="relaxConfirmLoading"
|
|
:confirm-loading="relaxConfirmLoading"
|
|
@@ -211,6 +214,7 @@ import TreeSelect from './components/tree-select/tree-select';
|
|
import {getAction, postAction} from '@/api/manage';
|
|
import {getAction, postAction} from '@/api/manage';
|
|
import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
|
|
import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
|
|
import AppMarketService from './crowd-control-service';
|
|
import AppMarketService from './crowd-control-service';
|
|
|
|
+import BMF from 'browser-md5-file';
|
|
|
|
|
|
let COS = require('cos-js-sdk-v5');
|
|
let COS = require('cos-js-sdk-v5');
|
|
let cos = new COS({
|
|
let cos = new COS({
|
|
@@ -226,6 +230,8 @@ export default {
|
|
data() {
|
|
data() {
|
|
let that = this;
|
|
let that = this;
|
|
return {
|
|
return {
|
|
|
|
+ personResourceDisabled: false,
|
|
|
|
+ personNameDisabled: false,
|
|
totalAllCause: 0,
|
|
totalAllCause: 0,
|
|
acountId: undefined, // 搜索的账户ID
|
|
acountId: undefined, // 搜索的账户ID
|
|
uploadAcountIds: '',
|
|
uploadAcountIds: '',
|
|
@@ -364,11 +370,12 @@ export default {
|
|
handleGetTableList(data) {
|
|
handleGetTableList(data) {
|
|
const paramsData = {
|
|
const paramsData = {
|
|
orientationName: data.name,
|
|
orientationName: data.name,
|
|
- accountName: this.acountId,
|
|
|
|
|
|
+ accountId: this.acountId,
|
|
status: data.status,
|
|
status: data.status,
|
|
pageNo: this.tablePag.page,
|
|
pageNo: this.tablePag.page,
|
|
pageSize: this.tablePag.size
|
|
pageSize: this.tablePag.size
|
|
};
|
|
};
|
|
|
|
+ this.dataSource = []
|
|
getAction('/kuaishouCrowdPack/queryPageList', paramsData).then(result => {
|
|
getAction('/kuaishouCrowdPack/queryPageList', paramsData).then(result => {
|
|
if (result.code === 200) {
|
|
if (result.code === 200) {
|
|
this.dataSource = result.result.list || [];
|
|
this.dataSource = result.result.list || [];
|
|
@@ -382,16 +389,18 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleDelete(data) {
|
|
handleDelete(data) {
|
|
|
|
+ let that = this
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '删除提示',
|
|
title: '删除提示',
|
|
content: '确定要删除这一条吗?',
|
|
content: '确定要删除这一条吗?',
|
|
onOk() {
|
|
onOk() {
|
|
getAction('/kuaishouCrowdPack/delete', {id: data.id}).then(result => {
|
|
getAction('/kuaishouCrowdPack/delete', {id: data.id}).then(result => {
|
|
if (result.code === 200) {
|
|
if (result.code === 200) {
|
|
- this.handleGetTableList({});
|
|
|
|
|
|
+ that.handleGetTableList({});
|
|
|
|
+ that.$message.success('删除成功');
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- this.$message.error(result.message);
|
|
|
|
|
|
+ that.$message.error(result.message);
|
|
}
|
|
}
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
console.log(error, 'eeee');
|
|
console.log(error, 'eeee');
|
|
@@ -471,7 +480,7 @@ export default {
|
|
handlePushSure() {
|
|
handlePushSure() {
|
|
const paramsData = {
|
|
const paramsData = {
|
|
accountIds: this.finallyRightTree.map(item => item.key),
|
|
accountIds: this.finallyRightTree.map(item => item.key),
|
|
- orientationId: this.tableSelectList.orientationId,
|
|
|
|
|
|
+ signature: this.tableSelectList.signature,
|
|
accountId: this.tableSelectList.accountId
|
|
accountId: this.tableSelectList.accountId
|
|
};
|
|
};
|
|
postAction('/kuaishouCrowdPack/accountPush', paramsData).then(result => {
|
|
postAction('/kuaishouCrowdPack/accountPush', paramsData).then(result => {
|
|
@@ -490,19 +499,34 @@ export default {
|
|
this.pushVisible = false;
|
|
this.pushVisible = false;
|
|
},
|
|
},
|
|
beforeUpload(file) {
|
|
beforeUpload(file) {
|
|
- const isZip = file.type.includes('zip') || file.type.includes('text');
|
|
|
|
- const fileOvesize = file.size > (1024 * 1024 * 1024);
|
|
|
|
- if (!isZip) {
|
|
|
|
- this.fileList = [];
|
|
|
|
- this.$message.error('只能上传zip格式的文件或者txt文件');
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- if (fileOvesize) {
|
|
|
|
- this.$message.error('文件大小不能超过1G');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
this.cosUpload(file);
|
|
this.cosUpload(file);
|
|
},
|
|
},
|
|
|
|
+ handleMd5(file) {
|
|
|
|
+ let bmf = new BMF();
|
|
|
|
+ let that = this;
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
+ bmf.md5(file, (err, md5) => {
|
|
|
|
+ getAction('/kuaishouCrowdPack/checkCrowdPackage', {signature: md5}).then(result => {
|
|
|
|
+ if (result.code === 200) {
|
|
|
|
+ that.personNameDisabled = false;
|
|
|
|
+ that.personResourceDisabled = false;
|
|
|
|
+ resolve();
|
|
|
|
+ }
|
|
|
|
+ else if (result.code === 201) {
|
|
|
|
+ that.$message.error(result.message);
|
|
|
|
+ that.personForm.name = result.result.orientationName;
|
|
|
|
+ that.personForm.resource = result.result.type;
|
|
|
|
+ that.personNameDisabled = true;
|
|
|
|
+ that.personResourceDisabled = true;
|
|
|
|
+ reject();
|
|
|
|
+ }
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ console.log(error, 'eeee');
|
|
|
|
+ reject();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
handleChange(info) {
|
|
handleChange(info) {
|
|
this.fileList = info.fileList;
|
|
this.fileList = info.fileList;
|
|
},
|
|
},
|
|
@@ -553,6 +577,17 @@ export default {
|
|
if (that.fileList.length > 1) {
|
|
if (that.fileList.length > 1) {
|
|
that.fileList = that.fileList.slice(-1);
|
|
that.fileList = that.fileList.slice(-1);
|
|
}
|
|
}
|
|
|
|
+ const isZip = file.type.includes('zip') || file.type.includes('text');
|
|
|
|
+ const fileOvesize = file.size > (1024 * 1024 * 1024);
|
|
|
|
+ if (!isZip) {
|
|
|
|
+ that.$message.error('只能上传zip格式的文件或者txt文件');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (fileOvesize) {
|
|
|
|
+ that.$message.error('文件大小不能超过1G');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ that.handleMd5(file);
|
|
}
|
|
}
|
|
);
|
|
);
|
|
},
|
|
},
|
|
@@ -580,6 +615,7 @@ export default {
|
|
this.$message.error('请上传文件');
|
|
this.$message.error('请上传文件');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ this.confirmLoading = true
|
|
this.handleUploadRuleForm();
|
|
this.handleUploadRuleForm();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -595,9 +631,17 @@ export default {
|
|
url: this.fileList[0].url
|
|
url: this.fileList[0].url
|
|
};
|
|
};
|
|
postAction('/kuaishouCrowdPack/uploadCrowdPack', paramsData).then(result => {
|
|
postAction('/kuaishouCrowdPack/uploadCrowdPack', paramsData).then(result => {
|
|
|
|
+ this.confirmLoading = false
|
|
if (result.code === 200) {
|
|
if (result.code === 200) {
|
|
this.personVisible = false;
|
|
this.personVisible = false;
|
|
|
|
+ this.personResourceDisabled = false;
|
|
|
|
+ this.personNameDisabled = false;
|
|
|
|
+ this.$message.success('上传成功');
|
|
this.handleGetTableList({});
|
|
this.handleGetTableList({});
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.personForm.name = '';
|
|
|
|
+ this.personForm.resource = '';
|
|
|
|
+ this.uploadAcountIds = undefined;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
this.$message.error(result.message);
|
|
this.$message.error(result.message);
|
|
@@ -607,9 +651,15 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleCancel() {
|
|
handleCancel() {
|
|
|
|
+ this.confirmLoading = false
|
|
this.personVisible = false;
|
|
this.personVisible = false;
|
|
|
|
+ this.personResourceDisabled = false;
|
|
|
|
+ this.personNameDisabled = false;
|
|
this.$refs.ruleForm.resetFields();
|
|
this.$refs.ruleForm.resetFields();
|
|
this.uploadAcountIds = '';
|
|
this.uploadAcountIds = '';
|
|
|
|
+ this.personForm.name = '';
|
|
|
|
+ this.personForm.resource = '';
|
|
|
|
+ this.fileList = [];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|