|
@@ -29,7 +29,7 @@ export default {
|
|
|
data: () => ({
|
|
|
input: '',
|
|
|
info: {},
|
|
|
- jobsList: [{}],
|
|
|
+ jobsList: [],
|
|
|
}),
|
|
|
created() {
|
|
|
if (this.$route.query.id) {
|
|
@@ -38,15 +38,25 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- ...mapActions(['jobinfoOperation']),
|
|
|
+ ...mapActions(['jobinfoOperation', 'postsOperation']),
|
|
|
async search() {
|
|
|
let result = await this.jobinfoOperation({ type: 'search', data: { id: this.$route.query.id } });
|
|
|
if (`${result.errcode}` === '0') {
|
|
|
this.$set(this, `info`, result.data);
|
|
|
+ await this.searchJobs();
|
|
|
} else {
|
|
|
this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
}
|
|
|
},
|
|
|
+ async searchJobs() {
|
|
|
+ let jobIds = JSON.parse(JSON.stringify(this.info.jobs));
|
|
|
+ for (const item of jobIds) {
|
|
|
+ let result = await this.postsOperation({ type: 'search', data: { id: item } });
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
+ this.jobsList.push(result.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|