Commit 42a5a9d6 by 蒋勇

d

parent 60c63b7a
<template> <template>
<div> <div>
<div v-if="searchable && searchPlace === 'top'" class="search-con search-con-top"> <div v-if="searchable && searchPlace === 'top'" class="search-con search-con-top">
<Select v-model="searchKey" class="search-col"> <Select v-model="searchKey" clearable placeholder="搜索关键字" class="search-col">
<Option <Option
v-for="item in searchcols" v-for="item in searchcols"
v-if="item.key !== 'handle'" v-if="item.key !== 'handle'"
...@@ -16,12 +16,16 @@ ...@@ -16,12 +16,16 @@
class="search-input" class="search-input"
v-model="searchValue" v-model="searchValue"
/> />
<Button @click="handleSearch" class="search-btn" type="primary"> <Button @click="handleSearch" class="search-btn" type="text">
<Icon type="search"/>&nbsp;&nbsp;搜索 <Icon type="ios-locate-outline" />&nbsp;&nbsp;搜索
</Button> </Button>
<Button @click="advSearch" class="search-btn" type="primary"> <span style="position:absolute;right:100px;">
<Icon type="search"/>&nbsp;&nbsp;高级 <slot name="tblbtnarea">
<Button @click="advSearch" class="search-btn" type="text">
<Icon type="ios-search-outline" />&nbsp;&nbsp;高级
</Button> </Button>
</slot>
</span>
</div> </div>
<Table <Table
ref="tablesMain" ref="tablesMain"
...@@ -292,9 +296,13 @@ export default { ...@@ -292,9 +296,13 @@ export default {
// this.insideTableData = this.value.filter( // this.insideTableData = this.value.filter(
// item => item[this.searchKey].indexOf(this.searchValue) > -1 // item => item[this.searchKey].indexOf(this.searchValue) > -1
// ); // );
if(this.searchKey && this.searchKey!=""){
let eobj={}; let eobj={};
eobj[this.searchKey]=this.searchValue eobj[this.searchKey]=this.searchValue
this.$emit("on-rapid-query",eobj) this.$emit("on-rapid-query",eobj)
}else{
this.$emit("on-rapid-query",null)
}
}, },
handleTableData() { handleTableData() {
this.insideTableData = this.value.map((item, index) => { this.insideTableData = this.value.map((item, index) => {
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
}, },
"auths":{ "auths":{
"add":[ "add":[
{"icon":"el-icon-plus","title":"新增","type":"text","key":"new","isOnGrid":true}, {"icon":"ios-add-circle-outline","title":"新增","type":"text","key":"create","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"text","key":"save","isOnForm":true}, {"icon":"el-icon-save","title":"保存","type":"text","key":"save","isOnForm":true},
], ],
"edit":[ "edit":[
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
{"icon":"el-icon-cancel","title":"取消","type":"text","key":"cancel","isOnForm":true}, {"icon":"el-icon-cancel","title":"取消","type":"text","key":"cancel","isOnForm":true},
{"icon":"el-icon-cancel","title":"取消","type":"text","key":"cancel-search","isInSearch":true}, {"icon":"el-icon-cancel","title":"取消","type":"text","key":"cancel-search","isInSearch":true},
{"icon":"el-icon-cancel","title":"搜索","type":"text","key":"start-search","isInSearch":true}, {"icon":"el-icon-cancel","title":"搜索","type":"text","key":"start-search","isInSearch":true},
{"icon":"ios-search-outline","title":"高级","type":"text","key":"adv-search","isOnGrid":true},
], ],
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
v-for="bt in searchbtns" v-for="bt in searchbtns"
:key="bt.key" :key="bt.key"
:type="bt.type" :type="bt.type"
:icon="bt.icon"
@click="doquery(slotProps.fm,bt.key)" @click="doquery(slotProps.fm,bt.key)"
>{{ bt.title }}</Button> >{{ bt.title }}</Button>
</template> </template>
...@@ -26,7 +27,17 @@ ...@@ -26,7 +27,17 @@
@on-exec="doexec" @on-exec="doexec"
@on-select="onsels" @on-select="onsels"
@on-adv-search="advsearch" @on-adv-search="advsearch"
/> >
<template v-slot:tblbtnarea="slotProps">
<Button
v-for="bt in onlistbtns"
:key="bt.key"
:type="bt.type"
:icon="bt.icon"
@click="doexec(bt.key)"
>{{ bt.title }}</Button>
</template>
</tables>
<div style="text-align:center"> <div style="text-align:center">
<Page <Page
:total="pageInfo.total" :total="pageInfo.total"
...@@ -40,19 +51,27 @@ ...@@ -40,19 +51,27 @@
</div> </div>
<!-- <Button style="margin: 10px 0;" type="primary" @click="exportExcel">导出为Csv文件</Button> --> <!-- <Button style="margin: 10px 0;" type="primary" @click="exportExcel">导出为Csv文件</Button> -->
<Drawer placement="right" :closable="false" v-model="showedform" width="70"> <Drawer placement="right" :closable="false" v-model="showedform" width="70">
<Forms ref="edform" :fminfo="forminfo" style="height:100%"></Forms> <Forms ref="edform" :fminfo="forminfo" style="height:100%">
<template v-slot:default="slotProps">
<Button
v-for="bt in formbtns"
:key="bt.key"
:type="bt.type"
:icon="bt.icon"
@click="doexec(bt.key,slotProps.fm)"
>{{ bt.title }}</Button>
</template>
</Forms>
</Drawer> </Drawer>
</Card> </Card>
<Modal v-model="isdel" width="360"> <Modal v-model="isdel" width="360">
<p slot="header" style="color:#f60;text-align:center"> <p slot="header" style="color:#f60;text-align:center">
<Icon type="ios-information-circle"></Icon> <Icon type="ios-information-circle"></Icon>
<span>Delete confirmation</span> <span>删除提示</span>
</p> </p>
<div style="text-align:center"> <div style="text-align:center">
<p>After this task is deleted, the downstream 10 tasks will not be implemented.</p> <p>您真的要删除当前选中的记录吗?</p>
<p>Will you delete it?</p>
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="error" size="large" long :loading="modal_loading" @click="delpost">Delete</Button> <Button type="error" size="large" long :loading="modal_loading" @click="delpost">Delete</Button>
...@@ -115,6 +134,7 @@ export default { ...@@ -115,6 +134,7 @@ export default {
searchModel: {}, searchModel: {},
showsearch: false, showsearch: false,
showedform: false, showedform: false,
fm_status:"normal",
sum_fields: this.sumfields ? this.sumfields : [], sum_fields: this.sumfields ? this.sumfields : [],
avg_fields: this.avgfields ? this.avgfields : [], avg_fields: this.avgfields ? this.avgfields : [],
...@@ -148,6 +168,7 @@ export default { ...@@ -148,6 +168,7 @@ export default {
}, },
onsizeChange(s) { onsizeChange(s) {
this.pageInfo.pageSize = s; this.pageInfo.pageSize = s;
this.fetchData();
}, },
onsels(sels, lastsel) { onsels(sels, lastsel) {
this.currentSels = currentSels; this.currentSels = currentSels;
...@@ -167,8 +188,27 @@ export default { ...@@ -167,8 +188,27 @@ export default {
this.isdel = true; this.isdel = true;
} }
if (key == "edit") { if (key == "edit") {
this.fm_status="edit"
this.showedform = true;
}
if (key == "create") {
this.fm_status="create"
this.showedform = true; this.showedform = true;
} }
if (key == "save") {
this.fm_status="normal"
this.showedform = false;
}
if (key == "cancel") {
this.fm_status="normal"
this.showedform = false;
}
if (key == "export") {
this.exportExcel()
}
if(key=="adv-search"){
this.advsearch()
}
console.log(key, row); console.log(key, row);
}, },
doquery(q, k) { doquery(q, k) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment