【修改】修改水印传参 增加枚举
This commit is contained in:
@@ -6,3 +6,11 @@ export const PERMISSION = new Esenum([
|
||||
{ label: '预览+下载', value: "2" }
|
||||
])
|
||||
|
||||
// 基础设置的枚举
|
||||
// export const basMessage = new Esenum([
|
||||
// {name:"水印前缀" ,value: "WATERMARK_PREFIX"}
|
||||
// ])
|
||||
export const basMessage = new Esenum({
|
||||
mark: {name: "水印前缀", value: "WATERMARK_PREFIX",index:0}
|
||||
})
|
||||
|
||||
|
||||
+3
-2
@@ -38,11 +38,12 @@
|
||||
|
||||
<script>
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
import {basMessage} from '@/utils/Enum/enum'
|
||||
export default {
|
||||
name: 'Login',
|
||||
data () {
|
||||
return {
|
||||
basMessage,
|
||||
form: {
|
||||
username: '',
|
||||
password: '',
|
||||
@@ -134,7 +135,7 @@ export default {
|
||||
// 调用获取水印的前缀接口 获取前缀
|
||||
getMarket () {
|
||||
return new Promise((resolve,reject)=>{
|
||||
this.$api.setting.getOneSetting("水印前缀").then(res=>{
|
||||
this.$api.setting.getOneSetting( this.basMessage['mark'].value).then(res=>{
|
||||
if(res.data){
|
||||
resolve(res.data.configValue)
|
||||
|
||||
|
||||
+26
-18
@@ -1,31 +1,32 @@
|
||||
<template>
|
||||
<div class="content-height">
|
||||
<el-row class="inputForm" v-for="i in formData">
|
||||
<el-row class="inputForm" >
|
||||
<el-col :span="6">
|
||||
<div class="tag-item showLimit">
|
||||
<label class="tag-title">{{i.configKey}}:</label>
|
||||
<el-input v-model="i.configValue" placeholder="请输入水印前缀"
|
||||
<label class="tag-title">水印前缀:</label>
|
||||
<el-input v-model="formData.markValue" placeholder="请输入水印前缀"
|
||||
maxlength="100" show-word-limit></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2" align="right" class="tag-btns">
|
||||
<el-button type="primary" @click="save(i)">保存</el-button>
|
||||
<el-button type="primary" @click="save('mark',0)">保存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {basMessage} from '@/utils/Enum/enum'
|
||||
export default {
|
||||
name: "index",
|
||||
data(){
|
||||
return {
|
||||
formData:[
|
||||
{
|
||||
configKey:'水印前缀',
|
||||
configValue:''
|
||||
}
|
||||
]
|
||||
basMessage,
|
||||
formData:{
|
||||
markValue:''
|
||||
},
|
||||
row0:{}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -36,18 +37,25 @@ export default {
|
||||
loadMark(){
|
||||
this.$api.setting.getAllSetting().then(res=>{
|
||||
if(res.data.length>0){
|
||||
this.formData=res.data
|
||||
console.log(res.data.data,"res.data.data")
|
||||
res.data.forEach( item=>{
|
||||
switch (item.configKey){
|
||||
case this.basMessage['mark'].value :
|
||||
this.formData.markValue=item.configValue
|
||||
this['row'+this.basMessage['mark'].index] = item
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.formData=[{
|
||||
configKey:'水印前缀',
|
||||
configValue:''
|
||||
}]
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
save(i){
|
||||
this.$api.setting.saveMarket(i).then(res=>{
|
||||
save(name,index){
|
||||
let param={
|
||||
id: this["row"+index].id ? this["row"+index].id:'',
|
||||
configValue: this.formData[name+'Value'],
|
||||
configKey: this.basMessage[name].value
|
||||
}
|
||||
this.$api.setting.saveMarket(param).then(res=>{
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user