添加重点
parent
46b649ac25
commit
82d6b76bec
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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: '农业类型',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue