Your Name
2022-08-25 6c6e0514283c7ff3016b845b600186b464e616c4
src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue
@@ -2,17 +2,6 @@
    <div class="app-container">
        <div class="filter-container">
            <div class="basic_search">
                <span>企业名称:</span>
                <el-select v-model="listQuery.eid" class="analyseUnit_input">
                    <el-option
                        v-for="item in companyList"
                        :key="item.id"
                        :label="item.company"
                        :value="item.id"
                    ></el-option>
                </el-select>
            </div>
            <div class="basic_search">
                <span>状态:</span>
                <el-select v-model="listQuery.status" class="analyseUnit_input">
                    <el-option
@@ -40,12 +29,13 @@
                </el-table-column>
                <el-table-column label="安全风险空间分布图" prop="img" align="center">
                    <template slot-scope="scope">
                        <el-popover placement="top-start" trigger="click">
                            <!--                        <a href="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" target="_blank" title="查看最大化图片"><img src="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" style="width: 300px;height: 300px" /></a>-->
                            <!--                        <img slot="reference" src="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" style="width:40px;height:40px;margin-left:10px;cursor:pointer" ></img>-->
                            <!--                            <a  :href="scope.row.enterpriseResources.url" target="_blank" title="查看最大化图片"><img v-for="(item,index) in scope.row.enterpriseResources" :src="item.url" style="width: 300px;height: 300px" /></a>-->
                            <img slot="reference" :src="scope.row.img" style="width:40px;height:40px;margin-left:10px;cursor:pointer" @click="showImg(scope.row.img)"></img>
                        </el-popover>
                        <el-button type="text" @click="downloadPic(scope.row)">下载</el-button>
<!--                        <el-popover placement="top-start" trigger="click">-->
<!--                            &lt;!&ndash;                        <a href="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" target="_blank" title="查看最大化图片"><img src="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" style="width: 300px;height: 300px" /></a>&ndash;&gt;-->
<!--                            &lt;!&ndash;                        <img slot="reference" src="http://192.168.0.7:8100/upload/enterprise/20210327184751998.png" style="width:40px;height:40px;margin-left:10px;cursor:pointer" ></img>&ndash;&gt;-->
<!--                            &lt;!&ndash;                            <a  :href="scope.row.enterpriseResources.url" target="_blank" title="查看最大化图片"><img v-for="(item,index) in scope.row.enterpriseResources" :src="item.url" style="width: 300px;height: 300px" /></a>&ndash;&gt;-->
<!--                            <img slot="reference" :src="scope.row.img" style="width:40px;height:40px;margin-left:10px;cursor:pointer" @click="showImg(scope.row.img)"></img>-->
<!--                        </el-popover>-->
                    </template>
                </el-table-column>
                <el-table-column label="创建人" prop="createUname" align="center">
@@ -185,7 +175,6 @@
                    status: null
                },
                listQuery:{
                    eid:'',
                    status:0,
                },
            }
@@ -198,7 +187,6 @@
            async getSafetyRiskSpaceData(){
                this.listLoading = true
                let params = {}
                params["eid"] = (this.listQuery.eid === '' ? Cookies.get('companyid') : this.listQuery.eid)
                params["status"] = this.listQuery.status
                let res = await getSafetyRiskSpaceList(params)
                if(res.data.code === '200'){
@@ -233,6 +221,9 @@
                    })
                }
            },
            downloadPic(val){
                window.open( val.img, '_blank')
            },
            showSafetyRiskSpace(value,type){
                this.safetyRiskSpaceVisible = true
                this.$nextTick(() =>{
@@ -241,20 +232,21 @@
                if(type === '新增'){
                    this.title = '新增'
                    this.safetyRiskSpaceForm = {
                        createUid: Cookies.get('userId'),
                        createUid: parseInt(Cookies.get('userId')),
                        descInfo: null,
                        img: null,
                    }
                    this.fileList = []
                }else{
                    this.title = '查看'
                    this.safetyRiskSpaceForm = value
                    this.fileList = []
                    this.fileList.push({url:value.img})
                }
            },
            submitSafetyRiskSpace(){
                this.$refs["safetyRiskSpaceForm"].validate((valid) =>{
                    if(valid){
                        debugger
                        addSafetyRiskSpace(this.safetyRiskSpaceForm).then((res)=>{
                            if(res.data.code === '200'){
                                this.safetyRiskSpaceVisible = false
@@ -286,14 +278,22 @@
                    cancelButtonText:'取消',
                    type:'warning',
                }).then(()=> {
                    deleteSafetyRiskSpace(val.id).then( ()=>{
                        this.getSafetyRiskSpaceData()
                        this.$notify({
                            title:'成功',
                            message:'删除成功',
                            type:'success',
                            duration:2000,
                        })
                    deleteSafetyRiskSpace(val.id).then( (res)=>{
                        if(res.data.code === '200'){
                            this.getSafetyRiskSpaceData()
                            this.$notify({
                                title:'成功',
                                message:'删除成功',
                                type:'success',
                                duration:2000,
                            })
                        }else{
                            this.$message({
                                type:'warning',
                                message:res.data.message
                            })
                        }
                    })
                })
            },
@@ -305,8 +305,8 @@
            },
            onFileSuccess(response){
                if(response.code === '200'){
                    debugger
                    this.safetyRiskSpaceForm.img = response.result.path
                    this.fileList = []
                    this.fileList.push({url:process.env.IMG_API + response.result.path})
                    this.$notify({
                        type:'success',
@@ -322,7 +322,6 @@
                }
            },
            handleFile(file){
                debugger
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            },