zx 3 years ago
parent bd1fe2ad7a
commit bbcaac1f9b

@ -51,13 +51,16 @@ export default defineComponent({
maxValue maxValue
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi() this.getApi()
}, },
methods: { methods: {
getApi() { getApi() {
if(this.$route.params.id) { if(this.$route.query.id) {
this.proxy.$post("/rewardRuleTemplate/detail", {id: this.$route.params.id}).then(res => { this.proxy.$post("/rewardRuleTemplate/detail", {id: this.$route.query.id}).then(res => {
this.form.title = res.data.title; this.form.title = res.data.title;
let arr = []; let arr = [];
res.data.ruleList.forEach(ele => { res.data.ruleList.forEach(ele => {
@ -75,8 +78,8 @@ export default defineComponent({
this.form.rewardRuleList = [{limitNum: 0, reward: 0}] this.form.rewardRuleList = [{limitNum: 0, reward: 0}]
}, },
confirm() { confirm() {
if(this.$route.params.id) { if(this.$route.query.id) {
let obj = Object.assign(this.form, {id: this.$route.params.id}) let obj = Object.assign(this.form, {id: this.$route.query.id})
this.proxy.$post("/rewardRuleTemplate/upd", obj).then(res => { this.proxy.$post("/rewardRuleTemplate/upd", obj).then(res => {
this.$message.success(res.data) this.$message.success(res.data)
this.$router.go(-1); this.$router.go(-1);

@ -103,7 +103,7 @@ export default defineComponent({
}, },
handlerEdit(value) { handlerEdit(value) {
this.$router.push({name: 'AddReward', params:{id:value}}) this.$router.push({name: 'AddReward', query:{id:value}})
}, },
goAdd() { goAdd() {
this.$router.push({name: 'AddReward'}) this.$router.push({name: 'AddReward'})

@ -84,6 +84,9 @@ export default defineComponent({
activeId activeId
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi() this.getApi()
}, },

@ -83,6 +83,9 @@ export default defineComponent({
activeId activeId
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi() this.getApi()
}, },
@ -113,12 +116,14 @@ export default defineComponent({
if(this.$route.params.id) { if(this.$route.params.id) {
let obj = Object.assign(this.form, {id: this.$route.params.id}) let obj = Object.assign(this.form, {id: this.$route.params.id})
this.proxy.$post("/reference/upd", obj).then(res => { this.proxy.$post("/reference/upd", obj).then(res => {
this.$message.success(res.data) this.$message.success(res.data);
this.form.fileUrlList = [];
this.$router.go(-1); this.$router.go(-1);
}).catch(() => {}); }).catch(() => {});
} else { } else {
this.proxy.$post("/reference/add", this.form).then(res => { this.proxy.$post("/reference/add", this.form).then(res => {
this.$message.success(res.data) this.$message.success(res.data);
this.form.fileUrlList = [];
this.$router.go(-1); this.$router.go(-1);
}).catch(() => {}); }).catch(() => {});
} }

@ -174,6 +174,9 @@ export default defineComponent({
activeId activeId
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi(); this.getApi();
}, },

@ -204,6 +204,9 @@ export default defineComponent({
activeId activeId
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi(); this.getApi();
}, },

@ -73,6 +73,9 @@ export default defineComponent({
activeId activeId
} }
}, },
activated() {
this.getApi();
},
created() { created() {
this.getApi(); this.getApi();
}, },

@ -91,6 +91,9 @@ export default defineComponent({
editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi(); this.getApi();
}, },

@ -123,6 +123,9 @@ export default defineComponent({
editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi(); this.getApi();
}, },

@ -116,6 +116,9 @@ export default defineComponent({
editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated editorRef, mode: 'simple', toolbarConfig, editorConfig, handleCreated
} }
}, },
activated() {
this.getApi();
},
mounted() { mounted() {
this.getApi(); this.getApi();
}, },

Loading…
Cancel
Save