This commit is contained in:
parent
b436853001
commit
4cb2da49d8
5
src/api/spider.js
Normal file
5
src/api/spider.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import {mande} from "mande";
|
||||||
|
|
||||||
|
const spider = mande('/api/v1/spider')
|
||||||
|
|
||||||
|
export const GetSpiderCfg = ()=> spider.get("cfg")
|
@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="h-full border-0 border-t-1 border-solid border-gray-300 pt-4">
|
<div class="h-full border-0 border-t-1 border-solid border-gray-300 pt-4">
|
||||||
<a-spin :spinning="loading" :indicator="indicator">
|
<a-spin :spinning="loading" :indicator="indicator">
|
||||||
<a-table :dataSource="data.list" :columns="columns" :pagination="false" @change="tableChange">
|
<a-table :dataSource="data.list" :columns="columns" :custom-row="customRow" :pagination="false" @change="tableChange">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'name'">
|
<template v-if="column.key === 'name'">
|
||||||
<a v-if="record.name !== '' " :href="record.link" target="_blank">{{record.name}}</a>
|
<a v-if="record.name !== '' " :href="record.link" target="_blank">{{record.name}}</a>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'freight'">
|
<template v-else-if="column.key === 'freight'">
|
||||||
<div class="flex space-x-4">
|
<div class="flex space-x-4">
|
||||||
<a-input-number v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @pressEnter="doUpdate"></a-input-number>
|
<a-input-number @click.stop v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @pressEnter="doUpdate"></a-input-number>
|
||||||
<span v-else @dblclick="onEdit(record, 'freight')">{{record.freight}}</span>
|
<span v-else @dblclick="onEdit(record, 'freight')">{{record.freight}}</span>
|
||||||
<SaveOutlined class="cursor-pointer" v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @click="doUpdate"/>
|
<SaveOutlined class="cursor-pointer" v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @click="doUpdate"/>
|
||||||
<!-- <FormOutlined v-else class="cursor-pointer" @click="onEdit(record, 'freight')"/>-->
|
<!-- <FormOutlined v-else class="cursor-pointer" @click="onEdit(record, 'freight')"/>-->
|
||||||
@ -38,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'dwPrice'">
|
<template v-else-if="column.key === 'dwPrice'">
|
||||||
<div class="flex space-x-4">
|
<div class="flex space-x-4">
|
||||||
<a-input-number v-if="editData.edit && editData.param==='dwPrice' && editData.data.pid === record.pid" v-model:value="editData.data.dwPrice" @pressEnter="doUpdate"></a-input-number>
|
<a-input-number @click.stop v-if="editData.edit && editData.param==='dwPrice' && editData.data.pid === record.pid" v-model:value="editData.data.dwPrice" @pressEnter="doUpdate"></a-input-number>
|
||||||
<span v-else @dblclick="onEdit(record, 'dwPrice')">{{record.dwPrice}}</span>
|
<span v-else @dblclick="onEdit(record, 'dwPrice')">{{record.dwPrice}}</span>
|
||||||
<SaveOutlined class="cursor-pointer" v-if="editData.edit && editData.param==='dwPrice' && editData.data.pid === record.pid" v-model:value="editData.data.dwPrice" @click="doUpdate"/>
|
<SaveOutlined class="cursor-pointer" v-if="editData.edit && editData.param==='dwPrice' && editData.data.pid === record.pid" v-model:value="editData.data.dwPrice" @click="doUpdate"/>
|
||||||
<!-- <FormOutlined v-else class="cursor-pointer" @click="onEdit(record, 'dwPrice')"/>-->
|
<!-- <FormOutlined v-else class="cursor-pointer" @click="onEdit(record, 'dwPrice')"/>-->
|
||||||
@ -66,7 +66,6 @@
|
|||||||
<template #content>
|
<template #content>
|
||||||
<a-button type="text" block @click="onEdit(record, 'modal')">编辑</a-button>
|
<a-button type="text" block @click="onEdit(record, 'modal')">编辑</a-button>
|
||||||
<a-button type="text" block @click="onWatch(record.pid, record.name)">一键蹲货</a-button>
|
<a-button type="text" block @click="onWatch(record.pid, record.name)">一键蹲货</a-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<SettingOutlined class="cursor-pointer" />
|
<SettingOutlined class="cursor-pointer" />
|
||||||
</a-popover>
|
</a-popover>
|
||||||
@ -295,6 +294,14 @@ const loadSpiderCfg = ()=>{
|
|||||||
message.error("获取spider配置失败")
|
message.error("获取spider配置失败")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const customRow=(record, index)=>{
|
||||||
|
return {
|
||||||
|
onClick: (event) => {
|
||||||
|
editData.edit = false
|
||||||
|
}, // 点击行
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user