瀏覽代碼

拉取代码冲突

Shan9312 11 月之前
父節點
當前提交
a188cab058

+ 2 - 0
.env.development

@@ -10,6 +10,8 @@ ENV = 'development'
 # VUE_APP_BASE_API = 'http://192.168.1.56:8082/'
 # 线上测试
 VUE_APP_BASE_API = 'http://tmrwatch.cn:8082/'
+# VUE_APP_BASE_API = 'http://8.130.17.8:8082/' // 蒙牛
+
 # VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
 
 # VUE_APP_BASE_API = 'http://36.155.144.182:18090/'

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


二進制
src/assets/cow.jpg


二進制
src/assets/cow1.jpg


二進制
src/assets/images/login-l.jpg


二進制
src/assets/images/login-l1.jpg


二進制
src/assets/images/logo1.png


二進制
src/assets/images/logo11.png


二進制
src/assets/images/logo_u3.png


二進制
src/assets/images/logo_u31.png


+ 11 - 11
src/permission.js

@@ -3,11 +3,11 @@ import store from './store'
 import { Message } from 'element-ui'
 import NProgress from 'nprogress' // progress bar
 import 'nprogress/nprogress.css' // progress bar style
-import { getToken,removeToken } from '@/utils/auth' // get token from cookie
+import { getToken, removeToken } from '@/utils/auth' // get token from cookie
 import Cookies from 'js-cookie'
 import getPageTitle from '@/utils/get-page-title'
 // 1为单点登录,其他不是
