修改中英文切换

This commit is contained in:
qq787203167
2022-02-23 15:12:41 +08:00
parent daa473e220
commit 742403daab
9 changed files with 557 additions and 202 deletions
+5 -2
View File
@@ -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',
}
+7 -3
View File
@@ -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:'请选择',
}
@@ -0,0 +1,250 @@
<template>
<div>
<div class="box-title-text">
<a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="query.placeholder"/>
<a-button type="primary" class="button-box" @click="standardClick">
人员选择
</a-button>
</div>
<a-drawer
:title="'人员选择'"
:maskClosable="true"
:width="600"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
<div class="drawer-content">
<a-tree
style="margin-bottom: 60px;height: 600px"
checkable
:loading="loading"
:tree-data="gData"
@select="onSelect"
@check="onCheck"
>
</a-tree>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
name: 'index',
props: ['query', 'value'],
data(){
return{
loading:true,
gData:[
{
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
},
],
autoExpandParent: true,
expandedKeys:[],
visible: false,
confirmLoading:false,
}
},
mounted() {
},
methods:{
standardClick() {
this.visible = true
},
onSelect(selectedKeys, info) {
console.log('selected', selectedKeys, info);
},
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info);
},
handleCancel(){
this.visible = false
},
handleSubmit(){
},
indexclick(event) {
this.$emit('input', event.target.value)
},
onChange(){
},
},
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.button-box {
margin-left: 10px;
height: 38px;
line-height: 38px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.drawer-content{
height: calc(100% - 60px);
overflow: auto;
}
</style>
@@ -22,14 +22,22 @@
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form layout="inline" @keyup.enter.native="searchQuery" style="margin-bottom: 20px">
<a-row :gutter="24">
<a-col :md="6" :sm="8" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<a-col :md="6" :sm="8" style="line-height: 48px">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{item.enName}}</span><br>
<span>{{item.name}}</span>
<span>{{$t('standard')}}</span>
</div>
<a-input class="box-input-index" :placeholder="item.placeholder"
v-model="queryParam[item.attrModel]"></a-input>
<a-input class="box-input-index" :placeholder="this.$t('PleaseEnter') +' '+ this.$t('standard')"
v-model="queryParam.serialNumber"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8" style="line-height: 48px">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input-index" :placeholder="this.$t('PleaseEnter') +' '+ this.$t('title')"
v-model="queryParam.title"></a-input>
</div>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -40,14 +48,24 @@
</a-form>
<a-table
:columns="columns"
:data-source="data"
rowKey="id"
:data-source="dataList"
:scroll="{ y: 540 }"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
bordered>
<template slot="name" slot-scope="text">
<a>{{ text }}</a>
</template>
:loading="loading">
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
@@ -57,6 +75,8 @@
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'index',
props: ['query', 'value'],
@@ -66,110 +86,58 @@
confirmLoading: false,
selectedRowKeys: [],
content: [],
loading: false,
queryParam: {},
searchList: [
{ name: '标准编号', placeholder: '请输入标准编号', attrModel: 'name', enName: 'standard' },
{ name: '标准名称', placeholder: '请输入标准名称', attrModel: 'title', enName: 'standName' }
],
columns: [
{
title: 'Name',
dataIndex: 'name',
scopedSlots: { customRender: 'name' }
title: this.$t('standard'),
dataIndex: 'serial_number'
},
{
title: 'Cash Assets',
className: 'column-money',
dataIndex: 'money'
title: this.$t('title'),
dataIndex: 'title'
},
{
title: 'Address',
dataIndex: 'address'
title: this.$t('TextStatus'),
dataIndex: 'state'
}
],
data: [
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '4',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '5',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '6',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '7',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '8',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '9',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '10',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '11',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
}
]
dataList: [],
pageNo: 1,
pageSize: 10,
total: 0
}
},
mounted() {
this.replacePage()
},
methods: {
standardClick() {
this.visible = true
},
replacePage() {
let query = {
...this.queryParam,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.loading = true
getAction('document/bussDocumentLibraryEO/replacePageInfo', query).then((res) => {
this.loading = false
if (res.success) {
this.dataList = res.result.records
this.total = res.result.total
} else {
this.dataList = []
}
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
let content = []
this.content.forEach(res=>{
this.content.forEach(res => {
content.push(res.name)
})
this.$emit('input', content.join(','))
@@ -182,7 +150,7 @@
this.content = []
value.forEach(val => {
this.data.forEach((res) => {
if (res.key === val){
if (res.key === val) {
this.content.push(res)
}
})
@@ -190,11 +158,20 @@
this.selectedRowKeys = value
},
searchQuery() {
this.replacePage()
},
searchReset() {
}
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageSize = pageSize
this.replacePage()
},
}
}
</script>
@@ -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;
}
</style>
+31 -5
View File
@@ -43,6 +43,8 @@
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-date-picker class="box-input" v-model="formInline[item.db_field_name]"
@change="dateChange(item)"
format="YYYY-MM-DD"
:disabled="disabled"
style="width: 100%"/>
</a-form-model-item>
@@ -59,7 +61,7 @@
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker v-model="formInline[item.db_field_name]"
:disabled="disabled"
@change="onChange"></a-range-picker>
@change="onChange(item.db_field_name)"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
@@ -140,7 +142,25 @@
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'treeSelect'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-tree-select
v-model="formInline[item.db_field_name]"
style="width: 100%"
:maxTagCount="1"
:tree-data="treeData"
tree-checkable
placeholder="Please select"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'file'">
<div class="box-title-text">
<div class="title-text">
@@ -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) {
@@ -39,7 +39,20 @@
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'dateAll'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@change="onChange(item.db_field_name)"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'date'">
<div class="box-title-text">
<div class="title-text">
@@ -58,20 +71,6 @@
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@change="onChange"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
<div class="box-title-text">
@@ -152,7 +151,37 @@
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'treeSelect'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-tree-select
v-model="formInline[item.db_field_name]"
style="width: 100%"
:maxTagCount="1"
:tree-data="treeData"
tree-checkable
placeholder="Please select"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === 'file'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<PersonnelSelection :query="item" :disabled="disabled" v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'file'">
<div class="box-title-text">
<div class="title-text">
@@ -194,6 +223,7 @@
<script>
import uploadFile from '@/components/uploadFile/file'
import Standardselection from '@/components/Standardselection/index'
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction } from '@/api/manage'
import eventBUs from '../../common/event'
import moment from 'moment'
@@ -202,7 +232,8 @@
name: 'index',
components: {
uploadFile,
Standardselection
Standardselection,
PersonnelSelection
},
props: {
url: {
@@ -249,7 +280,51 @@
text: '关联信息',
content: []
}
]
],
treeData:[
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0',
key: '0-0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0-0',
key: '0-0-0-0',
},
],
},
],
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
children: [
{
title: 'Child Node3',
value: '0-1-0',
key: '0-1-0',
disabled: true,
},
{
title: 'Child Node4',
value: '0-1-1',
key: '0-1-1',
},
{
title: 'Child Node5',
value: '0-1-2',
key: '0-1-2',
},
],
},
],
}
},
mounted() {
@@ -288,10 +363,12 @@
dateChange(item) {
this.formInline[item.db_field_name] = moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD')
},
onChange(date, dateString) {
console.log(typeof date)
// moment(date).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]
},
clickButtonToUpload(current) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
+30 -13
View File
@@ -5,7 +5,6 @@
<template v-if="index < 2">
<div class="box-title-text" v-if="item.field_show_type == 'text'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<a-input class="box-input" :placeholder="item.placeholder"
@@ -13,23 +12,29 @@
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
<div class="box-title-text" v-else-if="item.field_show_type == 'dateAll'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
<a-range-picker class="box-input" v-model="queryParam[item.db_field_name]"
@change="onChange(item.db_field_name)"></a-range-picker>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
<div class="title-text">
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker class="box-input"
@change="dateChange(item.db_field_name)"
v-model="queryParam[item.db_field_name]"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
@@ -40,7 +45,6 @@
<template v-if="toggleSearchStatus && index >= 2">
<div class="box-title-text" v-if="item.field_show_type == 'text'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<a-input class="box-input" :placeholder="item.placeholder"
@@ -48,23 +52,27 @@
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
<div class="box-title-text" v-else-if="item.field_show_type == 'dateAll'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
<a-range-picker class="box-input" v-model="queryParam[item.db_field_name]"
@change="onChange(item.db_field_name)"></a-range-picker>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
<div class="title-text">
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker @change="dateChange(item.db_field_name)" class="box-input" v-model="queryParam[item.db_field_name]"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
<div class="title-text">
<!-- <span>{{item.db_field_en_name}}</span><br>-->
<span>{{item.db_field_txt}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
@@ -90,6 +98,7 @@
<script>
import { getAction } from '@/api/manage'
import eventBUs from '../../common/event.js'
import moment from 'moment'
export default {
name: 'index',
@@ -133,7 +142,15 @@
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
}
},
dateChange(item) {
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
},
onChange(item){
let dateOne = moment(this.queryParam[item][0]).format('YYYY-MM-DD')
let dateTwo = moment(this.queryParam[item][1]).format('YYYY-MM-DD')
this.queryParam[item] = [dateOne, dateTwo]
},
}
}
</script>
+6 -1
View File
@@ -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 = {}
+52 -37
View File
@@ -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)
}