| | |
| | | <a-button type="primary" icon="plus-circle" style="margin-left: 8px" @click="Lockvisibledialog = true" |
| | | >添加 |
| | | </a-button> |
| | | <a-button type="primary" icon="key" style="margin-left: 8px" @click="updateKey" |
| | | >密钥配置 |
| | | </a-button> |
| | | </span> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | </a-row> |
| | | </a-form> |
| | | </a-modal> |
| | | <a-modal |
| | | title="密钥配置" |
| | | :width="830" |
| | | :visible="visibledialog" |
| | | :confirmLoading="keyvisibleloading" |
| | | @ok="getkeyDialogok" |
| | | @cancel="handlekeyCancel" |
| | | > |
| | | <a-form :form="addkeyUserform" ref="addkeyUserform"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="12" :lg="12" :sm="12"> |
| | | <a-form-item label="密钥配置" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input |
| | | placeholder="请输入密钥配置" |
| | | v-decorator="['vipPassword', { rules: [{ required: true, message: '请输入密钥配置' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { positionlock, positionsell, examine, sitevipList, sitevipAdd, sitevipUpdate,sitevipUpdateStatus,sitevipDel } from '@/api/position' |
| | | import { setupdate,admingetSetting } from '@/api/risksetting' |
| | | import { nextagent } from '@/api/home' |
| | | import pick from 'lodash.pick' |
| | | import moment from 'moment' |
| | |
| | | 'lowestTrade', |
| | | 'createTime', |
| | | 'updateTime', |
| | | 'vipPassword' |
| | | ], |
| | | datalist: [], |
| | | agentlist: [], |
| | | agentloading: false, |
| | | Lockvisibledialog: false, |
| | | visibledialog: false, |
| | | Lockvisibleloading: false, |
| | | keyvisibleloading: false, |
| | | Lockvisibleform: this.$form.createForm(this), |
| | | clickpositionId: '', |
| | | agentqueryParam: { |
| | |
| | | md: { span: 14 }, |
| | | }, |
| | | addUserform: this.$form.createForm(this), |
| | | addkeyUserform: this.$form.createForm(this), |
| | | currentdetail: '', |
| | | details: {} |
| | | } |
| | | }, |
| | | created() { |
| | | this.getlist() |
| | | this.getdetail() |
| | | }, |
| | | methods: { |
| | | updateKey(){ |
| | | this.visibledialog = true |
| | | this.fields.forEach((v) => this.addkeyUserform.getFieldDecorator(v)) |
| | | this.addkeyUserform.setFieldsValue(pick(this.details, this.fields)) |
| | | }, |
| | | getdetail () { |
| | | admingetSetting().then((res) => { |
| | | this.details = res.data |
| | | }) |
| | | }, |
| | | geteditStock(val) { |
| | | console.log(val); |
| | | this.currentdetail = val |
| | | this.Lockvisibledialog = true |
| | | this.fields.forEach((v) => this.addUserform.getFieldDecorator(v)) |
| | | console.log(this.fields); |
| | | this.addUserform.setFieldsValue(pick(val, this.fields)) |
| | | }, |
| | | getLockopen(val) { |
| | |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | console.log('handleCancel',this.Lockvisibledialog); |
| | | this.Lockvisibledialog = false |
| | | const form = this.$refs.addUserform.form |
| | | form.resetFields() |
| | | }, |
| | | handlekeyCancel() { |
| | | this.visibledialog = false |
| | | const form = this.$refs.addkeyUserform.form |
| | | form.resetFields() |
| | | }, |
| | | getDialogok() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getkeyDialogok() { |
| | | const form = this.$refs.addkeyUserform.form |
| | | |
| | | form.validateFields((errors, values) => { |
| | | if (!errors) { |
| | | values.id = this.details.id |
| | | setupdate(values).then((res) => { |
| | | if (res.status == 0) { |
| | | this.visibledialog = false |
| | | this.$message.success('修改成功') |
| | | form.resetFields() |
| | | this.getdetail() |
| | | } else { |
| | | this.$message.error(res.msg) |
| | | } |
| | | this.visibledialog = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | getinit() { |
| | | this.queryParam = { |
| | | pageNum: 1, |