<template>
    <div class="app-container Input">
        <el-tabs type="border-card">
            <el-tab-pane label="密钥配置" name="order">
                <el-form ref="form" :model="form" :rules="rules" label-width="300px">
                    <!-- 上 -->
                    <el-form-item label="对接平台名称" prop="platformName">
                        <el-input v-model="form.platformName" placeholder="请输入对接平台名称"/>
                    </el-form-item>
                    <el-form-item label="接口地址前缀" prop="urlPrefix">
                        <el-input v-model="form.urlPrefix" placeholder="请输入接口地址前缀"/>
                    </el-form-item>
                    <el-form-item label="对接平台标识(OperatorId)" prop="theirOperatorId">
                        <el-input v-model="form.theirOperatorId" placeholder="请输入对接平台标识(OperatorId)"/>
                    </el-form-item>

                    <!-- 左侧 -->
                    <el-form-item label="对接平台唯一识别密钥(OperatorSecret)" prop="theirOperatorSecret">
                        <el-input v-model="form.theirOperatorSecret"
                                  placeholder="请输入对接平台生成的唯一识别密钥(OperatorSecret)"/>
                    </el-form-item>
                    <el-form-item label="对接平台消息密钥(DataSecret)" prop="theirDataSecret">
                        <el-input v-model="form.theirDataSecret"
                                  placeholder="请输入对接平台生成的消息密钥(DataSecret)"/>
                    </el-form-item>
                    <el-form-item label="对接平台初始化向量(DataSecretIv)" prop="theirDataSecretIv">
                        <el-input v-model="form.theirDataSecretIv"
                                  placeholder="请输入对接平台生成的初始化向量(DataSecretIv)"/>
                    </el-form-item>
                    <el-form-item label="对接平台签名密钥(SigSecret)" prop="theirSigSecret">
                        <el-input v-model="form.theirSigSecret" placeholder="请输入对接平台生成的签名密钥(SigSecret)"/>
                    </el-form-item>

                    <!-- 右侧 -->
                    <el-form-item label="我方唯一识别密钥(OperatorSecret)" prop="ourOperatorSecret">
                        <el-input v-model="form.ourOperatorSecret"
                                  placeholder="请输入我方生成的唯一识别密钥(OperatorSecret)"/>
                    </el-form-item>
                    <el-form-item label="我方消息密钥(DataSecret)" prop="ourDataSecret">
                        <el-input v-model="form.ourDataSecret" placeholder="请输入我方生成的消息密钥(DataSecret)"/>
                    </el-form-item>
                    <el-form-item label="我方初始化向量(DataSecretIv)" prop="ourDataSecretIv">
                        <el-input v-model="form.ourDataSecretIv"
                                  placeholder="请输入我方生成的初始化向量(DataSecretIv)"/>
                    </el-form-item>
                    <el-form-item label="我方签名密钥(SigSecret)" prop="ourSigSecret">
                        <el-input v-model="form.ourSigSecret" placeholder="请输入我方生成的签名密钥(SigSecret)"/>
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="submitForm">确 定</el-button>
                    <el-button @click="cancel">取 消</el-button>
                </div>
            </el-tab-pane>

            <el-tab-pane label="同步数据" name="pile">

            </el-tab-pane>

        </el-tabs>
    </div>
</template>

<script>


import {getSecret} from "@/api/thirdParty/secret";

export default {
    dicts: ["third_party_type"],
    components: {},
    data() {
        return {
            id: this.$route.params.id,
            platformName: this.$route.params.platformName,
            // 表单参数
            form: {},
            // 表单校验
            rules: {
            }
        };
    },
    created() {
        this.updateTitle();
    },
    methods: {
        querySecretDetail(row) {
            getSecret(this.id).then(response => {
                this.form = response.data;
                this.open = true;
                // this.title = "修改对接三方平台配置";
            });
        },
        // 更新页面title显示
        updateTitle() {
            const platformName = this.platformName;
            const title = "【" + platformName + "】平台配置";
            const route = Object.assign({}, this.$route, {title: `${title}`});
            this.$store.dispatch("tagsView/updateVisitedView", route);
        },
    },
    mounted() {

    },
};
</script>

<style scoped lang="scss">

</style>
