src/pages/cameraAccess/components/SceneRule.vue
@@ -35,7 +35,7 @@
            </el-select>
          </el-form-item>
        </div>
        <div class="right">
          <el-form-item label="任务描述">
@@ -124,10 +124,13 @@
            <template slot-scope="scope">
              <span v-html="scope.row.group_text"></span>
            </template>
          </el-table-column> -->
          </el-table-column>workTimeId -->
          <el-table-column label="时间段" prop="time_name" align="center">
            <template slot-scope="scope">
              {{(scope.row.workingTime || []).map(r => r.labelName).join(' / ') || ''}}
              <!-- {{(scope.row.workingTime || []).map(r => r.labelName).join(' / ') || ''}} -->
              <span v-for="(tag, idx) in VideoManageData.TimeRules.filter(t => t.id === scope.row.workTimeId)"
                :key="idx">
                {{ tag.name }}</span>
            </template>
          </el-table-column>
          <el-table-column label="检测内容" prop="checkContent" align="center">
@@ -178,6 +181,7 @@
import RuleEditor from "@/components/subComponents/RuleEditor";
import SceneEditor from "./scene/Editor";
import { getSoundList } from "@/api/event";
import { forEach } from "jszip";
export default {
  name: "SceneRuleEditor",
@@ -476,13 +480,13 @@
      // this.sceneForm.rules = editorResp.rules;
      // this.sceneForm.id = editorResp.id;
      // this.sceneForm.group_text = editorResp.text;
      const workTimes = [this.sceneForm.workingTimes].map(id => {
        const timeOption = this.VideoManageData.TimeRules.find(opt => opt.id === id)
        return {
          labelId: id,
          labelName: timeOption ? timeOption.name : ''
        }
      })
      // const workTimes = [this.sceneForm.workingTimes].map(id => {
      //   const timeOption = this.VideoManageData.TimeRules.find(opt => opt.id === id)
      //   return {
      //     labelId: id,
      //     labelName: timeOption ? timeOption.name : ''
      //   }
      // })
      const fileIds = this.sceneForm.knowsList.map(
        path => {
          // 提取最后一级的文件ID并转换为数字
@@ -494,7 +498,8 @@
      this.sceneForm.eventLevel = this.sceneForm.alarm_level
      this.sceneForm.checks = this.sceneForm.checkContents
      this.sceneForm.rules = this.sceneForm.warningRules
      this.sceneForm.workTimes = workTimes
      // this.sceneForm.workTimes = workTimes
      this.sceneForm.workTimeId = this.sceneForm.workingTimes
      this.sceneForm.taskDescription = this.sceneForm.desc
      this.sceneForm.knows = fileIds,
        this.onSaveScene(this.sceneForm);