瀏覽代碼

数据中心代码

qinzhipeng_v 6 年之前
父節點
當前提交
bc526b6abd
共有 6 個文件被更改,包括 248 次插入15 次删除
  1. 27 0
      src/api/actionHome.js
  2. 39 14
      src/router/index.js
  3. 3 1
      src/utils/request.js
  4. 76 0
      src/views/cure/menu1/Homes.vue
  5. 100 0
      src/views/cure/menu1/action.vue
  6. 3 0
      src/views/cure/menu1/index.vue

+ 27 - 0
src/api/actionHome.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+const commonUrl = 'http://10.179.181.222:10086/api/'
+
+export function getGlobalInterface(data) {
+  return request({
+    url: 'http://10.179.181.222:10086/render/menu',
+    method: 'get',
+    data
+  })
+}
+
+export function getRedis(data) {
+  return request({
+    url: commonUrl + '/daijiaDemo/redisDemo',
+    method: 'post',
+    data
+  })
+}
+
+export function getHighBottomLine(data) {
+  return request({
+    url: commonUrl + '/daijiaDemo/changeDriverGradeDemo',
+    method: 'post',
+    data
+  })
+}

+ 39 - 14
src/router/index.js

@@ -165,19 +165,45 @@ export const constantRoutes = [
     ]
   },
 
-  // {
-  //   path: '/form',
-  //   component: Layout,
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'Form',
-  //       component: () => import('@/views/form/index'),
-  //       meta: { title: 'Form', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // 404 page must be placed at the end !!!
+  {
+    path: '/cure',
+    component: Layout,
+    redirect: '/cure/commonTools',
+    name: '数据中心',
+    meta: { title: '数据中心', icon: 'example' },
+    children: [
+      {
+        path: 'commonTools',
+        name: '通用工具',
+        alwaysShow: true,
+        component: () => import('@/views/cure/menu1/index.vue'),
+        meta: { title: '通用工具', icon: 'interface' },
+        children: [
+          {
+            path: 'redis',
+            name: 'Redis',
+            component: () => import('@/views/cure/menu1/action.vue'),
+            meta: { title: '获取Redis的数据', icon: 'interface' }
+          }
+        ]
+      },
+      {
+        path: 'daijia',
+        name: '代驾数据构造',
+        component: () => import('@/views/cure/menu1/index.vue'),
+        alwaysShow: true,
+        meta: { title: '代驾数据构造', icon: 'rule' },
+        children: [
+          {
+            path: 'highBottomLine',
+            name: 'HighBottomLine',
+            component: () => import('@/views/cure/menu1/Homes.vue'),
+            meta: { title: '司机高底线切换', icon: 'interface' }
+          }
+        ]
+      }
+    ]
+  },
   { path: '*', redirect: '/404', hidden: true }
 ]
 
@@ -186,7 +212,6 @@ const createRouter = () => new Router({
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRoutes
 })
-
 const router = createRouter()
 
 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465

+ 3 - 1
src/utils/request.js

@@ -128,7 +128,9 @@ service.interceptors.response.use(
         type: 'warning',
         duration: 5 * 1000
       })
-      location.href = 'http://10.179.209.19:8899/'
+      if (location.href.indexOf('localhost') < 0) {
+        location.href = 'http://10.179.209.19:8899/'
+      }
     }
     return Promise.reject(error)
   }

+ 76 - 0
src/views/cure/menu1/Homes.vue

