|
@@ -47,17 +47,17 @@ export default {
|
|
|
fillColor: '#ff003f',
|
|
|
strokeColor: '#ff003f',
|
|
|
colorArr: [
|
|
|
- {color: '#fb6557'},
|
|
|
- {color: '#ff9149'},
|
|
|
+ {color: '#fb6557', t: '专本科'},
|
|
|
+ {color: '#ff9149', t: '幼儿园'},
|
|
|
// {color: '#9f7df4'},
|
|
|
- {color: '#60c68b'},
|
|
|
+ {color: '#60c68b', t: ''},
|
|
|
// {color: '#4da4ee'},
|
|
|
- {color: '#e77ad4'}
|
|
|
+ {color: '#e77ad4', t: ''}
|
|
|
],
|
|
|
colorArr2: [
|
|
|
- {color: '#ff0', t: '新房'},
|
|
|
- {color: '#9f7df4', t: '二手'},
|
|
|
- {color: '#ff7fbf', t: '教育'},
|
|
|
+ {color: '#ff0', t: '新楼盘'},
|
|
|
+ {color: '#9f7df4', t: '二手房'},
|
|
|
+ {color: '#ff7fbf', t: '中小学'},
|
|
|
{color: '#ff003f', t: '商业'},
|
|
|
{color: '#007299', t: '公共'},
|
|
|
{color: '#00ff3f', t: '公园'},
|
|
@@ -65,12 +65,14 @@ export default {
|
|
|
],
|
|
|
cObj: {},
|
|
|
estateObj: {},
|
|
|
+ schoolObj: {},
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
isShow: function(val) {
|
|
|
if (val) {
|
|
|
this.estateObj = {}
|
|
|
+ this.schoolObj = {}
|
|
|
this.cObj = JSON.parse(JSON.stringify(this.curObj))
|
|
|
this.getDef()
|
|
|
}
|
|
@@ -79,12 +81,20 @@ export default {
|
|
|
methods: {
|
|
|
getDef (str) {
|
|
|
let params = { ...this.curObj.obj }
|
|
|
- let remoteOptions = []
|
|
|
+ let remoteEstateOptions = []
|
|
|
if (params.estateObj) {
|
|
|
const estateObj = JSON.parse(params.estateObj)
|
|
|
if (estateObj.id) {
|
|
|
params.estate_id = estateObj.id
|
|
|
- remoteOptions = [{ keyRO: estateObj.estate_name, valRO: estateObj.id }]
|
|
|
+ remoteEstateOptions = [{ keyRO: estateObj.estate_name, valRO: estateObj.id }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let remoteSchoolOptions = []
|
|
|
+ if (params.schoolObj) {
|
|
|
+ const schoolObj = JSON.parse(params.schoolObj)
|
|
|
+ if (schoolObj.id) {
|
|
|
+ params.school_id = schoolObj.id
|
|
|
+ remoteSchoolOptions = [{ keyRO: schoolObj.school_name, valRO: schoolObj.id }]
|
|
|
}
|
|
|
}
|
|
|
if (str === 'color') {
|
|
@@ -97,7 +107,15 @@ export default {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
params = {...oldform}
|
|
|
params.text = this.estateObj.estate_name
|
|
|
- remoteOptions = [{ keyRO: this.estateObj.estate_name, valRO: this.estateObj.id }]
|
|
|
+ remoteEstateOptions = [{ keyRO: this.estateObj.estate_name, valRO: this.estateObj.id }]
|
|
|
+ params.school_id = ''
|
|
|
+ }
|
|
|
+ if (str === 'school') {
|
|
|
+ const oldform = this.$refs.ruleForm.baseForm
|
|
|
+ params = {...oldform}
|
|
|
+ params.text = this.schoolObj.school_name
|
|
|
+ remoteSchoolOptions = [{ keyRO: this.schoolObj.school_name, valRO: this.schoolObj.id }]
|
|
|
+ params.estate_id = ''
|
|
|
}
|
|
|
if (!params.text) params.text = '标题示例'
|
|
|
if (!params.strokeStyle) params.strokeStyle = 'solid'
|
|
@@ -110,7 +128,11 @@ export default {
|
|
|
this.formData = [
|
|
|
{ label: '关联楼盘', key: 'estate_id', type: 'selectRemote', changeHandle: this.estateChange,
|
|
|
remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
|
|
|
- remoteOptions
|
|
|
+ remoteOptions: remoteEstateOptions
|
|
|
+ },
|
|
|
+ { label: '关联学校', key: 'school_id', type: 'selectRemote', changeHandle: this.schoolChange,
|
|
|
+ remoteParams: { skey: 'school_name', api: `school.admschoollist`, opKey: 'school_name', opVal: 'id' },
|
|
|
+ remoteOptions: remoteSchoolOptions
|
|
|
},
|
|
|
{ label: '标题', key: 'text', rules: 1},
|
|
|
{ label: '填充色', key: 'fillColor', type: 'colorPicker', rules: 1},
|
|
@@ -145,6 +167,17 @@ export default {
|
|
|
}
|
|
|
this.getDef('estate')
|
|
|
},
|
|
|
+ schoolChange (val, op, valObj) {
|
|
|
+ this.schoolObj = {
|
|
|
+ id: valObj.id,
|
|
|
+ school_name: valObj.school_name,
|
|
|
+ pri_image: valObj.pri_image,
|
|
|
+ school_attrib: valObj.school_attrib,
|
|
|
+ school_type: valObj.school_type,
|
|
|
+ remarked: valObj.remarked,
|
|
|
+ }
|
|
|
+ this.getDef('school')
|
|
|
+ },
|
|
|
colorHandle (item) {
|
|
|
this.fillColor = item.color
|
|
|
this.strokeColor = item.color
|
|
@@ -159,6 +192,9 @@ export default {
|
|
|
if (this.estateObj && this.estateObj.id) {
|
|
|
newForm.estateObj = JSON.stringify(this.estateObj)
|
|
|
}
|
|
|
+ if (this.schoolObj && this.schoolObj.id) {
|
|
|
+ newForm.schoolObj = JSON.stringify(this.schoolObj)
|
|
|
+ }
|
|
|
if (this.curObj.obj) {
|
|
|
this.$emit('close', newForm, 'edit')
|
|
|
} else {
|
|
@@ -205,6 +241,7 @@ export default {
|
|
|
opacity: .6;
|
|
|
color: #000;
|
|
|
user-select: none;
|
|
|
+ font-size: 12px;
|
|
|
&.cur {
|
|
|
opacity: 1;
|
|
|
color: #fff;
|