Forráskód Böngészése

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

5 éve
szülő
commit
c3c6716f9d

+ 1 - 1
ys_vue/src/http.js

@@ -66,7 +66,7 @@ export default {
      * @param response 请求成功时的回调函数
      * @param exception 异常的回调函数
      */
-    get (url, response, exception) {
+    get (url , response, exception) {
         var user = sessionStorage.getItem('user') , token = "";
         if(user != null){
             token = JSON.parse(user).headImgurl

+ 2 - 0
ys_vue/src/port.js

@@ -64,6 +64,8 @@ export default {
         importPart: '/part/importAppLogin',//零件的excel导入
         partUpload: '/mouldfile/uploadPartFileList', //零件文档的批量上传
 
+        download: '/mouldfile/download',
+
         moldMaintain: '/mouldmaintain/maintain', //维护
         moldMaintainList: '/mouldmaintain/list', //获取列表
         moldMaintainListGet: '/mould/maintainMouldList', //主页获取保养模具列表

+ 49 - 16
ys_vue/src/views/map/map.vue

@@ -110,7 +110,8 @@
             //新地图
             var map = new AMap.Map('container', {
                 zoom: 4,
-                mapStyle: "amap://styles/grey",
+                //mapStyle: "amap://styles/grey",
+                mapStyle: "amap://styles/8016abec658e1132508723183f848f14",
                 features: ['bg']
             });
 
@@ -152,7 +153,7 @@
                         pointStyle: {
                             width: 6,
                             height: 6,
-                            fillStyle:'rgba(0, 236, 252, 0.38)'
+                            fillStyle:'rgba(0, 236, 252, 0.9)'
                         },
                         //鼠标hover时的title信息
                         hoverTitleStyle: {
@@ -188,7 +189,7 @@
                      * 绘制一个蓝底白字的label替代聚合标注
                      */
                     drawMyLabel: function(feature, dataItems) {
-                        if(dataItems.length != 0){
+                        //if(dataItems.length != 0){
                             var pixelRatio = this.getPixelRatio(); //高清下存在比例放大
 
                             var containerPos = map.lngLatToContainer(feature.properties.centroid || feature.properties.center);
@@ -202,28 +203,59 @@
                             labelCtx.save();
 
                             labelCtx.font = 12 * pixelRatio + 'px 微软雅黑';
-
-                            var text = feature.properties.name + '\n' + dataItems.length + '';
-
+                            
+                            var name = feature.properties.name;
+                            if(feature.properties.level == "province") {
+                                if(name == "黑龙江省" || name == "内蒙古自治区"){
+                                    name = name.substring(0,3)
+                                } else {
+                                    name = name.substring(0,2)
+                                }
+                            }
+                            var text = name;//feature.properties.name ;//+ '\n' + dataItems.length;
                             var textMetrics = labelCtx.measureText(text);
-
                             var halfTxtWidth = textMetrics.width / 2;
 
-                            labelCtx.fillStyle = 'rgba(3 , 94 , 255 , 0.5)';//'#3366cc';
+                            var num = dataItems.length;
+                            var numMetrics = labelCtx.measureText(num);
+                            var halfNumWidth = numMetrics.width / 2;
+
+                            // labelCtx.fillStyle = 'rgba(3 , 94 , 255 , 0.5)';//'#3366cc';
+                            
+                            labelCtx.beginPath();
+                            labelCtx.fillStyle = 'rgba(12 , 239 , 231 , 0.8)';//'#3366cc';
+
                             //绘制一个蓝色背景
-                            labelCtx.fillRect(centerX - halfTxtWidth - 3 * pixelRatio,
-                                centerY - 11 * pixelRatio,
-                                textMetrics.width + 6 * pixelRatio,
-                                22 * pixelRatio);
+                            labelCtx.strokeStyle= "rgba(12 , 239 , 231 , 0.8)"
+                            labelCtx.fillStyle = 'rgba(12 , 239 , 231 , 0.8)';
+                            
+                            var radius = 0;
+                            if(textMetrics.width > numMetrics.width) {
+                                radius = (textMetrics.width + 6 * pixelRatio) / 2;
+                            } else {
+                                radius = (numMetrics.width + 6 * pixelRatio) / 2;
+                            }
+
+                            labelCtx.arc(centerX , centerY, radius + 6,
+                                0*Math.PI, 2*Math.PI, false);
 
+                            labelCtx.closePath();
+                            labelCtx.fill();
+                            // labelCtx.fillRect(centerX - halfTxtWidth - 3 * pixelRatio,
+                            //     centerY - 11 * pixelRatio,
+                            //     textMetrics.width + 6 * pixelRatio,
+                            //     22 * pixelRatio);
 
                             labelCtx.fillStyle = '#ffffff';
                             labelCtx.textBaseline = 'middle';
-                            labelCtx.stroke();
-                            labelCtx.fillText(text, centerX - halfTxtWidth, centerY);
+                            //labelCtx.stroke();
 
+                            labelCtx.fillText(text, centerX - halfTxtWidth, centerY - 5);
+                            labelCtx.fillText(num , centerX - halfNumWidth, centerY + 12);
+
+                            labelCtx.stroke();
                             labelCtx.restore();
-                        }
+                        //}
                     }
                 });
 
@@ -247,7 +279,8 @@
                         featureClickToShowSub: true,
                         featureStyle: {
                             lineWidth: 2, //描边线宽
-                            strokeStyle: 'rgba(31, 119, 180, 0.8)', //描边色
+                            // strokeStyle: 'rgba(0, 119, 180, 0.5)', //描边色
+                            strokeStyle: 'rgba(75, 143, 239, 0.5)', //描边色
                             //鼠标Hover后的样式
                             hoverOptions: {
                                 fillStyle: 'rgba(255,255,255,0.2)'

+ 17 - 1
ys_vue/src/views/mold/moldDetail.vue

@@ -413,7 +413,7 @@
                 <el-table-column type="index" width="40"></el-table-column>
                 <el-table-column label="模具编号" sortable>
                     <template slot-scope="scope">
-                        <router-link :to="'/moldList/' + scope.row.mouldId" tag="span" style="cursor: pointer;color: #409eff;">{{scope.row.mouldNo}}</router-link>
+                        <span @click="toAnotherMould(scope.row.mouldId)" style="cursor: pointer;color: #409eff;">{{scope.row.mouldNo}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column prop="applicantName" label="申请人" align="center" width="200" sortable></el-table-column>
@@ -685,6 +685,14 @@
                 this.$router.push('/project/' + id);
             },
 
+            toAnotherMould(id){
+                var currentRoute = this.$route.path.split("/");
+                if (currentRoute.length == 3 && currentRoute[1] == "moldList") {
+                    this.$router.go(0);
+                }
+                this.$router.push('/mould/' + id);
+            },
+
             //标签页面切换时
             handleClick(tab, event) {
                 this.activeTab = tab.name;
@@ -1049,6 +1057,14 @@
                     id: id
                 },
                 res => {
+                    // const elink = document.createElement('a')
+                    // elink.download = row.fileName
+                    // elink.style.display = 'none'
+                    // const blob = new Blob([res])
+                    // elink.href = URL.createObjectURL(blob)
+                    // document.body.appendChild(elink)
+                    // elink.click()
+                    // document.body.removeChild(elink)
                     this.getOperationRecord(this.activePage);
                 },
                 error => {

+ 6 - 5
ys_vue/src/views/mold/moldDownload.vue

@@ -47,35 +47,35 @@
       <el-table-column width="200" label="模具3D图档">
         <template slot-scope="scope">
           <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould3DFiles.state == 3">已通过</span>
+          <span v-else-if="scope.row.mould3DFilesState">已通过</span>
           <span v-else>未通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="模具2D图档">
         <template slot-scope="scope">
           <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould2DFiles.state == 3">已通过</span>
+          <span v-else-if="scope.row.mould2DFilesState">已通过</span>
           <span v-else>未通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="零件3D图档">
         <template slot-scope="scope">
           <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart3DFiles.state == 3">已通过</span>
+          <span v-else-if="scope.row.sparepart3DFilesState">已通过</span>
           <span v-else>未通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="零件2D图档">
         <template slot-scope="scope">
           <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart2DFiles.state == 3">已通过</span>
+          <span v-else-if="scope.row.sparepart2DFilesState">已通过</span>
           <span v-else>未通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="保养方案">
         <template slot-scope="scope">
           <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.maintainFiles.state == 3">已通过</span>
+          <span v-else-if="scope.row.maintainFilesState">已通过</span>
           <span v-else>未通过</span>
         </template>
       </el-table-column>
@@ -136,6 +136,7 @@ export default {
         res => {
           if (res.code == "ok") {
             this.documents = res.data.list;
+            this.total = res.data.total;
             //对于拿到的所有数据
             this.documents.forEach(file => {
               var mould2DFilesState = true;

+ 10 - 10
ys_vue/src/views/project/projectDetail.vue

@@ -104,11 +104,11 @@
                                 <el-table-column prop="indate" label="上传时间" width="200" align="center" sortable></el-table-column>
                                 <el-table-column label="操作" width="220" align="center" sortable>
                                     <template slot-scope="scope" v-if="download == 1">
-                                        <!-- <a :href="scope.row.url" :download="scope.row.fileName"> -->
+                                        <a :href="scope.row.url" :download="scope.row.fileName">
                                             <el-button size="small" @click="dowloadFile(scope.row)">
                                                 下载
                                             </el-button>
-                                        <!-- </a> -->
+                                        </a>
                                         <el-button size="small" type="danger" @click="fileDel(scope.row.id)" v-if="scope.row.uploaderId == user.id">删除</el-button>
                                     </template>
                                     <template slot-scope="scope" v-else>
@@ -914,14 +914,14 @@
                 this.http.post(this.port.project.dowloadFile, {
                     id: row.id
                 } , res => {
-                    const elink = document.createElement('a')
-                    elink.download = row.fileName
-                    elink.style.display = 'none'
-                    const blob = new Blob([res])
-                    elink.href = URL.createObjectURL(blob)
-                    document.body.appendChild(elink)
-                    elink.click()
-                    document.body.removeChild(elink)
+                    // const elink = document.createElement('a')
+                    // elink.download = row.fileName
+                    // elink.style.display = 'none'
+                    // const blob = new Blob([res])
+                    // elink.href = URL.createObjectURL(blob)
+                    // document.body.appendChild(elink)
+                    // elink.click()
+                    // document.body.removeChild(elink)
                     this.getOperList();
                 }, error => {
                 })