Commit 50ca4ee0 authored by limengyang's avatar limengyang

fix(lmy):eslint修复

parent 2c097084
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { import { message } from 'ant-design-vue';
message, const config = import.meta.env;
} from 'ant-design-vue'; import {
const config = import.meta.env taskCenterQueryListApi,
import { taskCenterRevokeExcelUploadApi,
taskCenterQueryListApi, } from '/@/api/regionalSpotManage';
taskCenterRevokeExcelUploadApi, onMounted(async () => {
} from '/@/api/regionalSpotManage'; getList();
onMounted(async () => { });
getList() let list = ref<any[]>([]);
}); let listLoading = ref(false);
let list = ref<any[]>([]) const downLoad = (url) => {
let listLoading = ref(false) window.open(config.VITE_GLOB_API_URL + '/system/excelFile/' + url, '_blank');
const downLoad = (url) => { };
window.open(config.VITE_GLOB_API_URL + '/system/excelFile/' + url, '_blank') const downloadFail = (record) => {
} if (record.failNum === 0) return;
const downloadFail = (record) => { let href =
if(record.failNum === 0) return config.VITE_GLOB_API_URL +
let href = config.VITE_GLOB_API_URL + '/excel/excelNew/fail/download?sysid=' + record.sysid+'&type='+record.type.slice(2,6) '/excel/excelNew/fail/download?sysid=' +
window.open(href,'blank') record.sysid +
} '&type=' +
const cancel = async (record) => { record.type.slice(2, 6);
const param = ref<{ [key: string]: any }>({ window.open(href, 'blank');
sysid: record.sysid };
}) const cancel = async (record) => {
const res = await taskCenterRevokeExcelUploadApi(param.value) const param = ref<{ [key: string]: any }>({
if (res.code === 20000) { sysid: record.sysid,
message.success('操作成功') });
getList() const res = await taskCenterRevokeExcelUploadApi(param.value);
} else { if (res.code === 20000) {
message.error(res.message) message.success('操作成功');
} getList();
} } else {
const getList = async () => { message.error(res.message);
listLoading.value = true }
const res = await taskCenterQueryListApi({type:0}) };
if (res.code === 20000) { const getList = async () => {
list.value = res.data listLoading.value = true;
} else { const res = await taskCenterQueryListApi({ type: 0 });
list.value = [] if (res.code === 20000) {
} list.value = res.data;
listLoading.value = false } else {
} list.value = [];
}
listLoading.value = false;
};
</script> </script>
<template> <template>
<div> <div>
<a-button @click="getList" type="primary">刷新数据</a-button> <a-button @click="getList" type="primary">刷新数据</a-button>
</div> </div>
<a-table <a-table
:data-source="list" :data-source="list"
:loading="listLoading" :loading="listLoading"
bordered bordered
:rowKey="(record) => record.sysid" :rowKey="(record) => record.sysid"
style="margin-top: 15px" style="margin-top: 15px"
> >
<a-table-column title="操作时间" align="center" :width="100"> <a-table-column title="操作时间" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="类型" align="center" :width="100"> <a-table-column title="类型" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.type }} {{ record.type }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="状态" align="center" :width="100"> <a-table-column title="状态" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
<p>{{ record.isRevoke ? '已撤销' : record.status == 0 ? '待进行':(record.status == 1 ? '进行中':'已完成') }}</p> <p>{{
record.isRevoke
? '已撤销'
: record.status == 0
? '待进行'
: record.status == 1
? '进行中'
: '已完成'
}}</p>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作数据" align="center" :width="100"> <a-table-column title="操作数据" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.sproductNumpec }} {{ record.sproductNumpec }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="成功数据" align="center" :width="100"> <a-table-column title="成功数据" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.successNum }} {{ record.successNum }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="错误数据" align="center" :width="100"> <a-table-column title="错误数据" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.failNum }} {{ record.failNum }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作人" align="center" :width="100"> <a-table-column title="操作人" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createName }} {{ record.createName }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作" align="center" :width="200"> <a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}"> <template #default="{ record }">
<Button type="link" @click="downLoad(record.fileUrl)">下载源文件</Button> <Button type="link" @click="downLoad(record.fileUrl)">下载源文件</Button>
<Button type="link" v-if="record.failNum" @click="downloadFail(record)">下载错误数据</Button> <Button type="link" v-if="record.failNum" @click="downloadFail(record)"
<Button type="link" v-if="record.status == 0 && !record.isRevoke" @click="cancel(record)">撤销</Button> >下载错误数据</Button
>
<Button type="link" v-if="record.status == 0 && !record.isRevoke" @click="cancel(record)"
>撤销</Button
>
</template> </template>
</a-table-column> </a-table-column>
</a-table> </a-table>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import uploadTask from './components/upLoadTask.vue' import uploadTask from './components/upLoadTask.vue';
import downLoadTask from './components/downLoadTask.vue' import downLoadTask from './components/downLoadTask.vue';
import platformProBatch from './components/platformProBatch.vue' import platformProBatch from './components/platformProBatch.vue';
const activeKey = ref('1') const activeKey = ref('1');
const callback = (val) => { const callback = (val) => {
activeKey.value = val activeKey.value = val;
} };
</script> </script>
<template> <template>
<a-tabs @change="callback" v-model:activeKey="activeKey"> <a-tabs @change="callback" v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="上传任务数据"> <a-tab-pane key="1" tab="上传任务数据">
<uploadTask v-if="activeKey === '1'"></uploadTask> <uploadTask v-if="activeKey === '1'" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="下载任务数据" force-render> <a-tab-pane key="2" tab="下载任务数据" force-render>
<downLoadTask v-if="activeKey === '2'"></downLoadTask> <downLoadTask v-if="activeKey === '2'" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="平台商品批量"> <a-tab-pane key="3" tab="平台商品批量">
<platformProBatch v-if="activeKey === '3'"></platformProBatch> <platformProBatch v-if="activeKey === '3'" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
...@@ -52,6 +52,13 @@ declare global { ...@@ -52,6 +52,13 @@ declare global {
declare interface WheelEvent { declare interface WheelEvent {
path?: EventTarget[]; path?: EventTarget[];
} }
interface ImportMeta {
env: {
VITE_GLOB_API_URL?: string;
};
}
interface ImportMetaEnv extends ViteEnv { interface ImportMetaEnv extends ViteEnv {
__: unknown; __: unknown;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment