添加重点

develop
ihzero 2023-11-22 17:01:20 +08:00
parent 46b649ac25
commit 82d6b76bec
4 changed files with 31 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -30,6 +30,7 @@
</BasicDrawer>
</template>
<script lang="ts" setup>
import { defaultsDeep } from 'lodash-es'
import { InputNumber } from 'ant-design-vue'
import { ref, computed, unref, watch } from 'vue'
import { BasicForm, useForm } from '/@/components/Form/index'
@ -80,17 +81,29 @@
const inputChange = (e, event) => {
params.value[e] = event
}
const setValue = (keys: any, value: any) => {
const object = {}
var last = keys.pop()
keys.reduce((o, k) => (o[k] = o[k] || {}), object)[last] = value
return object
}
const handleSubmit = async () => {
try {
const values = await validate()
values.type = 1
let params = {}
for (const key in values) {
params = defaultsDeep({}, params, setValue(key.split('.'), values[key]))
}
params.type = 1
setDrawerProps({ confirmLoading: true })
if (values.id) {
//
await editGriculturalBasic(values.id, values)
await editGriculturalBasic(values.id, params)
} else {
//
await addaGriculturalBasic(values)
await addaGriculturalBasic(params)
}
closeDrawer()
emits('success')

View File

@ -122,7 +122,17 @@ export const accountFormSchema: FormSchema[] = [
return !!values.is_blank
},
},
{
field: 'extends.priority',
label: '重点',
required: true,
component: 'Switch',
componentProps: {
checkedChildren: '是',
unCheckedChildren: '否',
},
defaultValue: false,
},
{
field: 'industry_key',
label: '农业类型',

View File

@ -36,6 +36,7 @@
import SheepImg from '/@/assets/images/sheep.png'
import PigImg from '/@/assets/images/pig.png'
import SternImg from '/@/assets/images/stern.png'
import DotImg from '/@/assets/images/WechatIMG555.jpg'
const domImg = document.createElement('img')
domImg.style.height = '8px'
@ -449,7 +450,9 @@
...e,
value: [e.address_lng, e.address_lat],
datas: e.areas,
img: 'image://https://www.makeapie.cn/asset/get/s/data-1619059442567-s5l7-f8Eu9.png',
img: e.extends?.priority
? `image://${DotImg}`
: 'image://https://www.makeapie.cn/asset/get/s/data-1619059442567-s5l7-f8Eu9.png',
})
})
registerMap('lcxz', tempMapJSON.value)