添加默哀日灰度样式

This commit is contained in:
lixuetao
2023-10-28 10:22:04 +08:00
parent 26c43aecd7
commit 4449a9d973
3 changed files with 74 additions and 44 deletions
+42 -36
View File
@@ -6,11 +6,14 @@
</template>
<script>
import { loading } from './utils/request'
import { basMessage } from '@/utils/Enum/enum'
export default {
name: 'ReportManager',
data () {
return {}
return {
basMessage,
}
},
methods: {
getQueryVariable (r, variable) {
@@ -30,6 +33,27 @@ export default {
closeLoading () {
loading.close()
this.$store.commit('saveIsLoading', false)
},
// 判断是否要把页面置灰
getGray () {
let that = this
this.$api.setting.getOneSetting(that.basMessage['gray'].value).then(res=>{
if (res.ok) {
let obj=res.data;
if(!obj || !obj.configValue){
obj = {
configValue : '0'
}
}
if (obj.configValue === '1') {
document.querySelector('body').classList.add('setGray')
} else {
document.querySelector('body').classList.remove('setGray')
}
} else {
this.$message.error(res.respMsg)
}
})
}
},
created () {
@@ -41,35 +65,14 @@ export default {
action: 'aplus.setMetaInfo',
arguments: ['Info ', true]
});
const _that = this
// var path = window.location.search
// var ticket = this.getQueryVariable(path, 'ticket')
// var loginType = this.getQueryVariable(path, 'loginType')
// if (loginType == 1) {
// window.open('http://10.12.1.78:9090/cas/login?service=http://192.168.144.22:9966/home', '_self');
// } else {
// // if (ticket) {
// // var params = {
// // service: 'http://localhost:8080/home',
// // ticket: ticket
// // }
// // this.$api.login.loginByTicket(params).then(res => {
// // if (res.respCode !== '0') {
// // // this.verifyCode();
// // return this.$message.error(res.data.message);
// // }
// // this.$message.success('登录成功');
// // _that.$store.commit('saveUserInfo', res.data);
// // _that.$router.push('/home');
// // }).catch(_ => {
// // // this.verifyCode();
// // this.$router.push('/');
// // })
// //
// // } else {
// // this.$router.push('/');
// // }
// }
},
mounted() {
debugger
this.$bus.$on('getGray', () => {
this.getGray()
})
// @msg: 刷新后重定向
this.getGray();
}
}
</script>
@@ -92,12 +95,6 @@ export default {
position: relative;
overflow: hidden;
body {
-webkit-filter: grayscale(100%);
/* Chrome, Safari, Opera */
filter: grayscale(100%);
}
#app {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@@ -550,4 +547,13 @@ export default {
.ql-font-sans-serif {
font-family: "sans-serif";
}
.setGray{
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
}
</style>
+2 -1
View File
@@ -12,7 +12,8 @@ export const PERMISSION = [
// {name:"水印前缀" ,value: "WATERMARK_PREFIX"}
// ])
export const basMessage = new Esenum({
mark: {name: "水印前缀", value: "WATERMARK_PREFIX",index:0}
mark: {name: "水印前缀", value: "WATERMARK_PREFIX",index:0},
gray: {name: "黑白模式", value: "SET_GRAY",index:1}
})
+30 -7
View File
@@ -12,6 +12,23 @@
<el-button type="primary" @click="save('mark',0)">保存</el-button>
</el-col>
</el-row>
<el-row class="inputForm" >
<el-col :span="6">
<div class="tag-item">
<label class="tag-title">黑白模式:</label>
<el-switch
v-model="formData.grayValue"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</div>
</el-col>
<el-col :span="2" align="right" class="tag-btns">
<el-button type="primary" @click="save('gray',1)">保存</el-button>
</el-col>
</el-row>
</div>
</template>
@@ -23,10 +40,11 @@ export default {
return {
basMessage,
formData:{
markValue:''
markValue:'',
grayValue:''
},
row0:{}
row0:{},
row1:{}
}
},
created() {
@@ -38,10 +56,14 @@ export default {
this.$api.setting.getAllSetting().then(res=>{
if(res.data.length>0){
res.data.forEach( item=>{
switch (item.configKey){
case this.basMessage['mark'].value :
this.formData.markValue=item.configValue
this['row'+this.basMessage['mark'].index] = item
if (item.configKey == this.basMessage['mark'].value){
this.formData.markValue=item.configValue
this['row'+this.basMessage['mark'].index] = item
}
if (item.configKey == this.basMessage['gray'].value){
this.formData.grayValue=item.configValue
this['row'+this.basMessage['gray'].index] = item
}
})
}else{
@@ -57,6 +79,7 @@ export default {
}
this.$api.setting.saveMarket(param).then(res=>{
this.$message.success(res.data)
this.$bus.$emit('getGray')
})
},
}