<template>
  <el-dialog
    :title="$t2('修改脚本', 'components.wf.setCandidateTitle')"
    :close-on-click-modal="false"
    :visible="showDialog"
    :modal="false"
    custom-class="dialog-style list-dialog dialog-checkbox pd_0"
    width="1200px"
    @close="closeDialog"
    v-el-drag-dialog
    v-el-dialog-center
    :append-to-body="true"
  >
    <template #title>
      <span class="el-dialog__title">
        {{ $t1("修改脚本") }}
      </span>
    </template>
    <div class="cont" style="height: 450px">
      <vxe-grid
        ref="table-m1"
        v-bind="vxeOption"
        @resizable-change="$vxeTableUtil.onColumnWitchChange"
        @custom="$vxeTableUtil.customHandle"
      >
        <template #operate="{ row, rowIndex }">
          <a class="a-link" @click="openScriptDialog(row)">
            <i class="el-icon-edit"></i
            ><span>{{ $t1(!!row.script ? "修改脚本 - 已维护" : "修改脚本") }}</span>
          </a>
        </template>
      </vxe-grid>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" plain class="button-sty" @click="closeDialog">
        <i class="el-icon-close el-icon"></i>
        {{ $t2("取 消", "system.button.cancel2") }}
      </el-button>
      <el-button type="primary" @click="closeDialog" class="button-sty">
        <i class="el-icon-check el-icon"></i>
        {{ $t2("确 定", "system.button.confirm2") }}
      </el-button>
    </span>
    <el-dialog
      :title="scritpDialogTitle"
      :append-to-body="true"
      :modal-append-to-body="true"
      :close-on-click-modal="false"
      v-if="showScriptDialog"
      :visible.sync="showScriptDialog"
      :modal="false"
      custom-class="dialog-style tips-dialog tips-1 "
      width="800px"
      v-el-drag-dialog
      v-el-dialog-center
    >
      <div class="cont" style="height: 700px">
        <code-editor
          mode="java"
          :readonly="!1"
          v-model="script"
          height="414px;"
        ></code-editor>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          plain
          class="button-sty"
          @click="showScriptDialog = false"
        >
          <i class="el-icon-close el-icon"></i>
          {{ $t1("取 消") }}
        </el-button>
        <el-button type="primary" @click="saveScript" class="button-sty">
          <i class="el-icon-check el-icon"></i>
          {{ $t1("确 定") }}
        </el-button>
      </span>
    </el-dialog>
  </el-dialog>
</template>

<script>
import mixin from "./mixins/wfFlowEleScriptDialog.js";
export default {
  mixins: [mixin],
};
</script>
