Kaynağa Gözat

修改标题
修改webaccess连接

dongjh 1 yıl önce
ebeveyn
işleme
8a872d40b2

+ 2 - 2
public/index.html

@@ -5,7 +5,7 @@
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <title>JeecgBoot 企业级低代码平台</title>
+  <title>固安设备监测系统</title>
   <link rel="icon" href="<%= BASE_URL %>logo.png">
   <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script>
   <style>
@@ -249,7 +249,7 @@
     <div id="loader"></div>
     <div class="loader-section section-left"></div>
     <div class="loader-section section-right"></div>
-    <div class="load_title">正在加载 JeecgBoot 低代码平台,请耐心等待
+    <div class="load_title">正在加载,请耐心等待
 
     </div>
   </div>

+ 7 - 0
src/api/api.js

@@ -2,6 +2,10 @@ import { getAction, deleteAction, putAction, postAction, httpAction } from '@/ap
 import Vue from 'vue'
 import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
 
+//固安
+const addDashParam = (params)=>postAction("/guan/dashboardparam/add",params);
+const editDashParam = (params)=>putAction("/guan/dashboardparam/edit",params);
+
 //角色管理
 const addRole = (params)=>postAction("/sys/role/add",params);
 const editRole = (params)=>putAction("/sys/role/edit",params);
@@ -100,6 +104,9 @@ export const transitRESTful = {
 }
 
 export {
+  addDashParam,
+  editDashParam,
+
   addRole,
   editRole,
   checkRoleCode,

+ 9 - 1
src/api/datacoll/webaccess.js

@@ -17,4 +17,12 @@ export function setWATagNameValues(query) {
       params: query
     })
   }
-  
+  
+
+// 设置设备参数值
+export function getWADataLog() {
+  return axios({
+    url: '/datacoll/webaccess/getWADataLog',
+    method: 'get'
+  })
+}

+ 1 - 1
src/components/layouts/TabLayout.vue

@@ -183,7 +183,7 @@
        * @param title 要修改的新标题
        */
       changeTitle(title) {
-        let projectTitle = "Jeecg-Boot 企业级低代码平台"
+        let projectTitle = "固安设备监测系统"
         // 首页特殊处理
         if (this.$route.path === indexKey) {
           document.title = projectTitle

+ 158 - 0
src/views/modules_guAn/dashboardparam/DashParamModal.vue

@@ -0,0 +1,158 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <a-spin :spinning="confirmLoading">
+      <a-form-model  ref="form" :model="model" :rules="validatorRules">
+
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="paramName"
+          label="大屏参数名称">
+          <a-input placeholder="请输入大屏参数名称" v-model="model.paramName"/>
+        </a-form-model-item>
+
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="tagName"
+          label="webaccess点名">
+          <a-input placeholder="请输入webaccess点名" v-model="model.tagName" />
+        </a-form-model-item>
+
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="状态"
+          hasFeedback>
+            <a-select placeholder="请选择" default-value="1" v-model="model.status">
+              <a-select-option value="1">启用</a-select-option>
+              <a-select-option value="0">禁用</a-select-option>
+            </a-select>
+        </a-form-model-item>
+
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="是否获取历史记录"
+          hasFeedback>
+            <a-select placeholder="请选择" default-value="N" v-model="model.iflog">
+              <a-select-option value="Y">是</a-select-option>
+              <a-select-option value="N">否</a-select-option>
+            </a-select>
+        </a-form-model-item>
+
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="tagName"
+          label="历史记录条数">
+          <a-input-number placeholder="历史记录条数" v-model="model.lognum" />
+        </a-form-model-item>
+
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import pick from 'lodash.pick'
+  import {addDashParam, editDashParam} from '@/api/api'
+  import { getAction } from '@api/manage'
+
+  export default {
+    name: "DashParamModal",
+    data() {
+      return {
+        title: "操作",
+        visible: false,
+        // visibleCheck: true,
+        model: {},
+        status: 1,
+        labelCol: {
+          xs: {span: 24},
+          sm: {span: 5},
+        },
+        wrapperCol: {
+          xs: {span: 24},
+          sm: {span: 16},
+        },
+        confirmLoading: false,
+        validatorRules: {
+          paramName:  [{required: true, message: '请输入大屏参数名称!'}],
+          tagName:  [{required: true, message: '请输入webaccess点名!'}],
+        },
+      }
+    },
+    created() {
+    },
+    methods: {
+      add() {
+        //初始化默认值
+        this.edit({iflog:"N",status:"1"});
+      },
+      edit(record) {
+        // this.status = record.status;
+        // this.visibleCheck = (record.status == 1) ? true : false;
+        this.model = Object.assign({}, record);
+        console.log(this.model)
+        // this.model.status = this.status;
+        this.visible = true
+      },
+    //   onChose(checked) {
+    //     // if (checked) {
+    //     //   this.status = 1;
+    //     //   this.visibleCheck = true;
+    //     // } else {
+    //     //   this.status = 0;
+    //     //   this.visibleCheck = false;
+    //     // }
+    //   },
+      // 确定
+      handleOk() {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let obj;
+            if (!this.model.id) {
+              obj = addDashParam(this.model);
+            } else {
+              obj = editDashParam(this.model);
+            }
+            obj.then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit('ok');
+              } else {
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.close();
+            })
+          }else{
+            return false;
+          }
+        })
+      },
+      // 关闭
+      handleCancel() {
+        this.close();
+      },
+      close() {
+        this.$emit('close');
+        this.visible = false;
+        this.$refs.form.resetFields();
+      },
+    }
+  }
+</script>

+ 195 - 0
src/views/modules_guAn/dashboardparam/index.vue

