|
|
@@ -9,11 +9,19 @@
|
|
|
<el-button @click="clean('userMy')">all userMy</el-button>
|
|
|
<el-button @click="clean('collection')">all collection</el-button>
|
|
|
<el-button @click="clean('recommend')">all recommend</el-button>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <div>
|
|
|
+ <el-button @click="clearUserProperty">清除UserProperty</el-button>
|
|
|
+ <el-button @click="importUserProperty">导入UserProperty</el-button>
|
|
|
+ <el-button @click="clearVipPoint">清除VipPoint</el-button>
|
|
|
+ <el-button @click="importVipPoint">导入VipPoint</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import SingleUpload from '../components/SingleUpload.vue';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -34,8 +42,80 @@ export default {
|
|
|
this.loading = false;
|
|
|
this.$message.error(e.error || '失败');
|
|
|
});
|
|
|
+ },
|
|
|
+ clearUserProperty() {
|
|
|
+ this.loading = true;
|
|
|
+ this.$http
|
|
|
+ .get('/eventMgmt/clearUserProperty')
|
|
|
+ .then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('成功');
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.error || '失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clearVipPoint() {
|
|
|
+ this.loading = true;
|
|
|
+ this.$http
|
|
|
+ .get('/eventMgmt/clearVipPoint')
|
|
|
+ .then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('成功');
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.error || '失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ importUserProperty() {
|
|
|
+ const i = document.createElement('input');
|
|
|
+ i.type = 'file';
|
|
|
+ i.accept =
|
|
|
+ 'application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel';
|
|
|
+ i.onchange = () => {
|
|
|
+ console.log(i.files[0]);
|
|
|
+ const form = new FormData();
|
|
|
+ form.append('file', i.files[0]);
|
|
|
+ this.loading = true;
|
|
|
+ this.$http
|
|
|
+ .post('/eventMgmt/importUserProperty', form)
|
|
|
+ .then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('成功');
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.error || '失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ i.click();
|
|
|
+ },
|
|
|
+ importVipPoint() {
|
|
|
+ const i = document.createElement('input');
|
|
|
+ i.type = 'file';
|
|
|
+ i.accept =
|
|
|
+ 'application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel';
|
|
|
+ i.onchange = () => {
|
|
|
+ const form = new FormData();
|
|
|
+ form.append('file', i.files[0]);
|
|
|
+ this.loading = true;
|
|
|
+ this.$http
|
|
|
+ .post('/eventMgmt/importVipPoint', form)
|
|
|
+ .then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('成功');
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.error || '失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ i.click();
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ components: { SingleUpload }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
@@ -47,4 +127,4 @@ export default {
|
|
|
.el-button {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|