src/pages/cameraAccess/components/ruleSelect/ruleSelect.vue
@@ -1,7 +1,8 @@
<template>
  <div class="rule-selector">
    <el-autocomplete v-model="inputValue" :fetch-suggestions="querySearch" placeholder="请输入任务描述"
    <el-autocomplete size="mini" v-model="inputValue" :fetch-suggestions="querySearch" placeholder="一句话生成算法"
      :trigger-on-focus="true" value-key="fileName" @select="handleSelect" @blur="handleBlur" clearable
      @clear="handleClear"
      class="rule-input">
      <template slot-scope="{ item }">
        <div class="rule-item">
@@ -92,6 +93,10 @@
      return text.replace(regex, '<span class="highlight">$1</span>');
    },
    // 清空输入框
    handleClear() {
      this.$emit('rule-created');
    },
    // 选择规则
    handleSelect(item) {
      this.$emit('rule-selected', item);
@@ -117,7 +122,7 @@
        // fileName: `自定义规则-${new Date().toLocaleDateString()}`,
        fileName: this.inputValue,
        warningRules: this.inputValue,
        iconUrl: '',
        iconUrl: '/opt/smart/icon/task_icon.png',
        rangeValue: 50,
        createTime: new Date().toISOString(),
        createUser: 1 // 假设当前用户ID为1