<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="4" :xs="24">
        <el-tabs type="card" v-model="activeTab">
          <!-- 数据源标签页 -->
          <el-tab-pane label="数据源" name="dataSource">
            <div class="head-container">
              <el-input
                v-model="dbResoursName"
                placeholder="请输入数据源"
                clearable
                size="small"
                prefix-icon="el-icon-search"
                style="margin-bottom: 20px"
              />
            </div>
            <div class="head-container">
              <el-tree
                :data="dbResourceOptions"
                :props="defaultProps"
                :expand-on-click-node="false"
                :filter-node-method="filterNode"
                ref="tree"
                node-key="id"
                default-expand-all
                highlight-current
                @node-click="handleNodeClick"
              >
              <template #default="{ node, data }">
      <span class="custom-tree-node">
        <i :class="getIconClass(data)"></i>
        <span>{{ data.name }}</span>
      </span>
    </template>
              </el-tree>
            </div>
          </el-tab-pane>
          <el-tab-pane label="报表" name="report">
            <div>敬请期待。。。。。</div>
          </el-tab-pane>
        </el-tabs>
      </el-col>
      <!--用户数据-->
      <el-col :span="20" :xs="24">
        <el-form
          :model="queryParams"
          ref="queryForm"
          size="small"
          :inline="true"
          v-show="showSearch"
          label-width="68px"
        >
          <el-form-item label="任务名称" prop="metataskName">
            <el-input
              v-model="queryParams.metataskName"
              placeholder="请输入任务名称"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="任务类型" prop="metataskType">
            <el-select
              v-model="queryParams.metataskType"
              placeholder="任务类型"
              clearable
              style="width: 240px"
            >
              <el-option
                v-for="dict in dict.type.meta_task_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="创建时间">
            <el-date-picker
              v-model="dateRange"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['meta:metatask:add']"
              >新建任务</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="singleOne"
              @click="handleUpdate"
              v-hasPermi="['meta:metatask:edit']"
              >修改</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-top"
              size="mini"
              :disabled="singleOne"
              @click="handleUp"
              v-hasPermi="['meta:metatask:up']"
              >上线</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-bottom"
              size="mini"
              :disabled="singleTwo"
              @click="handleDown"
              v-hasPermi="['meta:metatask:down']"
              >下线</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-time"
              size="mini"
              :disabled="singleTwo"
              @click="handleDS"
              v-hasPermi="['meta:metatask:ds']"
              >调度</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-video-play"
              size="mini"
              :disabled="singleTwo"
              @click="handleRun"
              v-hasPermi="['meta:metatask:run']"
              >运行</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleLog"
              v-hasPermi="['meta:metatask:log']"
              >日志</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['meta:metatask:delete']"
              >删除</el-button
            >
          </el-col>

          <right-toolbar
            :showSearch.sync="showSearch"
            @queryTable="getList"
            :columns="columns"
          ></right-toolbar>
        </el-row>

        <el-table
          v-loading="loading"
          :data="userList"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="50" align="center" />
          <!-- <el-table-column
            label="任务ID"
            align="center"
            key="metataskId"
            prop="metataskId"
            v-if="columns[0].visible"
            width="80"
          /> -->
          <el-table-column
            label="任务名称"
            align="center"
            key="metataskName"
            prop="metataskName"
            v-if="columns[1].visible"
            :show-overflow-tooltip="true"
          
          />
          <el-table-column
            label="任务类型"
            align="center"
            key="metataskType"
            prop="metataskType"
            v-if="columns[2].visible"
            :show-overflow-tooltip="true"
             width="180"
          >
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.meta_task_type"
                :value="scope.row.metataskType"
              />
            </template>
          </el-table-column>
          <el-table-column
            label="所属数据源"
            align="center"
            key="dbRCode"
            prop="dbRCode"
            v-if="columns[3].visible"
            :show-overflow-tooltip="true"
          >
          <template slot-scope="scope">
            {{ getListNameById(scope.row.dbRCode) }}

            </template>
          </el-table-column>
       
          <el-table-column
            label="状态"
            align="center"
            key="status"
            prop="status"
            v-if="columns[4].visible"
            :show-overflow-tooltip="true"
          >
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.meta_task_status"
                :value="scope.row.status"
              />
            </template>
          </el-table-column>
          <el-table-column
            label="调度时间"
            align="center"
            prop="dsTime"
            v-if="columns[5].visible"
            width="100"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="创建时间"
            align="center"
            prop="createTime"
            v-if="columns[6].visible"
            width="100"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="更新时间"
            align="center"
            prop="updateTime"
            v-if="columns[7].visible"
            width="100"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="描述"
            align="center"
            key="remark"
            prop="remark"
            v-if="columns[8].visible"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="创建人"
            align="center"
            key="createBy"
            prop="createBy"
            v-if="columns[9].visible"
            :show-overflow-tooltip="true"
            width="70"
          />
          <el-table-column
            label="修改人"
            align="center"
            key="updateBy"
            prop="updateBy"
            v-if="columns[10].visible"
            :show-overflow-tooltip="true"
            width="70"
          />

          <el-table-column
            label="操作"
            align="center"
            width="160"
            class-name="small-padding fixed-width"
          >
            <template slot-scope="scope" v-if="scope.row.metataskId !== 1">
              <el-button
                size="mini"
                type="text"
                :disabled="scope.row.status === 'ONLINE'"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['meta:metatask:edit']"
                >修改</el-button
              >
              <el-button
                size="mini"
                type="text"
                :disabled="scope.row.status === 'ONLINE'"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['meta:metatask:delete']"
                >删除</el-button
              >
              <el-dropdown
                size="mini"
                @command="(command) => handleCommand(command, scope.row)"
                v-hasPermi="['system:user:resetPwd', 'meta:metatask:edit']"
              >
                <el-button size="mini" type="text" icon="el-icon-d-arrow-right"
                  >更多</el-button
                >
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item
                    command="handleUp"
                    icon="el-icon-circle-check"
                    :disabled="scope.row.status === 'ONLINE'"
                    v-hasPermi="['meta:metatask:up']"
                    >上线</el-dropdown-item
                  >
                  <el-dropdown-item
                    command="handleDown"
                    icon="el-icon-circle-check"
                    :disabled="scope.row.status === 'OFFLINE'"
                    v-hasPermi="['meta:metatask:down']"
                    >下线</el-dropdown-item
                  >
                  <el-dropdown-item
                    command="handleDS"
                    icon="el-icon-circle-check"
                    :disabled="scope.row.status === 'OFFLINE'"
                    v-hasPermi="['meta:metatask:ds']"
                    >调度</el-dropdown-item
                  >
                  <el-dropdown-item
                    command="handleRun"
                    icon="el-icon-circle-check"
                    :disabled="scope.row.status === 'OFFLINE'"
                    v-hasPermi="['meta:metatask:run']"
                    >运行</el-dropdown-item
                  >
                  <el-dropdown-item
                    command="handleLog"
                    icon="el-icon-circle-check"
                    v-hasPermi="['meta:metatask:log']"
                    >日志</el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>

    <el-dialog :visible.sync="open" width="600px" append-to-body>
      <div slot="title">
        <el-cascader
    v-model="form.metataskType"
    :options="metataskTypeOptions"
    :props="{ expandTrigger: 'hover' }"
    @change="handleChangeType"></el-cascader>
      </div>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="任务名称" prop="metataskName">
              <el-input
                v-model="form.metataskName"
                placeholder="请输入任务名称"
                maxlength="30"
                style="width: 80%"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="采集方式" prop="acquisitionType">
              <el-select
                v-model="form.acquisitionType"
                placeholder="请选择采集方式"
                maxlength="30"
                style="width: 80%"
              >
                <el-option
                  v-for="dict in dict.type.meta_task_acq"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="数据源" prop="dbRCode">
              <el-select
                v-model="form.dbRCode"
                placeholder="请选择数据源"
                maxlength="30"
                disabled
                style="width: 80%"
              >
                <el-option
                  v-for="dict in dbResourceOldList"
                  :key="dict.id"
                  :label="dict.name"
                  :value="dict.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="数据库" prop="dbCode">
              <el-input
                v-model="form.dbCode"
                placeholder="请输入数据库"
                maxlength="30"
                style="width: 80%"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="模式列表" prop="dbSName">
              <el-input
                v-model="form.dbSName"
                placeholder="请输入模式列表"
                maxlength="30"
                style="width: 80%"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row>
          <el-col :span="24">
            <el-form-item label="采集目标" prop="acTarget">
              <el-select
                v-model="form.acTarget"
                placeholder="请选择采集目标"
                maxlength="30"
                multiple
                style="width: 80%"
              >
                <el-option
                  v-for="dict in dict.type.meta_task_at"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row>
          <el-col :span="24">
            <el-form-item label="备注">
              <el-input
                v-model="form.remark"
                type="textarea"
                placeholder="请输入内容"
                style="width: 80%"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <run-dialog ref="rundialog"
     :warningGroupList="warningGroupList"
     :environmentList="environmentList"
     :workerGroupList="workerGroupList"
     :processDefinitionCode="dsIds"
     />
     <ds-dialog ref="dsdialog"
     :warningGroupList="warningGroupList"
     :environmentList="environmentList"
     :workerGroupList="workerGroupList"
     :processDefinitionCode="dsIds"
     />
     <log-dialog ref="logdialog"
     :defindName="defindName"
  
     />
  </div>
