确定合同功能模式
This commit is contained in:
@ -91,8 +91,15 @@ public class SysContractController extends BaseController {
|
||||
|
||||
|
||||
@GetMapping("/file/{id}")
|
||||
public String getContract(@PathVariable long id) {
|
||||
return redirect("/swagger-ui.html");
|
||||
public AjaxResult getfile(@PathVariable long id) {
|
||||
try {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// ajax.put("url", "/login");
|
||||
ajax.put("data", id);
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,4 +50,11 @@ export function exportContract(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function getFile(id) {
|
||||
return request({
|
||||
url: '/custom/contract/file/' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
import {Message} from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {getToken} from '@/utils/auth'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
NProgress.configure({showSpinner: false})
|
||||
|
||||
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/sign']
|
||||
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
if (getToken()) {
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
next({path: '/'})
|
||||
NProgress.done()
|
||||
} else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
@ -22,18 +22,18 @@ router.beforeEach((to, from, next) => {
|
||||
store.dispatch('GetInfo').then(res => {
|
||||
// 拉取user_info
|
||||
const roles = res.roles
|
||||
store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => {
|
||||
// 测试 默认静态页面
|
||||
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
|
||||
store.dispatch('GenerateRoutes', {roles}).then(accessRoutes => {
|
||||
// 测试 默认静态页面
|
||||
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
next({...to, replace: true}) // hack方法 确保addRoutes已完成
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
store.dispatch('FedLogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({ path: '/' })
|
||||
next({path: '/'})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
@ -49,7 +49,7 @@ router.beforeEach((to, from, next) => {
|
||||
}
|
||||
} else {
|
||||
// 没有token
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/contract')) {
|
||||
// 在免登录白名单,直接进入
|
||||
next()
|
||||
} else {
|
||||
|
@ -125,9 +125,10 @@ export const constantRoutes = [
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/sign',
|
||||
path: '/contract/:id(\\d+)',
|
||||
hidden: true,
|
||||
component: (resolve) => require(['@/views/custom/signContract'], resolve),
|
||||
meta: { title: '合同' }
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -1,85 +1,59 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
|
||||
<panel-group @handleSetLineChartData="handleSetLineChartData"/>
|
||||
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<line-chart :chart-data="lineChartData"/>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row :gutter="32">-->
|
||||
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||
<!-- <div class="chart-wrapper">-->
|
||||
<!-- <raddar-chart />-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||
<!-- <div class="chart-wrapper">-->
|
||||
<!-- <pie-chart />-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||
<!-- <div class="chart-wrapper">-->
|
||||
<!-- <bar-chart />-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
|
||||
<div v-if="show">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PanelGroup from '@/views/dashboard/PanelGroup'
|
||||
import LineChart from '@/views/dashboard/LineChart'
|
||||
import RaddarChart from '@/views/dashboard/RaddarChart'
|
||||
import PieChart from '@/views/dashboard/PieChart'
|
||||
import BarChart from '@/views/dashboard/BarChart'
|
||||
import Base64 from 'base-64';
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||
}
|
||||
}
|
||||
|
||||
let params = window.location.search.substring(1);
|
||||
if(params){
|
||||
params = Base64.decode( window.location.search.substring(1))
|
||||
params = this.searchToParams((params));
|
||||
}
|
||||
console.log(params)
|
||||
import {getFile} from "@/api/custom/contract";
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
PanelGroup,
|
||||
LineChart,
|
||||
RaddarChart,
|
||||
PieChart,
|
||||
BarChart
|
||||
},
|
||||
name: 'sign',
|
||||
data() {
|
||||
return {
|
||||
lineChartData: lineChartData.newVisitis
|
||||
show: false,
|
||||
form: {},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: "姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
phone: [
|
||||
{required: true, message: "电话不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getContract();
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.lineChartData = lineChartData[type]
|
||||
getContract() {
|
||||
const {pathname} = window.location;
|
||||
const id = pathname.substring(pathname.lastIndexOf('/') + 1);
|
||||
console.log(id)
|
||||
getFile(id).then(result => {
|
||||
if (result.url) {
|
||||
this.$router.push(result.url);
|
||||
} else if (result.data) {
|
||||
this.show = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$emit('handleOnSubmit', this.form);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
ruoyi-ui/src/views/custom/signContract/signView/index.vue
Normal file
41
ruoyi-ui/src/views/custom/signContract/signView/index.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'signContract',
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: "姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
phone: [
|
||||
{required: true, message: "电话不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$emit('handleOnSubmit', this.form);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user