<template>
  <app-dialog v-model="visible" :loading="loading" :title="title" append-to-body class="detail-dialog" width="700px" @cancel="onCancel" @confirm="onCancel">
    <el-form ref="form" :disabled="disabled" :model="form" label-width="210px">
      <el-row :gutter="15">
        <app-filter-item :span="24" label="调用方名称:" prop="memberName">
          <!--          <el-input v-model="form.memberName" />-->
          <span>{{ form.memberName }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用方系统名称:" prop="appName">
          <span>{{ form.appName }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用方编码:" prop="memberCode">
          <span>{{ form.memberCode }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用访问的资源名称:" prop="resourceName">
          <span>{{ form.resourceName }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用访问的资源编码:" prop="resourceCode">
          <span>{{ form.resourceCode }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用离线文件下载文件名称:" prop="fileName">
          <span>{{ form.fileName }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="调用离线文件下载文件地址:" prop="filePath">
          <span>{{ form.filePath }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="客户端访问的IP地址:" prop="requestIp">
          <span>{{ form.requestIp }}</span>
        </app-filter-item>
        <app-filter-item :span="24" label="客户端请求访问时间:" prop="filePath">
          <span>{{ form.requestTime }}</span>
        </app-filter-item>
      </el-row>
    </el-form>
  </app-dialog>
</template>

<script>
import dialogMixin from '@/mixins/dialog.js';

export default {
  companyName: 'CompanyDialog',
  mixins: [dialogMixin],
  props: {
    selectedRows: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      disabled: true,
      form: {
        sourceType: '1',
      },
      tableNameList: [
        { label: '成功', value: 1 },
        { label: '失败', value: 0 },
      ],
      levelList: ['低', '中', '较高', '高'],
      rateList: ['仅一次', '实时', '每天', '每周', '每月', '每季度', '每年'],
      rules: {
        companyName: [{ required: true, message: '资源项名称不能为空' }],
        sysCode: [{ required: true, message: '资源项编码不能为空' }],
        isCreateTable: [{ required: true, message: '请选择是否生成表' }],
        level: [{ required: true, message: '请选择资源项级别' }],
        tableName: [{ required: true, message: '数据库表名不能为空' }],
      },
      loading: false,
    };
  },
  mounted() {},
  methods: {
    /**
     * @description: dialog每次显示时触发的init方法
     * @param {*} data 传入data
     * @return {*}
     */
    initData(data) {
      const orgForm = this.$options.data().form;
      this.form = { ...orgForm, ...data };
      this.$nextTick(() => {
        this.$refs.form.clearValidate();
      });
    },
    onCancel() {
      this.visible = false;
    },
  },
};
</script>

<style lang="scss" scoped></style>
