代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-30 17:52:16 +08:00
parent 91c804b2ff
commit 3ae2b5acd5
2 changed files with 82 additions and 11 deletions

View File

@ -1,7 +1,30 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
{{}}
<el-form-item label="项目名称:" prop="title">
<el-input v-model="formModel.title" style="width: 260px;" />
</el-form-item>
<el-form-item label="左上角名称:" prop="loginTitle">
<el-input v-model="formModel.loginTitle" style="width: 260px;" />
</el-form-item>
<el-form-item label="页签名称:" prop="browserTitle">
<el-input v-model="formModel.browserTitle" style="width: 260px;" />
</el-form-item>
<el-form-item label="关于系统:" prop="aboutSystem">
<el-input v-model="formModel.aboutSystem" style="width: 260px;" />
</el-form-item>
<el-form-item label="基于系统开发:" prop="baseDevelopment">
<el-switch v-model="formModel.baseDevelopment" />
</el-form-item>
<el-form-item label="显示背景图片:" prop="showBackPic">
<el-switch v-model="formModel.showBackPic" />
</el-form-item>
<el-form-item label="微信登录:" prop="wechatLogin">
<el-switch v-model="formModel.wechatLogin" />
</el-form-item>
<el-form-item label="导航栏名称:" prop="homeTitle">
<el-input v-model="formModel.homeTitle" style="width: 260px;" />
</el-form-item>
<!-- -->
</el-form>
<span slot="footer" class="dialog-footer">
@ -17,27 +40,65 @@ export default {
data() {
return {
dialogVisible: false,
row:null,
loading: false,
formModel:{
title:'',
loginPath:''
title:'', //
loginTitle:'', //
browserTitle:'', //
baseDevelopment:false, //
showBackPic:true, //
aboutSystem:'', //
wechatLogin:true, //
homeTitle:'' //
}
};
},
computed: {
rules() {
const crules = {
title: [
{ required: true, message: '请输入项目名称', trigger: 'blur' }
],
browserTitle: [
{ required: true, message: '请输入页签名称', trigger: 'blur' }
],
homeTitle: [
{ required: true, message: '请输入导航栏名称', trigger: 'blur' }
]
};
return crules;
},
title() {
return '修改前端配置';
}
},
methods:{
doShow(row) {
this.dialogVisible = true;
if (row) {
// this.formModel.title = row.id;
// this.formModel.markKey = row.markKey;
// this.formModel.project = row.project;
this.row = row;
const viewSetting = JSON.parse(row.viewSetting);
this.formModel.title = viewSetting.title || '';
this.formModel.loginTitle = viewSetting.loginTitle || '';
this.formModel.browserTitle = viewSetting.browserTitle || '';
this.formModel.aboutSystem = viewSetting.aboutSystem || '';
this.formModel.homeTitle = viewSetting.homeTitle || '';
this.formModel.baseDevelopment = viewSetting.baseDevelopment || false;
this.formModel.showBackPic = viewSetting.showBackPic || true;
this.formModel.wechatLogin = viewSetting.wechatLogin || true;
}
},
handleClose() {
this.formModel = {
title:'',
loginPath:''
title:'', //
loginTitle:'', //
browserTitle:'', //
baseDevelopment:false, //
showBackPic:true, //
aboutSystem:'', //
wechatLogin:true, //
homeTitle:'' //
};
this.$refs.ruleForm.resetFields();
this.dialogVisible = false;
@ -47,7 +108,17 @@ export default {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.loading = true;
const data = Object.assign({}, this.formModel);
const row = JSON.parse(JSON.stringify(this.row));
row.viewSetting = JSON.stringify(this.formModel);
//
updateFrontProjectConfig(row).then(resp => {
this.$message.success('修改前端配置成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
}
});
}

View File

@ -2,7 +2,7 @@
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-project-config ref="addProjectConfig" @reloadTable="reloadTable" />
<front-project-config ref="frontProjectConfig" />
<front-project-config ref="frontProjectConfig" @reloadTable="reloadTable" />
</div>
</template>
<script>