|
@@ -81,7 +81,7 @@ searchClick(type,data){
|
|
|
</el-select>
|
|
|
<el-date-picker v-if="item.type == 3" v-model="item.value" :clearable="false" value-format="yyyy-MM-dd"
|
|
|
:style="item.width?'width:'+item.width+'px;':'width: 240px;'"
|
|
|
- type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
+ type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -92,7 +92,8 @@ searchClick(type,data){
|
|
|
<p class="advanced-button" @click="stateSwitch">高级搜索</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right" v-for="item in searchData.buttonList" >
|
|
|
- <p v-if="item.type == 1" class="inquire-button-one" v-hasPermi="item.hasPermi" style="width:120px;" @click="buttonClick(item.parameter)">{{item.name}}</p>
|
|
|
+ <p v-if="item.type == 1 && !item.hasPermi" class="inquire-button-one" style="width:120px;" @click="buttonClick(item.parameter)">{{item.name}}</p>
|
|
|
+ <p v-if="item.type == 1 && item.hasPermi" class="inquire-button-one" v-hasPermi="item.hasPermi" style="width:120px;" @click="buttonClick(item.parameter)">{{item.name}}</p>
|
|
|
<div style="float: right;" v-if="item.type == 2">
|
|
|
<el-dropdown @command="commandButton" v-hasPermi="item.hasPermi">
|
|
|
<div class="form-dropdown-box">
|
|
@@ -179,127 +180,127 @@ searchClick(type,data){
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- name: "advancedSearch",
|
|
|
- props:{
|
|
|
- searchData:{}
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- searchState:false,
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+export default {
|
|
|
+ name: "advancedSearch",
|
|
|
+ props:{
|
|
|
+ searchData:{}
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchState:false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
|
|
|
- },
|
|
|
- mounted(){
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //普通/高级状态切换
|
|
|
+ stateSwitch(){
|
|
|
+ this.searchState = !this.searchState;
|
|
|
+ },
|
|
|
+ //导出/导入按钮
|
|
|
+ commandButton(data){
|
|
|
+ this.$parent.searchClick(data.item.parameter,data.command);
|
|
|
},
|
|
|
- methods: {
|
|
|
- //普通/高级状态切换
|
|
|
- stateSwitch(){
|
|
|
- this.searchState = !this.searchState;
|
|
|
- },
|
|
|
- //导出/导入按钮
|
|
|
- commandButton(data){
|
|
|
- this.$parent.searchClick(data.item.parameter,data.command);
|
|
|
- },
|
|
|
- //按钮方法
|
|
|
- buttonClick(type){
|
|
|
- let self = this;
|
|
|
- if(type == '1'){
|
|
|
- //查找
|
|
|
- let obj = {};
|
|
|
- for(let i=0;i<self.searchData.searchList.length;i++){
|
|
|
- if(self.searchState){
|
|
|
- //高级搜索
|
|
|
+ //按钮方法
|
|
|
+ buttonClick(type){
|
|
|
+ let self = this;
|
|
|
+ if(type == '1'){
|
|
|
+ //查找
|
|
|
+ let obj = {};
|
|
|
+ for(let i=0;i<self.searchData.searchList.length;i++){
|
|
|
+ if(self.searchState){
|
|
|
+ //高级搜索
|
|
|
+ obj[self.searchData.searchList[i].key] = self.searchData.searchList[i].value;
|
|
|
+ }else{
|
|
|
+ //普通搜索
|
|
|
+ if(self.searchData.searchList[i].level == '1'){
|
|
|
obj[self.searchData.searchList[i].key] = self.searchData.searchList[i].value;
|
|
|
- }else{
|
|
|
- //普通搜索
|
|
|
- if(self.searchData.searchList[i].level == '1'){
|
|
|
- obj[self.searchData.searchList[i].key] = self.searchData.searchList[i].value;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- self.$parent.searchClick(type,obj);
|
|
|
- }else if(type == '2'){
|
|
|
- //返回
|
|
|
- for(let i=0;i<self.searchData.searchList.length;i++){
|
|
|
- self.searchData.searchList[i].value = '';
|
|
|
- }
|
|
|
- self.$parent.searchClick(type);
|
|
|
- }else{
|
|
|
- self.$parent.searchClick(type);
|
|
|
}
|
|
|
- },
|
|
|
- }
|
|
|
+ self.$parent.searchClick(type,obj);
|
|
|
+ }else if(type == '2'){
|
|
|
+ //返回
|
|
|
+ for(let i=0;i<self.searchData.searchList.length;i++){
|
|
|
+ self.searchData.searchList[i].value = '';
|
|
|
+ }
|
|
|
+ self.$parent.searchClick(type);
|
|
|
+ }else{
|
|
|
+ self.$parent.searchClick(type);
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .advancedSearchMaxBigBox{
|
|
|
+.advancedSearchMaxBigBox{
|
|
|
+ margin:0 20px;
|
|
|
+ .advanced-button{
|
|
|
margin:0 20px;
|
|
|
- .advanced-button{
|
|
|
- margin:0 20px;
|
|
|
- cursor: pointer;
|
|
|
- line-height:40px;
|
|
|
- font-weight:500;
|
|
|
- font-size:14px;
|
|
|
- color:#0183FA;
|
|
|
+ cursor: pointer;
|
|
|
+ line-height:40px;
|
|
|
+ font-weight:500;
|
|
|
+ font-size:14px;
|
|
|
+ color:#0183FA;
|
|
|
+ }
|
|
|
+ .advanced-max-big-box{
|
|
|
+ display: flex;
|
|
|
+ padding-bottom:20px;
|
|
|
+ padding-right:10px;
|
|
|
+ font-size:14px;
|
|
|
+ .left-advanced-box{
|
|
|
+ flex:1;
|
|
|
}
|
|
|
- .advanced-max-big-box{
|
|
|
- display: flex;
|
|
|
- padding-bottom:20px;
|
|
|
- padding-right:10px;
|
|
|
- font-size:14px;
|
|
|
- .left-advanced-box{
|
|
|
- flex:1;
|
|
|
- }
|
|
|
- .center-advanced-box{
|
|
|
+ .center-advanced-box{
|
|
|
|
|
|
- }
|
|
|
- .right-advanced-box{
|
|
|
- flex:1;
|
|
|
- .ordinary-button{
|
|
|
- margin:0 20px;
|
|
|
- cursor: pointer;
|
|
|
- line-height:40px;
|
|
|
- font-weight:500;
|
|
|
- font-size:14px;
|
|
|
- color:#0183FA;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
- .form-dropdown-box{
|
|
|
- display: flex;
|
|
|
- margin:0;
|
|
|
- padding:0 10px;
|
|
|
- cursor: pointer;
|
|
|
- height:40px;
|
|
|
- img:nth-child(1){
|
|
|
- width:16px;
|
|
|
- height:16px;
|
|
|
- margin-top:12px;
|
|
|
- }
|
|
|
- p{
|
|
|
- width:47px;
|
|
|
- text-align: center;
|
|
|
- font-size:14px;
|
|
|
- margin:0;
|
|
|
+ .right-advanced-box{
|
|
|
+ flex:1;
|
|
|
+ .ordinary-button{
|
|
|
+ margin:0 20px;
|
|
|
+ cursor: pointer;
|
|
|
line-height:40px;
|
|
|
+ font-weight:500;
|
|
|
+ font-size:14px;
|
|
|
+ color:#0183FA;
|
|
|
}
|
|
|
- img:nth-child(3){
|
|
|
- width:10px;
|
|
|
- height:6px;
|
|
|
- margin-top:17px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+ .form-dropdown-box{
|
|
|
+ display: flex;
|
|
|
+ margin:0;
|
|
|
+ padding:0 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ height:40px;
|
|
|
+ img:nth-child(1){
|
|
|
+ width:16px;
|
|
|
+ height:16px;
|
|
|
+ margin-top:12px;
|
|
|
+ }
|
|
|
+ p{
|
|
|
+ width:47px;
|
|
|
+ text-align: center;
|
|
|
+ font-size:14px;
|
|
|
+ margin:0;
|
|
|
+ line-height:40px;
|
|
|
+ }
|
|
|
+ img:nth-child(3){
|
|
|
+ width:10px;
|
|
|
+ height:6px;
|
|
|
+ margin-top:17px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
- .advancedSearchMaxBigBox{
|
|
|
- .el-range-editor--medium.el-input__inner{
|
|
|
- height:40px;
|
|
|
- }
|
|
|
+.advancedSearchMaxBigBox{
|
|
|
+ .el-range-editor--medium.el-input__inner{
|
|
|
+ height:40px;
|
|
|
}
|
|
|
+}
|
|
|
</style>
|