</template>
<style scoped>
.custom-tree-node {
  display: flex;
  align-items: center;
}
.custom-tree-node i {
  margin-right: 8px; /* 图标与文本之间的间距 */
}
</style>
<script>
import {
  listmetatask,
  getmetatask,
  delmetatask,
  addmetatask,
  updatemetatask,
  downOrUpmetatask,
  datasourcetree,
  datasourceall,
  dsmetatask
} from "@/api/meta/metatask";


import runDialog from "./runDialog";
import dsDialog from "./dsDialog";
import logDialog from "./logsDialog";

export default {
  name: "User",
  dicts: ["meta_task_type", "meta_task_acq", "meta_task_status", "meta_task_at"],
  components: { runDialog,dsDialog,logDialog  },
  data() {
    return {
      // 默认激活的标签页
      activeTab: "dataSource",
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      dsIds: [],
      // 非单个禁用
      single: true,
      singleOne: true,//上线 编辑 删除
      singleTwo: true,//下线 日志 调度
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 用户表格数据
      userList: null,
      // 弹出层标题
      title: "",
      warningGroupList:undefined,
      environmentList:undefined,
      workerGroupList:undefined,
      defindName:"",
      // 部门树选项
      dbResourceOptions: undefined,
      //数据源
      dbRCodeList: undefined,
      //模式列表
      dbSCodeList: [
        {
          value: "scheam",
          label: "scheam",
        },
        {
          value: "scheam2",
          label: "scheam2",
        },
      ],
      //任务类型树
      metataskTypeOptions:[
      {value: '0', label: "元数据采集", 
        children:[
        {value: '00', label: "表字段"},
        {value: '01', label: "存储过程"}
        ]
      },
      {value: '1', label: "元数据加工"}

      ],
      // 是否显示弹出层
      open: false,
      // 部门名称
      dbResoursName: undefined,
      //左侧点击的数据源
      clickNode: undefined,
      // 日期范围
      dateRange: [],
      // 岗位选项
      postOptions: [],

      // 表单参数
      form: {},
      defaultProps: {
        children: "children",
        label: "name",
      },
      selectRowData:{},
      dbResourceOldList:[],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        dbRcode: undefined,
        dsId: undefined,
        metataskName: undefined,
        metataskType: undefined,
        dbRCode: undefined,
      },
      // 列信息
      columns: [
        { key: 0, label: `任务ID`, visible: true },
        { key: 1, label: `任务名称`, visible: true },
        { key: 2, label: `任务类型`, visible: true },
        { key: 3, label: `所属数据源`, visible: true },
        { key: 4, label: `状态`, visible: true },
        { key: 5, label: `调度时间`, visible: true },
        { key: 6, label: `创建时间`, visible: true },
        { key: 7, label: `更新时间`, visible: true },
        { key: 8, label: `描述`, visible: true },
        { key: 9, label: `创建人`, visible: true },
        { key: 10, label: `修改人`, visible: true },
      ],
      chooseRows:[],//选中行
      // 表单校验
      rules: {
        metataskName: [
          { required: true, message: "任务名称不能为空", trigger: "blur" },
          {
            min: 2,
            max: 20,
            message: "任务名称长度必须介于 2 和 20 之间",
            trigger: "blur",
          },
        ],
        // dbCode: [
        //   { required: true, message: "数据库不能为空", trigger: "blur" },
        // ],
        dbSCode: [
          { required: true, message: "模式列表不能为空", trigger: "blur" },
        ],
        acquisitionType: [
          { required: true, message: "采集方式不能为空", trigger: "blur" },
        ],
        acTarget: [
          { required: true, message: "采集目标不能为空", trigger: "blur" },
        ],
      },
    };
  },
  watch: {
    // 根据名称筛选部门树
    dbResoursName(val) {
      this.$refs.tree.filter(val);
    },
  },
  created() {
    this.getList();
    this.getDeptTree();
  },
  methods: {
    handleChangeType(value) {
      this.form.metataskType = value[value.length - 1];
      if(this.form.metataskType=='00'){
        this.form.acTarget='0'
      }else if(this.form.metataskType=='01'){
        this.form.acTarget='1'
      }
      },
    /** 查询用户列表 */
    getList() {
      this.loading = true;
      listmetatask(this.addDateRange(this.queryParams, this.dateRange)).then(
        (response) => {
          this.userList = response.rows;
          this.total = response.total;
          this.loading = false;
        }
      );
    },
    getListNameById(id) {
      const item = this.dbResourceOldList.find(item => item.id === id);
      return item ? item.name : '';
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      datasourceall().then((response)=>{
        this.warningGroupList=response.data.alertGroups,
        this.environmentList=response.data.environment,
        this.workerGroupList=response.data.workerGroup

        
      })
     datasourcetree().then(
        (response) => {
        if(response.success&&response.rows.length>0){
        this.dbResourceOldList=response.rows
        let  childrenList=[]
        this.dbResourceOldList.forEach(element => {
          childrenList.push({...element,parentId:"100"})
        });
        this.dbResourceOptions = [
        {
          id: 100,
          name: "数据源",
          parentId: 0,
          children: childrenList
        }
        ]
  
    }
    })
  },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.name.indexOf(value) !== -1;
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.clickNode = data;
      this.queryParams.dbRCode = data.id;
      this.handleQuery();
    },

    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        metataskId: undefined,
        metataskType: "00",
        metataskName: undefined,
        dbRName: undefined,
        dbCode: undefined,
        dbName: undefined,
        dbRCode: this.clickNode.id,
        dbSName: undefined,
        dbSCode: undefined,
        remark: undefined,
        acquisitionType: "0",
        dsId: undefined,
        acTarget:"0"
      };
      this.resetForm("form");
    },
    getIconClass(data) {
      // 根据数据返回相应的图标类名
      if (data.parentId == '0') {
        return 'el-icon-files'; // 文件夹图标
      } else if (data.parentId == '100') {
        return 'el-icon-coin'; // 文件图标
      } else {
        return ''; // 默认无图标
      }
  },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.queryParams.dbRCode = this.clickNode.id;
      this.$refs.tree.setCurrentKey(null);
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.selectRowData=selection[0]
      console.log(this.selectRowData,"dddddddddddd")
      this.chooseRows=selection
      this.ids = selection.map((item) => item.metataskId);
      this.dsIds = selection.map((item) => item.dsIds);
      this.singleOne = selection.length != 1||this.selectRowData.status=="ONLINE";
      this.singleTwo = selection.length != 1||this.selectRowData.status=="OFFLINE";
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleUp":
          this.handleUp(row);
          break;
          case "handleDown":
          this.handleDown(row);
          break;
          case "handleDS":
          this.handleDS(row);
          break;
          case "handleRun":
          this.handleRun(row);
          break;
        case "handleLog":
          this.handleLog(row);
          break;
        default:
          break;
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
      if(this.clickNode==undefined||this.clickNode==null){
        this.$message.warning("请选择数据源节点!")
        return
      }
  

      this.reset();
      // getmetatask().then(response => {

      this.open = true;
      // });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const metataskId = row.metataskId || this.ids;
      getmetatask(metataskId).then((response) => {
        this.form = response.data;
        // this.form.acTarget=response.data.acTarget.split(',');
        this.open = true;
      });
    },
    // 上线操作
    handleUp(row) {
      const metataskIds = String(row.metataskId||this.ids)
      this.$modal
        .confirm('是否确认上线任务编号为"' + metataskIds + '"的数据项？')
        .then(function () {
          return downOrUpmetatask(metataskIds,"ONLINE");
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("上线成功");
        })
        .catch(() => {});
    },

    // 下线操作
    handleDown(row) {
      const metataskIds = String(row.metataskId||this.ids)
      this.$modal
        .confirm('是否确认下线任务编号为"' + metataskIds + '"的数据项？')
        .then(function () {
          return downOrUpmetatask(metataskIds,"OFFLINE");
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("下线成功");
        })
        .catch(() => {});
    },
    // 调度操作

   handleDS(row) {

    
this.$refs.dsdialog.show(row.dsIds);


},
    // 运行
    handleRun(row) {

    
      this.$refs.rundialog.show(row.dsIds);


    },
        // 运行
        handleLog(row) {

    this.defindName=this.selectRowData.metataskName+(this.selectRowData.dsTypes=="0"?"-表字段采集":"-存储过程采集")
    console.log(this.defindName,"defindName")
    this.$refs.logdialog.show(this.defindName);


},
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          var submitForm ={...this.form}
           submitForm.dbCode=this.clickNode.type
           submitForm.dbRName=this.clickNode.name
          // submitForm.acTarget=this.form.acTarget.join(',')
       
          if (this.form.metataskId != undefined) {
            updatemetatask(submitForm).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addmetatask(submitForm).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      var isDlete=true
      if (row.status === 'ONLINE') {
        this.$modal.msgWarning("请选择下线数据进行删除");
        isDlete=false
        
      }
      if(this.chooseRows.length>0){

        this.chooseRows.forEach(b=>{
          if (b.status === 'ONLINE') {
            this.$modal.msgWarning("请选择下线数据进行删除");
            isDlete=false

      }

        })
      }
      if(isDlete){
      const metataskIds = row.metataskId || this.ids;
      const dsidsVo = row.dsIds || this.dsIds;

      this.$modal
        .confirm('是否确认删除任务编号为"' + metataskIds + '"的数据项？')
        .then(function () {
          return delmetatask(metataskIds,dsidsVo);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    }
  },
  },
};
</script>