@@ -0,0 +1,195 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- 左侧面板 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="12">
+          <a-col :md="7" :sm="8">
+            <a-form-item label="参数名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
+              <a-input placeholder="请输入参数名称" v-model="queryParam.paramName"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="7" :sm="8">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+
+      <div class="table-operator" style="border-top: 5px">
+        <a-button @click="handleAdd" type="primary" icon="plus">添加</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls('大屏参数设置信息')">导出</a-button>
+        <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+          <a-button type="primary" icon="import">导入</a-button>
+        </a-upload>
+      </div>
+
+      <a-table
+        ref="table"
+        rowKey="id"
+        size="middle"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        @change="handleTableChange">
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">
+            <a-icon type="edit"/>
+            编辑
+          </a>
+          <a-divider type="vertical"/>
+          <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+      </a-table>
+
+    </div>
+    <dash-param-modal ref="modalForm" @ok="modalFormOk"></dash-param-modal>  <!-- 编辑 -->
+  </a-card>
+</template>
+
+<script>
+  import { filterObj } from '@/utils/util';
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DashParamModal from './DashParamModal'
+  import { getAction } from '@/api/manage'
+  import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
+  import Vue from 'vue'
+
+  export default {
+    name: "edit",
+    mixins:[JeecgListMixin],
+    components: {DashParamModal},
+    data() {
+      return {
+        description: '这是大屏展示参数页面',
+        visible: false,
+        // 查询条件
+        queryParam: {
+          paramName: "",
+        },
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 120,
+            align: "center",
+            customRender: function (t, r, index) {
+              return parseInt(index) + 1;
+            }
+          },
+          {
+            title: '大屏参数名称',
+            align: "left",
+            dataIndex: 'paramName',
+          },
+          {
+            title: 'webaccess点名',
+            align: "left",
+            dataIndex: 'tagName',
+          },
+          {
+            title: '是否启用',
+            align: "center",
+            dataIndex: 'status',
+            customRender: function (text) {
+              if (text == "0") {
+                return "禁用";
+              } else if (text == "1") {
+                return "启用";
+              }
+              else {
+                return text;
+              }
+            }
+          },
+          {
+            title: '是否获取历史记录',
+            align: "center",
+            dataIndex: 'iflog',
+            customRender: function (text) {
+              if (text == "Y") {
+                return "是";
+              } else if (text == "N") {
+                return "否";
+              }
+              else {
+                return text;
+              }
+            }
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: "center",
+            scopedSlots: {customRender: 'action'},
+          }
+        ],
+        dict: "",
+        labelCol: {
+          xs: {span: 8},
+          sm: {span: 5},
+        },
+        wrapperCol: {
+          xs: {span: 16},
+          sm: {span: 19},
+        },
+        url: {
+          list: "/guan/dashboardparam/list",
+          delete: "/guan/dashboardparam/delete",
+          exportXlsUrl: "/guan/dashboardparam/exportXls",
+          importExcelUrl: "/guan/dashboardparam/importExcel",
+        },
+      }
+    },
+    computed: {
+      importExcelUrl: function () {
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      }
+    },
+    methods: {
+      getQueryParams() {
+        var param = Object.assign({}, this.queryParam, this.isorter);
+        param.field = this.getQueryField();
+        param.pageNo = this.ipagination.current;
+        param.pageSize = this.ipagination.pageSize;
+        if (this.superQueryParams) {
+          param['superQueryParams'] = encodeURI(this.superQueryParams)
+          param['superQueryMatchType'] = this.superQueryMatchType
+        }
+        return filterObj(param);
+      },
+    add() {
+      this.edit(this.modelDefault)
+    },
+    edit(record) {
+      this.model = Object.assign({}, record)
+      this.visible = true
+    },
+      // 重置字典类型搜索框的内容
+      searchReset() {
+        var that = this;
+        that.queryParam.paramName = "";
+        that.loadData(this.ipagination.current);
+      },
+      openDeleteList(){
+        this.$refs.dictDeleteList.show()
+      },
+    },
+    watch: {
+      // openKeys(val) {
+      //   console.log('openKeys', val)
+      // },
+    },
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less'
+</style>

+ 13 - 1
src/views/modules_guAn/webaccess/index.vue

@@ -13,6 +13,11 @@
         <el-button type="info" icon="reload" @click="set">设置参数值</el-button>
       </template>
     </a-form-model-item>
+    <a-form-model-item label="获取历史数据" :labelCol="labelCol" :wrapperCol="wrapperCol">
+      <template>
+        <el-button type="info" icon="reload" @click="getlog">获取历史数据</el-button>
+      </template>
+    </a-form-model-item>
     <a-form-model-item label="返回内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
       <a-textarea v-model="message" rows="9" />
     </a-form-model-item>
@@ -20,7 +25,7 @@
 </template>
 
 <script>
-import { getWATagNameValues, setWATagNameValues } from '@/api/datacoll/webaccess.js'
+import { getWATagNameValues, setWATagNameValues, getWADataLog } from '@/api/datacoll/webaccess.js'
 export default {
   name: 'Index',
   data() {
@@ -67,6 +72,13 @@ export default {
         this.message = response.message
       })
     },
+    getlog() {
+      console.log('获取历史数据')
+      getWADataLog().then((response) => {
+        console.log(response)
+        this.message = response.message
+      })
+    },
     exit() {
       if (this.ws) {
         this.ws.close()

+ 1 - 1
src/views/user/oauth2/OAuth2Login.vue

@@ -4,7 +4,7 @@
       <div id="loader"></div>
       <div class="loader-section section-left"></div>
       <div class="loader-section section-right"></div>
-      <div class="load_title">正在登录 JeecgBoot 低代码平台,请耐心等待</div>
+      <div class="load_title">正在登录,请耐心等待</div>
     </div>
   </div>
 </template>