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 class="h-full border-0 border-t-1 border-solid border-gray-300 pt-4">
|
||||
<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 v-if="column.key === 'name'">
|
||||
<a v-if="record.name !== '' " :href="record.link" target="_blank">{{record.name}}</a>
|
||||
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
<template v-else-if="column.key === 'freight'">
|
||||
<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>
|
||||
<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')"/>-->
|
||||
@ -38,7 +38,7 @@
|
||||
</template>
|
||||
<template v-else-if="column.key === 'dwPrice'">
|
||||
<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>
|
||||
<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')"/>-->
|
||||
@ -66,7 +66,6 @@
|
||||
<template #content>
|
||||
<a-button type="text" block @click="onEdit(record, 'modal')">编辑</a-button>
|
||||
<a-button type="text" block @click="onWatch(record.pid, record.name)">一键蹲货</a-button>
|
||||
|
||||
</template>
|
||||
<SettingOutlined class="cursor-pointer" />
|
||||
</a-popover>
|
||||
@ -295,6 +294,14 @@ const loadSpiderCfg = ()=>{
|
||||
message.error("获取spider配置失败")
|
||||
})
|
||||
}
|
||||
|
||||
const customRow=(record, index)=>{
|
||||
return {
|
||||
onClick: (event) => {
|
||||
editData.edit = false
|
||||
}, // 点击行
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user