Browse Source

Merge branch 'master-2023-10-25' into dev

# Conflicts:
#	.gitignore
#	src/views/wel/index.vue
#	vite.config.js
fix_bug_pro20231227
pref_mail@163.com 12 months ago
parent
commit
d54eb75eb3
  1. 2
      .env.production
  2. 12
      README.md
  3. 2
      build.sh
  4. 15
      package.json
  5. 5
      src/api/desk/notice.js
  6. 12
      src/axios.js
  7. 70
      src/components/avue-ueditor/main.vue
  8. 2
      src/components/third-register/main.vue
  9. 4
      src/config/website.js
  10. 2
      src/const/tool/model.js
  11. 2
      src/mac/index.vue
  12. 4
      src/main.js
  13. 2
      src/page/index/top/index.vue
  14. 2
      src/page/login/userlogin.vue
  15. 2
      src/permission.js
  16. 4
      src/router/avue-router.js
  17. 10
      src/store/modules/user.js
  18. 4
      src/utils/auth.js
  19. 10
      src/views/desk/notice.vue
  20. 10
      src/views/report/reportlist.vue
  21. 4
      src/views/resource/oss.vue
  22. 6
      src/views/tool/code.vue
  23. 1
      src/views/tool/model.vue
  24. 11
      src/views/work/process/leave/detail.vue
  25. 23
      src/views/work/process/leave/handle.vue
  26. 1711
      yarn.lock

2
.env.production

@ -3,7 +3,7 @@ VITE_APP_ENV = 'production'
#接口地址 #接口地址
#填写前缀 [/api] 需要用nginx进行反向代理 #填写前缀 [/api] 需要用nginx进行反向代理
#填写地址 [https://api.bladex.vip] 只需要保证接口支持跨域即可, 无需再做代理 #填写地址 [https://api.bladex.cn] 只需要保证接口支持跨域即可, 无需再做代理
VITE_APP_API=/api VITE_APP_API=/api
#页面基础路径 #页面基础路径

12
README.md