-Cookies.set('sso',0)
+Cookies.set('sso', 0)
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 const whiteList = ['/login'] // no redirect whitelist
@@ -22,7 +22,7 @@ router.beforeEach(async(to, from, next) => {
   // determine whether the user has logged in
   const hasToken = getToken()
 
-    console.log('hasToken==>',hasToken)
+  console.log('hasToken==>', hasToken)
   if (hasToken) {
     if (to.path === '/login') {
       // if is logged in, redirect to the home page
@@ -43,7 +43,7 @@ router.beforeEach(async(to, from, next) => {
 
           // generate accessible routes map based on roles
           const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
-          console.log(accessRoutes,'accessRoutes')
+          console.log(accessRoutes, 'accessRoutes')
           // dynamically add accessible routes
           router.addRoutes(accessRoutes)
 
@@ -75,19 +75,19 @@ router.beforeEach(async(to, from, next) => {
 
       next({ path: '/login' })
       NProgress.done()
-      if(Cookies.get('sso') == 1){
+      if (Cookies.get('sso') == 1) {
         // 单点登录
         // 构建要跳转的URL
         var url = process.env.VUE_APP_BASE_API
-        console.log(url,'url')
-        //获取当前url
-        if(url.indexOf('/')==0 && url.length==1){
-          url= window.location.protocol + "//"+window.location.host+url
+        console.log(url, 'url')
+        // 获取当前url
+        if (url.indexOf('/') == 0 && url.length == 1) {
+          url = window.location.protocol + '//' + window.location.host + url
         }
-        const externalURL = "https://id.xiandaimuye.com/api/v1/oauth2/authorize?response_type=code&client_id=fTBm64I4k3kqHYtoFTUpvirCDxxCfx7I&redirect_uri="+url+'api/v1/oauth2/token';
+        const externalURL = 'https://id.xiandaimuye.com/api/v1/oauth2/authorize?response_type=code&client_id=fTBm64I4k3kqHYtoFTUpvirCDxxCfx7I&redirect_uri=' + url + 'api/v1/oauth2/token'
         // 使用 $router.push 进行页面跳转
         // 注意: 这里的跳转是在当前窗口进行的,如果需要在新标签页打开,可以使用 window.open(externalURL)
-        window.open(externalURL, "_self");
+        window.open(externalURL, '_self')
       }
     }
   }

+ 22 - 22
src/settings.js

@@ -1,22 +1,22 @@
-module.exports = {
-
-  title: '现代牧业设备管理平台',
-
-  /**
-   * @type {boolean} true | false
-   * @description Whether fix the header
-   */
-  fixedHeader: true,
-
-  /**
-   * @type {boolean} true | false
-   * @description Whether need tagsView
-   */
-  tagsView: true,
-
-  /**
-   * @type {boolean} true | false
-   * @description Whether show the logo in sidebar
-   */
-  sidebarLogo: true
-}
+module.exports = {
+
+  title: '科湃腾设备管理系统',
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether fix the header
+   */
+  fixedHeader: true,
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether need tagsView
+   */
+  tagsView: true,
+
+  /**
+   * @type {boolean} true | false
+   * @description Whether show the logo in sidebar
+   */
+  sidebarLogo: true
+}

+ 15 - 8
src/views/console/ranchManagement/index.vue

@@ -4,6 +4,12 @@
       <el-select v-model="table.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width: 140px;" class="filter-item">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.pastureName" placeholder="区域" style="width: 140px;" class="filter-item">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.pastureName" placeholder="奶源部" style="width: 140px;" class="filter-item">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
       <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
     </div>
     <div class="app-operation" style="height:50px">
@@ -29,8 +35,9 @@
             <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="中心" min-width="150px" align="center" prop="center" />
-        <el-table-column label="区域" min-width="150px" align="center" prop="areaName" />
+        <el-table-column label="中心" min-width="150px" align="center" prop="clique" />
+        <el-table-column label="区域" min-width="150px" align="center" prop="region" />
+        <el-table-column label="奶源部" min-width="150px" align="center" prop="areaName" />
         <el-table-column label="牧场" min-width="150px" align="center" prop="pastureName" />
         <el-table-column label="牧场全称" min-width="150px" align="center" prop="companyName" />
         <el-table-column label="牧场编号" min-width="150px" align="center" prop="pastureNumber" />
@@ -55,14 +62,14 @@
         <el-form ref="createTemp" :rules="create.rules" :model="create.temp" label-position="right" label-width="110px" style="width: 80%;margin: 0 auto;">
           <el-row>
             <el-col :span="24">
-              <el-form-item label="所属区域:" prop="areaId" v-if="create.dialogStatus =='create'">
-                <el-select  v-model="create.temp.areaId" placeholder="所属区域" style="width: 100%;">
+              <el-form-item label="奶源部:" prop="areaId" v-if="create.dialogStatus =='create'">
+                <el-select  v-model="create.temp.areaId" placeholder="奶源部" style="width: 100%;">
                   <el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
-              <el-form-item label="所属区域:"  v-else>
+              <el-form-item label="奶源部:"  v-else>
                 <!-- <el-input ref="areaName" v-model="create.temp.areaName" placeholder="所属区域"  style="width: 100%;" /> -->
-                <el-select  v-model="create.temp.areaid" placeholder="所属区域" style="width: 100%;" :disabled="create.dialogStatus =='see'" >
+                <el-select  v-model="create.temp.areaid" placeholder="奶源部" style="width: 100%;" :disabled="create.dialogStatus =='see'" >
                   <el-option  v-for="item in regionList" :key="item.id" :label="item.name" :value="parseInt(item.id)" />
                 </el-select>
               </el-form-item>
@@ -89,13 +96,13 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row>
+          <!-- <el-row>
             <el-col :span="24">
               <el-form-item label="中心: " prop="center">
                 <el-input ref="center" v-model="create.temp.center" placeholder="中心" style="width: 100%;" :disabled="create.dialogStatus =='see'"  />
               </el-form-item>
             </el-col>
-          </el-row>
+          </el-row> -->
           <el-row>
             <el-col :span="24">
               <el-form-item label="地图经度:" prop="longitude">

+ 513 - 511
src/views/console/role/index.vue

@@ -1,511 +1,513 @@
-<template>
-  <div class="app-container">
-    <div class="app-container">
-      <div class="filter-container">
-        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add"> 新增 </el-button>
-      </div>
-      <el-table
-        v-loading="listLoading"
-        element-loading-text="给我一点时间"
-        :data="list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable"
-        row-key="id"
-        default-expand-all
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-        @sort-change="tableSort"
-        :max-height="myHeight"
-      >
-        <el-table-column label="角色名称" header-align="center" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.name }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="顺序" sortable prop="sort" min-width="80px" header-align="center" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.sort }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="启用" min-width="80px" header-align="center" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" header-align="center" align="center" width="330" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button type="warning" size="mini" @click="handleMenu(row)">菜单</el-button>
-            <el-button type="warning" size="mini" style="width:70px" @click="handleDataRole(row)">数据权限</el-button>
-            <el-button type="primary" size="mini" @click="form_edit(row)">编辑</el-button>
-            <el-button v-if="row.status!='已删'" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
-        <el-form ref="dataForm" :rules="rules" :model="dataform" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
-          <el-form-item label="角色名称" prop="name">
-            <el-input ref="name" v-model="dataform.name" />
-          </el-form-item>
-          <el-form-item label="顺序" prop="sort">
-            <el-input ref="sort" v-model="dataform.sort" />
-          </el-form-item>
-          <el-form-item label="EAS信息接收" prop="easInformationReception">
-            <el-switch ref="easInformationReception" v-model="dataform.easInformationReception" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </el-form-item>
-          <el-form-item label="启用" prop="enable">
-            <el-switch ref="enable" v-model="dataform.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button v-if="dialogStatus==='create'" type="success" @click="add_dialog_save_again()"> 确认新增 </el-button>
-          <el-button type="primary" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()"> 确认 </el-button>
-          <el-button @click="dialogFormVisible = false;get_table_data();"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-
-      <el-dialog :title="textMap['dataRole']" :visible.sync="dialogDataRoleVisible" :close-on-click-modal="false">
-        <el-form ref="dataRoleTemp" :rules="rules" label-position="left" :model="dataRoleTemp" label-width="100px" style="width: 600px; margin-left:50px;">
-          <el-form-item label="数据权限" prop="datarole">
-            <el-radio-group v-model="dataRoleTemp.datarole">
-              <el-radio :label="3">全部数据</el-radio>
-              <el-radio :label="2">牧场数据</el-radio>
-              <el-radio :label="1">部门数据</el-radio>
-              <el-radio :label="0">个人数据</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item v-if="dataRoleTemp.datarole == 1" label="部门" prop="deptNameList">
-            <el-select v-model="dataRoleTemp.deptNameList" style="width:500px;" multiple placeholder="部门">
-              <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="edit_dialog_saveRole()"> 确认 </el-button>
-          <el-button @click="dialogDataRoleVisible = false;get_table_data()"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-      <el-dialog :title="textMap['menu']" :visible.sync="dialogMenuVisible" :close-on-click-modal="false">
-        <el-form :rules="rules" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
-          <el-form-item label="菜单" prop="menuname">
-            <tree-select
-              :disabled="disabled"
-              :height="280"
-              :width="200"
-              size="small"
-              multiple
-              :data="parentMenu"
-              :default-props="defaultProps"
-              collapse-tags
-              check-strictly
-              :node-key="nodeKey"
-              :checked-keys="defaultCheckedKeys"
-              @popoverHide="popoverHide"
-            />
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button :disabled="isokDisable" type="primary" @click="updateMenu()"> 确认 </el-button>
-          <el-button @click="dialogMenuVisible = false;get_table_data()"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-    </div>
-  </div>
-</template>
-
-<script>
-import TreeSelect from '@/components/TreeSelect'
-import waves from '@/directive/waves' // waves directive
-import { isIntegerZero } from '@/utils/validate'
-import { PostDataByName, GetDataByName, UpdateDataRelation, ExecDataByConfig, getRecuData, failproccess } from '@/api/common'
-import Pagination from '@/components/Pagination' // secondary package based on el-pagination
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import { sortChange } from '@/utils/index.js'
-export default {
-  name: 'Role',
-  components: { Pagination, TreeSelect },
-  directives: { waves },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 180,
-      disabled: false,
-      tableKey: 0,
-      list: [{ 'sqlname': '', 'id': 0, 'sqlstr': '' }],
-      parentMenu: [],
-      total: 0,
-      listLoading: true,
-      requestParam: {
-        name: 'createRole', offset: 0, pagecount: 0, params: []
-      },
-      UpdateDataRelationParam: {
-        name: '', dataname: '', datavalue: '', valuename: '', values: ''
-      },
-      dataform: {
-        id: '', name: '', selectMenus: [], sort: '', enable: '', easInformationReception: ''
-      },
-      getdataListParm: { name: 'getRoleall',
-        offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureId: Cookies.get('pastureid') }},
-      getMenuParm: { name: 'getMenuandButtonRecuRule', idname: 'id', params: [-1] },
-      rules: {
-        name: [{ type: 'string', required: true, message: '名称必填', trigger: 'change' }],
-        sort: [{ validator: isIntegerZero, trigger: 'blur' }],
-        datarole: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      dialogFormVisible: false,
-      dialogMenuVisible: false,
-      dialogDataRoleVisible: false,
-      selectedMenu: '',
-      dialogStatus: '',
-      textMap: { update: '编辑', create: '新增', menu: '授权菜单', dataRole: '数据权限' },
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      defaultProps: { children: 'children', label: 'title' },
-      nodeKey: 'id',
-      defaultCheckedKeys: [],
-      getDataRoleListParm: {
-        name: 'getDataRole', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
-      },
-      getEchoDeptParm: {
-        name: 'getRoleDepartmentName', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
-      },
-      isokDisable: false,
-      dataRoleTemp: {},
-      dataRolelist: [],
-      deptList: [],
-      findAllDepart: [],
-      getDepartParam: { name: 'getDepatmentOnlyName', offset: 0, pagecount: 0 },
-      requestParam2: {},
-      requestParam3: {}
-    }
-  },
-  created() {
-    this.get_table_data()
-    this.getDepartDownList()
-  },
-  methods: {
-    tableSort(column) {
-      sortChange(column, this.list)
-    },
-    popoverHide(checkedIds, checkedData) {
-      this.dataform.selectMenus = checkedIds
-      this.selectedMenu = checkedIds
-      this.UpdateDataRelationParam.values = checkedIds
-    },
-    getMenuList() {
-      getRecuData(this.getMenuParm).then(response => {
-        this.parentMenu = response.data
-      })
-    },
-    getDepartDownList() {
-      GetDataByName(this.getDepartParam).then(response => {
-        this.findAllDepart = response.data.list
-      })
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (var i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].enable = parseInt(response.data.list[i].enable)
-          }
-          this.list = response.data.list
-        }
-        if (response.data.total) {
-          this.total = response.data.total
-        }
-        this.getMenuList()
-        // Just to simulate the time of the request
-        setTimeout(() => {
-          this.listLoading = false
-        }, 0.5 * 1000)
-      })
-    },
-    resetRequestParam() {
-      this.dataform.id = ''
-      this.dataform.name = ''
-      this.dataform.sort = '0'
-      this.dataform.enable = 1
-      this.dataform.easInformationReception = 0
-    },
-    form_add() {
-      this.resetRequestParam()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-        this.$refs.name.focus()
-      })
-    },
-    add_dialog_save() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'createRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          PostDataByName(this.requestParam).then(() => {
-            this.get_table_data()
-            this.dialogFormVisible = false
-            this.$notify({
-              title: '成功',
-              message: '新增成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    add_dialog_save_again() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'createRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          PostDataByName(this.requestParam).then(() => {
-            this.$nextTick(() => {
-              this.$refs['name'].focus()
-            })
-            this.get_table_data()
-            this.resetRequestParam()
-            this.$notify({
-              title: '成功',
-              message: '新增成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    handleMenu(row) {
-      this.requestParam.name = 'getMenuByRole'
-      this.requestParam.params = []
-      this.requestParam.params[0] = row.id
-      this.requestParam.pagecount = 0
-      this.requestParam.returntype = 'list'
-      this.dataform.id = row.id
-      this.dialogMenuVisible = true
-
-      console.log("this.requestParam",this.requestParam)
-      GetDataByName(this.requestParam).then(response => {
-        this.selectedMenu = response.data.lists.menu_id
-        this.defaultCheckedKeys = this.selectedMenu
-        this.UpdateDataRelationParam.values = this.defaultCheckedKeys
-      })
-    },
-    updateMenu() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.UpdateDataRelationParam.name = 'role_menu'
-      this.UpdateDataRelationParam.dataname = 'role_id'
-      this.UpdateDataRelationParam.datavalue = this.dataform.id
-      this.UpdateDataRelationParam.valuename = 'menu_id'
-      this.UpdateDataRelationParam.values = this.selectedMenu
-
-      UpdateDataRelation(this.UpdateDataRelationParam).then(() => {
-        this.dialogMenuVisible = false
-        this.$notify({
-          title: '成功',
-          message: '修改成功',
-          type: 'success',
-          duration: 2000
-        })
-      })
-    },
-    form_edit(row) {
-      console.log(row, '=====')
-      this.dataform.id = row.id
-      this.dataform.name = row.name
-      this.dataform.sort = row.sort
-      this.dataform.enable = row.enable
-      this.dataform.easInformationReception = row.easInformationReception
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-        this.$refs.name.focus()
-      })
-    },
-    edit_dialog_save() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'updateRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          this.requestParam.params[4] = this.dataform.id
-          PostDataByName(this.requestParam).then(() => {
-            this.get_table_data()
-            this.resetRequestParam()
-            this.dialogFormVisible = false
-            this.$notify({
-              title: '成功',
-              message: '修改成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    handleEnableChange(index, row) {
-      this.requestParam.name = 'updateRole'
-      this.requestParam.params = []
-      this.requestParam.params[0] = row.name
-      this.requestParam.params[1] = row.sort
-      this.requestParam.params[2] = row.enable
-      this.requestParam.params[3] = row.id
-      PostDataByName(this.requestParam).then(() => {
-        this.$notify({
-          title: '成功',
-          message: '修改成功',
-          type: 'success',
-          duration: 2000
-        })
-      })
-    },
-    form_delete(row) {
-      MessageBox.confirm('名称:' + row.name, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'deleteRole'
-        this.requestParam.params = []
-        this.requestParam.params[0] = row.id
-        PostDataByName(this.requestParam).then(() => {
-          this.get_table_data()
-          this.resetRequestParam()
-          this.dialogFormVisible = false
-          this.$notify({
-            title: '成功',
-            message: '删除成功',
-            type: 'success',
-            duration: 2000
-          })
-        })
-      })
-    },
-    handleDataRole(row) {
-      if (row.deptNameList == undefined) {
-        this.$set(row, 'deptNameList', [])
-      }
-      this.dataRoleTemp = Object.assign({}, row)
-      this.$set(this.dataRoleTemp, 'datarole', 0)
-      this.dialogDataRoleVisible = true
-      this.getDataRoleListParm.parammaps.id = row.id
-      GetDataByName(this.getDataRoleListParm).then(response => {
-        this.dataRolelist = response.data.list
-        this.$set(this.dataRoleTemp, 'datarole', response.data.list[0].datarole)
-        if (this.dataRoleTemp.datarole == 1) {
-          this.getEchoDeptParm.parammaps = {}
-          this.getEchoDeptParm.parammaps.role_id = row.id
-          GetDataByName(this.getEchoDeptParm).then(response => {
-            var deptNameArr = []
-            for (let i = 0; i < response.data.list.length; i++) {
-              deptNameArr.push(response.data.list[i].name)
-            }
-            this.$set(this.dataRoleTemp, 'deptNameList', deptNameArr)
-            this.$forceUpdate()
-            console.log(this.dataRoleTemp.deptNameList)
-          })
-        }
-      })
-    },
-
-    edit_dialog_saveRole() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['dataRoleTemp'].validate((valid) => {
-        if (valid) {
-          if (this.dataRoleTemp.datarole == 1) {
-            console.log('quanbu', this.dataRoleTemp.deptNameList)
-            if (this.dataRoleTemp.deptNameList == undefined || this.dataRoleTemp.deptNameList.length == 0) {
-              this.$message({ type: 'warning', message: '请选择部门' })
-              return false
-            }
-            this.requestParam2 = {}
-            this.requestParam2.common = { 'returnmap': '0' }
-            this.requestParam2.data = []
-            for (let i = 0; i < this.dataRoleTemp.deptNameList.length; i++) {
-              this.requestParam2.data.push({ 'name': 'getDepartmentId', 'type': 'sm', 'parammaps': { 'name': this.dataRoleTemp.deptNameList[i] }})
-            }
-            ExecDataByConfig(this.requestParam2).then(response => {
-              console.log('新增保存发送参数', this.requestParam2)
-              if (response.msg == 'fail') {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-              } else {
-                var arr = []
-                for (let i = 0; i < response.data.length; i++) {
-                  for (let j = 0; j < response.data[i].resultmaps.length; j++) {
-                    arr.push(response.data[i].resultmaps[j].id)
-                  }
-                }
-                this.requestParam3.name = 'role_department'
-                this.requestParam3.dataname = 'role_id'
-                this.requestParam3.datavalue = this.dataRoleTemp.id
-                this.requestParam3.valuename = 'department_id'
-                this.requestParam3.values = arr
-                UpdateDataRelation(this.requestParam3).then(response => {
-                  if (response.msg == 'fail') {
-                    this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-                  } else {
-                    this.requestParam.name = 'setDataRole'
-                    this.requestParam.parammaps = {}
-                    this.requestParam.parammaps.id = this.dataRoleTemp.id
-                    this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
-                    PostDataByName(this.requestParam).then(response => {
-                      console.log('设置数据权限保存发送参数', this.requestParam)
-                      if (response.msg !== 'fail') {
-                        this.get_table_data()
-                        this.dialogDataRoleVisible = false
-                        this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
-                      } else {
-                        failproccess(response, this.$notify)
-                      }
-                    })
-                  }
-                })
-              }
-            })
-          } else {
-            this.requestParam.name = 'setDataRole'
-            this.requestParam.parammaps = {}
-            this.requestParam.parammaps.id = this.dataRoleTemp.id
-            this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
-            PostDataByName(this.requestParam).then(response => {
-              console.log('设置数据权限保存发送参数', this.requestParam)
-              if (response.msg !== 'fail') {
-                this.get_table_data()
-                this.dialogDataRoleVisible = false
-                this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
-              } else {
-                failproccess(response, this.$notify)
-              }
-            })
-          }
-        }
-      })
-    }
-  }
-}
-</script>
+<template>
+  <div class="app-container">
+    <div class="app-container">
+      <div class="filter-container">
+        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add"> 新增 </el-button>
+      </div>
+      <el-table
+        v-loading="listLoading"
+        element-loading-text="给我一点时间"
+        :data="list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable"
+        row-key="id"
+        default-expand-all
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+        @sort-change="tableSort"
+        :max-height="myHeight"
+      >
+        <el-table-column label="角色名称" header-align="center" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="顺序" sortable prop="sort" min-width="80px" header-align="center" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.sort }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="启用" min-width="80px" header-align="center" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" header-align="center" align="center" width="330" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button type="warning" size="mini" @click="handleMenu(row)">菜单</el-button>
+            <el-button type="warning" size="mini" style="width:70px" @click="handleDataRole(row)">数据权限</el-button>
+            <el-button type="primary" size="mini" @click="form_edit(row)">编辑</el-button>
+            <el-button v-if="row.status!='已删'" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
+        <el-form ref="dataForm" :rules="rules" :model="dataform" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
+          <el-form-item label="角色名称" prop="name">
+            <el-input ref="name" v-model="dataform.name" />
+          </el-form-item>
+          <el-form-item label="顺序" prop="sort">
+            <el-input ref="sort" v-model="dataform.sort" />
+          </el-form-item>
+          <el-form-item label="EAS信息接收" prop="easInformationReception">
+            <el-switch ref="easInformationReception" v-model="dataform.easInformationReception" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </el-form-item>
+          <el-form-item label="启用" prop="enable">
+            <el-switch ref="enable" v-model="dataform.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button v-if="dialogStatus==='create'" type="success" @click="add_dialog_save_again()"> 确认新增 </el-button>
+          <el-button type="primary" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()"> 确认 </el-button>
+          <el-button @click="dialogFormVisible = false;get_table_data();"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+
+      <el-dialog :title="textMap['dataRole']" :visible.sync="dialogDataRoleVisible" :close-on-click-modal="false">
+        <el-form ref="dataRoleTemp" :rules="rules" label-position="left" :model="dataRoleTemp" label-width="100px" style="width: 800px; margin-left:50px;">
+          <el-form-item label="数据权限" prop="datarole">
+            <el-radio-group v-model="dataRoleTemp.datarole">
+              <el-radio :label="3">全部数据</el-radio>
+              <el-radio :label="4">区域数据</el-radio>
+              <el-radio :label="5">奶源部数据</el-radio>
+              <el-radio :label="2">牧场数据</el-radio>
+              <el-radio :label="1">部门数据</el-radio>
+              <el-radio :label="0">个人数据</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item v-if="dataRoleTemp.datarole == 1" label="部门" prop="deptNameList">
+            <el-select v-model="dataRoleTemp.deptNameList" style="width:500px;" multiple placeholder="部门">
+              <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="edit_dialog_saveRole()"> 确认 </el-button>
+          <el-button @click="dialogDataRoleVisible = false;get_table_data()"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+      <el-dialog :title="textMap['menu']" :visible.sync="dialogMenuVisible" :close-on-click-modal="false">
+        <el-form :rules="rules" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
+          <el-form-item label="菜单" prop="menuname">
+            <tree-select
+              :disabled="disabled"
+              :height="280"
+              :width="200"
+              size="small"
+              multiple
+              :data="parentMenu"
+              :default-props="defaultProps"
+              collapse-tags
+              check-strictly
+              :node-key="nodeKey"
+              :checked-keys="defaultCheckedKeys"
+              @popoverHide="popoverHide"
+            />
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button :disabled="isokDisable" type="primary" @click="updateMenu()"> 确认 </el-button>
+          <el-button @click="dialogMenuVisible = false;get_table_data()"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import TreeSelect from '@/components/TreeSelect'
+import waves from '@/directive/waves' // waves directive
+import { isIntegerZero } from '@/utils/validate'
+import { PostDataByName, GetDataByName, UpdateDataRelation, ExecDataByConfig, getRecuData, failproccess } from '@/api/common'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import { MessageBox } from 'element-ui'
+import Cookies from 'js-cookie'
+import { sortChange } from '@/utils/index.js'
+export default {
+  name: 'Role',
+  components: { Pagination, TreeSelect },
+  directives: { waves },
+  data() {
+    return {
+      myHeight:document.documentElement.clientHeight - 85- 180,
+      disabled: false,
+      tableKey: 0,
+      list: [{ 'sqlname': '', 'id': 0, 'sqlstr': '' }],
+      parentMenu: [],
+      total: 0,
+      listLoading: true,
+      requestParam: {
+        name: 'createRole', offset: 0, pagecount: 0, params: []
+      },
+      UpdateDataRelationParam: {
+        name: '', dataname: '', datavalue: '', valuename: '', values: ''
+      },
+      dataform: {
+        id: '', name: '', selectMenus: [], sort: '', enable: '', easInformationReception: ''
+      },
+      getdataListParm: { name: 'getRoleall',
+        offset: 1, pagecount: 10, returntype: 'Map',
+        parammaps: { pastureId: Cookies.get('pastureid') }},
+      getMenuParm: { name: 'getMenuandButtonRecuRule', idname: 'id', params: [-1] },
+      rules: {
+        name: [{ type: 'string', required: true, message: '名称必填', trigger: 'change' }],
+        sort: [{ validator: isIntegerZero, trigger: 'blur' }],
+        datarole: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      dialogFormVisible: false,
+      dialogMenuVisible: false,
+      dialogDataRoleVisible: false,
+      selectedMenu: '',
+      dialogStatus: '',
+      textMap: { update: '编辑', create: '新增', menu: '授权菜单', dataRole: '数据权限' },
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      defaultProps: { children: 'children', label: 'title' },
+      nodeKey: 'id',
+      defaultCheckedKeys: [],
+      getDataRoleListParm: {
+        name: 'getDataRole', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
+      },
+      getEchoDeptParm: {
+        name: 'getRoleDepartmentName', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
+      },
+      isokDisable: false,
+      dataRoleTemp: {},
+      dataRolelist: [],
+      deptList: [],
+      findAllDepart: [],
+      getDepartParam: { name: 'getDepatmentOnlyName', offset: 0, pagecount: 0 },
+      requestParam2: {},
+      requestParam3: {}
+    }
+  },
+  created() {
+    this.get_table_data()
+    this.getDepartDownList()
+  },
+  methods: {
+    tableSort(column) {
+      sortChange(column, this.list)
+    },
+    popoverHide(checkedIds, checkedData) {
+      this.dataform.selectMenus = checkedIds
+      this.selectedMenu = checkedIds
+      this.UpdateDataRelationParam.values = checkedIds
+    },
+    getMenuList() {
+      getRecuData(this.getMenuParm).then(response => {
+        this.parentMenu = response.data
+      })
+    },
+    getDepartDownList() {
+      GetDataByName(this.getDepartParam).then(response => {
+        this.findAllDepart = response.data.list
+      })
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (var i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].enable = parseInt(response.data.list[i].enable)
+          }
+          this.list = response.data.list
+        }
+        if (response.data.total) {
+          this.total = response.data.total
+        }
+        this.getMenuList()
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoading = false
+        }, 0.5 * 1000)
+      })
+    },
+    resetRequestParam() {
+      this.dataform.id = ''
+      this.dataform.name = ''
+      this.dataform.sort = '0'
+      this.dataform.enable = 1
+      this.dataform.easInformationReception = 0
+    },
+    form_add() {
+      this.resetRequestParam()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs.name.focus()
+      })
+    },
+    add_dialog_save() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'createRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          PostDataByName(this.requestParam).then(() => {
+            this.get_table_data()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    add_dialog_save_again() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'createRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          PostDataByName(this.requestParam).then(() => {
+            this.$nextTick(() => {
+              this.$refs['name'].focus()
+            })
+            this.get_table_data()
+            this.resetRequestParam()
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    handleMenu(row) {
+      this.requestParam.name = 'getMenuByRole'
+      this.requestParam.params = []
+      this.requestParam.params[0] = row.id
+      this.requestParam.pagecount = 0
+      this.requestParam.returntype = 'list'
+      this.dataform.id = row.id
+      this.dialogMenuVisible = true
+
+      console.log("this.requestParam",this.requestParam)
+      GetDataByName(this.requestParam).then(response => {
+        this.selectedMenu = response.data.lists.menu_id
+        this.defaultCheckedKeys = this.selectedMenu
+        this.UpdateDataRelationParam.values = this.defaultCheckedKeys
+      })
+    },
+    updateMenu() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.UpdateDataRelationParam.name = 'role_menu'
+      this.UpdateDataRelationParam.dataname = 'role_id'
+      this.UpdateDataRelationParam.datavalue = this.dataform.id
+      this.UpdateDataRelationParam.valuename = 'menu_id'
+      this.UpdateDataRelationParam.values = this.selectedMenu
+
+      UpdateDataRelation(this.UpdateDataRelationParam).then(() => {
+        this.dialogMenuVisible = false
+        this.$notify({
+          title: '成功',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    form_edit(row) {
+      console.log(row, '=====')
+      this.dataform.id = row.id
+      this.dataform.name = row.name
+      this.dataform.sort = row.sort
+      this.dataform.enable = row.enable
+      this.dataform.easInformationReception = row.easInformationReception
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs.name.focus()
+      })
+    },
+    edit_dialog_save() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'updateRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          this.requestParam.params[4] = this.dataform.id
+          PostDataByName(this.requestParam).then(() => {
+            this.get_table_data()
+            this.resetRequestParam()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '修改成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    handleEnableChange(index, row) {
+      this.requestParam.name = 'updateRole'
+      this.requestParam.params = []
+      this.requestParam.params[0] = row.name
+      this.requestParam.params[1] = row.sort
+      this.requestParam.params[2] = row.enable
+      this.requestParam.params[3] = row.id
+      PostDataByName(this.requestParam).then(() => {
+        this.$notify({
+          title: '成功',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    form_delete(row) {
+      MessageBox.confirm('名称:' + row.name, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'deleteRole'
+        this.requestParam.params = []
+        this.requestParam.params[0] = row.id
+        PostDataByName(this.requestParam).then(() => {
+          this.get_table_data()
+          this.resetRequestParam()
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      })
+    },
+    handleDataRole(row) {
+      if (row.deptNameList == undefined) {
+        this.$set(row, 'deptNameList', [])
+      }
+      this.dataRoleTemp = Object.assign({}, row)
+      this.$set(this.dataRoleTemp, 'datarole', 0)
+      this.dialogDataRoleVisible = true
+      this.getDataRoleListParm.parammaps.id = row.id
+      GetDataByName(this.getDataRoleListParm).then(response => {
+        this.dataRolelist = response.data.list
+        this.$set(this.dataRoleTemp, 'datarole', response.data.list[0].datarole)
+        if (this.dataRoleTemp.datarole == 1) {
+          this.getEchoDeptParm.parammaps = {}
+          this.getEchoDeptParm.parammaps.role_id = row.id
+          GetDataByName(this.getEchoDeptParm).then(response => {
+            var deptNameArr = []
+            for (let i = 0; i < response.data.list.length; i++) {
+              deptNameArr.push(response.data.list[i].name)
+            }
+            this.$set(this.dataRoleTemp, 'deptNameList', deptNameArr)
+            this.$forceUpdate()
+            console.log(this.dataRoleTemp.deptNameList)
+          })
+        }
+      })
+    },
+
+    edit_dialog_saveRole() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['dataRoleTemp'].validate((valid) => {
+        if (valid) {
+          if (this.dataRoleTemp.datarole == 1) {
+            console.log('quanbu', this.dataRoleTemp.deptNameList)
+            if (this.dataRoleTemp.deptNameList == undefined || this.dataRoleTemp.deptNameList.length == 0) {
+              this.$message({ type: 'warning', message: '请选择部门' })
+              return false
+            }
+            this.requestParam2 = {}
+            this.requestParam2.common = { 'returnmap': '0' }
+            this.requestParam2.data = []
+            for (let i = 0; i < this.dataRoleTemp.deptNameList.length; i++) {
+              this.requestParam2.data.push({ 'name': 'getDepartmentId', 'type': 'sm', 'parammaps': { 'name': this.dataRoleTemp.deptNameList[i] }})
+            }
+            ExecDataByConfig(this.requestParam2).then(response => {
+              console.log('新增保存发送参数', this.requestParam2)
+              if (response.msg == 'fail') {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              } else {
+                var arr = []
+                for (let i = 0; i < response.data.length; i++) {
+                  for (let j = 0; j < response.data[i].resultmaps.length; j++) {
+                    arr.push(response.data[i].resultmaps[j].id)
+                  }
+                }
+                this.requestParam3.name = 'role_department'
+                this.requestParam3.dataname = 'role_id'
+                this.requestParam3.datavalue = this.dataRoleTemp.id
+                this.requestParam3.valuename = 'department_id'
+                this.requestParam3.values = arr
+                UpdateDataRelation(this.requestParam3).then(response => {
+                  if (response.msg == 'fail') {
+                    this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                  } else {
+                    this.requestParam.name = 'setDataRole'
+                    this.requestParam.parammaps = {}
+                    this.requestParam.parammaps.id = this.dataRoleTemp.id
+                    this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
+                    PostDataByName(this.requestParam).then(response => {
+                      console.log('设置数据权限保存发送参数', this.requestParam)
+                      if (response.msg !== 'fail') {
+                        this.get_table_data()
+                        this.dialogDataRoleVisible = false
+                        this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
+                      } else {
+                        failproccess(response, this.$notify)
+                      }
+                    })
+                  }
+                })
+              }
+            })
+          } else {
+            this.requestParam.name = 'setDataRole'
+            this.requestParam.parammaps = {}
+            this.requestParam.parammaps.id = this.dataRoleTemp.id
+            this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
+            PostDataByName(this.requestParam).then(response => {
+              console.log('设置数据权限保存发送参数', this.requestParam)
+              if (response.msg !== 'fail') {
+                this.get_table_data()
+                this.dialogDataRoleVisible = false
+                this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
+              } else {
+                failproccess(response, this.$notify)
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
+</script>

+ 298 - 298
src/views/login/index.vue

@@ -1,298 +1,298 @@
-<template>
-  <div v-if="isdisplay == 1"></div>
-  <div class="login-container" v-else>
-    <div class="content">
-      <div class="content-l"></div>
-      <div class="login">
-        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left" >
-          <div class="title-container">
-            <h3 class="title">万象设备管理系统</h3>
-            <b>WanXiang Equipment Management System</b>
-            <hr>
-          </div>
-          <el-form-item prop="username">
-            <span class="svg-container">
-              <svg-icon icon-class="user" />
-            </span>
-            <el-input ref="username" v-model="loginForm.username" placeholder="Username" name="username" type="text" tabindex="1" auto-complete="on" />
-          </el-form-item>
-
-          <el-form-item prop="password">
-            <span class="svg-container">
-              <svg-icon icon-class="password" />
-            </span>
-            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" placeholder="Password" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
-            <span class="show-pwd" @click="showPwd">
-              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
-            </span>
-          </el-form-item>
-          <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;background:#50b5ff;" @click.native.prevent="handleLogin" >登录</el-button>
-        </el-form>
-      </div>
-    </div>
-  </div>
-  
-</template>
-
-<script>
-import { validUsername } from '@/utils/validate'
-import { getJson } from '@/api/common'
-import Cookies from 'js-cookie'
-import axios from 'axios';
-import { setToken } from '@/utils/auth' // get token from cookie
-export default {
-  name: 'Login',
-  data() {
-    const validateUsername = (rule, value, callback) => {
-      if (!validUsername(value)) {
-        callback(new Error('请输入正确的用户名'))
-      } else {
-        callback()
-      }
-    }
-    const validatePassword = (rule, value, callback) => {
-      const re = new RegExp(`^(?=.*[a-z])(?=.*\\d)(?=.*\\W)[^]{8,32}$`)
-      if (value === '') {
-        callback(new Error('请输入密码'))
-      } else if (!re.test(value)) {
-        callback(new Error('密码由8位以上数字,大小写字母,特殊字符组成'))
-      } else {
-        callback()
-      }
-    }
-    return {
-      loginForm: {
-        username: '',
-        password: ''
-      },
-      loginRules: {
-        username: [
-          { required: true, trigger: 'blur', validator: validateUsername }
-        ],
-        password: [
-          { required: true, trigger: 'blur', validator: validatePassword }
-        ]
-      },
-      loading: false,
-      passwordType: 'password',
-      redirect: undefined,
-      isdisplay:Cookies.get('sso')
-    }
-  },
-  watch: {
-    $route: {
-      handler: function(route) {
-        this.redirect = route.query && route.query.redirect
-      },
-      immediate: true
-    }
-  },
-  created() {
-    // var that = this
-    // document.onkeydown = function(e) {
-    //   e = window.event || e
-    //   // eslint-disable-next-line eqeqeq
-    //   if (that.$route.path == '/login' && (e.code == 'Enter' || e.code == 'Num Enter')) { // 验证在登录界面和按得键是回车键enter
-    //     that.handleLogin('ruleForm2') // 登录函数 (handleSubmit2('ruleForm2')-登录按钮的点击事件)
-    //   }
-    // }
-    // 单点登录
-    if(Cookies.get('sso') == 1){
-     this.getcodeList()
-    }
-  },
-  methods: {
-    showPwd() {
-      if (this.passwordType === 'password') {
-        this.passwordType = ''
-      } else {
-        this.passwordType = 'password'
-      }
-      this.$nextTick(() => {
-        this.$refs.password.focus()
-      })
-    },
-    handleLogin() {
-      this.$refs.loginForm.validate(valid => {
-        if (valid) {
-          this.$store.dispatch('user/login', this.loginForm) .then(() => {
-            // const re = new RegExp(`^(?=.*[a-z])(?=.*\\d)(?=.*\\W)[^]{8,32}$`)
-            // if (!re.test(this.loginForm.password)) {
-            //   this.$router.push('/console/Changpwd')
-            //   console.log('密码不符合要求')
-            // }
-            this.$router.push({ path: this.redirect || '/' })
-            this.loading = false
-          }).catch(() => {
-            this.loading = false
-          })
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
-    },
-    getcodeList(){
-      this.$store.dispatch('user/login', this.loginForm) .then(() => {
-      }).catch(() => {
-        this.loading = false
-      })
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-/* 修复input 背景不协调 和光标变色 */
-/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
-
-// $bg: #283443;
-// $light_gray: #fff;
-// $cursor: #fff;
-// 更改
-$bg: #ccc;
-$light_gray: #ccc;
-$cursor: #000;
-@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
-  .login-container .el-input input {
-    color: $cursor;
-  }
-}
-
-/* reset element-ui css */
-.login-container {
-  .el-input {
-    display: inline-block;
-    height: 38px;
-    width: 85%;
-
-    input {
-      background: transparent;
-      border: 0px;
-      -webkit-appearance: none;
-      border-radius: 0px;
-      padding: 5px 5px 5px 15px;
-      color: #000;
-      height: 38px;
-      caret-color: $cursor;
-
-      &:-webkit-autofill {
-        box-shadow: 0 0 0px 1000px $bg inset !important;
-        -webkit-text-fill-color: $cursor !important;
-      }
-    }
-  }
-
-  .el-form-item {
-    border: 1px solid rgba(255, 255, 255, 0.1);
-    background: rgba(0, 0, 0, 0.2);
-    border-radius: 5px;
-    color: #454545;
-    .el-form-item__content {
-      line-height: 30px;
-    }
-  }
-}
-</style>
-
-<style lang="scss" scoped>
-$bg: #2d3a4b;
-$dark_gray: #889aa4;
-$light_gray: #000;
-
-.login-container {
-  min-height: 100%;
-  width: 100%;
-  position: relative;
-  background: url("../../assets/images/login.png") no-repeat;
-  background-size:cover;
-  overflow: hidden;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  .logo{
-    padding: 5px;
-  }
-  .bujian{
-    position: absolute;
-    top: 0;
-    bottom: 0;
-    left: 0;
-    right: 200px;
-    margin: auto;
-  }
-  .login {
-    padding: 30px;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    margin: auto;
-    bottom: 0;
-    .tips {
-      font-size: 14px; color: #fff; margin-bottom: 10px;
-      span { &:first-of-type { margin-right: 16px; } }
-    }
-
-    .svg-container { padding: 6px 5px 6px 15px; color: $dark_gray; vertical-align: middle; width: 30px; display: inline-block; }
-
-    .title-container {
-      position: relative;
-      .title { font-size: 28px; color: $light_gray; margin: 0px auto 0 auto; text-align: center; font-weight: bold; }
-      b { text-align: center; font: 14px/2 ""; display: block; }
-    }
-
-    .show-pwd { position: absolute; right: 10px; top: 7px; font-size: 16px; color: $dark_gray; cursor: pointer; user-select: none; }
-    hr { color: #ccc; margin: 20px 0; }
-  }
-}
-.content{
-  left: 0;
-  right: 0;
-  bottom: 0;
-  top: 0;
-  margin: 0 auto;
-}
-@media (min-width: 770px) {
-   .content{
-      width: 770px;
-      height: 420px;
-    }
-   .content-l{
-    float: left;
-    width: 420px;
-    height: 420px;
-    background: url("../../assets/images/login-l.jpg") no-repeat;
-    background-size:cover;
-  }
-  .login{
-    float: left;
-    width: 350px;
-    height: 420px;
-    background: url("../../assets/images/login-r.jpg") no-repeat;
-    background-size:cover;
-  }
-  .login-form { position: relative; width: 224px; max-width: 100%; overflow: hidden; }
-}
- @media (min-width: 1100px) {
-   .content{
-      width: 1100px;
-      height: 600px;
-    }
-   .content-l{
-    float: left;
-    width: 593px;
-    height: 593px;
-    background: url("../../assets/images/login-l.jpg") no-repeat;
-    background-size:cover;
-  }
-  .login{
-    float: left;
-    width: 495px;
-    height: 593px;
-    background: url("../../assets/images/login-r.jpg") no-repeat;
-    background-size:cover;
-  }
-  .login-form { position: relative; width: 330px; max-width: 100%; overflow: hidden; }
-}
-
-</style>
+<template>
+  <div v-if="isdisplay == 1"></div>
+  <div class="login-container" v-else>
+    <div class="content">
+      <div class="content-l"></div>
+      <div class="login">
+        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left" >
+          <div class="title-container">
+            <h3 class="title">科湃腾设备管理系统</h3>
+            <b>KePaiTeng Equipment Management System</b>
+            <hr>
+          </div>
+          <el-form-item prop="username">
+            <span class="svg-container">
+              <svg-icon icon-class="user" />
+            </span>
+            <el-input ref="username" v-model="loginForm.username" placeholder="Username" name="username" type="text" tabindex="1" auto-complete="on" />
+          </el-form-item>
+
+          <el-form-item prop="password">
+            <span class="svg-container">
+              <svg-icon icon-class="password" />
+            </span>
+            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" placeholder="Password" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
+            <span class="show-pwd" @click="showPwd">
+              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+            </span>
+          </el-form-item>
+          <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;background:#50b5ff;" @click.native.prevent="handleLogin" >登录</el-button>
+        </el-form>
+      </div>
+    </div>
+  </div>
+  
+</template>
+
+<script>
+import { validUsername } from '@/utils/validate'
+import { getJson } from '@/api/common'
+import Cookies from 'js-cookie'
+import axios from 'axios';
+import { setToken } from '@/utils/auth' // get token from cookie
+export default {
+  name: 'Login',
+  data() {
+    const validateUsername = (rule, value, callback) => {
+      if (!validUsername(value)) {
+        callback(new Error('请输入正确的用户名'))
+      } else {
+        callback()
+      }
+    }
+    const validatePassword = (rule, value, callback) => {
+      const re = new RegExp(`^(?=.*[a-z])(?=.*\\d)(?=.*\\W)[^]{8,32}$`)
+      if (value === '') {
+        callback(new Error('请输入密码'))
+      } else if (!re.test(value)) {
+        callback(new Error('密码由8位以上数字,大小写字母,特殊字符组成'))
+      } else {
+        callback()
+      }
+    }
+    return {
+      loginForm: {
+        username: '',
+        password: ''
+      },
+      loginRules: {
+        username: [
+          { required: true, trigger: 'blur', validator: validateUsername }
+        ],
+        password: [
+          { required: true, trigger: 'blur', validator: validatePassword }
+        ]
+      },
+      loading: false,
+      passwordType: 'password',
+      redirect: undefined,
+      isdisplay:Cookies.get('sso')
+    }
+  },
+  watch: {
+    $route: {
+      handler: function(route) {
+        this.redirect = route.query && route.query.redirect
+      },
+      immediate: true
+    }
+  },
+  created() {
+    // var that = this
+    // document.onkeydown = function(e) {
+    //   e = window.event || e
+    //   // eslint-disable-next-line eqeqeq
+    //   if (that.$route.path == '/login' && (e.code == 'Enter' || e.code == 'Num Enter')) { // 验证在登录界面和按得键是回车键enter
+    //     that.handleLogin('ruleForm2') // 登录函数 (handleSubmit2('ruleForm2')-登录按钮的点击事件)
+    //   }
+    // }
+    // 单点登录
+    if(Cookies.get('sso') == 1){
+     this.getcodeList()
+    }
+  },
+  methods: {
+    showPwd() {
+      if (this.passwordType === 'password') {
+        this.passwordType = ''
+      } else {
+        this.passwordType = 'password'
+      }
+      this.$nextTick(() => {
+        this.$refs.password.focus()
+      })
+    },
+    handleLogin() {
+      this.$refs.loginForm.validate(valid => {
+        if (valid) {
+          this.$store.dispatch('user/login', this.loginForm) .then(() => {
+            // const re = new RegExp(`^(?=.*[a-z])(?=.*\\d)(?=.*\\W)[^]{8,32}$`)
+            // if (!re.test(this.loginForm.password)) {
+            //   this.$router.push('/console/Changpwd')
+            //   console.log('密码不符合要求')
+            // }
+            this.$router.push({ path: this.redirect || '/' })
+            this.loading = false
+          }).catch(() => {
+            this.loading = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    getcodeList(){
+      this.$store.dispatch('user/login', this.loginForm) .then(() => {
+      }).catch(() => {
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+/* 修复input 背景不协调 和光标变色 */
+/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
+
+// $bg: #283443;
+// $light_gray: #fff;
+// $cursor: #fff;
+// 更改
+$bg: #ccc;
+$light_gray: #ccc;
+$cursor: #000;
+@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+  .login-container .el-input input {
+    color: $cursor;
+  }
+}
+
+/* reset element-ui css */
+.login-container {
+  .el-input {
+    display: inline-block;
+    height: 38px;
+    width: 85%;
+
+    input {
+      background: transparent;
+      border: 0px;
+      -webkit-appearance: none;
+      border-radius: 0px;
+      padding: 5px 5px 5px 15px;
+      color: #000;
+      height: 38px;
+      caret-color: $cursor;
+
+      &:-webkit-autofill {
+        box-shadow: 0 0 0px 1000px $bg inset !important;
+        -webkit-text-fill-color: $cursor !important;
+      }
+    }
+  }
+
+  .el-form-item {
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    background: rgba(0, 0, 0, 0.2);
+    border-radius: 5px;
+    color: #454545;
+    .el-form-item__content {
+      line-height: 30px;
+    }
+  }
+}
+</style>
+
+<style lang="scss" scoped>
+$bg: #2d3a4b;
+$dark_gray: #889aa4;
+$light_gray: #000;
+
+.login-container {
+  min-height: 100%;
+  width: 100%;
+  position: relative;
+  background: url("../../assets/images/login.png") no-repeat;
+  background-size:cover;
+  overflow: hidden;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  .logo{
+    padding: 5px;
+  }
+  .bujian{
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 200px;
+    margin: auto;
+  }
+  .login {
+    padding: 30px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    margin: auto;
+    bottom: 0;
+    .tips {
+      font-size: 14px; color: #fff; margin-bottom: 10px;
+      span { &:first-of-type { margin-right: 16px; } }
+    }
+
+    .svg-container { padding: 6px 5px 6px 15px; color: $dark_gray; vertical-align: middle; width: 30px; display: inline-block; }
+
+    .title-container {
+      position: relative;
+      .title { font-size: 28px; color: $light_gray; margin: 0px auto 0 auto; text-align: center; font-weight: bold; }
+      b { text-align: center; font: 14px/2 ""; display: block; }
+    }
+
+    .show-pwd { position: absolute; right: 10px; top: 7px; font-size: 16px; color: $dark_gray; cursor: pointer; user-select: none; }
+    hr { color: #ccc; margin: 20px 0; }
+  }
+}
+.content{
+  left: 0;
+  right: 0;
+  bottom: 0;
+  top: 0;
+  margin: 0 auto;
+}
+@media (min-width: 770px) {
+   .content{
+      width: 770px;
+      height: 420px;
+    }
+   .content-l{
+    float: left;
+    width: 420px;
+    height: 420px;
+    background: url("../../assets/images/login-l.jpg") no-repeat;
+    background-size:cover;
+  }
+  .login{
+    float: left;
+    width: 350px;
+    height: 420px;
+    background: url("../../assets/images/login-r.jpg") no-repeat;
+    background-size:cover;
+  }
+  .login-form { position: relative; width: 224px; max-width: 100%; overflow: hidden; }
+}
+ @media (min-width: 1100px) {
+   .content{
+      width: 1100px;
+      height: 600px;
+    }
+   .content-l{
+    float: left;
+    width: 593px;
+    height: 593px;
+    background: url("../../assets/images/login-l.jpg") no-repeat;
+    background-size:cover;
+  }
+  .login{
+    float: left;
+    width: 495px;
+    height: 593px;
+    background: url("../../assets/images/login-r.jpg") no-repeat;
+    background-size:cover;
+  }
+  .login-form { position: relative; width: 330px; max-width: 100%; overflow: hidden; }
+}
+
+</style>

Some files were not shown because too many files changed in this diff