diff --git a/frontend/src/components/Config/ConfigList.vue b/frontend/src/components/Config/ConfigList.vue index 2c730b3b..160de988 100644 --- a/frontend/src/components/Config/ConfigList.vue +++ b/frontend/src/components/Config/ConfigList.vue @@ -177,7 +177,7 @@ :value="isList(stage)" @change="onCheckIsList($event, stage)" /> - +
CSS @@ -190,11 +190,24 @@
- CSS + + + + CSS - + + + XPath
@@ -208,8 +221,9 @@ style="text-align: left; flex-basis: 20px; margin-right: 5px" :value="isPage(stage)" @change="onCheckIsPage($event, stage)" + :disabled="!isList(stage)" /> - +
CSS @@ -222,11 +236,24 @@
- CSS + + + + CSS - + + + XPath
@@ -255,7 +282,7 @@
- + {{$t('Save')}}
@@ -522,6 +549,25 @@ export default { }, onClickSelectorType (selectorType) { Object.values(this.spiderForm.config.stages).forEach(stage => { + // 列表 + if (selectorType === 'css') { + if (stage.list_xpath) stage.list_xpath = '' + if (!stage.list_css) stage.list_css = 'body' + } else { + if (stage.list_css) stage.list_css = '' + if (!stage.list_xpath) stage.list_xpath = '//body' + } + + // 分页 + if (selectorType === 'css') { + if (stage.page_xpath) stage.page_xpath = '' + if (!stage.page_css) stage.page_css = 'body' + } else { + if (stage.page_css) stage.page_css = '' + if (!stage.page_xpath) stage.page_xpath = '//body' + } + + // 字段 stage.fields.forEach(field => { if (selectorType === 'css') { if (field.xpath) field.xpath = '' diff --git a/frontend/src/components/TableView/FieldsTableView.vue b/frontend/src/components/TableView/FieldsTableView.vue index 40c276de..2dbcfd81 100644 --- a/frontend/src/components/TableView/FieldsTableView.vue +++ b/frontend/src/components/TableView/FieldsTableView.vue @@ -23,6 +23,7 @@ @@ -50,10 +51,20 @@ @@ -80,7 +91,12 @@