@@ -0,0 +1,76 @@
+<template>
+  <div>
+    <el-radio-group v-model="labelPosition" size="small" />
+    <div style="margin: 20px;" />
+    <el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign" style="margin-left:80px;">
+      <el-form-item label="手机号" style="width:95%;">
+        <el-input v-model="CellPhoneNumber" style="margin-left:20px;" />
+      </el-form-item>
+      <el-form-item label="高底线切换" label-width="82px">
+        <el-select v-model="showHighBottomLine" style="margin-left:20px;" placeholder="请选择">
+          <el-option v-for="item in highOption" :key="item.value" :label="item.displayName" :value="item.value" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <el-button style="margin-left:180px;" type="primary" @click="onSubmit">提交</el-button>
+  </div>
+</template>
+
+<script>
+import { getGlobalInterface, getHighBottomLine } from '@/api/actionHome'
+
+export default {
+  name: 'HighBottomLine',
+  data() {
+    return {
+      data1: '',
+      showKey: '',
+      getEvevtKey: '',
+      currentMenu: {},
+      highOption: '',
+      showHighBottomLine: '',
+      CellPhoneNumber: '',
+      labelPosition: 'right',
+      formLabelAlign: {
+        name: ''
+      }
+    }
+  },
+  created() {
+    this.getEnvironmentalScience()
+  },
+  methods: {
+    getEnvironmentalScience() {
+      getGlobalInterface().then(response => {
+        this.highOption = response.data[1].subMenus[0].widgets[1].options
+      })
+    },
+    onSubmit() {
+      // this.data1 = JSON.parse(localStorage.getItem('key'))
+      this.luok = { mob: this.CellPhoneNumber, grade: this.showHighBottomLine }
+      // localStorage.setItem('mob', JSON.stringify(this.luok))
+      // this.showKey = Object.assign(this.data1, this.luok)
+      getHighBottomLine(this.luok).then(response => {
+        if (response.success === false) {
+          this.open(response.result)
+        }
+      })
+    },
+    open(e) {
+      this.$alert(e, '', {
+        confirmButtonText: '确定',
+        callback: action => {
+          // this.$message({
+          //   type: 'info'
+          //   // message: `action: ${{ action }}`
+          // })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 100 - 0
src/views/cure/menu1/action.vue

@@ -0,0 +1,100 @@
+<template>
+  <el-form label-width="80px">
+    <el-form-item>
+      key值
+      <el-input v-model="getUserInput" style="width:90%; margin-top:50px; margin-left: 30px;" />
+    </el-form-item>
+    <el-form-item>
+      <el-button style="margin-left:70px;" type="primary" @click="onSubmit">提交</el-button>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+import { getGlobalInterface, getRedis } from '@/api/actionHome'
+
+export default {
+  name: 'Redis',
+  data() {
+    return {
+      formData: {},
+      showexplain: false,
+      dataoption: '',
+      transForMation: '',
+      getUserInput: '',
+      WidgetMap: {
+        INPUT: 'el-input',
+        RADIO: '',
+        CHECKBOX: '',
+        TEXTAREA: '',
+        RESET: '',
+        SELECT: ''
+      },
+      Queryoptin: {
+        defaultValue: null,
+        label: '',
+        maxLength: 0,
+        name: '',
+        options: null,
+        pattern: null,
+        placeHolder: '',
+        required: false,
+        text: null,
+        title: null,
+        widgetType: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      getGlobalInterface().then(response => {
+        this.dataoption = response.data
+        this.menuName = this.dataoption[0].menuName
+        this.transForMation = this.dataoption[1].subMenus[0].widgets
+        // for (var val of this.transForMation) {
+        //   this.Queryoptin.defaultValue = val.defaultValue
+        //   this.Queryoptin.label = val.label
+        //   this.Queryoptin.maxLength = val.maxLength
+        //   this.Queryoptin.name = val.name
+        //   this.Queryoptin.options = val.options
+        //   this.Queryoptin.pattern = val.pattern
+        //   this.Queryoptin.placeHolder = val.placeHolder
+        //   this.Queryoptin.required = val.required
+        //   this.Queryoptin.text = val.text
+        //   this.Queryoptin.title = val.title
+        //   this.Queryoptin.widgetType = val.widgetType
+        // }
+        // console.log(this.Queryoptin)
+      })
+    },
+    onSubmit() {
+      // this.data2 = JSON.parse(localStorage.getItem('mob'))
+      const luok = { key: this.getUserInput }
+      // this.showKey = Object.assign(this.data2, luok)
+      // localStorage.setItem('key', JSON.stringify(luok))
+      getRedis(luok).then(response => {
+        this.open(response.result)
+      })
+    },
+    open(e) {
+      this.$alert(e, '', {
+        confirmButtonText: '确定',
+        callback: action => {
+          // this.$message({
+          //   type: 'info'
+          //   // message: `action: ${{ action }}`
+          // })
+        }
+      })
+    }
+  }
+}
+
+</script>
+
+<style scoped>
+
+</style>

+ 3 - 0
src/views/cure/menu1/index.vue

@@ -0,0 +1,3 @@
+<template>
+  <router-view />
+</template>