修改添加组件

This commit is contained in:
qq787203167
2022-01-21 16:54:05 +08:00
committed by xiejunyu
parent d33e38a4e0
commit bbb21b9175
30 changed files with 2661 additions and 16 deletions
@@ -0,0 +1,281 @@
<template>
<div>
<div class="box-title-text">
<!-- <div class="title-text">-->
<!-- <span class="Required">*</span>-->
<!-- <span :class="{'title-text-text':false}">{{query.enName}}</span><br>-->
<!-- <span :class="{'title-text-text':false}">{{query.name}}</span>-->
<!-- </div>-->
<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="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
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">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{item.enName}}</span><br>
<span>{{item.name}}</span>
</div>
<a-input class="box-input-index" :placeholder="item.placeholder"
v-model="queryParam[item.attrModel]"></a-input>
</div>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button class="box-button" type="primary" @click="searchReset">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchQuery">{{$t('reset')}}</a-button>
</span>
</a-row>
</a-form>
<a-table
:columns="columns"
:data-source="data"
:scroll="{ y: 540 }"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
bordered>
<template slot="name" slot-scope="text">
<a>{{ text }}</a>
</template>
</a-table>
<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 {
visible: false,
confirmLoading: false,
selectedRowKeys: [],
content: [],
queryParam: {},
searchList: [
{ name: '标准编号', placeholder: '请输入标准编号', attrModel: 'name', enName: 'standard' },
{ name: '标准名称', placeholder: '请输入标准名称', attrModel: 'title', enName: 'standName' }
],
columns: [
{
title: 'Name',
dataIndex: 'name',
scopedSlots: { customRender: 'name' }
},
{
title: 'Cash Assets',
className: 'column-money',
dataIndex: 'money'
},
{
title: 'Address',
dataIndex: 'address'
}
],
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'
}
]
}
},
mounted() {
},
methods: {
standardClick() {
this.visible = true
},
handleCancel() {
this.visible = false
},
handleSubmit() {
let content = []
this.content.forEach(res=>{
content.push(res.name)
})
this.$emit('input', content.join(','))
this.visible = false
},
indexclick(event) {
this.$emit('input', event.target.value)
},
onSelectChange(value) {
this.content = []
value.forEach(val => {
this.data.forEach((res) => {
if (res.key === val){
this.content.push(res)
}
})
})
this.selectedRowKeys = value
},
searchQuery() {
},
searchReset() {
}
}
}
</script>
<style scoped>
.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 {
display: inline-block;
height: 38px;
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;
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;
}
.box-title-text-index {
line-height: 1.4;
display: flex;
align-items: center;
}
.title-text-index {
display: inline-block;
font-weight: bold;
font-size: 14px;
margin-right: 16px;
}
.box-input-index {
display: inline-block;
width: 80%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
margin-top: 2px;
}
</style>