Przeglądaj źródła

上传任务任务要求

test
wzl 11 miesięcy temu
rodzic
commit
46e752362d
1 zmienionych plików z 21 dodań i 6 usunięć
  1. +21
    -6
      src/views/development/taskSubmission.vue

+ 21
- 6
src/views/development/taskSubmission.vue Wyświetl plik

@@ -57,7 +57,9 @@
</div>
</div>

<div class="taskDemand">任务要求</div>
<div class="taskDemand">任务要求:</div>
<div class="taskDemand">{{detail}}</div>


<input
ref="votefile"
@@ -102,7 +104,7 @@
</template>

<script>
import development from '@/api/development';
import develeopMent from '@/api/development';

export default {
components: {},
@@ -111,6 +113,7 @@ export default {
id: 1,
rankId: 1,
textarea: '',
detail:'',
subFiles: [],
only: true, // 文件是否唯一
maxFile: 3, // 最大文件数量 仅only=false时有效
@@ -143,7 +146,19 @@ export default {
}
},
methods: {
async initData() {},
async initData() {
let re = await develeopMent.TaskDetail({
id: this.id,
rankId: this.rankId
});
if (re) {
if (re.succeed) {
this.detail = re.data.require;
} else {
this.$message.error(re.message);
}
}
},
async submit() {
if (!this.subFiles.length) {
this.$toast('请选择文件');
@@ -151,7 +166,7 @@ export default {
}
this.$toast.loading({
forbidClick: true,
duration: 0,
duration: 0
});
if (this.subFiles.length) {
let re = await this.subFile();
@@ -166,7 +181,7 @@ export default {
})
);
// 提交任务
let re = await development.SubmitTask({
let re = await develeopMent.SubmitTask({
id: this.id,
uploadData: {
content: this.textarea,
@@ -200,7 +215,7 @@ export default {
let formData = new FormData();
formData.set('fileName', item.file.name);
formData.set('file', item.file);
let re = await development.UploadFile({ formData });
let re = await develeopMent.UploadFile({ formData });
if (!re || !re.succeed) {
resolve(false);
return;


Ładowanie…
Anuluj
Zapisz