|
@@ -22,13 +22,15 @@
|
|
|
</div> -->
|
|
</div> -->
|
|
|
<el-table :data="tableData" border @sort-change="sortChange" @selection-change="handleSelectionChange">
|
|
<el-table :data="tableData" border @sort-change="sortChange" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column type="selection" width="55" />
|
|
|
- <el-table-column align="left" label="任务ID" min-width="60" prop="task_id" sortable="custom" />
|
|
|
|
|
|
|
+ <el-table-column align="left" label="任务ID" min-width="60" prop="task_id" />
|
|
|
<el-table-column align="left" label="任务名称" min-width="60" prop="task_name" sortable="custom" />
|
|
<el-table-column align="left" label="任务名称" min-width="60" prop="task_name" sortable="custom" />
|
|
|
<el-table-column align="left" label="负责人" min-width="60" prop="user" sortable="custom" />
|
|
<el-table-column align="left" label="负责人" min-width="60" prop="user" sortable="custom" />
|
|
|
- <el-table-column align="left" label="游戏名称" min-width="80" prop="game_name" sortable="custom" />
|
|
|
|
|
|
|
+ <!-- <el-table-column align="left" label="游戏名称" min-width="80" prop="game_name" sortable="custom" /> -->
|
|
|
|
|
+ <el-table-column align="left" label="加币通知" min-width="80" prop="add_fee_notice" />
|
|
|
<el-table-column align="left" fixed="right" label="操作" width="140">
|
|
<el-table-column align="left" fixed="right" label="操作" width="140">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-button icon="edit" size="small" type="primary" link @click="uploadFunc(scope.row)">上传</el-button>
|
|
<el-button icon="edit" size="small" type="primary" link @click="uploadFunc(scope.row)">上传</el-button>
|
|
|
|
|
+ <el-button icon="edit" size="small" type="primary" link @click="configurationFunc(scope.row)">配置</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -46,7 +48,8 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="负责人">
|
|
<el-form-item label="负责人">
|
|
|
<el-select v-model="form.responsible_person" placeholder="负责人">
|
|
<el-select v-model="form.responsible_person" placeholder="负责人">
|
|
|
- <el-option v-for="item in ResponsiblePerson" :key="item.id" :label="item.name" :value="item.name" :disabled="true"/>
|
|
|
|
|
|
|
+ <el-option v-for="item in ResponsiblePerson" :key="item.id" :label="item.name" :value="item.name"
|
|
|
|
|
+ :disabled="true" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="上传文件" prop="file">
|
|
<el-form-item label="上传文件" prop="file">
|
|
@@ -54,17 +57,44 @@
|
|
|
:on-exceed="handleExceed" :on-remove="handleRemove" :on-change="handleChange" :file-list="fileList.data"
|
|
:on-exceed="handleExceed" :on-remove="handleRemove" :on-change="handleChange" :file-list="fileList.data"
|
|
|
:http-request="httpRequest" :data="form" :auto-upload="false" name="annexFile" style="width: 500px;">
|
|
:http-request="httpRequest" :data="form" :auto-upload="false" name="annexFile" style="width: 500px;">
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
- <el-text style="color:red;margin-left: 10px;font-size: larger;" class="mx-1" type="danger">{{ message }}</el-text>
|
|
|
|
|
|
|
+ <el-text style="color:red;margin-left: 10px;font-size: larger;" class="mx-1" type="danger">{{ message
|
|
|
|
|
+ }}</el-text>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="submitUpload" v-loading.fullscreen.lock="fullscreenLoading">立即创建</el-button>
|
|
<el-button type="primary" @click="submitUpload" v-loading.fullscreen.lock="fullscreenLoading">立即创建</el-button>
|
|
|
- <el-button @click="resetForm()">重置</el-button>
|
|
|
|
|
|
|
+ <el-button @click="resetUploadForm()">重置</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
+ <el-dialog v-model="dialogConfFormVisible" custom-class="conf-dialog" :before-close="closeConfDialog"
|
|
|
|
|
+ :title="dialogTitle" :show-close="false" :close-on-press-escape="false" :close-on-click-modal="false">
|
|
|
|
|
+ <div style="height:60vh;overflow:auto;padding:0 12px;">
|
|
|
|
|
+ <el-form ref="taskForm" :rules="confRules" :model="confForm" label-width="80px">
|
|
|
|
|
+ <el-form-item label="任务id" prop="task_id">
|
|
|
|
|
+ <el-input type="textarea" v-model="confForm.task_id" style="width:500px;" :disabled="true"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="负责人">
|
|
|
|
|
+ <el-select v-model="confForm.user" placeholder="负责人">
|
|
|
|
|
+ <el-option v-for="item in ResponsiblePerson" :key="item.id" :label="item.name" :value="item.name"
|
|
|
|
|
+ :disabled="true" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="加币通知" prop="add_fee_notice">
|
|
|
|
|
+ <!-- <el-input type="number" v-model="confForm.add_notice" style="width:500px;"></el-input> -->
|
|
|
|
|
+ <el-input-number v-model="confForm.add_fee_notice" :min="0" placeholder="0" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button size="small" @click="closeConfDialog">取 消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -78,8 +108,9 @@ export default {
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
addFileUpdate,
|
|
addFileUpdate,
|
|
|
- getGameTaskList,
|
|
|
|
|
-} from '@/api/upload'
|
|
|
|
|
|
|
+ getUsedGameTaskList,
|
|
|
|
|
+ addFeeNotice
|
|
|
|
|
+} from '@/api/taskConf'
|
|
|
import {
|
|
import {
|
|
|
selectResponsiblePerson,
|
|
selectResponsiblePerson,
|
|
|
} from '@/api/responsiblePerson'
|
|
} from '@/api/responsiblePerson'
|
|
@@ -136,6 +167,7 @@ const onReset = () => {
|
|
|
task_id: 0,
|
|
task_id: 0,
|
|
|
user: "",
|
|
user: "",
|
|
|
}
|
|
}
|
|
|
|
|
+ getTableData()
|
|
|
}
|
|
}
|
|
|
// 搜索
|
|
// 搜索
|
|
|
const onSubmit = () => {
|
|
const onSubmit = () => {
|
|
@@ -168,7 +200,7 @@ const sortChange = ({ prop, order }) => {
|
|
|
|
|
|
|
|
// 查询
|
|
// 查询
|
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
|
- const table = await getGameTaskList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
|
|
|
|
|
|
|
+ const table = await getUsedGameTaskList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
|
|
|
if (table.code === 0) {
|
|
if (table.code === 0) {
|
|
|
tableData.value = table.data.list
|
|
tableData.value = table.data.list
|
|
|
total.value = table.data.total
|
|
total.value = table.data.total
|
|
@@ -189,17 +221,6 @@ const handleSelectionChange = (val) => {
|
|
|
apis.value = val
|
|
apis.value = val
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 弹窗相关
|
|
|
|
|
-const initForm = () => {
|
|
|
|
|
-
|
|
|
|
|
- uploadForm.value.resetFields()
|
|
|
|
|
- upload.value!.clearFiles()
|
|
|
|
|
- form.value = {
|
|
|
|
|
- task_id: '',//游戏id
|
|
|
|
|
- responsible_person: '',
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const uploadFunc = async (row) => {
|
|
const uploadFunc = async (row) => {
|
|
|
// const res = await getGameTaskById({ id: row.task_id })
|
|
// const res = await getGameTaskById({ id: row.task_id })
|
|
|
form.value.task_id = row.task_id
|
|
form.value.task_id = row.task_id
|
|
@@ -207,31 +228,59 @@ const uploadFunc = async (row) => {
|
|
|
openDialog('upload')
|
|
openDialog('upload')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const configurationFunc = async (row) => {
|
|
|
|
|
+ // const res = await getGameTaskById({ id: row.task_id })
|
|
|
|
|
+ confForm.value.task_id = row.task_id
|
|
|
|
|
+ confForm.value.user = row.user
|
|
|
|
|
+ confForm.value.add_fee_notice = row.add_fee_notice
|
|
|
|
|
+ openDialog('conf')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const dialogTitle = ref('新增')
|
|
const dialogTitle = ref('新增')
|
|
|
const dialogFormVisible = ref(false)
|
|
const dialogFormVisible = ref(false)
|
|
|
|
|
+const dialogConfFormVisible = ref(false)
|
|
|
const openDialog = (key) => {
|
|
const openDialog = (key) => {
|
|
|
switch (key) {
|
|
switch (key) {
|
|
|
case 'upload':
|
|
case 'upload':
|
|
|
dialogTitle.value = '上传'
|
|
dialogTitle.value = '上传'
|
|
|
- // form.value.is_add = 1
|
|
|
|
|
|
|
+ type.value = key
|
|
|
|
|
+ dialogFormVisible.value = true
|
|
|
|
|
+ break
|
|
|
|
|
+ case 'conf':
|
|
|
|
|
+ dialogTitle.value = '配置'
|
|
|
|
|
+ type.value = key
|
|
|
|
|
+ dialogConfFormVisible.value = true
|
|
|
break
|
|
break
|
|
|
- // case 'edit':
|
|
|
|
|
- // dialogTitle.value = '编辑'
|
|
|
|
|
- // form.value.is_add = 0
|
|
|
|
|
- // break
|
|
|
|
|
default:
|
|
default:
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
- type.value = key
|
|
|
|
|
- dialogFormVisible.value = true
|
|
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//新加初始化fileList.data = []的重置代码
|
|
|
|
|
+
|
|
|
|
|
+const resetUploadForm = () => {
|
|
|
|
|
+ fileList.data = []
|
|
|
|
|
+ initForm()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const closeDialog = () => {
|
|
const closeDialog = () => {
|
|
|
|
|
+ fileList.data = []
|
|
|
initForm()
|
|
initForm()
|
|
|
dialogFormVisible.value = false
|
|
dialogFormVisible.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const links = ref([])
|
|
|
|
|
|
|
+const closeConfDialog = () => {
|
|
|
|
|
+ taskForm.value.resetFields()
|
|
|
|
|
+ confForm.value = {
|
|
|
|
|
+ task_id: '',//游戏id
|
|
|
|
|
+ user: '',
|
|
|
|
|
+ add_fee_notice: 0,
|
|
|
|
|
+ }
|
|
|
|
|
+ dialogConfFormVisible.value = false
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+const links = ref([])
|
|
|
const createFilter = (queryString) => {
|
|
const createFilter = (queryString) => {
|
|
|
return (restaurant) => {
|
|
return (restaurant) => {
|
|
|
return (
|
|
return (
|
|
@@ -245,6 +294,7 @@ let fullscreenLoading = false
|
|
|
// const uploadForm = ref([])
|
|
// const uploadForm = ref([])
|
|
|
const upload = ref<UploadInstance>()
|
|
const upload = ref<UploadInstance>()
|
|
|
const uploadForm: any = ref(null)
|
|
const uploadForm: any = ref(null)
|
|
|
|
|
+const taskForm: any = ref(null)
|
|
|
const imageUrl = ref('')
|
|
const imageUrl = ref('')
|
|
|
const fileList = reactive({
|
|
const fileList = reactive({
|
|
|
data: []
|
|
data: []
|
|
@@ -266,11 +316,26 @@ const rules = ref({
|
|
|
}],
|
|
}],
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+//校验规则
|
|
|
|
|
+const confRules = ref({
|
|
|
|
|
+ task_id: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入游戏id',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const form = ref({
|
|
const form = ref({
|
|
|
task_id: '',//游戏id
|
|
task_id: '',//游戏id
|
|
|
responsible_person: '',
|
|
responsible_person: '',
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const confForm = ref({
|
|
|
|
|
+ task_id: '',//游戏id
|
|
|
|
|
+ user: '',
|
|
|
|
|
+ add_fee_notice: 0,
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
|
|
|
const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
|
console.log("数组超标")
|
|
console.log("数组超标")
|
|
@@ -309,8 +374,6 @@ const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => {
|
|
|
let fd = new FormData()
|
|
let fd = new FormData()
|
|
|
const httpRequest = (param: any) => {
|
|
const httpRequest = (param: any) => {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// let fd = new FormData();
|
|
// let fd = new FormData();
|
|
|
const fileObj = param.file // 相当于input里取得的files
|
|
const fileObj = param.file // 相当于input里取得的files
|
|
|
fd.append('file', fileObj) // 文件对象
|
|
fd.append('file', fileObj) // 文件对象
|
|
@@ -326,8 +389,12 @@ const handleRemove: UploadProps['onRemove'] = (file, fileList) => {
|
|
|
const submitUpload = async () => {
|
|
const submitUpload = async () => {
|
|
|
uploadForm.value.validate(async valid => {
|
|
uploadForm.value.validate(async valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ console.log("数组内容")
|
|
|
|
|
+ console.log(fileList)
|
|
|
if (fileList.data.length <= 0) {
|
|
if (fileList.data.length <= 0) {
|
|
|
ElMessage.error("至少上传一款脚本!");
|
|
ElMessage.error("至少上传一款脚本!");
|
|
|
|
|
+ console.log("错误fileList")
|
|
|
|
|
+ console.log(fileList)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
upload.value!.submit()
|
|
upload.value!.submit()
|
|
@@ -366,6 +433,15 @@ const submitUpload = async () => {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 弹窗相关
|
|
|
|
|
+const initForm = () => {
|
|
|
|
|
+ uploadForm.value.resetFields()
|
|
|
|
|
+ upload.value!.clearFiles()
|
|
|
|
|
+ form.value = {
|
|
|
|
|
+ task_id: '',//游戏id
|
|
|
|
|
+ responsible_person: '',
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
//重置
|
|
//重置
|
|
|
const resetForm = async () => {
|
|
const resetForm = async () => {
|
|
@@ -378,149 +454,55 @@ const resetForm = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-<!-- <script lang="ts" setup>
|
|
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
|
|
-import { genFileId } from 'element-plus'
|
|
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
-import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
|
|
|
|
|
-
|
|
|
|
|
-const fullscreenLoading = ref(false)
|
|
|
|
|
-const uploadForm = ref(null)
|
|
|
|
|
-const upload = ref<UploadInstance>()
|
|
|
|
|
-const imageUrl = ref('')
|
|
|
|
|
-const fileList = reactive({
|
|
|
|
|
- data: []
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-//上传
|
|
|
|
|
-const headers = ref({
|
|
|
|
|
- // token: getStore('zxdAdmintoken'),
|
|
|
|
|
- "content-type": "multipart/form-data"
|
|
|
|
|
-})
|
|
|
|
|
-const message = ref('请上传dll文件')
|
|
|
|
|
-
|
|
|
|
|
-//校验规则
|
|
|
|
|
-const rules = ref({
|
|
|
|
|
- game_id: [{
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入游戏id',
|
|
|
|
|
- trigger: 'blur'
|
|
|
|
|
- }],
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const uploadForm = ref(null)
|
|
|
|
|
-const form = ref({
|
|
|
|
|
- game_id: '' //游戏id
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
|
|
|
- upload.value!.clearFiles()
|
|
|
|
|
- const file = files[0] as UploadRawFile
|
|
|
|
|
- file.uid = genFileId()
|
|
|
|
|
- upload.value!.handleStart(file)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const handleChange: UploadProps['onChange'] = (file, fileList) => {
|
|
|
|
|
-
|
|
|
|
|
- let extension = file.name.substring(file.name.lastIndexOf('.') + 1);
|
|
|
|
|
- console.log(extension)
|
|
|
|
|
- if (extension !== 'dll') {
|
|
|
|
|
- // this.$message.warning('只能上传后缀是.zip/.rar/.apk的文件'); //控制文件类型
|
|
|
|
|
- ElMessage.error('文件类型不对'); //控制文件类型
|
|
|
|
|
- upload.value!.clearFiles()
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- else if (Number(file.size) / 1024 / 1024 > 2) {
|
|
|
|
|
- ElMessage.error('Avatar picture size can not exceed 2MB!')
|
|
|
|
|
- upload.value!.clearFiles()
|
|
|
|
|
- return false
|
|
|
|
|
|
|
+const enterDialog = async () => {
|
|
|
|
|
+ taskForm.value.validate(async valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ switch (type.value) {
|
|
|
|
|
+ case 'conf':
|
|
|
|
|
+ {
|
|
|
|
|
+ const res = await addFeeNotice(confForm.value)
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '配置成功',
|
|
|
|
|
+ showClose: true
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ getTableData()
|
|
|
|
|
+ closeConfDialog()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ break
|
|
|
|
|
+ default:
|
|
|
|
|
+ // eslint-disable-next-line no-lone-blocks
|
|
|
|
|
+ {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '未知操作',
|
|
|
|
|
+ showClose: true
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- return true
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => {
|
|
|
|
|
- return ElMessageBox.confirm(
|
|
|
|
|
- `Cancel the transfert of ${uploadFile.name} ?`
|
|
|
|
|
- ).then(
|
|
|
|
|
- () => true,
|
|
|
|
|
- () => false
|
|
|
|
|
- )
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-const httpRequest = (param) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- let fd = new FormData();
|
|
|
|
|
- const fileObj = param.file // 相当于input里取得的files
|
|
|
|
|
- fd.append('file', fileObj) // 文件对象
|
|
|
|
|
- console.log("文件包" + fd.get('file'));
|
|
|
|
|
- const url = '';
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-const handleRemove: UploadProps['onRemove'] = (file, fileList) => {
|
|
|
|
|
- console.log(file, fileList)
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-const submitUpload = () => {
|
|
|
|
|
- uploadForm.value.validate(async valid => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- if (fileList.length <= 0) {
|
|
|
|
|
- $message.error("至少上传一款脚本!");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- upload.submit();
|
|
|
|
|
- //换行自动添加为<br/>
|
|
|
|
|
- // this.ruleForm.log= this.ruleForm.log.replace(/\n/g,"<br/>");
|
|
|
|
|
- // console.log(this.ruleForm.log)
|
|
|
|
|
- //将表单内其他内容添加进fd
|
|
|
|
|
- fd.append('game_id', form.game_id)
|
|
|
|
|
- // this.fd.append('log', this.ruleForm.log)
|
|
|
|
|
- fd.append('type', "0")
|
|
|
|
|
- fullscreenLoading = true;
|
|
|
|
|
- //调用后端接口,提交即可
|
|
|
|
|
- const res = await addFileUpdate(fd)
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- if (res.code == 0) {
|
|
|
|
|
- fullscreenLoading = false;
|
|
|
|
|
- $message({
|
|
|
|
|
- message: '上传成功',
|
|
|
|
|
- type: 'success'
|
|
|
|
|
- });
|
|
|
|
|
- fd = {}
|
|
|
|
|
- fileList = []
|
|
|
|
|
- resetForm(formName)
|
|
|
|
|
- } else {
|
|
|
|
|
- $message.error("上传失败");
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // console.log('error submit!!');
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
- upload.value!.submit()
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-//重置
|
|
|
|
|
-const resetForm = async (form) => {
|
|
|
|
|
- uploadForm.value.resetFields()
|
|
|
|
|
- console.log(uploadForm.file)
|
|
|
|
|
- upload.value.clearFiles()
|
|
|
|
|
- // form.value = {
|
|
|
|
|
- // game_id: '' //游戏id
|
|
|
|
|
- // }
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
-</script> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|