Skip to content

Commit

Permalink
fix: data collection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Apr 17, 2023
1 parent 287043e commit a4065bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crawlab-ui",
"version": "0.6.1-4",
"version": "0.6.1-5",
"private": false,
"author": {
"name": "Marvin Zhang",
Expand Down
7 changes: 7 additions & 0 deletions src/components/spider/SpiderForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import {TASK_MODE_SELECTED_NODE_TAGS, TASK_MODE_SELECTED_NODES} from '@/constant
import pinyin, {STYLE_NORMAL} from 'pinyin';
import {isZeroObjectId} from '@/utils/mongo';
import {useI18n} from 'vue-i18n';
import useSpiderDetail from "@/views/spider/detail/useSpiderDetail";
export default defineComponent({
name: 'SpiderForm',
Expand All @@ -196,6 +197,11 @@ export default defineComponent({
form,
} = useSpider(store);
// use spider detail
const {
activeId,
} = useSpiderDetail();
// whether col field of form has been changed
const isFormColChanged = ref<boolean>(false);
Expand All @@ -206,6 +212,7 @@ export default defineComponent({
watch(() => form.value?.name, () => {
if (isFormColChanged.value) return;
if (form.value?._id && isZeroObjectId(form.value?._id)) return;
if (activeId.value && form.value?.col_name) return;
if (!form.value.name) {
form.value.col_name = '';
} else {
Expand Down

0 comments on commit a4065bf

Please sign in to comment.