[admin] change uploaded & downloaded unit: GB

This commit is contained in:
xiaomlove
2022-05-10 22:08:41 +08:00
parent 3b9125d236
commit e7e708fd91
10 changed files with 91 additions and 26 deletions
+7 -3
View File
@@ -228,7 +228,7 @@
<DialogDisableUser ref="disableUser" :reload="fetchPageData" />
<DialogModComment ref="modComment" />
<DialogResetPassword ref="resetPassword" />
<DialogIncrementDecrement ref="incrementDecrement" :reload="fetchPageData" :title="dialogTitle" />
<DialogIncrementDecrement ref="incrementDecrement" :reload="fetchPageData" :title="dialogTitle" :valuePlaceholder="valuePlaceholder" />
</template>
<script>
@@ -266,7 +266,7 @@ export default {
baseInfo: {},
examInfo: null,
dialogTitle: '',
toChangeField: '',
valuePlaceholder: '',
})
onMounted(() => {
fetchPageData()
@@ -310,7 +310,11 @@ export default {
}
const handleIncrementDecrement = async (field) => {
state.dialogTitle = 'Change ' + field
state.toChangeField = field
if (['uploaded', 'downloaded'].includes(field)) {
state.valuePlaceholder = 'Unit: GB'
} else {
state.valuePlaceholder = ''
}
incrementDecrement.value.open(id, field)
}
const handleEnableUser = async () => {
@@ -18,7 +18,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="Value" prop="value">
<el-input v-model="formData.value" type="number" />
<el-input v-model="formData.value" type="number" :placeholder="valuePlaceholder" />
</el-form-item>
<el-form-item label="Reason" prop="reason">
<el-input type="textarea" v-model="formData.reason"></el-input>
@@ -43,7 +43,8 @@ export default {
name: "DialogIncrementDecrement",
props: {
reload: Function,
title: String
title: String,
valuePlaceholder: String
},
setup(props, context) {
const formRef = ref(null)