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
<template>
<div class="app-content">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<div class="card_ct">
<a-form-model ref="form" :model="formData" :rules="rules">
<a-divider orientation="left">设置</a-divider>
<!-- <a-form-model-item label="文件上传路径" prop="filePath" class="text_line">
<a-input v-model="formData.filePath" :maxLength="50" style="width:200px;" />
</a-form-model-item>
<a-form-model-item label="图片上传路径" prop="imgPath" class="text_line">
<a-input v-model="formData.imgPath" :maxLength="50" style="width:200px;" />
</a-form-model-item> -->
<a-form-model-item label="短信发送接口地址" prop="SMSApiUrl" class="text_line">
<a-input v-model="formData.SMSApiUrl" :maxLength="50" style="width:250px;" />
</a-form-model-item>
<a-form-model-item label="是否允许同时登录相同账户" prop="loginType" class="text_line">
<a-radio-group v-model="formData.loginType">
<a-radio value="1">
是
</a-radio>
<a-radio value="2">
否
</a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="申报项目类型" prop="projType" class="text_line">
<a-radio-group v-model="formData.projType">
<a-radio value="1" name="type">
科研项目
</a-radio>
<a-radio value="2" name="type">
重点学科项目
</a-radio>
<a-radio value="3" name="type">
同时申报科研项目和重点学科项目
</a-radio>
</a-radio-group>
</a-form-model-item>
<a-divider dashed />
<a-row>
<a-col style="text-align: center;width:100%;">
<a-button type="primary" style="width:100px;" @click="submit">保存</a-button>
</a-col>
</a-row>
</a-form-model>
</div>
</a-spin>
</div>
</template>
<script>
import { isEmptyParams, hideIdCard, hidePhone, checkEmail } from "@/views/utils/common"
export default {
name: 'systemSet',
components: {
},
data () {
return {
formData: {
// filePath: null,
// imgPath: null,
SMSApiUrl: null,
loginType: null,
projType: null,
},
rules: {
// filePath: [{ required: true, message: '请输入文件上传路径', trigger: 'blur' },],
// imgPath: [{ required: true, message: '请输入图片上传路径', trigger: 'blur' },],
SMSApiUrl: [{ required: true, message: '请输入短信发送接口地址', trigger: 'blur' },],
loginType: [{ required: true, message: '请选择登录设置', trigger: 'change' }],
projType: [{ required: true, message: '请选择申报项目类型', trigger: 'change' }],
},
loading: true
}
},
created () {
this.getSystemSet()
},
methods: {
getSystemSet () {
this.$api.systemSet.getSystemSet().then(({ data = {} }) => {
if (data) {
this.formData = data
}
this.loading = false
}).catch(() => { this.loading = false })
},
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.loading = true
let pars = isEmptyParams(this.formData)
let par = { ...pars }
this.$api.systemSet.save(par).then(({ data = {} }) => {
if (data) {
this.$message.success('修改成功!')
}
this.loading = false
}).catch(() => { this.loading = false })
} else {
return false;
}
})
}
}
}
</script>
<style lang="less" scoped>
.app-content {
padding: 10px 0px;
}
.card_ct {
height: 100%;
border-radius: 4px;
border: 1px solid #e6ebf5;
overflow: auto;
-webkit-transition: 0.3s;
transition: 0.3s;
}
::v-deep .ant-divider .ant-divider-inner-text {
color: #1890ff;
}
::v-deep .ant-form {
padding: 0 6px;
.ant-form-item {
margin-bottom: 2px !important;
}
.text_line {
.ant-form-item-label {
width: 190px !important;
line-height: 21px !important;
}
.ant-form-item-control-wrapper {
padding-left: 4px;
width: calc(100% - 190px) !important;
}
}
.ant-row {
.ant-col {
display: inline-block;
}
.ant-form-item-label {
width: 70px;
}
.ant-form-item-control-wrapper {
width: calc(100% - 70px);
}
.ant-form-explain {
margin-left: 5px;
display: inline-block;
}
}
.ant-radio-inner {
border-color: #625f5f;
}
.ant-checkbox-inner {
border-color: #625f5f;
}
span.ant-radio + * {
padding: 0 2px;
}
.ant-checkbox + span {
padding: 0 2px;
}
}
</style>