shuishen
2024-01-19 e03b60fdffe5ad9f179928fd090a489dbbee2c29
src/views/place/components/baseAllInfo.vue
@@ -1,7 +1,7 @@
<template>
    <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose">
        <div class="cur-container-box">
        <div class="cur-container-box" v-if="roleBox">
            <div class="content-box">
@@ -26,6 +26,7 @@
                <el-button size="small" @click="roleBoxClose">关 闭</el-button>
            </div>
        </div>
    </el-dialog>
@@ -390,14 +391,7 @@
                getPlace(newData['id']),
                getPlaceExt({ placeId: newData['id'] }),
            ]).then(that.$axios.spread(function (baseInfo, restInfo) {
                that.form = {
                    ...baseInfo.data.data,
                    neiCode: String(baseInfo.data.data.neiCode),
                    gridId: String(baseInfo.data.data.gridId),
                }
                console.log(that.form, 90999)
                // that.$nextTick(() => that.$refs.baseForm.dicInit('cascader'))
                that.form = baseInfo.data.data
                that.form.location = [that.form.lng, that.form.lat, that.form.location].join(',')
@@ -439,13 +433,7 @@
                        planImageUrls
                    }
                }
                // that.$nextTick(() => {
                //     that.$refs.baseForm.dicInit('select')
                // })
            }))
            that.holdOnLoad(this.holdPage)
        },
        locationDispose (data) {
@@ -526,6 +514,8 @@
        },
        holdOnLoad (holdPage, params = {}) {
            console.log(98098599)
            if (!this.curRow.id) return
            let values = {
@@ -552,26 +542,36 @@
            this.holdPage.pageSize = pageSize
        },
        dataUpdate () {
            const that = this
            let imageUrls = this.form.imageUrls
            if (imageUrls.length > 0) {
        desposeImage (data) {
            if (data.length > 0) {
                var urls = []
                var split = imageUrls.split(",").filter(item => item != '')
                var split = data.split(",").filter(item => item != '')
                split.forEach(url => {
                    var names = url.split("jczz/")
                    urls.push(names[1])
                })
                imageUrls = urls.join(",")
                data = urls.join(",")
            }
            return data
        },
        dataUpdate () {
            const that = this
            let imageUrls = this.desposeImage(this.form.imageUrls)
            let placeImages = this.desposeImage(this.placeForm.imageUrls)
            let placePlanImageUrls = this.desposeImage(this.placeForm.planImageUrls)
            let label = this.form.label
            if (this.form.smallLabel != '') {
                label = label + ',' + this.form.smallLabel
            }
            console.log(this.form, this.placeForm, 5555)
            delete this.form.smallLabel
@@ -585,14 +585,18 @@
                            label,
                            ...this.locationDispose(this.form.location)
                        }),
                        updatePlaceExt(this.placeForm)
                        updatePlaceExt({
                            ...this.placeForm,
                            imageUrls: placeImages,
                            planImageUrls: placePlanImageUrls
                        })
                    ]).then(that.$axios.spread(function () {
                        that.$message({
                            type: "success",
                            message: "操作成功!",
                        })
                        that.closeRowDetails()
                        that.roleBoxClose()
                        that.placeElement.onLoad(that.placeElement.page, that.placeElement.query)