修改中英文切换

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
@@ -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 = {}