From fd67747c58ba241aaaa3e86e7c0c5ebc816c2931 Mon Sep 17 00:00:00 2001
From: yaoyanan <794433246@qq.com>
Date: Thu, 8 Apr 2021 18:44:24 +0800
Subject: [PATCH] =?UTF-8?q?JImageupload=EF=BC=8CJUpload=E7=BB=84=E4=BB=B6?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=B8=85=E9=99=A4=E6=B2=A1=E5=BF=85?=
=?UTF-8?q?=E8=A6=81=E7=9A=84log?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jero-web/public/api_address_config.js | 2 +-
jero-web/src/api/api.js | 1 -
jero-web/src/components/jero/JImageUpload.vue | 38 +++------
jero-web/src/components/jero/JUpload.vue | 81 +++++++------------
.../src/components/jerobiz/JSelectDepart.vue | 1 -
.../src/components/jerobiz/JSelectRole.vue | 3 -
jero-web/src/components/layouts/RouteView.vue | 4 -
jero-web/src/mixins/JeroListMixin.js | 3 +-
jero-web/src/permission.js | 2 -
jero-web/src/store/modules/permission.js | 4 -
jero-web/src/utils/filter.js | 1 -
jero-web/src/utils/hasPermission.js | 2 -
jero-web/src/views/demo/SelectDemo.vue | 19 ++---
.../src/views/system/modules/DepartWindow.vue | 3 -
.../views/system/modules/PermissionModal.vue | 7 --
15 files changed, 47 insertions(+), 124 deletions(-)
diff --git a/jero-web/public/api_address_config.js b/jero-web/public/api_address_config.js
index 8ff08ec3..74ec003e 100644
--- a/jero-web/public/api_address_config.js
+++ b/jero-web/public/api_address_config.js
@@ -5,7 +5,7 @@ window._CONFIG = {}
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer
window._CONFIG['domianWebSocketURL'] = 'http://localhost:8080/jero-boot'
// 单点登录地址
-window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static'
+window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download'
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe'
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas'
// 预览文件地址
diff --git a/jero-web/src/api/api.js b/jero-web/src/api/api.js
index f35c79d7..a20b7f14 100644
--- a/jero-web/src/api/api.js
+++ b/jero-web/src/api/api.js
@@ -69,7 +69,6 @@ export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItem
function getDictItemsFromCache(dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) {
let dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode];
- console.log("-----------getDictItemsFromCache----------dictCode="+dictCode+"---- dictItems=",dictItems)
return dictItems;
}
}
diff --git a/jero-web/src/components/jero/JImageUpload.vue b/jero-web/src/components/jero/JImageUpload.vue
index 19b02576..afe163b9 100644
--- a/jero-web/src/components/jero/JImageUpload.vue
+++ b/jero-web/src/components/jero/JImageUpload.vue
@@ -19,6 +19,7 @@
:class="!isMultiple?'imgupload':''">
![]()
+
{{ text }}
@@ -39,13 +40,6 @@
const uidGenerator=()=>{
return '-'+parseInt(Math.random()*10000+1,10);
}
- const getFileName=(path)=>{
- if(path.lastIndexOf("\\")>=0){
- let reg=new RegExp("\\\\","g");
- path = path.replace(reg,"/");
- }
- return path.substring(path.lastIndexOf("/")+1);
- }
export default {
name: 'JImageUpload',
data(){
@@ -115,27 +109,20 @@
},
methods:{
initFileList(paths){
- if(!paths || paths.length==0){
+ if(!paths || paths.length === 0){
this.fileList = [];
return;
}
this.picUrl = true;
- let fileList = [];
- let arr = paths.split(",")
+ let arr = paths.join(",")
for(var a=0;a
{
+ if (item.url === arr[a]){
+ item.uid = uidGenerator()
+ item.response.status = 'history'
}
})
}
- this.fileList = fileList
},
beforeUpload: function(file){
var fileType = file.type;
@@ -157,7 +144,7 @@
this.picUrl = true;
fileList = fileList.map((file) => {
if (file.response) {
- file.url = file.response.message;
+ file.url = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`;
}
return file;
});
@@ -180,8 +167,8 @@
},
getAvatarView(){
if(this.fileList.length>0){
- let url = this.fileList[0].url
- return url
+ let url = this.fileList[this.fileList.length-1].url
+ return getFileAccessHttpUrl(url)
}
},
handlePathChange(){
@@ -192,12 +179,12 @@
}
let arr = [];
if(!this.isMultiple){
- arr.push(uploadFiles[uploadFiles.length-1].response.message)
+ arr.push(uploadFiles[uploadFiles.length-1].url)
}else{
for(let a=0;a{
return '-'+parseInt(Math.random()*10000+1,10);
}
- const getFileName=(path)=>{
- if(path.lastIndexOf("\\")>=0){
- let reg=new RegExp("\\\\","g");
- path = path.replace(reg,"/");
- }
- return path.substring(path.lastIndexOf("/")+1);
- }
export default {
name: 'JUpload',
data(){
@@ -176,46 +170,29 @@
this.fileList = [];
return;
}
- let fileList = [];
for(var a=0;a{
+ if (item.url === val[a]){
+ item.uid = uidGenerator()
+ item.response.status = 'done'
}
})
}
- this.fileList = fileList
},
initFileList(paths){
if(!paths || paths.length==0){
- //return [];
- // update-begin- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
this.fileList = [];
return;
- // update-end- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
}
- let fileList = [];
let arr = paths.split(",")
for(var a=0;a{
+ if (item.url === arr[a]){
+ item.uid = uidGenerator()
+ item.response.status = 'history'
}
})
}
- this.fileList = fileList
},
handlePathChange(){
let uploadFiles = this.fileList
@@ -226,13 +203,11 @@
let arr = [];
for(var a=0;a0){
path = arr.join(",")
@@ -253,7 +228,6 @@
return true
},
handleChange(info) {
- console.log("--文件列表改变--")
if(!info.file.status && this.uploadGoOn === false){
info.fileList.pop();
}
@@ -265,7 +239,7 @@
if(info.file.response.success){
fileList = fileList.map((file) => {
if (file.response) {
- let reUrl = file.response.message;
+ let reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`;
file.url = getFileAccessHttpUrl(reUrl);
}
return file;
@@ -290,7 +264,7 @@
if(fileList[a].status === 'done' ) {
var fileJson = {
fileName:fileList[a].name,
- filePath:fileList[a].response.message,
+ filePath:fileList[a].url,
fileSize:fileList[a].size
};
this.newFileList.push(fileJson);
@@ -307,12 +281,16 @@
//如有需要新增 删除逻辑
console.log(file)
},
- handlePreview(file){
+ handlePreview(file) {
if(this.fileType === FILE_TYPE_IMG){
this.previewImage = file.url || file.thumbUrl;
this.previewVisible = true;
}else{
- location.href=file.url
+ if (file && file.url) {
+ var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
+ let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
+ window.open(url)
+ }
}
},
handleCancel(){
@@ -320,20 +298,17 @@
},
//---------------------------- begin 图片左右换位置 -------------------------------------
moveLast(){
- //console.log(ev)
- //console.log(this.fileList)
- //console.log(this.currentImg)
let index = this.getIndexByUrl();
- if(index==0){
+ if(index == 0){
this.$message.warn('未知的操作')
}else{
let curr = this.fileList[index].url;
let last = this.fileList[index-1].url;
let arr =[]
for(let i=0;i{
ev = ev || window.event;
let target = ev.target || ev.srcElement;
- if('ant-upload-list-item-info' == target.className){
+ if('ant-upload-list-item-info' === target.className){
this.showMoverTask=false
let item = target.parentElement
this.left = item.offsetLeft
@@ -405,14 +380,14 @@
ev = ev || window.event;
let target = ev.target || ev.srcElement;
//console.log('移除',target)
- if('ant-upload-list-item-info' == target.className){
+ if('ant-upload-list-item-info' === target.className){
this.showMoverTask=true
setTimeout(()=>{
if(this.moverHold === false)
this.moveDisplay = 'none';
},100)
}
- if('ant-upload-list-item ant-upload-list-item-done' == target.className || 'ant-upload-list ant-upload-list-picture-card'== target.className){
+ if('ant-upload-list-item ant-upload-list-item-done' === target.className || 'ant-upload-list ant-upload-list-picture-card'=== target.className){
this.moveDisplay = 'none';
}
})
diff --git a/jero-web/src/components/jerobiz/JSelectDepart.vue b/jero-web/src/components/jerobiz/JSelectDepart.vue
index 815960ee..6f450121 100644
--- a/jero-web/src/components/jerobiz/JSelectDepart.vue
+++ b/jero-web/src/components/jerobiz/JSelectDepart.vue
@@ -88,7 +88,6 @@
//返回字段不为id时,根据返回字段获取id
if(this.customReturnField !== 'id' && this.value){
const dataList = this.$refs.innerDepartSelectModal.dataList;
- console.log('this.value',this.value)
this.departIds = this.value.split(',').map(item => {
const data = dataList.filter(d=>d[this.customReturnField] === item)
return data.length > 0 ? data[0].id : ''
diff --git a/jero-web/src/components/jerobiz/JSelectRole.vue b/jero-web/src/components/jerobiz/JSelectRole.vue
index 4ae67d9c..90b3d11e 100644
--- a/jero-web/src/components/jerobiz/JSelectRole.vue
+++ b/jero-web/src/components/jerobiz/JSelectRole.vue
@@ -31,9 +31,6 @@
{ title: '角色编码', dataIndex: 'roleCode', align: 'center', width: 120 }
]
}
- },
- created(){
- console.log(this.$attrs)
}
}
diff --git a/jero-web/src/components/layouts/RouteView.vue b/jero-web/src/components/layouts/RouteView.vue
index 370a8cf3..73237de1 100644
--- a/jero-web/src/components/layouts/RouteView.vue
+++ b/jero-web/src/components/layouts/RouteView.vue
@@ -17,17 +17,13 @@
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
includedComponents() {
const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES)
- console.log("includedRouters:" + includedRouters)
-
//如果是缓存路由,则加入到 cache_included_routes
if (this.$route.meta.keepAlive && this.$route.meta.componentName) {
let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
if(!cacheRouterArray.includes(this.$route.meta.componentName)){
cacheRouterArray.push(this.$route.meta.componentName)
// cacheRouterArray.push("OnlCgformHeadList")
- console.log("Vue ls set componentName :" + this.$route.meta.componentName)
Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
- console.log("Vue ls includedRouterArrays :" + Vue.ls.get(CACHE_INCLUDED_ROUTES))
return cacheRouterArray;
}
}
diff --git a/jero-web/src/mixins/JeroListMixin.js b/jero-web/src/mixins/JeroListMixin.js
index 7577c417..53775cc0 100644
--- a/jero-web/src/mixins/JeroListMixin.js
+++ b/jero-web/src/mixins/JeroListMixin.js
@@ -54,7 +54,6 @@ export const JeroListMixin = {
},
created() {
if(!this.disableMixinCreated){
- console.log(' -- mixin created -- ')
this.loadData();
//初始化字典配置 在自己页面定义
this.initDictConfig();
@@ -102,7 +101,7 @@ export const JeroListMixin = {
})
},
initDictConfig(){
- console.log("--这是一个假的方法!")
+
},
handleSuperQuery(params, matchType) {
//高级查询方法
diff --git a/jero-web/src/permission.js b/jero-web/src/permission.js
index b492a65e..10607c75 100644
--- a/jero-web/src/permission.js
+++ b/jero-web/src/permission.js
@@ -22,9 +22,7 @@ router.beforeEach((to, from, next) => {
} else {
if (store.getters.permissionList.length === 0) {
store.dispatch('GetPermissionList').then(res => {
- // console.log(res)
const menuData = res.result.menu;
- //console.log(res.message)
if (menuData === null || menuData === "" || menuData === undefined) {
return;
}
diff --git a/jero-web/src/store/modules/permission.js b/jero-web/src/store/modules/permission.js
index d6e0f1c3..0f9d7207 100644
--- a/jero-web/src/store/modules/permission.js
+++ b/jero-web/src/store/modules/permission.js
@@ -60,17 +60,14 @@ const permission = {
SET_ROUTERS: (state, data) => {
state.addRouters = data
state.routers = constantRouterMap.concat(data)
- //console.log('-----mutations---SET_ROUTERS----', data)
}
},
actions: {
GenerateRoutes({ commit }, data) {
return new Promise(resolve => {
const { roles } = data
- console.log('-----mutations---data----', data)
let accessedRouters
accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
- console.log('-----mutations---accessedRouters----', accessedRouters)
commit('SET_ROUTERS', accessedRouters)
resolve()
})
@@ -80,7 +77,6 @@ const permission = {
return new Promise(resolve => {
//const [ roles ] = routes.constRoutes
let routelist = routes.constRoutes;
- console.log(routelist)
commit('SET_ROUTERS', routelist)
resolve()
})
diff --git a/jero-web/src/utils/filter.js b/jero-web/src/utils/filter.js
index 43c77eff..7974e8b6 100644
--- a/jero-web/src/utils/filter.js
+++ b/jero-web/src/utils/filter.js
@@ -22,7 +22,6 @@ Vue.filter('ellipsis', function (value, vlength = 25) {
if(!value){
return "";
}
- console.log('vlength: '+ vlength);
if (value.length > vlength) {
return value.slice(0, vlength) + '...'
}
diff --git a/jero-web/src/utils/hasPermission.js b/jero-web/src/utils/hasPermission.js
index 8dce3327..46747709 100644
--- a/jero-web/src/utils/hasPermission.js
+++ b/jero-web/src/utils/hasPermission.js
@@ -2,7 +2,6 @@ import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
const hasPermission = {
install (Vue, options) {
- //console.log(options);
Vue.directive('has', {
inserted: (el, binding, vnode)=>{
console.log("页面权限控制----");
@@ -11,7 +10,6 @@ const hasPermission = {
if(!filterNodePermission(el, binding, vnode)){
filterGlobalPermission(el, binding, vnode);
}
- //console.timeEnd() //计时结束并输出时长
}
});
}
diff --git a/jero-web/src/views/demo/SelectDemo.vue b/jero-web/src/views/demo/SelectDemo.vue
index 889e0138..5eda1e75 100644
--- a/jero-web/src/views/demo/SelectDemo.vue
+++ b/jero-web/src/views/demo/SelectDemo.vue
@@ -178,7 +178,7 @@
-
+
过长剪切:{{ jellipsis.value }}
@@ -198,7 +198,7 @@
-
+
多选下拉框(v-model):{{ jselectMultiple.value }}
@@ -331,7 +331,7 @@
-
+
选中的值(v-model):{{ imgList }}
@@ -339,7 +339,7 @@
-
+
@@ -598,9 +598,6 @@ sayHi('hello, world!')`
],
}
},
- created(){
- console.log(this.formData.jInput)
- },
computed: {
nameList: function() {
@@ -612,12 +609,6 @@ sayHi('hello, world!')`
}
},
methods: {
- as(){
- this.ss = true
- },
- selectChange(){
- console.log("ok")
- },
getDepartIdValue() {
return this.form.getFieldValue('departId')
},
@@ -625,7 +616,7 @@ sayHi('hello, world!')`
return this.form.getFieldValue('orgCodes')
},
changeMe() {
- console.log('you so ... , change Me')
+
},
selectOK: function(data) {
this.selectList = data
diff --git a/jero-web/src/views/system/modules/DepartWindow.vue b/jero-web/src/views/system/modules/DepartWindow.vue
index 4df828f6..1a8d7810 100644
--- a/jero-web/src/views/system/modules/DepartWindow.vue
+++ b/jero-web/src/views/system/modules/DepartWindow.vue
@@ -106,7 +106,6 @@
if(res.success){
let formData = {userId:res.result,
departIdList:this.departList}
- console.log(formData)
that.$emit('ok', formData);
}
}).finally(() => {
@@ -117,7 +116,6 @@
}else {
let formData = {userId:this.userId,
departIdList:this.departList}
- console.log(formData)
that.departList = [];
that.$emit('ok', formData);
that.confirmLoading = false;
@@ -143,7 +141,6 @@
depart.title = de.title;
this.departList.push(depart);
}
- console.log('onCheck', checkedKeys, info);
},
queryDepartTree(){
queryIdTree().then((res)=>{
diff --git a/jero-web/src/views/system/modules/PermissionModal.vue b/jero-web/src/views/system/modules/PermissionModal.vue
index 12059724..f531ee05 100644
--- a/jero-web/src/views/system/modules/PermissionModal.vue
+++ b/jero-web/src/views/system/modules/PermissionModal.vue
@@ -236,8 +236,6 @@
var that = this;
queryTreeList().then((res)=>{
if(res.success){
- console.log('----queryTreeList---')
- console.log(res)
that.treeData = [];
let treeList = res.result.treeList
for(let a=0;a