Browse Source

修改问题

chuwu 5 years ago
parent
commit
cca5960696

+ 0 - 3
src/components/common/handsontable.vue

@@ -81,7 +81,6 @@
             //右键删除
             removeFm(index, amout) {
                 let delData = tools.differenceArr(this.data, this.deepArr)
-                console.log(delData,this.data, this.deepArr,'delData')
                 this.$emit("delete", delData)
             },
             //数据发生修改后(失焦)
@@ -181,13 +180,11 @@
                     // afterDocumentKeyDown: this.afterDocumentKeyDown, //鼠标单击
                 }, settings);
                 hotSettings.maxRows = settings.maxRows
-                console.log(hotSettings, settings, this.hot, 'hot')
                 if (!!this.hot && this.hot.hasOwnProperty('destroy')) {
                     this.hot.destroy();
                     this.hot = null
                 }
                 this.hot = new Handsontable(hotElement, hotSettings);
-                console.log(this.hot)
                 // this.hot.view.wt.update('onCellDblClick', (row,cell) => { 
                 //     //Get editor and begin edit mode on current cell (maintain current double click functionality) 
                 //     var activeEditor = this.hot.getActiveEditor(); 

+ 29 - 15
src/components/config_point/step3_point/3_identify.vue

@@ -6,6 +6,10 @@
                     {{item.Group}}
                 </template>
                 <div class="collapse-item">
+                    <div style="line-height: 40px;padding-left: 5px;box-sizing:border-box;">
+                        <el-input v-model="fillData" placeholder="批量填充空白的设备标识" style="width: 180px;"></el-input>
+                        <el-button @click="fillClick">填充</el-button>
+                    </div>
                     <handsontable-component ref="handsontable"></handsontable-component>
                 </div>
             </el-collapse-item>
@@ -37,7 +41,8 @@
         data() {
             return {
                 activeName: "1",
-                hotArr: []
+                hotArr: [],
+                fillData: "",//填充的数据
             }
         },
         computed: {
@@ -51,22 +56,31 @@
         mounted() {},
         methods: {
             save() {
+                console.log(this.renderData,'renderData')
+                // let data = this.hotArr[this.activeName - 1].getSourceData()
+                // data = data.map(item => {
+                //     return {
+                //         EquipmentMark: item.own || null,
+                //         Id: item.Id,
+                //     }
+                // })
+                // updatePoint({
+                //     data: {
+                //         Content: data
+                //     },
+                //     type: this.protocolType
+                // }, res => {
+                //     this.$emit("saved")
+                //     this.$message.success("保存成功")
+                // })
+            },
+            fillClick(){
                 let data = this.hotArr[this.activeName - 1].getSourceData()
-                data = data.map(item => {
-                    return {
-                        EquipmentMark: item.own || null,
-                        Id: item.Id,
-                    }
-                })
-                updatePoint({
-                    data: {
-                        Content: data
-                    },
-                    type: this.protocolType
-                }, res => {
-                    this.$emit("saved")
-                    this.$message.success("保存成功")
+                // data.own = this.fillData
+                data.map(item => {
+                    item.own = this.fillData
                 })
+                console.log(data,'data')
             },
             handleChange(val) {
                 if (!val) {

+ 1 - 2
src/utils/handsontable/delType.js

@@ -76,8 +76,7 @@ export function showTypes(arr, infosKey = '') {
                 }
             }
 
-            console.log(item, '---------------------------------------------------')
-                //文件类型
+            //文件类型
             if (item.InfoPointCode == "InsuranceFile" ||
                 item.InfoPointCode == "Archive" ||
                 item.InfoPointCode == "CheckReport") {

+ 6 - 18
src/views/point/config_point/steps/step1.vue

@@ -129,7 +129,6 @@
                 if(!data || !data.length){
                     return false
                 }
-                console.log(data,'data')
                 let param = {
                     data: {
                         DataSourceId: this.datasourceId,
@@ -140,7 +139,6 @@
                     type: this.protocolType
                 }
                 getPointValue(param,res => {
-                    console.log(res,'res')
                     if(!!res.Content && res.Content.length){
                         data.map(item => {
                             res.Content.map(child => {
@@ -170,7 +168,6 @@
                         ProjectId: this.projectId
                     }
                 }
-                console.log(param, 'param')
                 axios(param).then(function(res) {
                     var blob = new Blob([res.data], {
                         type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
@@ -191,7 +188,6 @@
                         navigator.msSaveBlob(blob, fileName)
                     }
                 }).catch(function(err) {
-                    console.dirxml(err);
                 })
             },
             //删除点位
@@ -202,12 +198,10 @@
                     }),
                     type: this.protocolType
                 }
-                console.log(param, 'param')
                 if (!param.length) {
                     return false
                 }
                 this.$confirm('你确定要删除点位吗?').then(_ => {
-                    console.log(param, 'param')
                     deletePoint(param, res => {
                         this.$message.success("删除成功")
                         this.getData()
@@ -249,13 +243,11 @@
                         navigator.msSaveBlob(blob, fileName)
                     }
                 }).catch(function(err) {
-                    console.dirxml(err);
                 })
             },
             //点击表格
             clickTable(info, row) {
                 let activeCell = this.hot.getActiveEditor()
-                console.log(activeCell, 'activeCell')
                 if(activeCell.prop == "Used"){
                     info.Used = !info.Used
                 }
@@ -276,7 +268,10 @@
                         maxRows: data.length
                     })
                 } else {
-                    this.allData = [{}]
+                    this.allData = [{
+                        Used: true,
+                        LocationFlag: []
+                    }]
                     this.createHot()
                 }
             },
@@ -348,10 +343,8 @@
                 if (!this.allData.length) {
                     return false
                 }
-                console.log(settings, 'settings')
                 this.$nextTick(_ => {
                     this.hot = this.$refs.handsontable.init(settings)
-                    console.log(this.hot)
                 })
             },
             //修改提示
@@ -364,14 +357,13 @@
             //保存
             saveData() {
                 if (!!this.hot) {
-                    console.log(this.hot.getSourceData())
+                    console.log(this.hot.getSourceData(),'getSourceData')
                     let data = this.hot.getSourceData(),
                         updateList = [],
                         arr1 = [],
                         createList = [];
                     data.map(item => {
                         if (!!item.Id) {
-                            console.log(item)
                             delete item.CreateTime
                             delete item.LastUpdate
                             if(item.hasOwnProperty('pointDate')){
@@ -386,7 +378,7 @@
                             createList.push(item)
                         }
                     })
-                    console.log(updateList, arr1, "updateList")
+                    console.log(updateList,createList, arr1, "updateList")
                     if (updateList.length) {
                         this.update(updateList)
                     }
@@ -398,7 +390,6 @@
                 }
             },
             async createList(createList) {
-                console.log(createList)
                 let i = 0;
                 for (i; i < createList.length; i++) {
                     if (createList[i].hasOwnProperty("Description")) {
@@ -423,7 +414,6 @@
                     data: obj,
                     type: this.protocolType
                 }, res => {
-                    console.log(res)
                     obj.Id = res.Id
                 })
             },
@@ -439,7 +429,6 @@
                     },
                     type: this.protocolType
                 }, res => {
-                    console.log(res)
                     this.getData()
                 })
             },
@@ -450,7 +439,6 @@
             //上传文件
             changeFile(file) {
                 this.file = file[0] || ''
-                console.log(file, 'file')
             },
             //确定上传
             sureOfUpload() {