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