Skip to content

SensecCAP Demo Website (English)

Jancee JX | 王静茜 edited this page Jan 6, 2020 · 1 revision

sensecap-demo is a front-end code developed based on Vue

Environment

  • Install node
  • Install npm

Quick start

  • Download the project, extract it, import it into IDE, and execute it in the project directory

    npm install

  • Execute startup command after compilation

    npm run dev

  • build Pack

npm run build

project start

#API configurationapi.js

#API invoke address
let apiHost = (window.location.protocol.indexOf('https') !== -1 ? 'https://' : 'http://') + ip+port(Your Java project access address)
#api
let apiUrl = {
  ****
}

Project


 views/index/index.vue homepage

 --  /  -- /components/control.vue  

                       /warning.vue 

                       /chart.vue 

                       /history.vue 

                       /range.vue 

                       /run.vue 

                       /soil.vue 

                       /meteorology.vue 

                       /video.vue 

 services/ajax.js Encapsulating Ajax files is convenient for unified management of Ajax calls

 services/api.js ncapsulate all APIs for multi page calling

 config/index.js Parameter configuration (update data time)

 assets/lang/cn.js CN

 assets/lang/en.js EN

 main.js Configurable language in

Interface call mode


 get方式

      (```)
          ajax.getData(api_url, {
               params: {
                 id: 001
               }
            }).then(res => {
                if (res.code == 0) {

                } else {

                }
              }).catch(err => {

                })
      (```)

 post方式(patch/patchData、delete/deleteData、put/putData)

      (```)
          ajax.postData(api_url, {
              id: 001
            }).then(res => {
                if (res.code == 0) {

                } else {

                }
              }).catch(err => {

                })
      (```)