Explorar el Código

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

haojianlong hace 5 años
padre
commit
4884fc3c0c

+ 6 - 1
src/components/business_space/lib/uploadFiles.vue

@@ -145,8 +145,13 @@
         };
         reader.onprogress = function (p) {
           // 这个事件在读取进行中定时触发
-        };
 
+        };
+        reader.onUploadProgress = function (progressEvent) {
+          let percent = (progressEvent.loaded / progressEvent.total * 100) | 0
+          //调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
+          uploader.onProgress({percent: percent})
+        }
         reader.onload = function () {
           // 这个事件在读取成功结束后触发
         };

+ 7 - 0
src/components/business_space/lib/uploadImgsName.vue

@@ -339,14 +339,21 @@
 </script>
 <style lang="less">
 #sagaUploads {
+  /deep/ .el-upload--text {
+    box-sizing: border-box;
+  }
+
   overflow: hidden;
+
   .avatar-uploader {
     height: 180px;
     width: 180px;
     overflow: hidden;
+
     .el-upload {
       width: 180px;
       height: 180px;
+
       .el-upload-dragger {
         width: 180px;
         height: 180px;

+ 28 - 38
src/components/ready/buildfloor/addBuild.vue

@@ -8,40 +8,39 @@
     <el-form
       :inline="true"
       :model="form"
-      label-width="135px"
+      label-width="125px"
       :rules="rules"
       ref="ruleForm"
     >
       <template v-for="(val,key) in buildMessage">
         <h4>{{key}}</h4>
 
-        <span
+        <div
           :key="item.InfoPointCode"
           v-for="item in val"
-          :class="[{'upload-file':item.InputMode == 'F2'}]"
-        >
-        <el-form-item
-          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
-          :label="item.InfoPointName"
-          :prop="item.InfoPointCode"
-          v-if="all||item.Visible"
+          :class="[{'upload-file':item.InputMode == 'F2' ||  item.Path === 'BuildingInfo.BuildingType.Pic'}]"
+          style="width: 50%;display: inline-block"
+
         >
-        <span v-if="item.InputMode == 'B1' || item.InputMode == 'B2'">
+          <el-form-item
+            :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+            :label="item.InfoPointName"
+            :prop="item.InfoPointCode"
+            v-if="all||item.Visible"
+
+          >
+
             <el-input
               v-model="form[item.Path]"
-              :placeholder="(item.InputMode === 'B1' && item.InfoPointCode==='BuildLocalID') ? '填写示例:F1、B1?':'' "
+              v-if="item.InputMode == 'B1' || item.InputMode == 'B2'"
             />
-           <div
-             v-if="item.InputMode === 'B1' && item.InfoPointCode==='BuildLocalID' && isShowTitle"
-             style="color: gray;font-size: 12px"
-           >用于楼层平面图切换</div>
 
-        </span>
 
-          <el-input type="number" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'" v-model="form[item.Path]">
-            <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
-          </el-input>
-          <el-select
+            <el-input type="number" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'"
+                      v-model="form[item.Path]">
+              <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+            </el-input>
+            <el-select
             placeholder="请选择"
             v-else-if="item.InputMode == 'D1' || item.InputMode == 'E2'"
             v-model="form[item.Path]"
@@ -74,6 +73,7 @@
                v-model="form[item.Path]"
                :props="{ checkStrictly: true ,value: 'Code',label:'Name'}"
                clearable
+               style="width: 200px"
              />
           <el-input
             v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'"
@@ -106,11 +106,11 @@
                :context-key="item.Path"
                @change="changeItem"
              />
-          <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"></el-input>
-        </el-form-item>
-      </span>
-      </template>
+            <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"/>
 
+          </el-form-item>
+        </div>
+      </template>
     </el-form>
     <span
       class="dialog-footer"
@@ -153,15 +153,7 @@
 
   export default {
     data() {
-      let validateId = (rule,value,callback) => {
-        if (!value) {
-          this.isShowTitle = false
-          return callback(new Error('请输入建筑本地编码'));
-        } else{
-          this.isShowTitle = true
-          callback()
-        }
-      }
+
       return {
         buildName: '',
         keysArr: [], //保存临时的文件key
@@ -172,15 +164,13 @@
         all: true,
         rules: {
           "BuildLocalID": [
-            // {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
-            {validator:validateId,trigger:'blur'}
+            {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
           ],
           "BuildLocalName": [
             {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
           ]
         },
         buildData: {},
-        isShowTitle:true,
       }
     },
     components: {uploadFiles, uploadImgs},
@@ -282,8 +272,8 @@
     }
 
     .upload-file {
-      width: 100%;
-      display: block;
+      width: 100% !important;
+      display: block !important;
     }
   }
 </style>

+ 89 - 56
src/components/ready/buildfloor/formItems.vue

@@ -1,10 +1,24 @@
 <template>
   <div id="inforsPoint">
     <el-form ref="ruleForm" :model="form" label-width="150px" :rules="rules" :inline="true" :label-position="'left'">
-      <div v-for="item in InforsList" :key="item.InfoPointCode" style="width:50%;float:left;">
-        <el-form-item :label="item.InfoPointName" :prop="item.InfoPointCode" v-if="all||item.Visible"
-          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}">
-          <el-input v-model="form[item.Path]" v-if="item.InputMode == 'B1'"></el-input>
+      <div v-for="item in InforsList" :key="item.InfoPointCode" style="width:50%;display: inline-block">
+        <el-form-item
+          :label="item.InfoPointName"
+          :prop="item.InfoPointCode"
+          v-if="all||item.Visible"
+          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+        >
+          <span v-if="item.InputMode == 'B1'">
+            <el-input
+              v-model="form[item.Path]"
+              :placeholder="(item.InputMode === 'B1' && item.Path==='FloorLocalID') ? '填写示例:F1、B1?':'' "
+
+            />
+              <div
+                v-if="item.InputMode === 'B1' && item.Path==='FloorLocalID' && isShowTitle"
+                style="color: gray;font-size: 12px"
+              >用于楼层平面图切换</div>
+          </span>
           <el-input v-model="form[item.Path]" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'" type="number">
             <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
           </el-input>
@@ -12,73 +26,92 @@
             <el-option v-for="op in item.options" :key="op.Code" :label="op.Name" :value="op.Code"></el-option>
           </el-select>
           <el-input v-model="form[item.Path]"
-            v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'">
+                    v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'">
             <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
           </el-input>
           <el-input v-model="form[item.Path]" v-else disabled title="暂不支持"></el-input>
+
         </el-form-item>
       </div>
     </el-form>
   </div>
 </template>
 <script>
-import { getDataDictionary } from "@/api/scan/request";
+  import {getDataDictionary} from "@/api/scan/request";
 
-//  v-for="item in InforsList" :key="item.InfoPointCode"
-export default {
-  props: {
-    type: {
-      default: 'Floor'
-    }
-  },
-  data() {
-    return {
-      form: {},
-      InforsList: [],
-      all: true, // 默认显示全部
-      rules: {
-        "FloorLocalName": [
-          { "required": true, "message": "请输入楼层本地名称", "trigger": "blur" }
-        ],
-        "FloorSequenceID": [
-          { "required": true, "message": "请输入楼层顺序号", "trigger": "blur" }
-        ]
+  //  v-for="item in InforsList" :key="item.InfoPointCode"
+  export default {
+    props: {
+      type: {
+        default: 'Floor'
       }
-    };
-  },
-  created() {
-    this.getInforsPoint()
-  },
-  methods: {
-    getInforsPoint() {
-      let params = {
-        data: {
-          Orders: "sort asc,InfoPointCode asc",
-          PageNumber: 1,
-          PageSize: 50
-        },
-        type: this.type
-      };
-      getDataDictionary(params, res => {
-        this.InforsList = res.Content.map(item => {
-          if (item.InputMode === 'D1') {
-            item.options = JSON.parse(item.DataSource)
-          }
-          return item
-        })
-      })
     },
-    submitForm(call) {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          call()
+    data() {
+      let validateId = (rule, value, callback) => {
+        if (!value) {
+          this.isShowTitle = false
+          return callback(new Error('请输入楼层本地编码'));
         } else {
-          return false;
+          this.isShowTitle = true
+          callback()
+        }
+      }
+      // }
+      return {
+        form: {},
+        isShowTitle: true,
+        InforsList: [],
+        all: true, // 默认显示全部
+        rules: {
+          "FloorLocalID": [
+            {validator: validateId, trigger: 'blur', "required": true}
+          ],
+          "FloorLocalName": [
+            {"required": true, "message": "请输入楼层本地名称", "trigger": "blur"}
+          ],
+          "FloorSequenceID": [
+            {"required": true, "message": "请输入楼层顺序号", "trigger": "blur"}
+          ]
         }
-      });
+      };
     },
-  }
-};
+
+    created() {
+      this.getInforsPoint()
+    }
+    ,
+    methods: {
+      getInforsPoint() {
+        let params = {
+          data: {
+            Orders: "sort asc,InfoPointCode asc",
+            PageNumber: 1,
+            PageSize: 50
+          },
+          type: this.type
+        };
+        getDataDictionary(params, res => {
+          this.InforsList = res.Content.map(item => {
+            if (item.InputMode === 'D1') {
+              item.options = JSON.parse(item.DataSource)
+            }
+            return item
+          })
+        })
+      }
+      ,
+      submitForm(call) {
+        this.$refs.ruleForm.validate((valid) => {
+          if (valid) {
+            call()
+          } else {
+            return false;
+          }
+        });
+      }
+      ,
+    }
+  };
 </script>
 <style lang="scss" scoped>
 #inforsPoint {

+ 54 - 49
src/views/ready/buildfloor/index.vue

@@ -5,24 +5,26 @@
         <div class="action-box">
           <div>
             <el-button @click="addBuild" icon="el-icon-plus" size="small" type="default"/>
-
-            <el-popover
-              placement="top"
-              width="160"
-              v-model="visible">
-              <p>确定删除吗?</p>
-              <div style="text-align: right; margin: 0">
-                <el-button size="mini" type="text" @click="visible = false">取消</el-button>
-                <el-button type="primary" size="mini" @click="delBuild">确定</el-button>
-              </div>
-              <el-button slot="reference" icon="el-icon-minus" size="small" type="default"/>
-            </el-popover>
+            <!--            <el-popover-->
+            <!--              placement="top"-->
+            <!--              width="160"-->
+            <!--              v-model="visible">-->
+            <!--              <p>确定删除吗?</p>-->
+            <!--              <div style="text-align: right; margin: 0">-->
+            <!--                <el-button size="mini" type="text" @click="visible = false">取消</el-button>-->
+            <!--                <el-button type="primary" size="mini" @click="delBuild">确定</el-button>-->
+            <!--              </div>-->
+            <!--              <el-button slot="reference" icon="el-icon-minus" size="small" type="default"/>-->
+            <!--            </el-popover>-->
+            <el-button @click="delBuild" icon="el-icon-minus" size="small" type="default"/>
             <el-button @click="editBuild" icon="el-icon-edit-outline" size="small" type="default"/>
           </div>
         </div>
         <h4>建筑</h4>
         <div class="build-list">
-          <div :class="{'floor-item':true,active:item.active}" :key="item.BuildID" @click="changeBuild(index)"
+          <div :class="{'floor-item':true,active:item.active}"
+               :key="item.BuildID"
+               @click="changeBuild(index)"
                v-for="(item,index) in buildList">
             <span>
               {{item.BuildLocalName || item.BuildName}}
@@ -163,7 +165,6 @@
         alreadyRelatedModel: [],
         // currentType: 'add'
         buildMessage: {},
-        visible: false,
       };
     },
     computed: {
@@ -220,33 +221,35 @@
           type: 'Building'
         };
         getDataDictionary(params, res => {
-          // let list = res.Content.map(item => {
-          //   if (item.InputMode === 'D1' && item.DataSource != undefined) {
-          //     item.options = JSON.parse(item.DataSource)
-          //   }
-          //   return item
-          // })
           let first = {}
           //一级循环出来一级标签
-          res.Content.map(item => {
-            if ((item.InputMode === 'D1' || item.InputMode === 'D2'  || item.InputMode === 'E2'|| item.InputMode === 'D1L') && item.DataSource != undefined) {
+          let list = res.Content.filter(i => (i.FirstName !== '工作历') && (i.FirstName !== '能耗信息') && (i.FirstName !== '人员信息'))
+          list.map(item => {
+            console.log(item.FirstName)
+            if ((item.InputMode === 'D1' || item.InputMode === 'D2' || item.InputMode === 'E2' || item.InputMode === 'D1L') && item.DataSource != undefined) {
               item.options = JSON.parse(item.DataSource)
             }
             if (first[item.FirstName] && first[item.FirstName].length) {
             } else {
               first[item.FirstName] = []
             }
-            first[item.FirstName].push({
-              InfoPointName: item.InfoPointName,
-              InfoPointCode: item.InfoPointCode,
-              Visible: item.Visible,
-              UnDisabled: item.UnDisabled,
-              SecondName: item.SecondName ? item.SecondName : "",
-              Path: item.Path,
-              InputMode: item.InputMode,
-              options: item.options,
-              Unit: item.Unit
-            })
+            if (
+              item.Path !== 'BuildingInfo.AreaInfo.AreaTree' &&
+              item.Path !== 'DefaultQRCode' &&
+              item.Path !== 'BuildQRCode'
+            ) {
+              first[item.FirstName].push({
+                InfoPointName: item.InfoPointName,
+                InfoPointCode: item.InfoPointCode,
+                Visible: item.Visible,
+                UnDisabled: item.UnDisabled,
+                SecondName: item.SecondName ? item.SecondName : "",
+                InputMode: item.InputMode,
+                options: item.options,
+                Unit: item.Unit,
+                Path: item.Path
+              })
+            }
           })
           this.buildMessage = first
 
@@ -254,18 +257,8 @@
       },
       //delete build ,根据id删除建筑信息
       delBuild() {
-        // this.$message.warning("开发中...");
-        // return;
-
-        let param = [{BuildId: this.curBuildId}];
-        objectDeleteBuild(param, res => {
-          setTimeout(() => {
-            this.handleBuildQuery()
-            this.init()
-          })
-          this.visible = false
-          this.$message.success("删除成功");
-        })
+        this.delText = '建筑'
+        this.delDialogVis = true;
       },
       //edit build
       editBuild() {
@@ -276,11 +269,7 @@
         for (let i = 0; i < list.length; i++) {
           obj = list[i]
         }
-
-
-
         this.$refs.addBuildDialog.showDialog(obj);
-
       },
       handleFile(val,name) {
       },
@@ -351,6 +340,22 @@
           });
         } else {
           //todo
+          // 删除建筑
+          if (this.tableData && this.tableData.length) {
+            this.$message.error("当前建筑中包含楼层,不可删除");
+            this.delDialogVis = false;
+          } else {
+            let param = [{BuildId: this.curBuildId}];
+            objectDeleteBuild(param, res => {
+              setTimeout(() => {
+                this.handleBuildQuery()
+                this.init()
+              })
+              this.$message.success("删除成功");
+              this.delDialogVis = false;
+            })
+          }
+
         }
       },
       // 修改楼层信息