|
@@ -5,12 +5,23 @@
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="logo图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logoPic">
|
|
<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-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="背景图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="backPic">
|
|
<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-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
@@ -43,10 +54,12 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
+ import DefaultImageUpload from './DefaultImageUpload.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'LoginConfigForm',
|
|
name: 'LoginConfigForm',
|
|
components: {
|
|
components: {
|
|
|
|
+ DefaultImageUpload
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
//表单禁用
|
|
//表单禁用
|
|
@@ -54,7 +67,12 @@
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false,
|
|
default: false,
|
|
required: false
|
|
required: false
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 是否是默认值状态
|
|
|
|
+ isDefault: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -87,7 +105,10 @@
|
|
add: "/interlockLoginConfig/interlockLoginConfig/add",
|
|
add: "/interlockLoginConfig/interlockLoginConfig/add",
|
|
edit: "/interlockLoginConfig/interlockLoginConfig/edit",
|
|
edit: "/interlockLoginConfig/interlockLoginConfig/edit",
|
|
// queryById: "/loginConfig/loginConfig/queryById"
|
|
// queryById: "/loginConfig/loginConfig/queryById"
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 是否已经改变图片状态为非默认值状态
|
|
|
|
+ isDefaultLogoPic: true,
|
|
|
|
+ isDefaultBackPic: true,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -100,11 +121,30 @@
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 删除默认图片后转换格式
|
|
|
|
+ removeLogoPic(){
|
|
|
|
+ this.model.logoPic = ''
|
|
|
|
+ this.isDefaultLogoPic = false
|
|
|
|
+ },
|
|
|
|
+ removeBackPic(){
|
|
|
|
+ this.model.backPic = ''
|
|
|
|
+ this.isDefaultBackPic = false
|
|
|
|
+ },
|
|
add () {
|
|
add () {
|
|
this.edit(this.modelDefault);
|
|
this.edit(this.modelDefault);
|
|
},
|
|
},
|
|
edit (record) {
|
|
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;
|
|
this.visible = true;
|
|
},
|
|
},
|
|
submitForm () {
|
|
submitForm () {
|