From 0cf8c573a1859837dc2d60cef5220c1c604c16d3 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Fri, 1 Nov 2024 13:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/CommonUtils.java | 2 +- .../controller/XxhbjwxtscwjxxController.java | 3 +- .../service/impl/ZjSqxxServiceImpl.java | 6 +- .../system/controller/CommonController.java | 7 +- .../src/main/resources/application-prod.yml | 4 +- .../views/bl/lwKhclXz/LwKhclXzListIndex.vue | 10 +- .../views/bl/xxhbjwxtscwjxx/KhpjclList.vue | 14 +- .../views/bl/xxhbjwxtxsmd/XsysclxqList.vue | 12 +- .../src/views/system/user/user.data.ts | 203 +++++++++--------- 9 files changed, 141 insertions(+), 120 deletions(-) diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java index a78d1b6..5af818f 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java @@ -102,7 +102,7 @@ public class CommonUtils { } //替换上传文件名字的特殊字符 fileName = fileName.replace("=","").replace(",","").replace("&","") - .replace("#", "").replace("“", "").replace("”", "").replace("(", "(").replace(")", ")"); + .replace("#", "").replace("“", "").replace("”", ""); //替换上传文件名字中的空格 fileName=fileName.replaceAll("\\s",""); //update-beign-author:taoyan date:20220302 for: /issues/3381 online 在线表单 使用文件组件时,上传文件名中含%,下载异常 diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/xxhbjwxtscwjxx/controller/XxhbjwxtscwjxxController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/xxhbjwxtscwjxx/controller/XxhbjwxtscwjxxController.java index 8dc61e9..b5ba760 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/xxhbjwxtscwjxx/controller/XxhbjwxtscwjxxController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/xxhbjwxtscwjxx/controller/XxhbjwxtscwjxxController.java @@ -114,8 +114,9 @@ public class XxhbjwxtscwjxxController extends JeecgControlleritem.getFjtype().equals(par)).findFirst().orElse(null)); + } - pageList.setRecords(list2); + pageList.setRecords(list2.stream().filter(list3 -> list3!=null).collect(Collectors.toList())); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/zjSqxx/service/impl/ZjSqxxServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/zjSqxx/service/impl/ZjSqxxServiceImpl.java index e78e9bd..c094ad1 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/zjSqxx/service/impl/ZjSqxxServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/zjSqxx/service/impl/ZjSqxxServiceImpl.java @@ -33,9 +33,9 @@ public class ZjSqxxServiceImpl extends ServiceImpl impleme SysUser user = sysUserService.getById(userId); //先删除该用户的授权记录 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("user_id",userId); - baseMapper.delete(queryWrapper); +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("user_id",userId); +// baseMapper.delete(queryWrapper); for(ZjSqxx sq:zjSqxxList){ sq.setId(null); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java index 7e36dba..ea63306 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java @@ -486,9 +486,11 @@ public class CommonController { @RequestMapping(value = "/ycxz", method = {RequestMethod.PUT,RequestMethod.POST}) - public void ycxz(@RequestBody JSONObject jsonObject, HttpServletResponse response) { + public Result ycxz(@RequestBody JSONObject jsonObject, HttpServletResponse response) { String downpath = jsonObject.getString("filename"); + System.out.println("downPath---->"+downpath); for(String imgPath: downpath.split(",")){ + System.out.println("imgPath---->"+imgPath); // 其余处理略 InputStream inputStream = null; OutputStream outputStream = null; @@ -511,6 +513,7 @@ public class CommonController { } //TODO 不确定是否有问题, Map map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path)); + System.out.println("msg-->"+map.get("msg")); if(!map.get("code").equals("0")){ response.setStatus(404); throw new RuntimeException(map.get("msg")); @@ -582,7 +585,7 @@ public class CommonController { } } - + return Result.OK(null); } } diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml index 6dd019e..81e42fa 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml @@ -321,8 +321,8 @@ justauth: sftp: hostname: 210.47.29.99 port: 22 - username: sftp - password: Nenujwc@99 + username: root + password: hmZ2a*G7fwwj timeout: 1000 uploadpath: kczx fullpath: /data \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/bl/lwKhclXz/LwKhclXzListIndex.vue b/jeecgboot-vue3/src/views/bl/lwKhclXz/LwKhclXzListIndex.vue index c6fef18..3e92045 100644 --- a/jeecgboot-vue3/src/views/bl/lwKhclXz/LwKhclXzListIndex.vue +++ b/jeecgboot-vue3/src/views/bl/lwKhclXz/LwKhclXzListIndex.vue @@ -411,7 +411,7 @@ async function batchHandleDown(record) { } //下载 function handleDownload(record) { - record = record.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")"); + record = record.replaceAll(" ",""); downloadFile(record); } //预览 @@ -448,7 +448,7 @@ async function handleChakan(record) { } if (record.ktbg) { - var file1 = getFileAccessHttpUrl(record.ktbg.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); + var file1 = getFileAccessHttpUrl(record.ktbg.replaceAll(" ","")); console.log("file1---->",file1); console.log("file11111---->",encodeURIComponent(encryptByBase64(file1))); ktbgUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)); @@ -457,7 +457,7 @@ async function handleChakan(record) { } if (record.ktbgshyj) { - var file1 = getFileAccessHttpUrl(record.ktbgshyj.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); + var file1 = getFileAccessHttpUrl(record.ktbgshyj.replaceAll(" ","")); ktbgshyjUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)); } else { ktbgshyjUrl.value = ''; @@ -471,14 +471,14 @@ async function handleChakan(record) { // } if (record.lwzg) { - var file1 = getFileAccessHttpUrl(record.lwzg.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); + var file1 = getFileAccessHttpUrl(record.lwzg.replaceAll(" ","")); lwzgUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)); } else { lwzgUrl.value = ''; } if (record.zdjld) { - var file1 = getFileAccessHttpUrl(record.zdjld.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); + var file1 = getFileAccessHttpUrl(record.zdjld.replaceAll(" ","")); zdjldUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)); } else { zdjldUrl.value = ''; diff --git a/jeecgboot-vue3/src/views/bl/xxhbjwxtscwjxx/KhpjclList.vue b/jeecgboot-vue3/src/views/bl/xxhbjwxtscwjxx/KhpjclList.vue index 65d0ff5..460feff 100644 --- a/jeecgboot-vue3/src/views/bl/xxhbjwxtscwjxx/KhpjclList.vue +++ b/jeecgboot-vue3/src/views/bl/xxhbjwxtscwjxx/KhpjclList.vue @@ -152,22 +152,22 @@ function handleSuccess() { /** * 预览 */ -function handleYulan(record) { - var file1 = getFileAccessHttpUrl(record.path.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); +async function handleYulan(record) { + var file1 = getFileAccessHttpUrl(record.path.replaceAll(" ","")); - if(file1){ - console.log("filename--->",file1) - defHttp.post({ url: '/sys/common/ycxz',params:{fileName:file1+","} }).then((res) => {}); + if(record.path){ + await defHttp.post({ url: '/sys/common/ycxz',params:{filename:record.path+","} }).then((res) => { + }); + window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)),"_blank"); } console.log("ktbgUrl1--->",file1) - window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1)),"_blank"); } /** * 下载 */ function handleDown(record) { - downloadFile(record.path.replaceAll(" ","").replaceAll("(","(").replaceAll(")",")")); + downloadFile(record.path.replaceAll(" ","")); } /** * 操作栏 diff --git a/jeecgboot-vue3/src/views/bl/xxhbjwxtxsmd/XsysclxqList.vue b/jeecgboot-vue3/src/views/bl/xxhbjwxtxsmd/XsysclxqList.vue index 674e2dd..445e94d 100644 --- a/jeecgboot-vue3/src/views/bl/xxhbjwxtxsmd/XsysclxqList.vue +++ b/jeecgboot-vue3/src/views/bl/xxhbjwxtxsmd/XsysclxqList.vue @@ -103,12 +103,18 @@ function handleEdit(record: Recordable) { /** * 预览 */ -function handleYulan(record) { +async function handleYulan(record) { var file = getFileAccessHttpUrl(record.studentPath); + + if(record.studentPath){ + console.log("filename--->",record.studentPath) + await defHttp.post({ url: '/sys/common/ycxz',params:{filename:record.studentPath+","} }).then((res) => { + }); + window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file))); + } console.log('🤬', file); // window.open('https://view.xdocin.com/view?src=' + encodeURIComponent(encryptByBase64(file))); - // window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file))); - window.open(file, '_blank'); + // window.open(file, '_blank'); } /** * 下载 diff --git a/jeecgboot-vue3/src/views/system/user/user.data.ts b/jeecgboot-vue3/src/views/system/user/user.data.ts index 2277d14..7b712a1 100644 --- a/jeecgboot-vue3/src/views/system/user/user.data.ts +++ b/jeecgboot-vue3/src/views/system/user/user.data.ts @@ -14,41 +14,41 @@ export const columns: BasicColumn[] = [ dataIndex: 'realname', width: 100, }, - { - title: '头像', - dataIndex: 'avatar', - width: 120, - customRender: render.renderAvatar, - }, - { - title: '性别', - dataIndex: 'sex', - width: 80, - sorter: true, - customRender: ({ text }) => { - return render.renderDict(text, 'sex'); - }, - }, - { - title: '生日', - dataIndex: 'birthday', - width: 100, - }, - { - title: '手机号', - dataIndex: 'phone', - width: 100, - }, - { - title: '部门', - width: 150, - dataIndex: 'orgCodeTxt', - }, - { - title: '负责部门', - width: 150, - dataIndex: 'departIds_dictText', - }, + // { + // title: '头像', + // dataIndex: 'avatar', + // width: 120, + // customRender: render.renderAvatar, + // }, + // { + // title: '性别', + // dataIndex: 'sex', + // width: 80, + // sorter: true, + // customRender: ({ text }) => { + // return render.renderDict(text, 'sex'); + // }, + // }, + // { + // title: '生日', + // dataIndex: 'birthday', + // width: 100, + // }, + // { + // title: '手机号', + // dataIndex: 'phone', + // width: 100, + // }, + // { + // title: '部门', + // width: 150, + // dataIndex: 'orgCodeTxt', + // }, + // { + // title: '负责部门', + // width: 150, + // dataIndex: 'departIds_dictText', + // }, { title: '状态', dataIndex: 'status_dictText', @@ -135,7 +135,7 @@ export const formSchema: FormSchema[] = [ show: false, }, { - label: '用户账号', + label: '登录账号', field: 'username', component: 'Input', dynamicDisabled: ({ values }) => { @@ -173,13 +173,13 @@ export const formSchema: FormSchema[] = [ required: true, component: 'Input', }, - { - label: '工号', - field: 'workNo', - required: true, - component: 'Input', - dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), - }, + // { + // label: '工号', + // field: 'workNo', + // required: true, + // component: 'Input', + // dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), + // }, { label: '职务', field: 'post', @@ -188,6 +188,7 @@ export const formSchema: FormSchema[] = [ componentProps: { labelKey: 'name', }, + ifShow: false, }, { label: '角色', @@ -200,6 +201,12 @@ export const formSchema: FormSchema[] = [ valueField: 'id', immediate: false, }, + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ] }, { label: '所属部门', @@ -231,6 +238,7 @@ export const formSchema: FormSchema[] = [ }, }; }, + ifShow: false, }, { label: '租户', @@ -244,6 +252,7 @@ export const formSchema: FormSchema[] = [ valueField: 'id', immediate: false, }, + ifShow: false, }, { label: '身份', @@ -261,6 +270,7 @@ export const formSchema: FormSchema[] = [ }, }; }, + ifShow: false, }, { label: '负责部门', @@ -271,59 +281,59 @@ export const formSchema: FormSchema[] = [ }, ifShow: ({ values }) => values.userIdentity == 2, }, - { - label: '头像', - field: 'avatar', - component: 'JImageUpload', - componentProps: { - fileMax: 1, - }, - }, - { - label: '生日', - field: 'birthday', - component: 'DatePicker', - }, - { - label: '性别', - field: 'sex', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'sex', - placeholder: '请选择性别', - stringToNumber: true, - }, - }, - { - label: '邮箱', - field: 'email', - component: 'Input', - required: true, - dynamicRules: ({ model, schema }) => { - return [ - { ...rules.duplicateCheckRule('sys_user', 'email', model, schema, true)[0], trigger: 'blur' }, - { ...rules.rule('email', false)[0], trigger: 'blur' }, - ]; - }, - }, - { - label: '手机号码', - field: 'phone', - component: 'Input', - required: true, - dynamicRules: ({ model, schema }) => { - return [ - { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0], trigger: 'blur' }, - { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }, - ]; - }, - }, - { - label: '座机', - field: 'telephone', - component: 'Input', - rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], - }, + // { + // label: '头像', + // field: 'avatar', + // component: 'JImageUpload', + // componentProps: { + // fileMax: 1, + // }, + // }, + // { + // label: '生日', + // field: 'birthday', + // component: 'DatePicker', + // }, + // { + // label: '性别', + // field: 'sex', + // component: 'JDictSelectTag', + // componentProps: { + // dictCode: 'sex', + // placeholder: '请选择性别', + // stringToNumber: true, + // }, + // }, + // { + // label: '邮箱', + // field: 'email', + // component: 'Input', + // required: true, + // dynamicRules: ({ model, schema }) => { + // return [ + // { ...rules.duplicateCheckRule('sys_user', 'email', model, schema, true)[0], trigger: 'blur' }, + // { ...rules.rule('email', false)[0], trigger: 'blur' }, + // ]; + // }, + // }, + // { + // label: '手机号码', + // field: 'phone', + // component: 'Input', + // required: true, + // dynamicRules: ({ model, schema }) => { + // return [ + // { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0], trigger: 'blur' }, + // { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }, + // ]; + // }, + // }, + // { + // label: '座机', + // field: 'telephone', + // component: 'Input', + // rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], + // }, { label: '工作流引擎', field: 'activitiSync', @@ -334,6 +344,7 @@ export const formSchema: FormSchema[] = [ type: 'radio', stringToNumber: true, }, + ifShow: false, }, ];