|
|
@@ -4,7 +4,7 @@
|
|
|
<div class='flex item full-width'>
|
|
|
<el-form-item class='full-width '>
|
|
|
<template v-slot:label>
|
|
|
- <div class='label light-red-bg full-width padding-left text-left bold' >
|
|
|
+ <div class='label full-width padding-left text-left bold' >
|
|
|
{{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -83,8 +83,7 @@
|
|
|
</template>
|
|
|
<div class='full-width flex flex-align-start full-height text-left full-width'
|
|
|
style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
- <el-select class="m-2" :placeholder="`请选择${item.label}`" @change='change($event,item)'
|
|
|
- :disabled='disable'>
|
|
|
+ <el-select v-if='!disable' class="m-2" v-model="editData[item.prop]" :placeholder="`请选择${item.label}`" @change='change($event,item)'>
|
|
|
<el-option
|
|
|
v-for="item in item.dict"
|
|
|
:key="item.value"
|
|
|
@@ -92,6 +91,7 @@
|
|
|
:value="item.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
+ <input v-else disabled v-model='editData[item.prop]' />
|
|
|
<el-icon v-if='!disable' class="padding-right padding-top">
|
|
|
<edit/>
|
|
|
</el-icon>
|
|
|
@@ -105,14 +105,15 @@
|
|
|
<template v-slot:label>
|
|
|
<div :style='`height:` + item.rows * 35 + `px`'
|
|
|
class='label white-bg full-width text-left padding-left bold'>
|
|
|
- {{ item.label }}{{ item.type }}
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class='full-width flex flex-align-start full-height text-left full-width'
|
|
|
style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
- <el-cascader ref='area' :options="item.dict" v-model="editData[item.prop]" :disabled='disable' class="m-2"
|
|
|
+ <el-cascader v-if='!disable' ref='area' :options="item.dict" v-model="editData[item.prop]" :disabled='disable' class="m-2"
|
|
|
:placeholder="`请选择${item.label}`" @change='change($event,item)'>
|
|
|
</el-cascader>
|
|
|
+ <input v-else disabled v-model='editData[item.prop]' />
|
|
|
<el-icon v-if='!disable' class="padding-right padding-top">
|
|
|
<edit/>
|
|
|
</el-icon>
|
|
|
@@ -127,12 +128,13 @@
|
|
|
<template v-slot:label>
|
|
|
<div :style='`height:` + item.rows * 35 + `px`'
|
|
|
class='label white-bg full-width text-left padding-left bold'>
|
|
|
- {{ item.label }}{{ item.type }}
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class='full-width flex flex-align-start full-height text-left full-width'
|
|
|
style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
<el-date-picker
|
|
|
+ v-if='!disable'
|
|
|
v-model="editData[item.prop]"
|
|
|
:disabled='disable'
|
|
|
type="daterange"
|
|
|
@@ -143,6 +145,7 @@
|
|
|
value-format='YYYY-MM-DD'
|
|
|
format='YYYY-MM-DD'
|
|
|
/>
|
|
|
+ <input v-else disabled v-model='editData[item.prop]' />
|
|
|
<el-icon v-if='!disable' class="padding-right padding-top">
|
|
|
<edit/>
|
|
|
</el-icon>
|
|
|
@@ -157,14 +160,14 @@
|
|
|
<template v-slot:label>
|
|
|
<div :style='`height:` + item.rows * 35 + `px`'
|
|
|
class='label white-bg full-width text-left padding-left bold'>
|
|
|
- {{ item.label }}{{ item.type }}
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div class='full-width flex flex-align-start full-height text-left full-width'
|
|
|
+ <div class='full-width flex flex-align-center full-height text-left full-width'
|
|
|
style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
- <el-input-number v-model='editData[item.prop]' :disabled='disable'
|
|
|
+ <input v-model='editData[item.prop]' :disabled='disable' type='number' class='full-width'
|
|
|
:placeholder='`请输入` + item.label' step='2'
|
|
|
- @change='change($event,item)'></el-input-number>
|
|
|
+ @change='change($event,item)'/>
|
|
|
<el-icon v-if='!disable' class="padding-right padding-top">
|
|
|
<edit/>
|
|
|
</el-icon>
|
|
|
@@ -196,16 +199,7 @@ export default {
|
|
|
item: {
|
|
|
handler (val) {
|
|
|
if (val.type === 'autoInput') {
|
|
|
- const tmp = {
|
|
|
- dict: '/blade-system/region/lazy-tree?parentCode=00',
|
|
|
- props: {
|
|
|
- label: 'title',
|
|
|
- value: 'key'
|
|
|
- }
|
|
|
- }
|
|
|
- val.expand = JSON.stringify(tmp, null, 4)
|
|
|
- val.expand = JSON.parse(val.expand)
|
|
|
- this.getDic(val.expand).then(res => {
|
|
|
+ this.getDic(val).then(res => {
|
|
|
val.dict = res
|
|
|
})
|
|
|
console.log(val.dict)
|
|
|
@@ -219,7 +213,11 @@ export default {
|
|
|
}
|
|
|
val.expand = JSON.stringify(tmp, null, 4)
|
|
|
val.expand = JSON.parse(val.expand)
|
|
|
- this.getDic(val.expand).then(res => {
|
|
|
+ this.getDic(val).then(res => {
|
|
|
+ val.dict = res
|
|
|
+ })
|
|
|
+ } else if (val.type === 'select') {
|
|
|
+ this.getDic(val).then(res => {
|
|
|
val.dict = res
|
|
|
})
|
|
|
}
|
|
|
@@ -245,14 +243,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async getDic (expand) {
|
|
|
- const local = localStorage.getItem('lazy-list')
|
|
|
- if (local) {
|
|
|
- return JSON.parse(local)
|
|
|
+ async getDic (item) {
|
|
|
+ let result = []
|
|
|
+ if (item.type === 'area') {
|
|
|
+ const local = localStorage.getItem('lazy-list')
|
|
|
+ if (local) {
|
|
|
+ return JSON.parse(local)
|
|
|
+ }
|
|
|
+ const tmp = await this.$api.common.basicFormRequest(item.expand.dict)
|
|
|
+ result = tmp.data.map(sub => this.mapTree(sub, item.expand))
|
|
|
+ localStorage.setItem('lazy-list', JSON.stringify(result))
|
|
|
+ } else {
|
|
|
+ const tmp = await this.$api.common.basicFormRequest(item.expand.dict)
|
|
|
+ result = tmp.data.map(sub => this.mapTree(sub, item.expand))
|
|
|
}
|
|
|
- const tmp = await this.$api.common.basicFormRequest(expand.dict)
|
|
|
- const result = tmp.data.map(item => this.mapTree(item, expand))
|
|
|
- localStorage.setItem('lazy-list', JSON.stringify(result))
|
|
|
return result
|
|
|
},
|
|
|
mapTree (item, expand) {
|