Bläddra i källkod

上传任务任务要求

test
wzl 1 år sedan
förälder
incheckning
46e752362d
1 ändrade filer med 21 tillägg och 6 borttagningar
  1. +21
    -6
      src/views/development/taskSubmission.vue

+ 21
- 6
src/views/development/taskSubmission.vue Visa fil

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


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



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


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


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


Laddar…
Avbryt
Spara