1
Showing
5 changed files
with
79 additions
and
78 deletions
| ... | @@ -126,8 +126,8 @@ | ... | @@ -126,8 +126,8 @@ | 
| 126 | methods: { | 126 | methods: { | 
| 127 | // 单选 | 127 | // 单选 | 
| 128 | singleElection (row) { | 128 | singleElection (row) { | 
| 129 | console.log("点击行"); | ||
| 130 | this.selected = this.data.indexOf(row); | 129 | this.selected = this.data.indexOf(row); | 
| 130 | this.$emit('row-click', row) | ||
| 131 | }, | 131 | }, | 
| 132 | 132 | ||
| 133 | tableRowClassName ({ row, rowIndex }) { | 133 | tableRowClassName ({ row, rowIndex }) { | ... | ... | 
| 1 | /* | 1 | /* | 
| 2 | * @Description: 项目权限 | 2 | * @Description: 项目权限 | 
| 3 | * @Autor: renchao | 3 | * @Autor: renchao | 
| 4 | * @LastEditTime: 2023-06-02 10:44:17 | 4 | * @LastEditTime: 2023-06-08 10:42:33 | 
| 5 | */ | 5 | */ | 
| 6 | import Vue from 'vue' | 6 | import Vue from 'vue' | 
| 7 | import axios from 'axios' | 7 | import axios from 'axios' | 
| 8 | import router from './router' | 8 | import router from './router' | 
| 9 | import store from './store' | 9 | import store from './store' | 
| 10 | import Cookies from 'js-cookie' | 10 | import Cookies from 'js-cookie' | 
| 11 | import {getMenuInfo} from '@/api/user' | 11 | import { getMenuInfo } from '@/api/user' | 
| 12 | import {getUrlParam} from '@/utils/operation' | 12 | import { getUrlParam } from '@/utils/operation' | 
| 13 | import NProgress from 'nprogress' // progress bar | 13 | import NProgress from 'nprogress' // progress bar | 
| 14 | import 'nprogress/nprogress.css' // progress bar style | 14 | import 'nprogress/nprogress.css' // progress bar style | 
| 15 | import getPageTitle from '@/utils/get-page-title' | 15 | import getPageTitle from '@/utils/get-page-title' | 
| 16 | 16 | ||
| 17 | NProgress.configure({showSpinner: false}) // NProgress Configuration | 17 | NProgress.configure({ showSpinner: false }) // NProgress Configuration | 
| 18 | 18 | ||
| 19 | router.beforeEach(async (to, from, next) => { | 19 | router.beforeEach(async (to, from, next) => { | 
| 20 | Vue.prototype.$currentRoute = to | 20 | Vue.prototype.$currentRoute = to | 
| ... | @@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { | 
| 23 | let hasAddDict = store.state.dict.addDict | 23 | let hasAddDict = store.state.dict.addDict | 
| 24 | let hasAddRoute = store.state.permission.addRoutes | 24 | let hasAddRoute = store.state.permission.addRoutes | 
| 25 | // cas操作 | 25 | // cas操作 | 
| 26 | const token = localStorage.getItem("token") || Cookies.get('ACCESS_TOKEN'); | 26 | const token = localStorage.getItem("token") || Cookies.get('token'); | 
| 27 | if (to.path === '/login') { | 27 | if (to.path === '/login') { | 
| 28 | if (token) { | 28 | if (token) { | 
| 29 | next('/') | 29 | next('/') | 
| ... | @@ -46,7 +46,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -46,7 +46,7 @@ router.beforeEach(async (to, from, next) => { | 
| 46 | if (process.env.NODE_ENV === 'development') { | 46 | if (process.env.NODE_ENV === 'development') { | 
| 47 | localStorage.setItem('token', res.data.content.accessToken) | 47 | localStorage.setItem('token', res.data.content.accessToken) | 
| 48 | } else { | 48 | } else { | 
| 49 | Cookies.set('ACCESS_TOKEN', res.data.content.accessToken) | 49 | Cookies.set('token', res.data.content.accessToken) | 
| 50 | } | 50 | } | 
| 51 | window.location.href = localStorage.getItem('location') | 51 | window.location.href = localStorage.getItem('location') | 
| 52 | 52 | ||
| ... | @@ -61,22 +61,21 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -61,22 +61,21 @@ router.beforeEach(async (to, from, next) => { | 
| 61 | permission() | 61 | permission() | 
| 62 | } | 62 | } | 
| 63 | 63 | ||
| 64 | async function permission() { | 64 | async function permission () { | 
| 65 | if (!hasAddDict) { | 65 | if (!hasAddDict) { | 
| 66 | store.dispatch('dict/generateDic') | 66 | store.dispatch('dict/generateDic') | 
| 67 | } | 67 | } | 
| 68 | if (hasAddRoute) { | 68 | if (hasAddRoute) { | 
| 69 | next() | 69 | next() | 
| 70 | // next({ ...to, replace: true }) | ||
| 71 | } else { | 70 | } else { | 
| 72 | const {result: getMenuData} = await getMenuInfo() | 71 | const { result: getMenuData } = await getMenuInfo() | 
| 73 | const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData) | 72 | const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData) | 
| 74 | // 获取用户信息 | 73 | // 获取用户信息 | 
| 75 | await store.dispatch('user/getUserInfo') | 74 | await store.dispatch('user/getUserInfo') | 
| 76 | router.addRoutes([...accessRoutes, {path: '*', redirect: '/404', hidden: true}]) | 75 | router.addRoutes([...accessRoutes, { path: '*', redirect: '/404', hidden: true }]) | 
| 77 | const routeTo = Cookies.get('routerTo') | 76 | const routeTo = Cookies.get('routerTo') | 
| 78 | if (routeTo && routeTo !== '/') { | 77 | if (routeTo && routeTo !== '/') { | 
| 79 | next({...to, replace: true}) | 78 | next({ ...to, replace: true }) | 
| 80 | } else { | 79 | } else { | 
| 81 | next('/home') | 80 | next('/home') | 
| 82 | } | 81 | } | ... | ... | 
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ | 
| 2 | /* | 2 | /* | 
| 3 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 | 3 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 | 
| 4 | * @Autor: renchao | 4 | * @Autor: renchao | 
| 5 | * @LastEditTime: 2023-06-02 10:18:32 | 5 | * @LastEditTime: 2023-06-07 15:37:07 | 
| 6 | */ | 6 | */ | 
| 7 | import axios from 'axios' | 7 | import axios from 'axios' | 
| 8 | import Router from '@/router' | 8 | import Router from '@/router' | 
| ... | @@ -70,7 +70,7 @@ service.interceptors.response.use( | ... | @@ -70,7 +70,7 @@ service.interceptors.response.use( | 
| 70 | if (process.env.NODE_ENV === 'development') { | 70 | if (process.env.NODE_ENV === 'development') { | 
| 71 | localStorage.removeItem('token') | 71 | localStorage.removeItem('token') | 
| 72 | } else { | 72 | } else { | 
| 73 | Cookies.remove('ACCESS_TOKEN') | 73 | Cookies.remove('token') | 
| 74 | } | 74 | } | 
| 75 | if (window._config.casEnable) { | 75 | if (window._config.casEnable) { | 
| 76 | window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl); | 76 | window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl); | ... | ... | 
| ... | @@ -83,7 +83,7 @@ | ... | @@ -83,7 +83,7 @@ | 
| 83 | }, | 83 | }, | 
| 84 | methods: { | 84 | methods: { | 
| 85 | queryClick () { | 85 | queryClick () { | 
| 86 | console.log("申请业务单一流向状态",this.sqywInfo.sqywdylx); | 86 | console.log("申请业务单一流向状态", this.sqywInfo.sqywdylx); | 
| 87 | this.$startLoading(); | 87 | this.$startLoading(); | 
| 88 | this.queryForm.sqywbm = this.sqywInfo.djywbm; | 88 | this.queryForm.sqywbm = this.sqywInfo.djywbm; | 
| 89 | selectJsydQlxx({ ...this.queryForm, ...this.pageData }).then((res) => { | 89 | selectJsydQlxx({ ...this.queryForm, ...this.pageData }).then((res) => { | 
| ... | @@ -141,39 +141,40 @@ | ... | @@ -141,39 +141,40 @@ | 
| 141 | formData: param | 141 | formData: param | 
| 142 | }) | 142 | }) | 
| 143 | }, | 143 | }, | 
| 144 | select(selection, row){ | 144 | select (selection, row) { | 
| 145 | if(this.sqywInfo.sqywdylx=="1"){ | 145 | if (this.sqywInfo.sqywdylx == "1") { | 
| 146 | // 清除 所有勾选项 | 146 | // 清除 所有勾选项 | 
| 147 | this.$refs.table.clearSelection() | 147 | this.$refs.table.clearSelection() | 
| 148 | // 当表格数据都没有被勾选的时候 就返回 | 148 | // 当表格数据都没有被勾选的时候 就返回 | 
| 149 | // 主要用于将当前勾选的表格状态清除 | 149 | // 主要用于将当前勾选的表格状态清除 | 
| 150 | if(selection.length == 0) return | 150 | if (selection.length == 0) return | 
| 151 | this.$refs.table.toggleRowSelection(row, true); | 151 | this.$refs.table.toggleRowSelection(row, true); | 
| 152 | } | 152 | } | 
| 153 | }, | 153 | }, | 
| 154 | handleRowClick(row){ | 154 | handleRowClick (row) { | 
| 155 | console.log(2222222222222222222222); | ||
| 155 | // 如果状态是1,那就是单选 | 156 | // 如果状态是1,那就是单选 | 
| 156 | if(this.sqywInfo.sqywdylx=="1"){ | 157 | if (this.sqywInfo.sqywdylx == "1") { | 
| 157 | const bdcdysz = this.bdcdysz | 158 | const bdcdysz = this.bdcdysz | 
| 158 | this.$refs.table.clearSelection() | 159 | this.$refs.table.clearSelection() | 
| 159 | if( bdcdysz.length == 1 ) { | 160 | if (bdcdysz.length == 1) { | 
| 160 | bdcdysz.forEach(item => { | 161 | bdcdysz.forEach(item => { | 
| 161 | // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中 | 162 | // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中 | 
| 162 | if (item == row) { | 163 | if (item == row) { | 
| 163 | this.$refs.table.toggleRowSelection(row, false); | 164 | this.$refs.table.toggleRowSelection(row, false); | 
| 164 | } | 165 | } | 
| 165 | // 不然就让当前的一行勾选 | 166 | // 不然就让当前的一行勾选 | 
| 166 | else { | 167 | else { | 
| 167 | this.$refs.table.toggleRowSelection(row, true); | 168 | this.$refs.table.toggleRowSelection(row, true); | 
| 168 | } | 169 | } | 
| 169 | }) | 170 | }) | 
| 170 | } | 171 | } | 
| 171 | else { | 172 | else { | 
| 172 | this.$refs.table.toggleRowSelection(row, true); | 173 | this.$refs.table.toggleRowSelection(row, true); | 
| 173 | } | 174 | } | 
| 174 | }else{ | 175 | } else { | 
| 175 | this.$refs.table.toggleRowSelection(row); | 176 | this.$refs.table.toggleRowSelection(row); | 
| 176 | } | 177 | } | 
| 177 | }, | 178 | }, | 
| 178 | } | 179 | } | 
| 179 | } | 180 | } | ... | ... | 
| ... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ | 
| 42 | <!-- 表格 --> | 42 | <!-- 表格 --> | 
| 43 | <div class="from-clues-content loadingtext"> | 43 | <div class="from-clues-content loadingtext"> | 
| 44 | 分割合并前权利信息 | 44 | 分割合并前权利信息 | 
| 45 | <lb-table ref="table" @row-click="handleRowClick" heightNumSetting :pagination=false | 45 | <lb-table ref="table" @row-click="handleRowClick" :minHeight="210" heightNumSetting :pagination=false | 
| 46 | :column="tableData.columns" :data="tableData.data"> | 46 | :column="tableData.columns" :data="tableData.data"> | 
| 47 | </lb-table> | 47 | </lb-table> | 
| 48 | </div> | 48 | </div> | 
| ... | @@ -89,7 +89,7 @@ | ... | @@ -89,7 +89,7 @@ | 
| 89 | </div> | 89 | </div> | 
| 90 | ) | 90 | ) | 
| 91 | } | 91 | } | 
| 92 | },].concat(datas.columns()), | 92 | }].concat(datas.columns()), | 
| 93 | data: [], | 93 | data: [], | 
| 94 | columns1: datastwo.columns1(), | 94 | columns1: datastwo.columns1(), | 
| 95 | datastwo: [] | 95 | datastwo: [] | 
| ... | @@ -117,7 +117,7 @@ | ... | @@ -117,7 +117,7 @@ | 
| 117 | }) | 117 | }) | 
| 118 | }, | 118 | }, | 
| 119 | queryClick () { | 119 | queryClick () { | 
| 120 | console.log("申请业务单一流向状态土地分割合并",this.sqywInfo.sqywdylx); | 120 | console.log("申请业务单一流向状态土地分割合并", this.sqywInfo.sqywdylx); | 
| 121 | this.$startLoading(); | 121 | this.$startLoading(); | 
| 122 | this.queryForm.sqywbm = this.sqywInfo.djywbm; | 122 | this.queryForm.sqywbm = this.sqywInfo.djywbm; | 
| 123 | selectJsydQlxxSplitMergeBefore({ ...this.queryForm, ...this.pageData }).then((res) => { | 123 | selectJsydQlxxSplitMergeBefore({ ...this.queryForm, ...this.pageData }).then((res) => { | 
| ... | @@ -128,6 +128,7 @@ | ... | @@ -128,6 +128,7 @@ | 
| 128 | }); | 128 | }); | 
| 129 | }, | 129 | }, | 
| 130 | handleRowClick (val) { | 130 | handleRowClick (val) { | 
| 131 | console.log(val, 'valvalvalval'); | ||
| 131 | this.radioVal = val.bhqkbsm | 132 | this.radioVal = val.bhqkbsm | 
| 132 | let obj = val | 133 | let obj = val | 
| 133 | obj.bsmSsql = val.bsmQlxx; | 134 | obj.bsmSsql = val.bsmQlxx; | 
| ... | @@ -172,39 +173,39 @@ | ... | @@ -172,39 +173,39 @@ | 
| 172 | formData: param | 173 | formData: param | 
| 173 | }) | 174 | }) | 
| 174 | }, | 175 | }, | 
| 175 | select(selection, row){ | 176 | select (selection, row) { | 
| 176 | if(this.sqywInfo.sqywdylx=="1"){ | 177 | if (this.sqywInfo.sqywdylx == "1") { | 
| 177 | // 清除 所有勾选项 | 178 | // 清除 所有勾选项 | 
| 178 | this.$refs.table.clearSelection() | 179 | this.$refs.table.clearSelection() | 
| 179 | // 当表格数据都没有被勾选的时候 就返回 | 180 | // 当表格数据都没有被勾选的时候 就返回 | 
| 180 | // 主要用于将当前勾选的表格状态清除 | 181 | // 主要用于将当前勾选的表格状态清除 | 
| 181 | if(selection.length == 0) return | 182 | if (selection.length == 0) return | 
| 182 | this.$refs.table.toggleRowSelection(row, true); | 183 | this.$refs.table.toggleRowSelection(row, true); | 
| 183 | } | 184 | } | 
| 184 | }, | 185 | }, | 
| 185 | handleRowClick(row){ | 186 | handleRowClick (row) { | 
| 186 | // 如果状态是1,那就是单选 | 187 | // 如果状态是1,那就是单选 | 
| 187 | if(this.sqywInfo.sqywdylx=="1"){ | 188 | if (this.sqywInfo.sqywdylx == "1") { | 
| 188 | const bdcdysz = this.bdcdysz | 189 | const bdcdysz = this.bdcdysz | 
| 189 | this.$refs.table.clearSelection() | 190 | this.$refs.table.clearSelection() | 
| 190 | if( bdcdysz.length == 1 ) { | 191 | if (bdcdysz.length == 1) { | 
| 191 | bdcdysz.forEach(item => { | 192 | bdcdysz.forEach(item => { | 
| 192 | // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中 | 193 | // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中 | 
| 193 | if (item == row) { | 194 | if (item == row) { | 
| 194 | this.$refs.table.toggleRowSelection(row, false); | 195 | this.$refs.table.toggleRowSelection(row, false); | 
| 195 | } | 196 | } | 
| 196 | // 不然就让当前的一行勾选 | 197 | // 不然就让当前的一行勾选 | 
| 197 | else { | 198 | else { | 
| 198 | this.$refs.table.toggleRowSelection(row, true); | 199 | this.$refs.table.toggleRowSelection(row, true); | 
| 199 | } | 200 | } | 
| 200 | }) | 201 | }) | 
| 201 | } | 202 | } | 
| 202 | else { | 203 | else { | 
| 203 | this.$refs.table.toggleRowSelection(row, true); | 204 | this.$refs.table.toggleRowSelection(row, true); | 
| 204 | } | 205 | } | 
| 205 | }else{ | 206 | } else { | 
| 206 | this.$refs.table.toggleRowSelection(row); | 207 | this.$refs.table.toggleRowSelection(row); | 
| 207 | } | 208 | } | 
| 208 | }, | 209 | }, | 
| 209 | } | 210 | } | 
| 210 | } | 211 | } | ... | ... | 
- 
Please register or sign in to post a comment