chuwu преди 6 години
родител
ревизия
aca5d8ba43

+ 474 - 0
src/assets/scss/reset.scss

@@ -0,0 +1,474 @@
+$WinWitdh:1200px;
+$BaseC:#555;
+$LinkC:#06f;
+$HoverC:#f60;
+$FontSize:13px;
+$fontFamily: "Spurce Han Sans,Wah Kang font,Microsoft YaHei";
+$allColor: #333; //正文#333
+$color1: #666; //辅助文字#666
+$color2: #999; //#999
+$color3: #ccc; //失效文字#ccc
+$color4: #00A0E8; //链接文字
+$color5: #8E9CC1; //表头文字加粗
+$colorList: ( 1:$color1, 2:$color2, 3:$color3, 4:$color4, 5:$color5);
+$theme1: #5BA7FF;
+$theme2: #FFF;
+$theme3: #8E9CC1;
+$themeList: (1:$theme1, 2:$theme2, 3:$theme3);
+$auxiliary1: #548FF0; //辅助色彩
+$auxiliary2: #FF4121;
+$auxiliary3: #7ED321;
+$auxiliary4: #F5A623;
+$auxiliaryList: ( 1:$auxiliary1, 2:$auxiliary2, 3:$auxiliary3, 4:$auxiliary4);
+$borderColor1: #C2CEDB; //线条色彩
+$borderColor2: #DDD;
+$borderColorList: (1:$borderColor1, 2:$borderColor2);
+$bg1: #FFF;
+$bg2: #F2FBFF;
+$bg3: #EEFAFF;
+$bg4: #FFF5E4;
+$bg5: #E5F6D3;
+$bgList: ( 1:$bg1, 2:$bg2, 3:$bg3, 4:$bg4, 5:$bg5);
+$allSize: 14px; //正常文字大小
+$size1: 12px; //辅助文字大小
+// mixins
+@mixin dz($time:0.25s) {
+    -webkit-transition: all $time ease-in-out;
+    -moz-transition: all $time ease-in-out;
+    -o-transition: all $time ease-in-out;
+    transition: all $time ease-in-out;
+}
+
+.el-dialog__headerbtn {
+    top: -24px;
+    right: -24px;
+    width: 24px;
+    height: 24px;
+    border-radius: 50%;
+    color: #8E9CC1;
+    background-color: #fff;
+}
+
+.el-dialog__header {
+    border-bottom: 1px solid #C2CEDB;
+    box-sizing: border-box;
+    .el-dialog__title {
+        height: 20px;
+        line-height: 20px;
+        font-size: 14px;
+    }
+}
+
+// .el-button--mini,
+// .el-button--mini.is-round {
+//     padding: 5px 20px;
+// }
+// .el-button {
+//     box-sizing: border-box;
+//     border-color: $auxiliary1;
+// }
+// .el-button span {
+//     color: $color4;
+// }
+// .el-button:focus,
+// .el-button:hover {
+//     background-color: $bg1;
+//     border-color: $auxiliary1;
+// }
+// .el-button span {
+//     display: inline-block;
+//     line-height: 20px;
+//     height: 20px;
+// }
+// * {
+//     font-family: $fontFamily;
+//     font-size: $allSize;
+//     color: $allColor;
+// }
+// .color {
+//     color: $allColor;
+// }
+// .el-input__inner:hover{
+//     border-color: 
+// }
+//文字色
+@each $i,
+$color in $colorList {
+    .color#{$i} {
+        color: $color;
+    }
+}
+
+//主题色
+@each $i,
+$theme in $themeList {
+    .theme#{$i} {
+        background-color: $theme;
+    }
+}
+
+//辅助背景色
+@each $i,
+$auxiliary in $auxiliaryList {
+    .auxiliary#{$i} {
+        background-color: $auxiliary;
+    }
+}
+
+//辅助色
+@each $i,
+$auxiliary in $auxiliaryList {
+    .auxiliary-color#{$i} {
+        color: $auxiliary;
+    }
+}
+
+//线条色
+@each $i,
+$borderColor in $borderColorList {
+    .border-color#{$i} {
+        border-color: $borderColor;
+    }
+}
+
+//背景色
+@each $i,
+$bg in $bgList {
+    .bg#{$i} {
+        background-color: $bg;
+    }
+}
+
+@for $i from 1 to 51 {
+    .border-radius#{$i} {
+        border-radius: #{$i}px;
+    }
+}
+
+@for $i from 1 to 11 {
+    .border#{$i} {
+        border-width: #{$i}px;
+        border-style: solid;
+    }
+}
+
+// .color2 {
+//     color: $color2;
+// }
+// .color3 {
+//     color: $color3;
+// }
+// .color4 {
+//     color: $color4;
+// }
+// .color5 {
+//     color: $color5
+// }
+// @charset "UTF-8";
+body,
+ul,
+ol,
+dl,
+dd,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+pre,
+form,
+fieldset,
+legend,
+input,
+button,
+textarea,
+p,
+blockquote,
+table,
+th,
+td,
+menu {
+    margin: 0;
+    padding: 0
+}
+
+html,
+body,
+#app {
+    height: 100%;
+    width: 100%;
+}
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+    table-layout: fixed
+}
+
+ul,
+ol,
+menu {
+    list-style: none
+}
+
+fieldset,
+img {
+    border: none
+}
+
+img,
+object,
+select,
+input,
+textarea,
+button {
+    vertical-align: middle
+}
+
+input,
+textarea,
+select,
+address,
+caption,
+cite,
+code,
+dfn,
+em,
+i,
+b,
+strong,
+small,
+th,
+var,
+abbr {
+    font-size: 100%;
+    font-style: normal
+}
+
+caption,
+th {
+    text-align: left;
+}
+
+article,
+aside,
+footer,
+header,
+hgroup,
+nav,
+section,
+figure,
+figcaption {
+    display: block;
+}
+
+code,
+kbd,
+pre,
+samp,
+tt {
+    font-family: Consolas, "Courier New", Courier, monospace;
+}
+
+address,
+cite,
+dfn,
+em,
+var,
+i {
+    font-style: normal;
+}
+
+blockquote,
+q {
+    quotes: none;
+}
+
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+    content: "";
+    content: none;
+}
+
+a {
+    color: $LinkC;
+    text-decoration: none;
+    cursor: pointer;
+    &:link,
+    &:visited,
+    &:active {
+        color: $LinkC;
+    }
+    &:hover,
+    &:focus {
+        color: $HoverC;
+        text-decoration: underline;
+        outline: none;
+    }
+    &,
+    span,
+    i,
+    em,
+    u,
+    strong,
+    b,
+    p,
+    img,
+    ul,
+    li,
+    div,
+    dd,
+    dt,
+    dl,
+    ol,
+    table,
+    th,
+    td,
+    h1,
+    h2,
+    h3,
+    h4,
+    h5,
+    h6,
+    input,
+    textarea,
+    button,
+    small,
+    select {
+        cursor: pointer;
+        @include dz;
+    }
+}
+
+abbr[title],
+acronym[title] {
+    border-bottom: 1px dotted;
+    cursor: help;
+}
+
+// base by fungleo
+html {
+    min-width: $WinWitdh;
+    // overflow-y: scroll;
+}
+
+body {
+    font-size: $FontSize;
+    color: $BaseC;
+    line-height: 2;
+}
+
+body,
+button,
+input,
+select,
+textarea {
+    font-family: tahoma, Helvetica, Arial, "\5FAE\8F6F\96C5\9ED1";
+    *font-family: "\5FAE\8F6F\96C5\9ED1";
+}
+
+h1 {
+    font-size: $FontSize+10;
+}
+
+h2 {
+    font-size: $FontSize+8;
+}
+
+h3 {
+    font-size: $FontSize+6;
+}
+
+h4 {
+    font-size: $FontSize+4;
+}
+
+h5 {
+    font-size: $FontSize+2;
+}
+
+h6 {
+    font-size: $FontSize;
+}
+
+hr {
+    border: none;
+    height: 1px;
+    background: lighten($BaseC, 50%);
+}
+
+.fl {
+    float: left;
+}
+
+.fr {
+    float: right;
+}
+
+.tl {
+    text-align: left;
+}
+
+.tr {
+    text-align: right;
+}
+
+.tc {
+    text-align: center;
+}
+
+.cf:before,
+.cf:after,
+.web:before,
+.web:after,
+.web_:before,
+.web_:after {
+    content: "";
+    display: table;
+}
+
+.cf:after,
+.web:after,
+.web_:after {
+    clear: both;
+}
+
+.cf {
+    zoom: 1;
+}
+
+.web {
+    width: $WinWitdh;
+    margin-left: auto;
+    margin-right: auto;
+    zoom: 1;
+}
+
+.web_ {
+    min-width: $WinWitdh;
+    width: 100%;
+    zoom: 1;
+}
+
+.block {
+    display: block;
+}
+
+.none {
+    display: none
+}
+
+.clear {
+    clear: both;
+}
+
+.fl {
+    float: left;
+}
+
+.disIne {
+    display: inline-block;
+}

