From 742403daab7f4e903b14177f8d418c33142bd16d Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Wed, 23 Feb 2022 15:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 7 +- jero-web/src/common/lang/zh-cn.js | 10 +- .../components/PersonnelSelection/index.vue | 250 ++++++++++++++++++ .../components/Standardselection/index.vue | 198 ++++++-------- jero-web/src/components/addForm/index.vue | 36 ++- .../src/components/libraryAddForm/index.vue | 119 +++++++-- jero-web/src/components/search/index.vue | 43 ++- jero-web/src/components/tableDate/index.vue | 7 +- jero-web/src/utils/request.js | 89 ++++--- 9 files changed, 557 insertions(+), 202 deletions(-) create mode 100644 jero-web/src/components/PersonnelSelection/index.vue diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 368bf85c4..d9fe5f447 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -245,7 +245,6 @@ module.exports = { CompletelyDelete:'Completely delete', FirstLevelMenu:'First level menu', Submenu:'Submenu', - ButtonsPermissions:'buttons/permissions', enterMenuName:'Please enter menu name', SuperiorMenu:'superior menu', selectSuperiorMenu:'Please select superior menu', @@ -335,5 +334,9 @@ module.exports = { Users:'users', reduction:'reduction', UsersSucceeded:'users succeeded!', - + standard:'number', + title:'title', + TextStatus:'TextStatus', + PleaseEnter:'Please enter', + PleaseSelect:'Please select', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 77af40b60..e67cb45bd 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -9,11 +9,11 @@ module.exports = { RealName:'真实姓名', pleaseEnter:'请输入', phoneNumber:'手机号码', - query:'查询', + query:'搜索', userStatues:'用户状态', normal:'正常', frozen:'冻结', - reset:'重置', + reset:'清空', putAway:'收起', open:'展开', addUser:'添加用户', @@ -338,5 +338,9 @@ module.exports = { Users:'个用户吗?', reduction:'还原', UsersSucceeded:'个用户成功!', - + standard:'编号', + title:'标题', + TextStatus:'文本状态', + PleaseEnter:'请输入', + PleaseSelect:'请选择', } \ No newline at end of file diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue new file mode 100644 index 000000000..a8e9fbc21 --- /dev/null +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -0,0 +1,250 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/components/Standardselection/index.vue b/jero-web/src/components/Standardselection/index.vue index 8925bd886..a4ea2fbcd 100644 --- a/jero-web/src/components/Standardselection/index.vue +++ b/jero-web/src/components/Standardselection/index.vue @@ -22,14 +22,22 @@ style="height: 100%;overflow: auto;padding-bottom: 53px;"> - +
- {{item.enName}}
- {{item.name}} + {{$t('standard')}}
- + +
+
+ +
+
+ {{$t('title')}} +
+
@@ -40,14 +48,24 @@
- + :loading="loading"> + +
+ +
{{$t('cancel')}} {{$t('submit')}} @@ -57,6 +75,8 @@ @@ -203,19 +180,6 @@ .box-title-text { line-height: 1.4; display: flex; - /*align-items: center;*/ - } - - .title-text { - width: 114px; - text-align: right; - display: inline-block; - font-weight: bold; - font-size: 14px; - margin-right: 16px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } .box-input { @@ -224,17 +188,6 @@ width: 100%; } - .itemModel { - width: calc(100% - 220px); - display: inline-block; - margin-top: 2px; - } - - .Required { - color: red; - margin-right: 4px; - } - .button-box { margin-left: 10px; height: 38px; @@ -262,6 +215,7 @@ .title-text-index { display: inline-block; + min-width: 60px; font-weight: bold; font-size: 14px; margin-right: 16px; @@ -278,4 +232,8 @@ height: 38px; margin-top: 2px; } + .page { + text-align: right; + margin-top: 20px; + } \ No newline at end of file diff --git a/jero-web/src/components/addForm/index.vue b/jero-web/src/components/addForm/index.vue index 6aa41244c..bd205ea44 100644 --- a/jero-web/src/components/addForm/index.vue +++ b/jero-web/src/components/addForm/index.vue @@ -43,6 +43,8 @@
@@ -59,7 +61,7 @@ + @change="onChange(item.db_field_name)"> @@ -140,7 +142,25 @@ - + +
+
+ * + + {{item.db_field_txt}} +
+ + + +
+
@@ -187,6 +207,7 @@ import Standardselection from '@/components/Standardselection/index' import { getAction, postAction } from '@/api/manage' import eventBUs from '../../common/event' + import moment from 'moment' export default { name: 'index', @@ -255,9 +276,6 @@ } }) }, - onChange(date, dateString) { - console.log(date, dateString) - }, clickButtonToUpload(current) { this.$refs.uploadFile.visible = true this.uploadName = current @@ -340,6 +358,14 @@ } }) }, + dateChange(item) { + this.formInline[item.db_field_name] = moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') + }, + onChange(item) { + let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD') + let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD') + this.formInline[item] = [dateOne, dateTwo] + }, edit(item) { getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => { if (res.success) { diff --git a/jero-web/src/components/libraryAddForm/index.vue b/jero-web/src/components/libraryAddForm/index.vue index d4d57d1f4..0f512a559 100644 --- a/jero-web/src/components/libraryAddForm/index.vue +++ b/jero-web/src/components/libraryAddForm/index.vue @@ -39,7 +39,20 @@
- + +
+
+ * + + {{item.db_field_txt}} +
+ + + +
+
@@ -58,20 +71,6 @@
- -
-
- * - - {{item.db_field_txt}} -
- - - -
-
@@ -152,7 +151,37 @@
- + +
+
+ * + + {{item.db_field_txt}} +
+ + + +
+
+ +
+
+ * + + {{item.db_field_txt}} +
+ + + +
+
@@ -194,6 +223,7 @@ diff --git a/jero-web/src/components/tableDate/index.vue b/jero-web/src/components/tableDate/index.vue index 9eb92beac..53a9eb506 100644 --- a/jero-web/src/components/tableDate/index.vue +++ b/jero-web/src/components/tableDate/index.vue @@ -80,8 +80,13 @@ }, mounted() { eventBUs.$on('searchQuery', search => { + Object.keys(search).forEach(res=>{ + if (search[res] instanceof Array){ + search[res] = search[res].join(',') + } + }) this.searchParmes = search - this.getTableList(search) + this.getTableList() }) eventBUs.$on('searchReset', target => { this.searchParmes = {} diff --git a/jero-web/src/utils/request.js b/jero-web/src/utils/request.js index 18a5ece70..a91681037 100644 --- a/jero-web/src/utils/request.js +++ b/jero-web/src/utils/request.js @@ -2,8 +2,8 @@ import Vue from 'vue' import axios from 'axios' import store from '@/store' import { VueAxios } from './axios' -import {Modal, notification} from 'ant-design-vue' -import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" +import { Modal, notification } from 'ant-design-vue' +import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types' /** * 【指定 axios的 baseURL】 @@ -11,7 +11,7 @@ import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" * 则映射后端域名,通过 vue.config.js * @type {*|string} */ -let apiBaseUrl = window._CONFIG['domianURL'] || "/jero-boot"; +let apiBaseUrl = window._CONFIG['domianURL'] || '/jero-boot' //console.log("apiBaseUrl= ",apiBaseUrl) // 创建 axios 实例 const service = axios.create({ @@ -24,23 +24,23 @@ const err = (error) => { if (error.response) { let data = error.response.data const token = Vue.ls.get(ACCESS_TOKEN) - console.log("------异常响应------",token) - console.log("------异常响应------",error.response.status) + console.log('------异常响应------', token) + console.log('------异常响应------', error.response.status) switch (error.response.status) { case 403: - notification.error({ message: '系统提示', description: '拒绝访问',duration: 4}) + notification.error({ message: '系统提示', description: '拒绝访问', duration: 4 }) break case 500: - console.log("------error.response------",error.response) + console.log('------error.response------', error.response) // update-begin- --- author:liusq ------ date:20200910 ---- for:处理Blob情况---- - let type=error.response.request.responseType; - if(type === 'blob'){ - blobToJson(data); - break; + let type = error.response.request.responseType + if (type === 'blob') { + blobToJson(data) + break } // update-end- --- author:liusq ------ date:20200910 ---- for:处理Blob情况---- //notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4}) - if(token && data.message.includes("Token失效")){ + if (token && data.message.includes('Token失效')) { // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转---- Modal.error({ title: '登录已过期', @@ -52,11 +52,11 @@ const err = (error) => { Vue.ls.remove(ACCESS_TOKEN) try { let path = window.document.location.pathname - console.log("location pathname -> "+path) - if(path!="/" && path.indexOf('/user/login')==-1){ + console.log('location pathname -> ' + path) + if (path != '/' && path.indexOf('/user/login') == -1) { window.location.reload() } - }catch (e) { + } catch (e) { window.location.reload() } }) @@ -66,13 +66,13 @@ const err = (error) => { } break case 404: - notification.error({ message: '系统提示', description:'很抱歉,资源未找到!',duration: 4}) + notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 }) break case 504: - notification.error({ message: '系统提示', description: '网络超时'}) + notification.error({ message: '系统提示', description: '网络超时' }) break case 401: - notification.error({ message: '系统提示', description:'未授权,请重新登录',duration: 4}) + notification.error({ message: '系统提示', description: '未授权,请重新登录', duration: 4 }) if (token) { store.dispatch('Logout').then(() => { setTimeout(() => { @@ -91,59 +91,74 @@ const err = (error) => { } } return Promise.reject(error) -}; +} // request interceptor service.interceptors.request.use(config => { const token = Vue.ls.get(ACCESS_TOKEN) if (token) { - config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改 + config.headers['X-Access-Token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改 } //update-begin-author:taoyan date:2020707 for:多租户 let tenantid = Vue.ls.get(TENANT_ID) if (!tenantid) { - tenantid = 0; + tenantid = 0 } - config.headers[ 'tenant_id' ] = tenantid + let long = localStorage.getItem('language') + let cut = '' + if (long && long == 'zh-cn') { + cut = 'cn' + } else if (long && long == 'en-us') { + cut = 'en' + } + config.headers['tenant_id'] = tenantid //update-end-author:taoyan date:2020707 for:多租户 - if(config.method=='get'){ - if(config.url.indexOf("sys/dict/getDictItems")<0){ + if (config.method == 'get') { + if (config.url.indexOf('sys/dict/getDictItems') < 0) { config.params = { - _t: Date.parse(new Date())/1000, + _t: Date.parse(new Date()) / 1000, + cut: cut, ...config.params } } + } else if((config.method == 'post')) { + console.log(config) + config.data = { + cut: cut, + ...config.data + } } return config -},(error) => { +}, (error) => { return Promise.reject(error) }) // response interceptor service.interceptors.response.use((response) => { - return response.data - }, err) + return response.data +}, err) const installer = { vm: {}, - install (Vue, router = {}) { + install(Vue, router = {}) { Vue.use(VueAxios, router, service) } } + /** * Blob解析 * @param data */ function blobToJson(data) { - let fileReader = new FileReader(); - let token = Vue.ls.get(ACCESS_TOKEN); + let fileReader = new FileReader() + let token = Vue.ls.get(ACCESS_TOKEN) fileReader.onload = function() { try { - let jsonData = JSON.parse(this.result); // 说明是普通对象数据,后台转换失败 - console.log("jsonData",jsonData) + let jsonData = JSON.parse(this.result) // 说明是普通对象数据,后台转换失败 + console.log('jsonData', jsonData) if (jsonData.status === 500) { - console.log("token----------》",token) - if(token && jsonData.message.includes("Token失效")){ + console.log('token----------》', token) + if (token && jsonData.message.includes('Token失效')) { Modal.error({ title: '登录已过期', content: '很抱歉,登录已过期,请重新登录', @@ -160,9 +175,9 @@ function blobToJson(data) { } } catch (err) { // 解析成对象失败,说明是正常的文件流 - console.log("blob解析fileReader返回err",err) + console.log('blob解析fileReader返回err', err) } - }; + } fileReader.readAsText(data) }