Bläddra i källkod

Merge branch 'master' of http://123.57.226.179:8080/yin_yu820/HS_MZAP

guoqing 2 år sedan
förälder
incheckning
353710a433

+ 3 - 2
src/utils/config.js

@@ -2,7 +2,8 @@ let APP_SERVER_URL = ""
 
 if (process.env.NODE_ENV === 'development') {
     // 开发环境
-    APP_SERVER_URL = 'http://192.168.139.74:8084'
+    //APP_SERVER_URL = 'http://192.168.139.110:8084'
+    APP_SERVER_URL = 'http://localhost:8084'
 } else {
     // 生产环境
     APP_SERVER_URL = 'http://123.57.226.179:8010/hs'
@@ -10,4 +11,4 @@ if (process.env.NODE_ENV === 'development') {
 
 // APP_SERVER_URL = APP_SERVER_URL + "/app"
 
-export default APP_SERVER_URL
+export default APP_SERVER_URL

+ 2 - 4
src/views/activityMan/placeactivity/placeActivityView.vue

@@ -206,7 +206,7 @@
               capture="camera"
               accept=""
             >
-              <van-button icon="plus" class="upload-icon">上传文件</van-button>
+              <van-button>上传文件</van-button>
               <template #preview-cover="file">
                 <div class="preview-cover van-ellipsis">{{ file.name }}</div>
               </template>
@@ -317,7 +317,6 @@ export default {
               });
             }
           });
-          console.log("图片", fileList);
           subjectContentEditor.value.init(placeActivity.value.subjectContent);
           isLoading.value = false;
         });
@@ -470,8 +469,7 @@ export default {
 </script>
 
 <style scoped>
-.van-cell__value .van-field__right-icon .van-icon-location,
-.upload-icon {
+.van-cell__value .van-field__right-icon .van-icon-location {
   color: #36a7f3 !important;
 }
 .van-uploader .van-button {

+ 46 - 10
src/views/activityMan/siteInspection/siteInspectionView.vue

@@ -104,20 +104,20 @@
             <van-uploader
               :after-read="afterRead"
               v-model="fileList"
-              :max-count="1"
+              :max-count="6"
               capture="camera"
               accept=""
+              :before-delete="fjdelete"
             >
               <van-button icon="plus">上传文件</van-button>
-              <template #preview-cover="file">
+              <!-- <template #preview-cover="file">
                 <div class="preview-cover van-ellipsis">{{ file.name }}</div>
-              </template>
+              </template> -->
             </van-uploader>
           </template>
         </van-field>
       </van-cell-group>
 
-
       <van-cell-group>
         <div class="rowTextArea">
           <van-field
@@ -143,6 +143,8 @@ import { reactive, ref } from "vue";
 import personList from "../personList.vue";
 import siteInspectionService from "@/api/siteInspection/siteInspectionService";
 import tools from "@/api/sys/tools";
+// 图片路径
+import $base from "@/utils/config";
 export default {
   components: { personList },
   setup() {
@@ -226,22 +228,44 @@ export default {
     // 文件上传
     let fileList = ref([]);
     const afterRead = (file) => {
-      fileList.value = [];
       // 此时可以自行将文件上传至服务器
       new tools()
         .uploadFile(file, `csjcqk/siteInspection`)
         .then(({ data }) => {
-          // window.xm.showToast({
-          //     message:data.url
-          // })
-          fileList.value.push("http://localhost:3000"+data.url);
-          //siteInspection.value.enclosure = data.url;
+        
+          data.name = decodeURIComponent(
+            data.url.substring(
+              data.url.lastIndexOf("/") + 1
+            )
+          );
+
+          data.url = `${$base}` + data.url;      
+          
+
+          //fileList.value[0].url = `${$base}` + fileList.value[0].url;
+          // fileList.value[0].name = decodeURIComponent(
+          //   fileList.value[0].url.substring(
+          //     fileList.value[0].url.lastIndexOf("/") + 1
+          //   )
+          // );
+
+
+
         });
     };
+
+    const fjdelete = (file) => {
+      console.log(file);
+    };
+    
     // 提交数据
     const submit = () => {
       //添加保存前判断
 
+      //保存前附件处理
+      siteInspection.enclosure = data.url;
+
+
       new siteInspectionService().save(siteInspection).then((res) => {
         if(res.data=="保存场所检查情况成功"){
           window.xm.showToast({
@@ -276,6 +300,7 @@ export default {
       // 文件上传
       afterRead,
       fileList,
+      fjdelete,
       submit,
     };
   },
@@ -342,4 +367,15 @@ export default {
   width: 80%;
   top: 50%;
 }
+.preview-cover {
+    position: absolute;
+    bottom: 0;
+    box-sizing: border-box;
+    width: 100%;
+    padding: 4px;
+    color: #fff;
+    font-size: 12px;
+    text-align: center;
+    background: rgba(0, 0, 0, 0.3);
+  }
 </style>

+ 17 - 7
src/views/tab_a/tabAll.vue

@@ -126,11 +126,15 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 			//待办数据获取
 			dataNumber(){
 				new toBeDone().list().then((res)=>{
-					this.con1 = res.records.length;
+					this.sum1 = res.records.length;
+					this.sum=this.sum1+this.sum2;
 				})
 				new toBeDone().list2().then((res1)=>{
-					this.con2 = res1.records.length;
+					this.sum2 = res1.records.length;
+					this.sum=this.sum1+this.sum2;
+					
 				})
+
 			},
 			onClickLeft(){
 				history.back();
@@ -200,7 +204,7 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 						that.$store.commit('setUser',res.account);
 						that.getBannerImg();//获取轮播图
 						that.getSelectColor();//获取主题颜色
-						that.getStatistics();//获取待办事项数
+						that.dataNumber();//获取待办事项数
 					});
 
 					//})//上线取消注释
@@ -208,7 +212,7 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 				}else{
 					that.getBannerImg();//获取轮播图
 					that.getSelectColor();//获取主题颜色
-					that.getStatistics();//获取待办事项数
+					that.dataNumber();//获取待办事项数
 				}
 
 
@@ -219,9 +223,15 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 				new userSets()
 				.Statistics()
 				.then((res) => {
-					that.sum=res[0].sum;
-					that.sum1=res[0].sum1;
-					that.sum2=res[0].sum2;
+					if(res[0].sum!=undefined&&res[0].sum!=null&&res[0].sum!=""){
+						that.sum=res[0].sum;
+					}
+					if(res[0].sum1!=undefined&&res[0].sum1!=null&&res[0].sum1!=""){
+						that.sum1=res[0].sum1;
+					}
+					if(res[0].sum2!=undefined&&res[0].sum2!=null&&res[0].sum2!=""){
+						that.sum2=res[0].sum2;
+					}
 				});
 			},