@ -1,20 +1,20 @@
## 版权声明 ## 版权声明
* BladeX是一个商业化软件,系列产品知识产权归**上海布雷德科技有限公司**独立所有 * BladeX是一个商业化软件,系列产品知识产权归**上海布雷德科技有限公司**独立所有
* 您一旦开始复制、下载、安装或者使用本产品,即被视为完全理解并接受本协议的各项条款 * 您一旦开始复制、下载、安装或者使用本产品,即被视为完全理解并接受本协议的各项条款
* 更多详情请看:[BladeX商业授权许可协议](/LICENSE) * 更多详情请看:[BladeX商业授权许可协议](https://license.bladex.cn)
## 答疑流程 ## 答疑流程
>1. 遇到问题或Bug >1. 遇到问题或Bug
>2. 业务型问题打断点调试尝试找出问题所在 >2. 业务型问题打断点调试尝试找出问题所在
>3. 系统型问题通过百度、谷歌、社区查找解决方案 >3. 系统型问题通过百度、谷歌、社区查找解决方案
>4. 未解决问题则进入技术社区进行发帖提问:[https://sns.bladex.vip/](https://sns.bladex.vip/) >4. 未解决问题则进入技术社区进行发帖提问:[https://sns.bladex.cn](https://sns.bladex.cn)
>5. 将帖子地址发至商业群,特别简单三言两语就能描述清楚的也可在答疑时间内发至商业群提问 >5. 将帖子地址发至商业群,特别简单三言两语就能描述清楚的也可在答疑时间内发至商业群提问
>6. 发帖的时候一定要描述清楚,详细描述遇到问题的**重现步骤**、**报错详细信息**、**相关代码与逻辑**、**使用软件版本**以及**操作系统版本**,否则随意发帖提问将会提高我们的答疑难度。 >6. 发帖的时候一定要描述清楚,详细描述遇到问题的**重现步骤**、**报错详细信息**、**相关代码与逻辑**、**使用软件版本**以及**操作系统版本**,否则随意发帖提问将会提高我们的答疑难度。
## 答疑时间 ## 答疑时间
* 工作日:9:00 ~ 17:00 提供答疑,周末、节假日休息,暂停答疑 * 工作日:9:00 ~ 17:00 提供答疑,周末、节假日休息,暂停答疑
* 请勿**私聊提问**,以免被其他用户的消息覆盖从而无法获得答疑 * 请勿**私聊提问**,以免被其他用户的消息覆盖从而无法获得答疑
* 答疑时间外遇到问题可以将问题发帖至[技术社区](https://sns.bladex.vip/),我们后续会逐个回复 * 答疑时间外遇到问题可以将问题发帖至[技术社区](https://sns.bladex.cn),我们后续会逐个回复
## 授权范围 ## 授权范围
* 专业版:只可用于**个人学习**及**个人私活**项目,不可用于公司或团队,不可泄露给任何第三方 * 专业版:只可用于**个人学习**及**个人私活**项目,不可用于公司或团队,不可泄露给任何第三方
@ -22,9 +22,9 @@
* 共同遵守:若甲方需要您提供项目源码,则需代为甲方购买BladeX企业授权,甲方购买后续的所有项目都无需再次购买授权 * 共同遵守:若甲方需要您提供项目源码,则需代为甲方购买BladeX企业授权,甲方购买后续的所有项目都无需再次购买授权
## 商用权益 ## 商用权益
* ✔ 遵守[商业协议](/LICENSE)的前提下,将BladeX系列产品用于授权范围内的商用项目,并上线运营 * ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,将BladeX系列产品用于授权范围内的商用项目,并上线运营
* ✔ 遵守[商业协议](/LICENSE)的前提下,不限制项目数,不限制服务器数 * ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,不限制项目数,不限制服务器数
* ✔ 遵守[商业协议](/LICENSE)的前提下,将自行编写的业务代码申请软件著作权 * ✔ 遵守[商业协议](https://license.bladex.cn)的前提下,将自行编写的业务代码申请软件著作权
## 何为侵权 ## 何为侵权
* ❌ 不遵守商业协议,私自销售商业源码 * ❌ 不遵守商业协议,私自销售商业源码

2
build.sh

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
echo "====================打包文件====================" echo "====================打包文件===================="
yarn build yarn build:prod
echo "====================传输文件====================" echo "====================传输文件===================="
scp -P 22 -r ./dist/** root@192.168.2.110:/www/wwwroot/192.168.2.110/ scp -P 22 -r ./dist/** root@192.168.2.110:/www/wwwroot/192.168.2.110/

15
package.json

@ -1,19 +1,20 @@
{ {
"name": "saber", "name": "saber",
"version": "3.1.0", "version": "3.2.0",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"prod": "vite --mode production",
"build": "vite build", "build": "vite build",
"build:prod": "vite build --mode production",
"serve": "vite preview --host" "serve": "vite preview --host"
}, },
"dependencies": { "dependencies": {
"@antfu/utils": "^0.7.2", "@antfu/utils": "^0.7.2",
"@element-plus/icons-vue": "^2.0.9", "@element-plus/icons-vue": "^2.0.9",
"@saber/nf-design-base-elp": "^1.0.0", "@saber/nf-design-base-elp": "^1.1.1",
"@smallwei/avue": "^3.2.13", "@smallwei/avue": "^3.2.19",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"avue-plugin-ueditor": "^1.0.3",
"axios": "^0.21.1", "axios": "^0.21.1",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
@ -30,7 +31,7 @@
"vue": "^3.2.40", "vue": "^3.2.40",
"vue-baidu-map": "^0.21.22", "vue-baidu-map": "^0.21.22",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"vue-router": "^4.1.5", "vue-router": "^4.2.4",
"vuex": "^4.0.2" "vuex": "^4.0.2"
}, },
"devDependencies": { "devDependencies": {
@ -40,7 +41,7 @@
"prettier": "^2.8.7", "prettier": "^2.8.7",
"sass": "^1.37.5", "sass": "^1.37.5",
"unplugin-auto-import": "^0.11.2", "unplugin-auto-import": "^0.11.2",
"vite": "^2.4.4", "vite": "^2.9.16",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-vue-setup-extend": "^0.4.0",
"xlsx": "0.18.5" "xlsx": "0.18.5"

5
src/api/desk/notice.js

@ -9,6 +9,7 @@ export const getList = (current, size, params) => {
current, current,
size, size,
}, },
cryptoToken: true,
}); });
}; };
@ -19,6 +20,7 @@ export const remove = ids => {
params: { params: {
ids, ids,
}, },
cryptoToken: true,
}); });
}; };
@ -27,6 +29,7 @@ export const add = row => {
url: '/blade-desk/notice/submit', url: '/blade-desk/notice/submit',
method: 'post', method: 'post',
data: row, data: row,
cryptoToken: true,
}); });
}; };
@ -35,6 +38,7 @@ export const update = row => {
url: '/blade-desk/notice/submit', url: '/blade-desk/notice/submit',
method: 'post', method: 'post',
data: row, data: row,
cryptoToken: true,
}); });
}; };
@ -45,5 +49,6 @@ export const getNotice = id => {
params: { params: {
id, id,
}, },
cryptoToken: true,
}); });
}; };

12
src/axios.js

@ -17,6 +17,7 @@ import NProgress from 'nprogress'; // progress bar
import 'nprogress/nprogress.css'; // progress bar style import 'nprogress/nprogress.css'; // progress bar style
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { baseUrl } from '@/config/env'; import { baseUrl } from '@/config/env';
import crypto from '@/utils/crypto';
axios.defaults.timeout = 60000; axios.defaults.timeout = 60000;
//返回其他状态吗 //返回其他状态吗
@ -45,11 +46,16 @@ axios.interceptors.request.use(
`${website.clientId}:${website.clientSecret}` `${website.clientId}:${website.clientSecret}`
)}`; )}`;
} }
//让每个请求携带token //headers判断请求是否携带token
const meta = config.meta || {}; const meta = config.meta || {};
const isToken = meta.isToken === false; const isToken = meta.isToken === false;
if (getToken() && !isToken) { //headers传递token是否加密
config.headers[website.tokenHeader] = 'bearer ' + getToken(); const cryptoToken = config.cryptoToken === true;
const token = getToken();
if (token && !isToken) {
config.headers[website.tokenHeader] = cryptoToken
? 'crypto ' + crypto.encrypt(token)
: 'bearer ' + token;
} }
//headers中配置text请求 //headers中配置text请求
if (config.text === true) { if (config.text === true) {

70
src/components/avue-ueditor/main.vue

@ -1,70 +0,0 @@
<template>
<div class="editor—wrapper">
<Toolbar class="toolbar-container" :editor="editorRef" :defaultConfig="toolbarConfig" />
<Editor
:style="styleName"
v-model="valueHtml"
:defaultConfig="editorConfig"
@onChange="onChange"
@onCreated="handleCreated"
/>
</div>
</template>
<script setup>
import '@wangeditor/editor/dist/css/style.css'; // css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
const emit = defineEmits();
const props = defineProps({
placeholder: String,
modelValue: String,
minRows: [String, Number],
});
const styleName = computed(() => {
return {
height: props.minRows * 50 + 'px',
};
});
// shallowRef
const editorRef = shallowRef();
// HTML
const valueHtml = ref(props.modelValue);
onMounted(() => {
valueHtml.value = props.modelValue;
});
const toolbarConfig = {};
const editorConfig = { placeholder: props.placeholder };
//
onBeforeUnmount(() => {
const editor = editorRef.value;
if (editor == null) return;
editor.destroy();
});
watch(
() => props.modelValue,
val => {
console.log(val);
valueHtml.value = val;
}
);
const onChange = editor => {
emit('update:modelValue', valueHtml.value);
};
const handleCreated = editor => {
editorRef.value = editor; // editor
};
</script>
<style>
.editorwrapper {
border: 1px solid #ccc;
}
.toolbar-container {
border-bottom: 1px solid #ccc;
}
</style>

2
src/components/third-register/main.vue

@ -115,7 +115,7 @@ export default {
getTenant() { getTenant() {
let domain = getTopUrl(); let domain = getTopUrl();
// 便 // 便
//domain = "https://bladex.vip"; //domain = "https://bladex.cn";
info(domain).then(res => { info(domain).then(res => {
const data = res.data; const data = res.data;
if (data.success && data.data.tenantId) { if (data.success && data.data.tenantId) {

4
src/config/website.js

@ -55,6 +55,6 @@ export default {
reportUrl: 'http://192.168.2.101:8108/ureport', reportUrl: 'http://192.168.2.101:8108/ureport',
// 单点登录系统认证(blade-auth服务的地) // 单点登录系统认证(blade-auth服务的地)
ssoUrl: 'http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=', ssoUrl: 'http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=',
// 单点登录回调地址(Saber服务的地址) // 单点登录回调地址(Saber服务的登录界面地址)
redirectUri: 'http://localhost:1888', redirectUri: 'http://localhost:2888/login',
}; };

2
src/const/tool/model.js

@ -263,7 +263,7 @@ export const optionModel = {
}, },
{ {
label: '字段说明', label: '字段说明',
prop: 'comment', prop: 'jdbcComment',
cell: true, cell: true,
}, },
{ {

2
src/mac/index.vue

@ -3,7 +3,7 @@
<div class="desktop"> <div class="desktop">
<div class="top"> <div class="top">
<el-dropdown trigger="click"> <el-dropdown trigger="click">
<div class="logo"><i class="iconfont icon-pingguo"></i></div> <div class="logo"><i class="iconfont iconicon_setting"></i></div>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item> <el-dropdown-item>

4
src/main.js

@ -16,7 +16,7 @@ import { getScreen,getHtmls } from './utils/util';
import functions from './utils/functions' import functions from './utils/functions'
import './permission'; import './permission';
import error from './error'; import error from './error';
import avueUeditor from 'components/avue-ueditor/main.vue'; import avueUeditor from 'avue-plugin-ueditor';
import basicBlock from 'components/basic-block/main.vue'; import basicBlock from 'components/basic-block/main.vue';
import basicContainer from 'components/basic-container/main.vue'; import basicContainer from 'components/basic-container/main.vue';
import thirdRegister from './components/third-register/main.vue'; import thirdRegister from './components/third-register/main.vue';
@ -41,7 +41,6 @@ const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component); app.component(key, component);
} }
app.component('avueUeditor', avueUeditor);
app.component('basicContainer', basicContainer); app.component('basicContainer', basicContainer);
app.component('basicBlock', basicBlock); app.component('basicBlock', basicBlock);
app.component('thirdRegister', thirdRegister); app.component('thirdRegister', thirdRegister);
@ -72,5 +71,6 @@ app.use(Avue, {
calcHeight: 10, calcHeight: 10,
locale: messages[language], locale: messages[language],
}); });
app.use(avueUeditor, { axios })
app.use(NfDesignBase); app.use(NfDesignBase);
app.mount('#app'); app.mount('#app');

2
src/page/index/top/index.vue

@ -36,7 +36,7 @@
<img class="top-bar__img" :src="userInfo.avatar" /> <img class="top-bar__img" :src="userInfo.avatar" />
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
{{ userInfo.userName }} {{ userInfo.real_name }}
<el-icon class="el-icon--right"> <el-icon class="el-icon--right">
<arrow-down /> <arrow-down />
</el-icon> </el-icon>

2
src/page/login/userlogin.vue

@ -281,7 +281,7 @@ export default {
getTenant() { getTenant() {
let domain = getTopUrl(); let domain = getTopUrl();
// 便 // 便
//domain = "https://bladex.vip"; //domain = "https://bladex.cn";
info(domain).then(res => { info(domain).then(res => {
const data = res.data; const data = res.data;
if (data.success && data.data.tenantId) { if (data.success && data.data.tenantId) {

2
src/permission.js

@ -10,7 +10,7 @@ router.beforeEach((to, from, next) => {
const isMenu = meta.menu === undefined ? to.query.menu : meta.menu; const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
store.commit('SET_IS_MENU', isMenu === undefined); store.commit('SET_IS_MENU', isMenu === undefined);
if (getToken()) { if (getToken()) {
if (store.getters.isLock && to.path != lockPage) { if (store.getters.isLock && to.path !== lockPage) {
//如果系统激活锁屏,全部跳转到锁屏页 //如果系统激活锁屏,全部跳转到锁屏页
next({ path: lockPage }); next({ path: lockPage });
} else if (to.path === '/login') { } else if (to.path === '/login') {

4
src/router/avue-router.js

@ -130,7 +130,7 @@ export const formatPath = (ele, first) => {
const propsDefault = website.menu; const propsDefault = website.menu;
const icon = ele[propsDefault.icon]; const icon = ele[propsDefault.icon];
ele[propsDefault.icon] = !icon ? propsDefault.iconDefault : icon; ele[propsDefault.icon] = !icon ? propsDefault.iconDefault : icon;
ele.meta = { keepAlive: ele.isOpen == 2 }; ele.meta = { keepAlive: ele.isOpen === 2 };
const iframeComponent = 'components/iframe/main'; const iframeComponent = 'components/iframe/main';
const iframeSrc = href => { const iframeSrc = href => {
return href.replace(/&/g, '#'); return href.replace(/&/g, '#');
@ -147,7 +147,7 @@ export const formatPath = (ele, first) => {
ele[propsDefault.children] && ele[propsDefault.children] &&
ele[propsDefault.children].forEach(child => { ele[propsDefault.children].forEach(child => {
child.component = 'views' + child[propsDefault.path]; child.component = 'views' + child[propsDefault.path];
child.meta = { keepAlive: child.isOpen == 2 }; child.meta = { keepAlive: child.isOpen === 2 };
if (isURL(child[propsDefault.href])) { if (isURL(child[propsDefault.href])) {
let href = child[propsDefault.href]; let href = child[propsDefault.href];
child[propsDefault.path] = ele[propsDefault.path] + '/' + child.code; child[propsDefault.path] = ele[propsDefault.path] + '/' + child.code;

10
src/store/modules/user.js

@ -2,7 +2,15 @@ import { setToken, setRefreshToken, removeToken, removeRefreshToken } from '@/ut
import { setStore, getStore } from '@/utils/store'; import { setStore, getStore } from '@/utils/store';
import { validatenull } from '@/utils/validate'; import { validatenull } from '@/utils/validate';
import { deepClone } from '@/utils/util'; import { deepClone } from '@/utils/util';
import { loginByUsername, getUserInfo, logout, refreshToken, getButtons } from '@/api/user'; import {
loginByUsername,
loginBySocial,
loginBySso,
getUserInfo,
logout,
refreshToken,
getButtons,
} from '@/api/user';
import { getRoutes, getTopMenu } from '@/api/system/menu'; import { getRoutes, getTopMenu } from '@/api/system/menu';
import { formatPath } from '@/router/avue-router'; import { formatPath } from '@/router/avue-router';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';

4
src/utils/auth.js

@ -2,6 +2,8 @@ import Cookies from 'js-cookie';
const TokenKey = 'saber3-access-token'; const TokenKey = 'saber3-access-token';
const RefreshTokenKey = 'saber3-refresh-token'; const RefreshTokenKey = 'saber3-refresh-token';
const SessionId = 'JSESSIONID';
const UserId = 'b-user-id';
export function getToken() { export function getToken() {
return Cookies.get(TokenKey); return Cookies.get(TokenKey);
@ -20,6 +22,8 @@ export function setRefreshToken(token) {
} }
export function removeToken() { export function removeToken() {
Cookies.remove(SessionId);
Cookies.remove(UserId);
return Cookies.remove(TokenKey); return Cookies.remove(TokenKey);
} }

10
src/views/desk/notice.vue

@ -139,12 +139,10 @@ export default {
label: '通知内容', label: '通知内容',
prop: 'content', prop: 'content',
component: 'avue-ueditor', component: 'avue-ueditor',
options: { action: '/blade-resource/oss/endpoint/put-file',
action: '/blade-resource/oss/endpoint/put-file', propsHttp: {
props: { res: 'data',
res: 'data', url: 'link',
url: 'link',
},
}, },
hide: true, hide: true,
minRows: 4, minRows: 4,

10
src/views/report/reportlist.vue

@ -26,7 +26,7 @@
<el-button <el-button
type="primary" type="primary"
text text
icon="el-icon-edit-outline" icon="el-icon-edit"
@click.stop="handleDesign(scope.row.name)" @click.stop="handleDesign(scope.row.name)"
v-if="userInfo.role_name.includes('admin')" v-if="userInfo.role_name.includes('admin')"
>设计 >设计
@ -114,14 +114,10 @@ export default {
}, },
methods: { methods: {
handlePreview(name) { handlePreview(name) {
this.$router.push({ window.open(`${this.website.reportUrl}/preview?_u=blade-${name}`);
path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
});
}, },
handleDesign(name) { handleDesign(name) {
this.$router.push({ window.open(`${this.website.reportUrl}/designer?_u=blade-${name}`);
path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.reportUrl}/designer?_u=blade-${name}`,
});
}, },
rowDel(row) { rowDel(row) {
this.$confirm('确定将选择数据删除?', { this.$confirm('确定将选择数据删除?', {

4
src/views/resource/oss.vue

@ -99,7 +99,7 @@ export default {
type: 'radio', type: 'radio',
value: 1, value: 1,
span: 24, span: 24,
width: 100, width: 120,
searchLabelWidth: 50, searchLabelWidth: 50,
row: true, row: true,
dicUrl: '/blade-system/dict/dictionary?code=oss', dicUrl: '/blade-system/dict/dictionary?code=oss',
@ -258,7 +258,7 @@ export default {
item.display = category === 4; item.display = category === 4;
} }
if (item.prop === 'region') { if (item.prop === 'region') {
item.display = category === 4; item.display = category === 4 || category === 5;
} }
}); });
}, },

6
src/views/tool/code.vue

@ -267,7 +267,7 @@ export default {
type: 'select', type: 'select',
dicData: [], dicData: [],
props: { props: {
label: 'comment', label: 'jdbcComment',
value: 'jdbcName', value: 'jdbcName',
}, },
display: false, display: false,
@ -279,7 +279,7 @@ export default {
type: 'select', type: 'select',
dicData: [], dicData: [],
props: { props: {
label: 'comment', label: 'jdbcComment',
value: 'jdbcName', value: 'jdbcName',
}, },
display: false, display: false,
@ -291,7 +291,7 @@ export default {
type: 'select', type: 'select',
dicData: [], dicData: [],
props: { props: {
label: 'comment', label: 'jdbcComment',
value: 'jdbcName', value: 'jdbcName',
}, },
display: false, display: false,

1
src/views/tool/model.vue

@ -320,6 +320,7 @@ export default {
if (!validatenull(item.name)) { if (!validatenull(item.name)) {
item.jdbcName = item.name; item.jdbcName = item.name;
item.jdbcType = item.propertyType; item.jdbcType = item.propertyType;
item.jdbcComment = item.comment;
if (item.propertyType === 'LocalDateTime') { if (item.propertyType === 'LocalDateTime') {
item.propertyType = 'Date'; item.propertyType = 'Date';
item.propertyEntity = 'java.util.Date'; item.propertyEntity = 'java.util.Date';

11
src/views/work/process/leave/detail.vue

@ -77,6 +77,7 @@
<script> <script>
import { historyFlowList, leaveDetail } from '@/api/work/process'; import { historyFlowList, leaveDetail } from '@/api/work/process';
import func from '@/utils/func';
export default { export default {
data() { data() {
@ -98,6 +99,13 @@ export default {
created() { created() {
this.init(); this.init();
}, },
watch: {
$route(to, from) {
if (to.path !== from.path) {
this.init();
}
},
},
methods: { methods: {
init() { init() {
if (!this.website.designMode) { if (!this.website.designMode) {
@ -107,6 +115,9 @@ export default {
} }
this.processInstanceId = this.$route.params.processInstanceId; this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId; this.businessId = this.$route.params.businessId;
if (func.isEmpty(this.processInstanceId) || func.isEmpty(this.businessId)) {
return;
}
historyFlowList(this.processInstanceId).then(res => { historyFlowList(this.processInstanceId).then(res => {
const data = res.data; const data = res.data;
if (data.success) { if (data.success) {

23
src/views/work/process/leave/handle.vue

@ -86,6 +86,7 @@
<script> <script>
import { historyFlowList, leaveDetail } from '@/api/work/process'; import { historyFlowList, leaveDetail } from '@/api/work/process';
import { completeTask } from '@/api/work/work'; import { completeTask } from '@/api/work/work';
import func from '@/utils/func';
export default { export default {
data() { data() {
@ -109,15 +110,12 @@ export default {
created() { created() {
this.init(); this.init();
}, },
beforeRouteUpdate(to, from, next) { watch: {
// $route(to, from) {
// /foo/:id /foo/1 /foo/2 if (to.path !== from.path) {
// Foo this.init();
// 访 `this` }
if (to.fullPath !== from.fullPath) { },
next();
this.init();
}
}, },
methods: { methods: {
init() { init() {
@ -129,6 +127,13 @@ export default {
this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId;
this.processInstanceId = this.$route.params.processInstanceId; this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId; this.businessId = this.$route.params.businessId;
if (
func.isEmpty(this.taskId) ||
func.isEmpty(this.processInstanceId) ||
func.isEmpty(this.businessId)
) {
return;
}
historyFlowList(this.processInstanceId).then(res => { historyFlowList(this.processInstanceId).then(res => {
const data = res.data; const data = res.data;
if (data.success) { if (data.success) {

1711
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save