From e8d946a82907aa530ff086987d3ec7d2c04a90d2 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 15 十一月 2022 13:09:55 +0800
Subject: [PATCH] 默认更改列表

---
 src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue |   50 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue b/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue
index f593625..1484256 100644
--- a/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue
@@ -29,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">
@@ -174,7 +175,6 @@
                     status: null
                 },
                 listQuery:{
-                    eid:'',
                     status:0,
                 },
             }
@@ -187,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'){
@@ -222,6 +221,9 @@
                     })
                 }
             },
+            downloadPic(val){
+                window.open( val.img, '_blank')
+            },
             showSafetyRiskSpace(value,type){
                 this.safetyRiskSpaceVisible = true
                 this.$nextTick(() =>{
@@ -230,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
@@ -275,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
+                            })
+                        }
+
                     })
                 })
             },
@@ -294,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',
@@ -311,7 +322,6 @@
                 }
             },
             handleFile(file){
-                debugger
                 this.dialogImageUrl = file.url;
                 this.dialogVisible = true;
             },

--
Gitblit v1.9.2