jhzh
2026-01-04 68079a248b6d552c5fc7c2feb64ba035d8994896
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<template>
    <page-header-wrapper>
        <a-form :form="addUserform" class="form" ref="addUserform">
            <a-card class="card" title="A股" :bordered="false" :loading="loading">
                <span slot="extra">状态为开启即表示用户可以进行该产品的交易</span>
                <a-row class="form-row" :gutter="48">
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="融资融券交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['stockDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="科创板交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['kcStockDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="指数交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['indexDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                </a-row>
            </a-card>
            <!-- <a-card class="card" title="期货" :bordered="false" :loading="loading"> -->
                <!-- <span slot="extra">状态为开启即表示用户可以进行该产品的交易</span>
                <a-row class="form-row" :gutter="48">
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="外盘期货" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['futuresDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                </a-row> -->
            <!-- </a-card> -->
            <a-card class="card" title="用户实名认证" :bordered="false" :loading="loading">
                <span slot="extra">状态为开启即表示用户实名认证后可以进行交易,关闭则不需要实名认证就可以正常交易</span>
                <a-row class="form-row" :gutter="48">
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="实名认证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['realNameDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                </a-row>
            </a-card>
 
            <!-- <a-card class="card" title="分仓配资" :bordered="false" :loading="loading">
                <span slot="extra">状态为开启即表示分仓配资板块全部可用,关闭则不需要分仓配资</span>
                <a-row class="form-row" :gutter="48">
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="分仓配资" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['fundsDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="续期审核" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['delayDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="扩大配资审核" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['expandDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                </a-row>
                <a-row class="form-row" :gutter="48">
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="追加保证金审核" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['marginDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                    <a-col :md="8" :lg="8" :sm="12">
                        <a-form-item label="终止操盘审核" :labelCol="labelCol" :wrapperCol="wrapperCol">
                            <a-switch v-decorator="['endDisplay', { valuePropName: 'checked' }]">
                                <a-icon slot="checkedChildren" type="check" />
                                <a-icon slot="unCheckedChildren" type="close" />
                            </a-switch>
                        </a-form-item>
                    </a-col>
                </a-row>
            </a-card> -->
 
        </a-form>
        <div class="bottomfixed">
            <div style="float:right">
                <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
                    保存当前设置
                </a-button>
            </div>
        </div>
 
    </page-header-wrapper>
</template>
<script>
import { getProductSetting, productupdate } from '@/api/risksetting'
import pick from 'lodash.pick'
export default {
    name: 'productsetting',
    data() {
        return {
            addUserform: this.$form.createForm(this),
            loading: false,
            fields: ['stockDisplay', 'kcStockDisplay', 'indexDisplay', 'futuresDisplay', 'realNameDisplay', 'fundsDisplay', 'delayDisplay', 'expandDisplay', 'marginDisplay', 'endDisplay',],
            labelCol: {
                xs: { span: 10 },
                sm: { span: 10 },
                md: { span: 10 }
            },
            wrapperCol: {
                xs: { span: 14 },
                sm: { span: 14 },
                md: { span: 14 },
            },
            addUserDialogloading: false,
            details: {}
        }
    },
    mounted() {
        this.getdetail()
    },
    methods: {
        OkaddUserdialog() {
            const form = this.$refs.addUserform.form
            form.validateFields((errors, values) => {
                if (!errors) {
                    this.addUserDialogloading = true
                    this.loading = true
                    values.id = this.details.id
                    productupdate(values).then(res => {
                        if (res.status == 0) {
                            this.$message.success({ content: res.msg, duration: 2 });
                            this.getdetail()
                        } else {
                            this.$message.error({ content: res.msg });
                        }
                        this.addUserDialogloading = false
                    })
                }
            })
        },
        getdetail() {
            var that = this
            this.loading = true
            getProductSetting().then(res => {
                this.details = res.data
                this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
                this.addUserform.setFieldsValue(pick(res.data, this.fields))
                setTimeout(() => {
                    that.loading = false
                }, 500);
 
            })
        },
    }
}
</script>
<style lang="less" scoped>
.bottomfixed {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 9;
    width: 100%;
    height: 56px;
    padding: 0 24px;
    line-height: 56px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
}
 
.card {
    margin-bottom: 24px;
}
 
/deep/ .ant-pro-global-footer {
    margin: 0 0 48px 0 !important;
}
 
.popover-wrapper {
    :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
        min-width: 256px;
        max-height: 290px;
        padding: 0;
        overflow: auto;
    }
}
 
.antd-pro-pages-forms-style-errorIcon {
    user-select: none;
    margin-right: 24px;
    color: #f5222d;
    cursor: pointer;
 
    i {
        margin-right: 4px;
    }
}
 
.antd-pro-pages-forms-style-errorListItem {
    padding: 8px 16px;
    list-style: none;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all .3s;
 
    &:hover {
        background: #e6f7ff;
    }
 
    .antd-pro-pages-forms-style-errorIcon {
        float: left;
        margin-top: 4px;
        margin-right: 12px;
        padding-bottom: 22px;
        color: #f5222d;
    }
 
    .antd-pro-pages-forms-style-errorField {
        margin-top: 2px;
        color: rgba(0, 0, 0, .45);
        font-size: 12px;
    }
}
</style>