From 19ec0269a9ce3a57ccfcd1d36585bb1c31977b60 Mon Sep 17 00:00:00 2001
From: ludc <ludc@vci-tech.com>
Date: 星期五, 10 一月 2025 10:25:22 +0800
Subject: [PATCH] ui定义为树或树表时默认设置orientation为positive
---
Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue | 82 ++++++++++++++++++++++++----------------
1 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue b/Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue
index c2c724d..7507f5f 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue
@@ -4,8 +4,12 @@
<el-main>
<basic-container>
<div style="margin: 0 0 10px 20px">
- <el-button v-if="form.delType==0" icon="el-icon-check" size="small" type="primary" @click="saveHandler">淇濆瓨</el-button>
- <el-button v-else icon="el-icon-delete" size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>
+ <el-button v-if="form.delType == 0 && permissionList.saveBtn" icon="el-icon-check" size="small" type="primary"
+ @click="saveHandler">淇濆瓨
+ </el-button>
+ <el-button v-if="form.delType != 0 && permissionList.delBtn" icon="el-icon-delete" size="small" type="danger"
+ @click="delHandler">鍒犻櫎
+ </el-button>
</div>
<avue-form ref="form" v-model="form" :option="formOption"></avue-form>
<div class="tip">
@@ -21,38 +25,40 @@
</template>
<script>
-import {getPeroid,savePeriod,deleteLog} from "@/api/system/log/logBasic";
+import {getPeroid, savePeriod, deleteLog} from "@/api/system/log/logBasic";
+import {mapGetters} from "vuex";
+
export default {
name: "basicConf",
data: function () {
return {
- form:{
- period:'',
+ form: {
+ period: '',
},
- periodData:[],
- formOption:{
+ periodData: [],
+ formOption: {
submitBtn: false,
emptyBtn: false,
column: [{
label: '鏃ュ織鍒犻櫎',
prop: 'delType',
span: 24,
- labelWidth:120,
+ labelWidth: 120,
type: 'radio',
value: 0,
dicData: [
- { label: '鑷姩鍒犻櫎', value: 0 },
- { label: '鎵嬪姩鍒犻櫎', value: 1 },
+ {label: '鑷姩鍒犻櫎', value: 0},
+ {label: '鎵嬪姩鍒犻櫎', value: 1},
]
}, {
label: '淇濆瓨鏃ユ湡',
prop: 'period',
type: 'select',
- labelWidth:120,
+ labelWidth: 120,
dicData: this.periodData,
- props:{
- label:'value',
- value:'code'
+ props: {
+ label: 'value',
+ value: 'code'
},
rules: [{
required: true,
@@ -63,8 +69,8 @@
label: '璇烽�夋嫨鏃ユ湡',
prop: 'deleteDate',
type: 'date',
- valueFormat:'yyyy-MM-dd',
- labelWidth:120,
+ valueFormat: 'yyyy-MM-dd',
+ labelWidth: 120,
display: false,
rules: [{
required: true,
@@ -75,44 +81,53 @@
},
}
},
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ saveBtn: this.vaildData(this.permission[this.$route.query.id].save, false),
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ };
+ },
+ },
created() {
this.getPeroid();
},
watch: {
'form.delType': {
handler(newval) {
- if (newval ==0) {
- this.formOption.column[1].display=true;
- this.formOption.column[2].display=false;
- }else {
- this.formOption.column[1].display=false;
- this.formOption.column[2].display=true;
+ if (newval == 0) {
+ this.formOption.column[1].display = true;
+ this.formOption.column[2].display = false;
+ } else {
+ this.formOption.column[1].display = false;
+ this.formOption.column[2].display = true;
}
}
},
},
- methods:{
- getPeroid:function (){
+ methods: {
+ getPeroid: function () {
getPeroid().then(res => {
this.$refs.form.updateDic('period', res.data.data);
- this.periodData=res.data.data;
- this.form.period=res.data.data.filter(item=>{
+ this.periodData = res.data.data;
+ this.form.period = res.data.data.filter(item => {
return item.choose
})[0].code
}).catch(error => {
})
},
- saveHandler:function (){
- savePeriod({'period':this.form.period}).then(res => {
+ saveHandler: function () {
+ savePeriod({'period': this.form.period}).then(res => {
if (res.data.success) {
this.$message.success('淇濆瓨鎴愬姛')
}
});
},
delHandler() {
- this.$refs.form.validate((valid,done) => {
- if(valid){
- deleteLog({'deleteDate':this.form.deleteDate}).then(res => {
+ this.$refs.form.validate((valid, done) => {
+ if (valid) {
+ deleteLog({'deleteDate': this.form.deleteDate}).then(res => {
if (res.data.success) {
this.$message.success('鍒犻櫎鎴愬姛')
}
@@ -126,13 +141,14 @@
</script>
<style scoped>
-.tip{
+.tip {
font-size: 12px;
line-height: 24px;
color: #909399;
margin: 0 0 10px 20px;
}
-.tip div{
+
+.tip div {
margin-left: 30px;
}
</style>
--
Gitblit v1.9.3