+ 15 - 0
src/components/config_point/step1/transfer_file.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+    </div>
+</template>
+<script>
+export default {
+    data(){ return {}},
+    created(){},
+    mounted(){},
+    methods:{}
+}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 1 - 0
src/components/ledger/handsontables/assets.vue

@@ -98,6 +98,7 @@ import { getTableHeader, getBillPropList, updateProperty, upDateTableMain, delPr
 import tools from "@/utils/scan/tools";
 import handsonUtils from "@/utils/scan/hasontableUtils"
 import showTools from "@/utils/handsontable/notShow"
+import text from "@/utils/handsontable/mainText"
 
 import qrcode from "@/components/business_space/lib/qrcode";
 import firm from "@/components/business_space/dialogs/list/firm";

+ 0 - 1
src/fetch/fetch.js

@@ -20,7 +20,6 @@ instance.interceptors.request.use(config => {
     if (projectId) {
         config.headers.ProjectId = projectId;
     }
-    //config.data = JSON.stringify(config.data);
     return config
 }, error => {
     console.log(error)

+ 7 - 1
src/fetch/point_http.js

@@ -57,6 +57,12 @@ export function queryLocaltionFlag(param, success) {
 
 
 /**  --------------任何点位接口必传一个type---------------------   */
+//下载模板
+export function downloadTemplete(param, header, success) {
+    let data = param.data
+    return request('post', `${point}/point/${param.type}/template-export`, data, header, success)
+}
+
 //查询point list
 export function queryPoint(param, success) {
     let data = param.data
@@ -273,4 +279,4 @@ export function batchQueryUnit(param, success) {
 export function batchCreate(param, success) {
     let data = param
     return post(`${point}/relation//batch-create`, data, success)
-}
+}

+ 1 - 2
src/fetch/request.js

@@ -63,7 +63,6 @@ export function post(url, data = {}, success) {
     if (data.hasOwnProperty('Filters')) {
         data.Filters = delFilters(data.Filters)
     }
-    console.log(data, 'data')
     instance.post(url, data).then(response => {
         //对接口错误码做处理
         successResponse(response, success)
@@ -108,7 +107,7 @@ export function request(methed, url, data = {}, headers, success) {
         })
         .then(response => {
             //对接口错误码做处理
-            successResponse(response, success)
+            success(response)
         })
         .catch(err => {
             errorResponse(response, err)

+ 3 - 0
src/main.js

@@ -8,6 +8,9 @@ import store from './store'
 import ElementUI from 'element-ui'
 import 'element-ui/lib/theme-chalk/index.css'
 import './framework/style/awesome.less'
+
+import './assets/scss/reset.scss'
+
 Vue.use(ElementUI, { size: "mini", zIndex: 1000 })
 
 import './framework/style/layout.scss'

+ 1 - 3
src/views/point/config_point/index.vue

@@ -46,9 +46,7 @@
         },
         methods: {
             getList(){
-                let param = {
-                }
-                queryDataSourceCount(param,res => {
+                queryDataSourceCount({},res => {
                     console.log(res)
                     this.list = res.Content
                 })

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

@@ -8,13 +8,21 @@
             <el-button @click="saveData">保存</el-button>
             <el-checkbox v-model="checked">只显示使用的原始点位</el-checkbox>
         </div>
-        <div id="handsontableSteps1">
+        <div id="handsontableSteps1" v-loading="isLoading">
             <handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
             <div v-else class="center">暂无数据</div>
         </div>
         <own-dialog :width="'580px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
             <localtion-falg :renderData="renderData"></localtion-falg>
         </own-dialog>
+        <own-dialog :width="'580px'" :index="true" title="导出excel模板" :dialogVisible="downloadExcel" @cancel="close">
+            <div class="center">
+                <el-button type="text" @click="download">下载模板</el-button>
+            </div>
+        </own-dialog>
+        <div class="center">
+            <pagination :page="pages" @change="changePage"></pagination>
+        </div>
     </div>
 </template>
 <script>
@@ -22,6 +30,7 @@
     import getHeaderSetting from "@/utils/point_edit/handson_header"
     import ownDialog from "@/components/el_pack/dialog"
     import localtionFalg from "@/components/config_point/location_flag"
+    import pagination from "@/components/common/myPagination"
     import {
         mapGetters,
         mapActions
@@ -33,7 +42,8 @@
     import {
         queryPoint,
         updatePoint,
-        createPoint
+        createPoint,
+        downloadTemplete
     } from "@/fetch/point_http"
     export default {
         data() {
@@ -44,7 +54,19 @@
                 changeFlag: true, //是否发生修改
                 localtionDialog: false,
                 renderData: {},
-                allData: []
+                allData: [],
+                pages:{
+                    size: 10,
+                    sizes: [10, 30, 50, 100],
+                    total: 0,
+                    currentPage: 0
+                },
+                oldPage: {
+                    currentPage: 0,
+                    size: 10
+                },
+                downloadExcel: true,
+                isLoading: false
             }
         },
         computed: {
@@ -68,6 +90,38 @@
             //关闭弹窗
             close(){
                 this.localtionDialog = false
+                this.downloadExcel = false
+            },
+
+            //下载excel模板
+            download(){
+                downloadTemplete({
+                    data: {
+                        DataSourceId: this.datasourceId,
+                    },
+                    type: this.protocolType
+                },{
+                    responseType: 'blob'
+                },res => {
+                    var blob = new Blob([res.data], {
+                        type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+                    });
+                    var fileName = res.headers['content-disposition'];
+                    if (fileName)
+                        fileName = fileName.substring(fileName.indexOf('=') + 1);
+                    if ('download' in document.createElement('a')) { // 非IE下载
+                        const elink = document.createElement('a')
+                        elink.download = fileName
+                        elink.style.display = 'none'
+                        elink.href = URL.createObjectURL(blob)
+                        document.body.appendChild(elink)
+                        elink.click()
+                        URL.revokeObjectURL(elink.href) // 释放URL 对象
+                        document.body.removeChild(elink)
+                    } else { // IE10+下载
+                        navigator.msSaveBlob(blob, fileName)
+                    }
+                })
             },
             //点击表格
             clickTable(info,row){
@@ -91,21 +145,48 @@
                     this.createHot()
                 }
             },
+            //页面发生更改
+            changePage(){
+                if(!this.changeFlag){
+                    //发生更改,提示是否保存
+                    this.$confirm('存在数据未保存, 是否继续?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        this.getData()
+                    }).catch(() => {
+                        this.pages.currentPage = this.oldPage.currentPage
+                        this.pages.size = this.oldPage.size
+                        return false
+                    });
+                }else{
+                    this.getData()
+                }
+            },
             getData() {
                 // width = (document.getElementById("app").clientWidth - 50) / header.length
+                this.isLoading = true
                 let param = {
                     type: this.protocolType,
                     data: {
                         Filters: {
                             DatasourceId: this.datasourceId,
                         },
-                        "PageNumber": 1,
-                        "PageSize": 50,
+                        "PageNumber": this.pages.currentPage || 1,
+                        "PageSize": this.pages.size,
                     }
                 }
+                this.oldPage = {
+                    size: this.pages.size,
+                    currentPage: this.pages.currentPage
+                }
                 queryPoint(param, res => {
                     console.log(res)
+                    this.isLoading = false
+                    this.changeFlag = true
                     this.allData = res.Content || []
+                    this.pages.total = res.Total
                     this.createHot()
                 })
             },
@@ -223,7 +304,8 @@
         components: {
             handsontableComponent,
             ownDialog,
-            localtionFalg
+            localtionFalg,
+            pagination
         },
     }
 </script>