|
@@ -5,12 +5,23 @@
|
|
|
<a-row>
|
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="logo图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logoPic">
|
|
|
- <j-image-upload v-model="model.logoPic" ></j-image-upload>
|
|
|
+ <!-- 为了不改变原jeecg的组件,所以单独写了一个 -->
|
|
|
+ <template v-if="isDefaultLogoPic">
|
|
|
+ <default-image-upload :url="model.logoPic" @remove="removeLogoPic"></default-image-upload>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <j-image-upload v-model="model.logoPic"></j-image-upload>
|
|
|
+ </template>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="背景图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="backPic">
|
|
|
- <j-image-upload v-model="model.backPic" ></j-image-upload>
|
|
|
+ <template v-if="isDefaultBackPic">
|
|
|
+ <default-image-upload :url="model.backPic" @remove="removeBackPic"></default-image-upload>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <j-image-upload v-model="model.backPic"></j-image-upload>
|
|
|
+ </template>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
@@ -43,10 +54,12 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
+ import DefaultImageUpload from './DefaultImageUpload.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'LoginConfigForm',
|
|
|
components: {
|
|
|
+ DefaultImageUpload
|
|
|
},
|
|
|
props: {
|
|
|
//表单禁用
|
|
@@ -54,7 +67,12 @@
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
required: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 是否是默认值状态
|
|
|
+ isDefault: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -87,7 +105,10 @@
|
|
|
add: "/interlockLoginConfig/interlockLoginConfig/add",
|
|
|
edit: "/interlockLoginConfig/interlockLoginConfig/edit",
|
|
|
// queryById: "/loginConfig/loginConfig/queryById"
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 是否已经改变图片状态为非默认值状态
|
|
|
+ isDefaultLogoPic: true,
|
|
|
+ isDefaultBackPic: true,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -100,11 +121,30 @@
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 删除默认图片后转换格式
|
|
|
+ removeLogoPic(){
|
|
|
+ this.model.logoPic = ''
|
|
|
+ this.isDefaultLogoPic = false
|
|
|
+ },
|
|
|
+ removeBackPic(){
|
|
|
+ this.model.backPic = ''
|
|
|
+ this.isDefaultBackPic = false
|
|
|
+ },
|
|
|
add () {
|
|
|
this.edit(this.modelDefault);
|
|
|
},
|
|
|
edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
+ this.isDefaultBackPic = this.isDefault
|
|
|
+ this.isDefaultLogoPic = this.isDefault
|
|
|
+ if(this.isDefault){
|
|
|
+ this.model = {
|
|
|
+ logoPic: require('@/assets/logo.png'),
|
|
|
+ backPic: require('@/assets/login.png'),
|
|
|
+ companyCopyright: '© 1983-2024 Advantech Co., Ltd.',
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.model = Object.assign({}, record);
|
|
|
+ }
|
|
|
this.visible = true;
|
|
|
},
|
|
|
submitForm () {
|