<template>
  <div>
    <el-dialog
      :title="$t1('逻辑脚本分派')"
      :append-to-body="true"
      :modal-append-to-body="true"
      :close-on-click-modal="false"
      :visible.sync="showDialog"
      :modal="false"
      custom-class="dialog-style list-dialog dialog-checkbox pd_0"
      width="650px"
      @close="dialogClose"
      v-el-drag-dialog
      v-el-dialog-center
    >
      <div class="cont">
        <div class="grid-height" style="height: 500px">
          <vxe-grid
            class="is-pointer"
            ref="table-m1"
            :data="tableData"
            v-bind="vxeOption"
            @resizable-change="$vxeTableUtil.onColumnWitchChange"
            @custom="$vxeTableUtil.customHandle"
          >
            <template #form>
              <div class="clearfix screen-btns">
                <div class="fl">
                  <vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openUserAddDialog">
                    {{ $t1('新增用户') }}
                  </vxe-button>
                </div>
              </div>
            </template>
            <template #user="{row,rowIndex}">
              <el-input
                class="search-input"
                v-model="row.nickName"
                clearable
                @clear="
                  row.userId = null;
                "
                v-if="!row._isParent"
                v-el-readonly
              >
                <i slot="suffix" class="el-input__icon el-icon-search" @click="openUserRowDialog(row,rowIndex)"></i>
              </el-input>
              <template v-else>{{ row.nickName }}</template>
            </template>
            <template #switch="{row,column,rowIndex}">
              <el-switch v-model="row[column.field]" :key="column.field+rowIndex" :active-value="1"
                         :inactive-value="0"></el-switch>
            </template>
          </vxe-grid>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
			<el-button type="primary" plain class="button-sty" @click="dialogClose">
				<i class="el-icon-close el-icon"></i>
				{{ $t1('取 消') }}
			</el-button>
			<el-button type="primary" @click="saveData" class="button-sty">
				<i class="el-icon-check el-icon"></i>
				{{ $t1('确 定') }}
			</el-button>
		</span>
    </el-dialog>
    <userDialog v-if="showUserAddDialog" :visiable.sync="showUserAddDialog" @confirm="confirmtUserAddDialog"
                multi="true" :param="{flag:8}"/>
  </div>
</template>

<script>
import mixin from "./mixins/otherAuthDialog";

export default {
  mixins: [mixin]
}
</script>

<style scoped>

</style>
