优化表头检索
This commit is contained in:
parent
afeff6d053
commit
377702dc12
@ -5,15 +5,15 @@ NODE_ENV = production
|
|||||||
VUE_APP_TITLE = 象纬云科
|
VUE_APP_TITLE = 象纬云科
|
||||||
|
|
||||||
# 测试环境
|
# 测试环境
|
||||||
# VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1
|
VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1
|
||||||
# VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1
|
VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1
|
||||||
# VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss
|
VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss
|
||||||
# VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss
|
VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss
|
||||||
|
|
||||||
# 线上环境
|
# 线上环境
|
||||||
# 接口地址 # WS地址
|
# 接口地址 # WS地址
|
||||||
VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1
|
# VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1
|
||||||
VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1
|
# VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1
|
||||||
VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss
|
# VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss
|
||||||
VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss
|
# VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss
|
||||||
|
|
||||||
|
|||||||
13
src/assets/icons/Filter.vue
Normal file
13
src/assets/icons/Filter.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<svg t="1734317431398" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6152" width="200" height="200"><path d="M949.7244448 88.33422187A56.576 56.576 0 0 0 898.8444448 56.88888853H125.1555552a56.88888853 56.88888853 0 0 0-45.5111104 91.02222294l295.82222187 394.432V944.3555552a22.7555552 22.7555552 0 0 0 31.2035552 21.12711147l227.55555626-91.02222187A22.7555552 22.7555552 0 0 0 648.53333333 853.33333333V542.34311147L944.3555552 147.91111147a56.576 56.576 0 0 0 5.3688896-59.5768896z" fill="" p-id="6153"></path></svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: ""
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -13,6 +13,7 @@ export { default as UploadExcel } from './UploadExcel.vue'
|
|||||||
export { default as Download } from './Download.vue'
|
export { default as Download } from './Download.vue'
|
||||||
export { default as Bell } from './Bell.vue'
|
export { default as Bell } from './Bell.vue'
|
||||||
export { default as Full } from './Full.vue'
|
export { default as Full } from './Full.vue'
|
||||||
|
export { default as Filter } from './Filter.vue'
|
||||||
export { default as Refresh } from './Refresh.vue'
|
export { default as Refresh } from './Refresh.vue'
|
||||||
export { default as Search } from './Search.vue'
|
export { default as Search } from './Search.vue'
|
||||||
export { default as Account } from './Account.vue'
|
export { default as Account } from './Account.vue'
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="scDatePicker">
|
<div class="scDatePicker">
|
||||||
<el-date-picker v-bind="$attrs" class="input" v-model="localDatePicker" @change="dateChange" @input="emitActivationDate" type="daterange" :size="size"
|
<el-date-picker ref="datePicker" v-bind="$attrs" class="input" v-model="localDatePicker" @change="dateChange" @input="emitActivationDate" type="daterange" :size="size"
|
||||||
:popper-options="{ placement: 'bottom-start' }" :start-placeholder="startPlaceholder" :end-placeholder="endPlaceholder" clearable
|
:popper-options="{ placement: 'bottom-start' }" :start-placeholder="startPlaceholder" :end-placeholder="endPlaceholder" clearable
|
||||||
:default-time="defaultTime"
|
:default-time="defaultTime"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
@ -32,15 +32,21 @@ export default {
|
|||||||
handler(val){
|
handler(val){
|
||||||
if(!val || val.value.length == 0){
|
if(!val || val.value.length == 0){
|
||||||
this.localDatePicker = [];
|
this.localDatePicker = [];
|
||||||
|
}else{
|
||||||
|
this.localDatePicker = val.value.map((date,index)=> index===0? this.$TOOL.getStartTime(date):this.$TOOL.getEndTime(date));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
immediate:true,
|
||||||
deep:true
|
deep:true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
localDatePicker:[],
|
localDatePicker:[],
|
||||||
defaultTime:[new Date(2000, 1, 1, 0, 0, 0),new Date(2000, 1, 1, 23, 59, 59)]
|
defaultTime:[
|
||||||
|
new Date(2000, 1, 1, 0, 0, 0),
|
||||||
|
new Date(2000, 1, 1, 23, 59, 59)
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -52,9 +58,10 @@ export default {
|
|||||||
this.emitActivationDate();
|
this.emitActivationDate();
|
||||||
},
|
},
|
||||||
emitActivationDate() {
|
emitActivationDate() {
|
||||||
|
let date = this.localDatePicker.map((date,index) => index===0? this.$TOOL.formatStartTime(date):this.$TOOL.formatEndTime(date));
|
||||||
this.$emit('update:activation_date', {
|
this.$emit('update:activation_date', {
|
||||||
operator: this.activation_date.operator,
|
operator: this.activation_date.operator,
|
||||||
value: this.localDatePicker && this.localDatePicker.length > 0? this.localDatePicker.map(date => this.$TOOL.getTime(date)):[]
|
value: this.localDatePicker && this.localDatePicker.length > 0? date:[]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="visible=false">取 消</el-button>
|
<el-button @click="visible=false">取 消</el-button>
|
||||||
<el-button type="primary" :disabled="!importTrue || progressShow" @click="save">确定导入</el-button>
|
<el-button type="primary" :disabled="!importTrue || progressShow || httpDisabled" @click="save">确定导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -72,7 +72,8 @@ export default {
|
|||||||
props:{
|
props:{
|
||||||
size:{type:String, default:'small'},
|
size:{type:String, default:'small'},
|
||||||
title:{type:String, default: ""},
|
title:{type:String, default: ""},
|
||||||
type:{type:[String, Number], default: ""}
|
type:{type:[String, Number], default: ""},
|
||||||
|
httpDisabled:{type:Boolean, default:false}
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default {
|
|||||||
default: ()=>({ operator: "link", value: "" })
|
default: ()=>({ operator: "link", value: "" })
|
||||||
},
|
},
|
||||||
size:{ type: String, default: "small" },
|
size:{ type: String, default: "small" },
|
||||||
placeholder:{type:String, default:"请输入关键字"},
|
placeholder:{type:String, default:"请输入"},
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
activation_text:{
|
activation_text:{
|
||||||
@ -30,6 +30,7 @@ export default {
|
|||||||
this.localText = val.value.replace(/%/g, "");
|
this.localText = val.value.replace(/%/g, "");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
immediate:true,
|
||||||
deep:true
|
deep:true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -49,7 +50,7 @@ export default {
|
|||||||
emitActivationText() {
|
emitActivationText() {
|
||||||
this.$emit('update:activation_text', {
|
this.$emit('update:activation_text', {
|
||||||
operator: this.activation_text.operator,
|
operator: this.activation_text.operator,
|
||||||
value: this.localText? '%'+this.localText+'%':""
|
value: this.localText ? this.activation_text.operator==="="?this.localText:'%'+this.localText+'%':""
|
||||||
});
|
});
|
||||||
this.$emit('fetchData');
|
this.$emit('fetchData');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,8 +30,11 @@ export default {
|
|||||||
handler(val){
|
handler(val){
|
||||||
if(!val || val.value.length == 0){
|
if(!val || val.value.length == 0){
|
||||||
this.localData = [];
|
this.localData = [];
|
||||||
|
}else{
|
||||||
|
this.localData = val.value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
immediate:true,
|
||||||
deep:true
|
deep:true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -56,6 +59,7 @@ export default {
|
|||||||
operator: this.activation_select.operator,
|
operator: this.activation_select.operator,
|
||||||
value: this.localData? this.localData:[]
|
value: this.localData? this.localData:[]
|
||||||
});
|
});
|
||||||
|
this.$emit('changeSelectData');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,8 +69,8 @@ export default {
|
|||||||
.scSelect{
|
.scSelect{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
:deep(.el-input){
|
:deep(.el-input){
|
||||||
height: 28px;
|
height: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -3,12 +3,15 @@
|
|||||||
<div class="setting-column__title">
|
<div class="setting-column__title">
|
||||||
<span class="move_b"></span>
|
<span class="move_b"></span>
|
||||||
<span class="show_b">显示</span>
|
<span class="show_b">显示</span>
|
||||||
|
<span class="search_b">检索</span>
|
||||||
<span class="name_b">名称</span>
|
<span class="name_b">名称</span>
|
||||||
<span class="width_b">宽度</span>
|
<span class="width_b">宽度</span>
|
||||||
|
<span class="type_b">类型</span>
|
||||||
<span class="sortable_b">排序</span>
|
<span class="sortable_b">排序</span>
|
||||||
<span class="fixed_b">固定</span>
|
<span class="fixed_b">固定</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-column__list" ref="list">
|
<div class="setting-column__list" ref="list">
|
||||||
|
<el-scrollbar max-height="314px">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="item in usercolumn" :key="item.prop">
|
<li v-for="item in usercolumn" :key="item.prop">
|
||||||
<span class="move_b">
|
<span class="move_b">
|
||||||
@ -17,10 +20,21 @@
|
|||||||
<span class="show_b">
|
<span class="show_b">
|
||||||
<el-switch v-model="item.hide" :active-value="false" :inactive-value="true"></el-switch>
|
<el-switch v-model="item.hide" :active-value="false" :inactive-value="true"></el-switch>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="search_b">
|
||||||
|
<el-switch v-model="item.is_search" :active-value="true" :inactive-value="false"></el-switch>
|
||||||
|
</span>
|
||||||
<span class="name_b" :title="item.prop">{{ item.label }}</span>
|
<span class="name_b" :title="item.prop">{{ item.label }}</span>
|
||||||
<span class="width_b">
|
<span class="width_b">
|
||||||
<el-input v-model="item.width" placeholder="auto" size="small"></el-input>
|
<el-input v-model="item.width" placeholder="auto" size="small"></el-input>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="type_b">
|
||||||
|
<el-select v-model="item.condition" size="small">
|
||||||
|
<el-option value="link"></el-option>
|
||||||
|
<el-option value="in"></el-option>
|
||||||
|
<el-option value="between"></el-option>
|
||||||
|
<el-option value="="></el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
<span class="sortable_b">
|
<span class="sortable_b">
|
||||||
<el-switch v-model="item.sortable"></el-switch>
|
<el-switch v-model="item.sortable"></el-switch>
|
||||||
</span>
|
</span>
|
||||||
@ -29,6 +43,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-column__bottom">
|
<div class="setting-column__bottom">
|
||||||
<el-button @click="backDefaul" :disabled="isSave">重置</el-button>
|
<el-button @click="backDefaul" :disabled="isSave">重置</el-button>
|
||||||
@ -46,7 +61,7 @@
|
|||||||
Sortable
|
Sortable
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
column: { type: Object, default: () => {} }
|
column: { type: [Object,Array], default: () => {} }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -57,8 +72,9 @@
|
|||||||
watch:{
|
watch:{
|
||||||
usercolumn: {
|
usercolumn: {
|
||||||
handler(){
|
handler(){
|
||||||
this.$emit('userChange', this.usercolumn)
|
// this.$emit('userChange', this.usercolumn)
|
||||||
},
|
},
|
||||||
|
immediate:false,
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -97,18 +113,22 @@
|
|||||||
.setting-column__title span {display: inline-block;font-weight: bold;color: #909399;font-size: 12px;}
|
.setting-column__title span {display: inline-block;font-weight: bold;color: #909399;font-size: 12px;}
|
||||||
.setting-column__title span.move_b {width: 30px;margin-right:15px;}
|
.setting-column__title span.move_b {width: 30px;margin-right:15px;}
|
||||||
.setting-column__title span.show_b {width: 60px;}
|
.setting-column__title span.show_b {width: 60px;}
|
||||||
|
.setting-column__title span.search_b {width: 60px;}
|
||||||
.setting-column__title span.name_b {width: 140px;}
|
.setting-column__title span.name_b {width: 140px;}
|
||||||
.setting-column__title span.width_b {width: 60px;margin-right:15px;}
|
.setting-column__title span.width_b {width: 60px;margin-right:15px;}
|
||||||
|
.setting-column__title span.type_b {width: 80px;margin-right:15px;}
|
||||||
.setting-column__title span.sortable_b {width: 60px;}
|
.setting-column__title span.sortable_b {width: 60px;}
|
||||||
.setting-column__title span.fixed_b {width: 60px;}
|
.setting-column__title span.fixed_b {width: 60px;}
|
||||||
|
|
||||||
.setting-column__list {max-height:314px;overflow: auto;}
|
.setting-column__list {max-height:314px;}
|
||||||
.setting-column__list li {list-style: none;margin:10px 0;display: flex;align-items: center;}
|
.setting-column__list li {list-style: none;margin:10px 0;display: flex;align-items: center;}
|
||||||
.setting-column__list li>span {display: inline-block;font-size: 12px;}
|
.setting-column__list li>span {display: inline-block;font-size: 12px;}
|
||||||
.setting-column__list li span.move_b {width: 30px;margin-right:15px;}
|
.setting-column__list li span.move_b {width: 30px;margin-right:15px;}
|
||||||
.setting-column__list li span.show_b {width: 60px;}
|
.setting-column__list li span.show_b {width: 60px;}
|
||||||
|
.setting-column__list li span.search_b {width: 60px;}
|
||||||
.setting-column__list li span.name_b {width: 140px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;cursor:default;}
|
.setting-column__list li span.name_b {width: 140px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;cursor:default;}
|
||||||
.setting-column__list li span.width_b {width: 60px;margin-right:15px;}
|
.setting-column__list li span.width_b {width: 60px;margin-right:15px;}
|
||||||
|
.setting-column__list li span.type_b {width: 80px;margin-right:15px;}
|
||||||
.setting-column__list li span.sortable_b {width: 60px;}
|
.setting-column__list li span.sortable_b {width: 60px;}
|
||||||
.setting-column__list li span.fixed_b {width: 60px;}
|
.setting-column__list li span.fixed_b {width: 60px;}
|
||||||
.setting-column__list li.ghost {opacity: 0.3;}
|
.setting-column__list li.ghost {opacity: 0.3;}
|
||||||
|
|||||||
162
src/components/scTable/components/headerSearch.vue
Normal file
162
src/components/scTable/components/headerSearch.vue
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<div class="headerSearch" v-for="(item,index) in columnList" :key="item">
|
||||||
|
<div class="searchItem" v-if="item.search_type == 'date_range' && (searchShow || (!searchShow && index<4)) && !item.hide">
|
||||||
|
<label class="name">{{item.label}}</label>
|
||||||
|
<scDatePicker :size="size" v-model:activation_date="params[item.prop]" @change="changeData" @visible-change="getSelect(item,$event)" start-placeholder="开始日期" end-placeholder="结束日期"></scDatePicker>
|
||||||
|
</div>
|
||||||
|
<div class="searchItem" v-if="item.search_type =='checkbox' && (searchShow || (!searchShow && index<4)) && !item.hide">
|
||||||
|
<label class="name">{{item.label}}</label>
|
||||||
|
<scMultipleSelect :size="size" v-model:activation_select="params[item.prop]" @changeSelectData="changeData" @fetchData="getSelect(item,$event)" :placeholder="'请选择'+item.label" multiple collapse-tags filterable clearable>
|
||||||
|
<el-option v-for="em in item.data" :key="em" :label="em.label" :value="em.value || em.id"></el-option>
|
||||||
|
</scMultipleSelect>
|
||||||
|
</div>
|
||||||
|
<div class="searchItem" v-if="item.search_type == 'select' && (searchShow || (!searchShow && index<4)) && !item.hide">
|
||||||
|
<label class="name">{{item.label}}</label>
|
||||||
|
<el-select class="input" :size="size" v-model="params[item.prop]" @change="changeData" @visible-change="getSelect(item,$event)" :placeholder="'请选择'+item.label" filterable clearable>
|
||||||
|
<el-option v-for="em in item.data" :key="em" :label="em.label " :value="em[item.code[0]] || em.active_status"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="searchItem" v-if="item.search_type == 'text' && (searchShow || (!searchShow && index<4)) && !item.hide">
|
||||||
|
<label class="name">{{item.label}}</label>
|
||||||
|
<div>
|
||||||
|
<scVgInput class="input" v-model:activation_text="params[item.prop]" @fetchData="getText(item,$event)" :placeholder="'请输入'+item.label" :size="size"></scVgInput>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {eventBus} from "@/utils/eventBus";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "headerSearch",
|
||||||
|
emits: ['fetchSelectData','changeHeaderData'],
|
||||||
|
props:{
|
||||||
|
searchList:{type: Array},
|
||||||
|
paramsData:{type: Object,default:()=>{}},
|
||||||
|
searchShow:{type: Boolean,default:false},
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
searchList:{
|
||||||
|
handler(val){
|
||||||
|
if(val && val.length>0){
|
||||||
|
this.columnList = val.filter(em=> !em.hide);
|
||||||
|
this.params = this.groupByType(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate:true,
|
||||||
|
deep:true
|
||||||
|
},
|
||||||
|
paramsData:{
|
||||||
|
handler(val){
|
||||||
|
if(val){
|
||||||
|
this.params = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate:true,
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
keywordParams:{
|
||||||
|
handler(val) {
|
||||||
|
for(let i in this.params){
|
||||||
|
if(this.params[i].keyword){
|
||||||
|
this.params[i].value = val===""?"":'%'+val+'%';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
size:"small",
|
||||||
|
columnList:this.searchList,
|
||||||
|
selectItem:'',
|
||||||
|
selectShow:false,
|
||||||
|
|
||||||
|
params:{},
|
||||||
|
keywordParams:"",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
changeData(){
|
||||||
|
this.$emit('changeHeaderData',this.params);
|
||||||
|
},
|
||||||
|
getSelect(item,e){
|
||||||
|
if(!e) return
|
||||||
|
this.$emit('fetchSelectData',{data:item,params:this.params});
|
||||||
|
eventBus.$emit('close-all-popovers');
|
||||||
|
},
|
||||||
|
getText(item){
|
||||||
|
this.$emit('fetchSelectData',{data:item,params:this.params});
|
||||||
|
eventBus.$emit('close-all-popovers');
|
||||||
|
},
|
||||||
|
reload(){
|
||||||
|
this.keywordParams = "";
|
||||||
|
for(let i in this.params){
|
||||||
|
if(typeof this.params[i] === "object" && this.params[i] !=null){
|
||||||
|
if(typeof this.params[i].value == "string"){
|
||||||
|
this.params[i].value = "";
|
||||||
|
}else{
|
||||||
|
this.params[i].value = [];
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.params[i] = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
groupByType(list){
|
||||||
|
const grouped = {};
|
||||||
|
list.forEach(item=>{
|
||||||
|
if (!grouped[item.prop]) {
|
||||||
|
if(typeof item.prop == 'string'){
|
||||||
|
grouped[item.prop] = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.search_type === 'text' && Array.isArray(item.prop)) {
|
||||||
|
item.code.forEach(code => {
|
||||||
|
if(!grouped[code]){
|
||||||
|
grouped[code] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
let params = {};
|
||||||
|
if(item.keyword){
|
||||||
|
params = {
|
||||||
|
keyword:true,
|
||||||
|
operator:'like',
|
||||||
|
value:""
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
params = {
|
||||||
|
operator:'like',
|
||||||
|
value:""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
grouped[code] = params;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let params = {
|
||||||
|
operator:item.condition,
|
||||||
|
value:item.condition=='like' || item.condition == "="?"":[]
|
||||||
|
}
|
||||||
|
grouped[item.prop] = item.condition=='' || item.condition== 'link'?"":params;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
for(let i in grouped){
|
||||||
|
if(this.params[i]){
|
||||||
|
grouped[i].value = this.params[i].value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return grouped
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
252
src/components/scTable/components/typePopover.vue
Normal file
252
src/components/scTable/components/typePopover.vue
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
<template>
|
||||||
|
<div class="popoverBox">
|
||||||
|
<el-popover :visible="visible" placement="bottom-end" :ref="`popover-${columnIndex}`" popper-class="customPopper">
|
||||||
|
<template #reference>
|
||||||
|
<span v-if="column.is_search && !column.hide" class="label" :class="filterModelParams.data[column.prop] && filterModelParams.data[column.prop].value!=''?'labelColor':''" style=" cursor: pointer;" @click.stop="clickShow(column)">
|
||||||
|
<span class="name">{{ column.label }}</span>
|
||||||
|
<el-icon class="sc-trend-icon"><sc-icon-Filter /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span v-else class="label name" @click.stop>
|
||||||
|
{{ column.label }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<!-- text 文本 -->
|
||||||
|
<div v-if="column.search_type == 'text'" @click.stop>
|
||||||
|
<el-input type="textarea" :autosize="{ minRows: 1, maxRows: 6 }" :size="size" clearable v-model="filterValue" placeholder="请输入查询内容" @clear="filterClear"></el-input>
|
||||||
|
</div>
|
||||||
|
<!-- date 单个日期-->
|
||||||
|
<div v-else-if="column.search_type == 'date'" @click.stop>
|
||||||
|
<el-date-picker v-model="filterValue" type="date" placeholder="选择日期" :size="size" format="YYYY-MM-DD" @clear="filterClear" />
|
||||||
|
</div>
|
||||||
|
<!-- datetime 日期时间-->
|
||||||
|
<div v-else-if="column.search_type == 'datetime'" @click.stop>
|
||||||
|
<el-date-picker v-model="filterValue" type="datetime" :size="size" placeholder="选择日期时间" format="YYYY-MM-DD HH:mm:ss" @clear="filterClear" />
|
||||||
|
</div>
|
||||||
|
<!-- date_range 日期范围-->
|
||||||
|
<div v-else-if="column.search_type == 'date_range'" @click.stop>
|
||||||
|
<el-date-picker v-model="filterValue" type="daterange" :size="size" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" @change="dateChange"></el-date-picker>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- select 下拉选择-->
|
||||||
|
<div v-else-if="column.search_type == 'select'" @click.stop>
|
||||||
|
<el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter @clear="filterClear" @visible-change="visibleChange(column,$event)">
|
||||||
|
<el-option v-for="(item, index) in column && column.data" :key="index" :label="item.label" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- select 多选下拉选择-->
|
||||||
|
<div v-else-if="column.search_type == 'checkbox'" @click.stop>
|
||||||
|
<el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter multiple collapse-tags @clear="filterClear" @visible-change="visibleChange(column,$event)">
|
||||||
|
<el-option v-for="(item, index) in column && column.data" :key="index" :label="item.label" :value="item.value || item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="text-align: right;display: flex;justify-content: flex-end;">
|
||||||
|
<el-button class="confirm" :size="size" @click="closeVisible">取消</el-button>
|
||||||
|
<el-button @click="confirm()" type="primary" :size="size" class="confirm">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* 逻辑 => 希望每次只打开一个 选择的数组都有 filterList 接收 每次只传当前选择的数据过来
|
||||||
|
* */
|
||||||
|
import { inject } from "vue";
|
||||||
|
import {eventBus} from "@/utils/eventBus"
|
||||||
|
export default {
|
||||||
|
name: 'typePopover',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
size: 'small',
|
||||||
|
checkedColumn: {},
|
||||||
|
filterValue: '',
|
||||||
|
allowedRange: { start: null, end: null }, // 动态允许的日期范围
|
||||||
|
defaultTime:[
|
||||||
|
new Date(2000, 1, 1, 0, 0, 0),
|
||||||
|
new Date(2000, 2, 1, 23, 59, 59),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
|
||||||
|
},
|
||||||
|
props: ['column', 'columnIndex'], // column 当前表头 columnIndex 弹框下标
|
||||||
|
setup() {
|
||||||
|
const filterUploadClick = inject('filterUploadClick', () => { });
|
||||||
|
const filterUploadParams = inject('filterUploadParams', () => { });
|
||||||
|
const filterTagClose = inject('filterTagClose', () => { });
|
||||||
|
const filterModelParams = inject('filterModelParams', ()=>{});
|
||||||
|
|
||||||
|
return { filterUploadClick, filterUploadParams, filterTagClose, filterModelParams };
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
eventBus.$on('close-all-popovers', this.closePopover);
|
||||||
|
eventBus.$on('reset-popovers', this.resetFilter);
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
eventBus.$off('close-all-popovers', this.closePopover);
|
||||||
|
eventBus.$off('reset-popovers', this.resetFilter);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickShow(column) {
|
||||||
|
const wasVisible = this.visible;
|
||||||
|
eventBus.$emit('close-all-popovers');
|
||||||
|
this.visible = !wasVisible;
|
||||||
|
if (this.visible) {
|
||||||
|
this.checkedColumn = column;
|
||||||
|
if (this.filterModelParams && this.filterModelParams.data && this.filterModelParams.data[column.prop]) {
|
||||||
|
switch (column.search_type){
|
||||||
|
case "text":
|
||||||
|
this.filterValue = this.filterModelParams.data[column.prop].value.replace(/%/g, "");
|
||||||
|
break;
|
||||||
|
case "date_range":
|
||||||
|
this.filterValue = this.filterModelParams.data[column.prop].value.map((date,index)=> index===0? this.$TOOL.getStartTime(date):this.$TOOL.getEndTime(date))
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.filterValue = this.filterModelParams.data[column.prop].value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
visibleChange(item,e) {
|
||||||
|
if(!(e && this.filterUploadClick)) return
|
||||||
|
let params = {
|
||||||
|
operator:item.condition,
|
||||||
|
value:this.filterValue?this.filterValue:[]
|
||||||
|
}
|
||||||
|
this.filterUploadClick({data:item,params:{[item.prop]:params}});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 确定时 判断是选择类型 radio checkbox 获取列表的 name
|
||||||
|
* */
|
||||||
|
confirm() {
|
||||||
|
this.visible = false;
|
||||||
|
if (!this.filterValue || this.filterValue === "") {
|
||||||
|
this.filterValue = "";
|
||||||
|
if(this.checkedColumn.search_type !== "text"){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
operator:this.checkedColumn.condition,
|
||||||
|
value:""
|
||||||
|
}
|
||||||
|
switch (this.checkedColumn.search_type){
|
||||||
|
case 'text':
|
||||||
|
params.value = this.filterValue?this.checkedColumn.condition==="="?this.filterValue:'%'+this.filterValue+'%':""
|
||||||
|
break;
|
||||||
|
case 'date_range':
|
||||||
|
params.value = this.filterValue.map((date,index) => index===0? this.$TOOL.formatStartTime(date):this.$TOOL.formatEndTime(date));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
params.value = this.filterValue;
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.filterUploadParams({[this.checkedColumn.prop]:params});
|
||||||
|
},
|
||||||
|
closeVisible(){
|
||||||
|
this.visible = false;
|
||||||
|
// this.$nextTick(()=>{
|
||||||
|
// this.$refs['popover-'+this.columnIndex].hide();
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
closePopover() {
|
||||||
|
this.visible = false;
|
||||||
|
// this.$nextTick(()=>{
|
||||||
|
// this.$refs['popover-'+this.columnIndex].hide();
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
/** 日期清空的处理 */
|
||||||
|
dateChange(val) {
|
||||||
|
if (val === null) {
|
||||||
|
this.filterClear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 清空 */
|
||||||
|
filterClear() {
|
||||||
|
let params = {
|
||||||
|
operator: this.checkedColumn.condition,
|
||||||
|
value: '',
|
||||||
|
}
|
||||||
|
switch (this.checkedColumn.search_type){
|
||||||
|
case 'text':
|
||||||
|
params.value = this.filterValue?this.checkedColumn.condition==="="?this.filterValue:'%'+this.filterValue+'%':""
|
||||||
|
break;
|
||||||
|
case 'date_range':
|
||||||
|
params.value = this.filterValue.length>0? this.filterValue.map((date,index) => index===0? this.$TOOL.formatStartTime(date):this.$TOOL.formatEndTime(date)):[];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
params.value = this.filterValue;
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.filterTagClose(params);
|
||||||
|
},
|
||||||
|
/** 重置输入框值 */
|
||||||
|
resetFilter(){
|
||||||
|
this.filterValue = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.popoverBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
.label{
|
||||||
|
width: 100%;
|
||||||
|
.el-icon{
|
||||||
|
flex-basis: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #a8abb2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
flex: 1;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.labelColor {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-checkbox-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
max-height: 150px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -13,8 +13,13 @@
|
|||||||
<el-table v-bind="$attrs" :header-cell-style="{'background': '#F5F7FA','color':'#606266'}" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable" :height="height=='auto'?null:'100%'" :size="config.size" :border="config.config.border" :stripe="config.config.stripe" :summary-method="remoteSummary?remoteSummaryMethod:summaryMethod" @sort-change="sortChange" @filter-change="filterChange" @header-dragend="headerDragend">
|
<el-table v-bind="$attrs" :header-cell-style="{'background': '#F5F7FA','color':'#606266'}" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable" :height="height=='auto'?null:'100%'" :size="config.size" :border="config.config.border" :stripe="config.config.stripe" :summary-method="remoteSummary?remoteSummaryMethod:summaryMethod" @sort-change="sortChange" @filter-change="filterChange" @header-dragend="headerDragend">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(item, index) in userColumn" :key="index">
|
<template v-for="(item, index) in userColumn" :key="index">
|
||||||
<!--item.showOverflowTooltip-->
|
|
||||||
<el-table-column v-if="!item.hide" :column-key="item.prop" :label="item.label" :prop="item.prop" :width="item.width" :sortable="item.sortable" :fixed="item.fix" :filters="item.filters" :filter-method="remoteFilter||!item.filters?null:filterHandler" :show-overflow-tooltip="true">
|
<el-table-column v-if="!item.hide" :column-key="item.prop" :label="item.label" :prop="item.prop" :width="item.width" :sortable="item.sortable" :fixed="item.fix" :filters="item.filters" :filter-method="remoteFilter||!item.filters?null:filterHandler" :show-overflow-tooltip="true">
|
||||||
|
<template #header>
|
||||||
|
<div style="display: inline-block;width: 100%;" v-if="item.is_search && !item.hide">
|
||||||
|
<type-popover ref="popoverRef" :columnIndex="index" :column="item"></type-popover>
|
||||||
|
</div>
|
||||||
|
<span v-else>{{ item.label }}</span>
|
||||||
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<slot :name="item.prop" v-bind="scope">
|
<slot :name="item.prop" v-bind="scope">
|
||||||
{{scope.row[item.prop]}}
|
{{scope.row[item.prop]}}
|
||||||
@ -37,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="scTable-do" v-if="!hideDo">
|
<div class="scTable-do" v-if="!hideDo">
|
||||||
<el-button v-if="!hideRefresh" @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
<el-button v-if="!hideRefresh" @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
||||||
<el-popover v-if="column" placement="top" title="列设置" :width="500" trigger="click" :hide-after="0" @show="customColumnShow=true" @after-leave="customColumnShow=false">
|
<el-popover v-if="column" placement="top" title="列设置" :width="630" trigger="click" :hide-after="0" @show="customColumnShow=true" @after-leave="customColumnShow=false">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button icon="el-icon-set-up" circle style="margin-left:15px"></el-button>
|
<el-button icon="el-icon-set-up" circle style="margin-left:15px"></el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -69,11 +74,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import config from "@/config/table";
|
import config from "@/config/table";
|
||||||
import columnSetting from './columnSetting'
|
import columnSetting from './columnSetting'
|
||||||
|
import TypePopover from './components/typePopover'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'scTable',
|
name: 'scTable',
|
||||||
components: {
|
components: {
|
||||||
columnSetting
|
columnSetting,
|
||||||
|
TypePopover
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
tableName: { type: String, default: "" },
|
tableName: { type: String, default: "" },
|
||||||
@ -239,6 +246,7 @@
|
|||||||
}
|
}
|
||||||
if(response.data.columnConfig){
|
if(response.data.columnConfig){
|
||||||
this.userColumn = response.data.columnConfig; // 表头获取
|
this.userColumn = response.data.columnConfig; // 表头获取
|
||||||
|
this.$emit('columnBack',this.userColumn);
|
||||||
}
|
}
|
||||||
if(response.data.tableConfig && response.data.tableConfig.size){
|
if(response.data.tableConfig && response.data.tableConfig.size){
|
||||||
this.config = response.data.tableConfig;
|
this.config = response.data.tableConfig;
|
||||||
@ -295,13 +303,18 @@
|
|||||||
async columnSettingSave(userColumn){
|
async columnSettingSave(userColumn){
|
||||||
this.$refs.columnSetting.isSave = true
|
this.$refs.columnSetting.isSave = true
|
||||||
try {
|
try {
|
||||||
await config.columnSettingSave(this.tableName, userColumn,this.apiObj);
|
const column = await config.columnSettingSave(this.tableName, userColumn,this.apiObj);
|
||||||
this.$message.success('保存成功')
|
if(column){
|
||||||
|
this.$message.success('保存成功');
|
||||||
|
|
||||||
|
this.userColumn = JSON.parse(JSON.stringify(userColumn));
|
||||||
|
this.$emit('columnBack',this.userColumn);
|
||||||
|
this.$refs.columnSetting.isSave = false
|
||||||
|
}
|
||||||
}catch(error){
|
}catch(error){
|
||||||
this.$message.error('保存失败')
|
this.$message.error('保存失败')
|
||||||
this.$refs.columnSetting.isSave = false
|
this.$refs.columnSetting.isSave = false
|
||||||
}
|
}
|
||||||
this.$refs.columnSetting.isSave = false
|
|
||||||
},
|
},
|
||||||
//自定义列重置
|
//自定义列重置
|
||||||
async columnSettingBack(userColumn){
|
async columnSettingBack(userColumn){
|
||||||
@ -309,14 +322,17 @@
|
|||||||
try {
|
try {
|
||||||
const column = await config.columnSettingReset(this.tableName, userColumn,this.apiObj)
|
const column = await config.columnSettingReset(this.tableName, userColumn,this.apiObj)
|
||||||
if(column){
|
if(column){
|
||||||
this.userColumn = column
|
this.userColumn = column;
|
||||||
this.$refs.columnSetting.usercolumn = JSON.parse(JSON.stringify(this.userColumn||[]))
|
this.$refs.columnSetting.usercolumn = JSON.parse(JSON.stringify(this.userColumn||[]));
|
||||||
|
|
||||||
|
this.$emit('columnBack',this.userColumn);
|
||||||
|
this.$refs.columnSetting.isSave = false
|
||||||
}
|
}
|
||||||
}catch(error){
|
}catch(error){
|
||||||
this.$message.error('重置失败')
|
this.$message.error('重置失败')
|
||||||
this.$refs.columnSetting.isSave = false
|
this.$refs.columnSetting.isSave = false
|
||||||
}
|
}
|
||||||
this.$refs.columnSetting.isSave = false
|
|
||||||
},
|
},
|
||||||
//排序事件
|
//排序事件
|
||||||
sortChange(obj){
|
sortChange(obj){
|
||||||
|
|||||||
@ -46,8 +46,8 @@ export default {
|
|||||||
pageSize:this.pageSize
|
pageSize:this.pageSize
|
||||||
},otherParams);
|
},otherParams);
|
||||||
http.post(params.url, data).then(res=>{
|
http.post(params.url, data).then(res=>{
|
||||||
if(res.code == 200 && res.data.column){
|
if(res.code == 200 && res.data.columnConfig){
|
||||||
resolve(true)
|
resolve(res.data.columnConfig)
|
||||||
}else{
|
}else{
|
||||||
resolve(false)
|
resolve(false)
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ export default {
|
|||||||
pageSize:this.pageSize
|
pageSize:this.pageSize
|
||||||
},otherParams);
|
},otherParams);
|
||||||
http.post(params.url, data).then(res=>{
|
http.post(params.url, data).then(res=>{
|
||||||
if(res.code == 200 && res.data.column){
|
if(res.code == 200 && res.data.columnConfig){
|
||||||
resolve(true)
|
resolve(true)
|
||||||
}else{
|
}else{
|
||||||
resolve(false)
|
resolve(false)
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
</el-container>
|
</el-container>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown ref="userDropdown" class="user userDropdown panel-item" trigger="click" @command="handleUser">
|
<el-dropdown ref="userDropdown" class="user userDropdown panel-item" trigger="click" popper-class="userDropdownClass" @command="handleUser">
|
||||||
<div class="user-avatar">
|
<div class="user-avatar">
|
||||||
<el-avatar :size="22" shape="circle" :src="this.$store.state.global.login_avatar"><span class="userName">{{ userNameF }}</span></el-avatar>
|
<el-avatar :size="22" shape="circle" :src="this.$store.state.global.login_avatar"><span class="userName">{{ userNameF }}</span></el-avatar>
|
||||||
<label>{{ userName }}</label>
|
<label>{{ userName }}</label>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import scMultipleSelect from "./components/scMultipleSelect";
|
|||||||
import scInput from "./components/scInput";
|
import scInput from "./components/scInput";
|
||||||
import scVgInput from "./components/scInput/inputVague";
|
import scVgInput from "./components/scInput/inputVague";
|
||||||
import scSearch from "./components/scSearch";
|
import scSearch from "./components/scSearch";
|
||||||
|
import scTableSearch from "./components/scTable/components/headerSearch";
|
||||||
import scExport from "./components/scExport";
|
import scExport from "./components/scExport";
|
||||||
import scExportList from "./components/scExport/exportList";
|
import scExportList from "./components/scExport/exportList";
|
||||||
import scImport from "./components/scImport";
|
import scImport from "./components/scImport";
|
||||||
@ -86,6 +87,7 @@ export default {
|
|||||||
app.component('scInput', scInput);
|
app.component('scInput', scInput);
|
||||||
app.component('scVgInput', scVgInput);
|
app.component('scVgInput', scVgInput);
|
||||||
app.component('scSearch', scSearch);
|
app.component('scSearch', scSearch);
|
||||||
|
app.component('scTableSearch', scTableSearch);
|
||||||
app.component('scExport', scExport);
|
app.component('scExport', scExport);
|
||||||
app.component('scExportList', scExportList);
|
app.component('scExportList', scExportList);
|
||||||
app.component('scImport', scImport);
|
app.component('scImport', scImport);
|
||||||
|
|||||||
@ -20,6 +20,12 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
|
|||||||
::-webkit-scrollbar-track {background-color: rgba(50, 50, 50, 0.1);}
|
::-webkit-scrollbar-track {background-color: rgba(50, 50, 50, 0.1);}
|
||||||
::-webkit-scrollbar-track:hover {background-color: rgba(50, 50, 50, 0.2);}
|
::-webkit-scrollbar-track:hover {background-color: rgba(50, 50, 50, 0.2);}
|
||||||
|
|
||||||
|
/* 表头检索 */
|
||||||
|
.customPopper{width: 240px !important;}
|
||||||
|
.customPopper.el-popover.el-popper {z-index: 20 !important;}
|
||||||
|
.customPopper .el-date-editor{width: 100% !important;}
|
||||||
|
.customPopper .el-input--small .el-input__inner{height: 26px !important;}
|
||||||
|
|
||||||
/*布局设置*/
|
/*布局设置*/
|
||||||
.layout-setting {position: fixed;width: 40px;height: 40px;border-radius: 3px 0 0 3px;bottom: 100px;right: 0px;z-index: 100;background: #409EFF;display: flex;flex-direction: column;align-items: center;justify-content: center;cursor: pointer;}
|
.layout-setting {position: fixed;width: 40px;height: 40px;border-radius: 3px 0 0 3px;bottom: 100px;right: 0px;z-index: 100;background: #409EFF;display: flex;flex-direction: column;align-items: center;justify-content: center;cursor: pointer;}
|
||||||
.layout-setting i {font-size: 18px;color: #fff;}
|
.layout-setting i {font-size: 18px;color: #fff;}
|
||||||
@ -119,6 +125,9 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.userDropdownClass .el-popper__arrow::before{
|
||||||
|
background: #F5F7FA !important;
|
||||||
|
}
|
||||||
/*定宽页面*/
|
/*定宽页面*/
|
||||||
.sc-page {width: 1230px;margin: 0 auto;}
|
.sc-page {width: 1230px;margin: 0 auto;}
|
||||||
|
|
||||||
|
|||||||
@ -151,6 +151,7 @@
|
|||||||
.el-main > .scTable .el-table--border .el-table__inner-wrapper tr:first-child th:first-child {border-left: 0;}
|
.el-main > .scTable .el-table--border .el-table__inner-wrapper tr:first-child th:first-child {border-left: 0;}
|
||||||
.el-table.el-table--large {font-size: 14px;}
|
.el-table.el-table--large {font-size: 14px;}
|
||||||
.el-table.el-table--small {font-size: 12px;}
|
.el-table.el-table--small {font-size: 12px;}
|
||||||
|
.scTable .el-table.el-table--small .el-table__header-wrapper .cell{display: flex;align-items: center;}
|
||||||
.el-table {font-size: 12px;}
|
.el-table {font-size: 12px;}
|
||||||
.el-radio-button__inner {font-size: 12px;}
|
.el-radio-button__inner {font-size: 12px;}
|
||||||
.el-checkbox-button__inner {font-size: 12px;}
|
.el-checkbox-button__inner {font-size: 12px;}
|
||||||
|
|||||||
@ -168,9 +168,34 @@ tool.dateFormat = function (date, fmt='yyyy-MM-dd hh:mm:ss') {
|
|||||||
return fmt;
|
return fmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
tool.getTime = function (date){
|
|
||||||
date = new Date(date);
|
/* 转时间戳 开始时间 */
|
||||||
return Math.floor(date.getTime() / 1000);
|
tool.formatStartTime = function(time){
|
||||||
|
let date = new Date(time);
|
||||||
|
date.setHours(0);
|
||||||
|
return Math.floor(date.getTime() / 1000)
|
||||||
|
}
|
||||||
|
/* 转时间戳 结束时间 */
|
||||||
|
tool.formatEndTime = function(time){
|
||||||
|
let date = new Date(time);
|
||||||
|
date.setHours(23);
|
||||||
|
return Math.floor(date.getTime() / 1000)
|
||||||
|
}
|
||||||
|
/* 时间戳转日期 开始 */
|
||||||
|
tool.getStartTime = function (time){
|
||||||
|
let date = new Date(time * 1000);
|
||||||
|
date.setHours(0);
|
||||||
|
tool.dateFormat(date,'yyyy-MM-dd');
|
||||||
|
// return date.toISOString();
|
||||||
|
return tool.dateFormat(date,'yyyy-MM-dd');
|
||||||
|
}
|
||||||
|
/* 时间戳转日期 结束 */
|
||||||
|
tool.getEndTime = function(time){
|
||||||
|
let date = new Date(time * 1000);
|
||||||
|
date.setHours(23);
|
||||||
|
tool.dateFormat(date,'yyyy-MM-dd');
|
||||||
|
// return date.toISOString()
|
||||||
|
return tool.dateFormat(date,'yyyy-MM-dd');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 千分符 */
|
/* 千分符 */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'addCost'" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
<el-button type="primary" v-auth="'addCost'" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
||||||
<el-button type="danger" plain v-auth="'deleteCost'" :disabled="selection.length>0?false:true" :size="size" icon="el-icon-delete" @click="all_del"></el-button>
|
<el-button type="danger" plain v-auth="'deleteCost'" :disabled="selection.length>0?false:true" :size="size" icon="el-icon-delete" @click="all_del"></el-button>
|
||||||
<scImport ref="scImport" :size="size" type="18" title="批量导入费用流水" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="18" title="批量导入费用流水" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'costFlowImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'costFlowImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -92,6 +92,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
show: false,
|
show: false,
|
||||||
@ -180,12 +181,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.finance.cost.import.post(params);
|
const res = await this.$API.finance.cost.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<el-container class="mainBox mainBoxHeaderNoBorder">
|
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<scImport ref="scImport" :size="size" type="27" title="批量导入库存" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="27" title="批量导入库存" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'importInventory'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
|
<el-button v-auth="'importInventory'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -75,6 +75,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
show: false,
|
show: false,
|
||||||
@ -169,12 +170,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.orders.order.sock.import.post(params);
|
const res = await this.$API.orders.order.sock.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<el-header class="header">
|
<el-header class="header">
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'maintenanceOrderAdd'" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
|
<el-button type="primary" v-auth="'maintenanceOrderAdd'" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="10" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" type="10" :httpDisabled="httpDisabled" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'maintenanceOrderImport'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
|
<el-button v-auth="'maintenanceOrderImport'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -24,9 +24,12 @@
|
|||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<div class="flowPath">
|
<div class="flowPath">
|
||||||
<flow :list="flowList"/>
|
<flow :list="flowList"/>
|
||||||
|
<!-- <video src="blob:https://y.qq.com/e5c50681-05f0-42a0-b70a-47c651a881d7">-->
|
||||||
|
<!-- -->
|
||||||
|
<!-- </video>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="searchMain searchMainNoTop">
|
<div class="searchMain searchMainNoTop">
|
||||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
|
||||||
|
|
||||||
<div class="searchItem searchBtn">
|
<div class="searchItem searchBtn">
|
||||||
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
|
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
|
||||||
@ -34,11 +37,11 @@
|
|||||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" border highlightCurrentRow :hideTotal="false" @selection-change="selectionChange">
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" border highlightCurrentRow :hideTotal="false" @selection-change="selectionChange" @columnBack="columnBack">
|
||||||
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
||||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
<template #business_status="scope">
|
<template #business_status="scope">
|
||||||
<span v-for="(item,ind) in statusList" :key="ind">
|
<span v-for="(item,ind) in setMap.statusList" :key="ind">
|
||||||
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
|
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
|
||||||
v-if="item.value == scope.row.business_status">{{item.label}}</span>
|
v-if="item.value == scope.row.business_status">{{item.label}}</span>
|
||||||
</span>
|
</span>
|
||||||
@ -84,9 +87,7 @@
|
|||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {eventBus} from "@/utils/eventBus";
|
import {eventBus} from "@/utils/eventBus";
|
||||||
@ -99,6 +100,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
flowList:[
|
flowList:[
|
||||||
{name:'新建/导入/同步邮件',left:false,right:true},
|
{name:'新建/导入/同步邮件',left:false,right:true},
|
||||||
{name:'提交维保',left:true,right:true},
|
{name:'提交维保',left:true,right:true},
|
||||||
@ -108,6 +110,9 @@ export default {
|
|||||||
save: false,
|
save: false,
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
|
setMap:{
|
||||||
|
statusList:[],
|
||||||
|
},
|
||||||
list: {
|
list: {
|
||||||
apiObj: this.$API.orders.order.maintenance.list,
|
apiObj: this.$API.orders.order.maintenance.list,
|
||||||
column: [],
|
column: [],
|
||||||
@ -115,37 +120,27 @@ export default {
|
|||||||
selection: [],
|
selection: [],
|
||||||
exportShow:false,
|
exportShow:false,
|
||||||
searchShow:false,
|
searchShow:false,
|
||||||
searchList:[
|
filterMap:{
|
||||||
{name:'PE确认时间',type:'date',code:'pe_confirmation_time',show:true},
|
data:{}
|
||||||
{name:'保修到期',type:'date',code:'warranty_end_date',show:true},
|
},
|
||||||
{name:'SLA到期时间',type:'date',code:'sla_expiration',show:true},
|
|
||||||
{name:'客户',type:'select',code:['customer_name'],placeholder:"请选择客户",isOpen:true,show:false},
|
|
||||||
{name:'维修单号',type:'text',code:['repair_order_no'],placeholder:"请输入维修单号",isOpen:true,show:false},
|
|
||||||
{name:'维修等级',type:'select',code:'maintenance_level', data:[], placeholder:"请选择维修等级",show:false},
|
|
||||||
{name:'园区名称',type:'select',code:['park_name'],data:[],placeholder:"请输入园区名称",isOpen:true,show:false},
|
|
||||||
{name:'整机型号',type:'text',code:['device_model'],placeholder:"请输入整机型号",isOpen:true,show:false},
|
|
||||||
{name:'故障类型',type:'multiple',code:'fault_type', data:[], placeholder:"请选择公司名称",show:false},
|
|
||||||
{name:'部件型号',type:'text',code:['component_model'],placeholder:"请输入部件型号",isOpen:true,show:false},
|
|
||||||
{name:'部件序列号',type:'text',code:['component_serial_no'],placeholder:"请输入部件序列号",isOpen:true,show:false},
|
|
||||||
{name:'整机厂商',type:'text',code:['device_manufacturer'],placeholder:"请输入整机厂商",isOpen:true,show:false},
|
|
||||||
{name:'是否需要关机',type:'select',code:['requires_shutdown'],placeholder:"请选择是否关机",isOpen:true,show:false},
|
|
||||||
{name:'机房城市',type:'select',code:['city'],data:[],placeholder:"请输入机房城市",isOpen:true,show:false},
|
|
||||||
{name:'机房/IDC名称',type:'select',code:['data_center_name'],data:[],placeholder:"请输入机房/IDC名称",isOpen:true,show:false},
|
|
||||||
{name:'机架位置',type:'text',code:['rack_position'],placeholder:"请输入机架位置",isOpen:true,show:false},
|
|
||||||
{name:'整机SN',type:'select',code:['device_sn'],data:[],placeholder:"请输入整机SN",isOpen:true,show:false},
|
|
||||||
{name:'部件厂商',type:'text',code:['component_manufacturer'],placeholder:"请输入部件厂商",isOpen:true,show:false},
|
|
||||||
{name:'部件零件PN号',type:'text',code:['component_pn'],placeholder:"请输入部件零件PN号",isOpen:true,show:false},
|
|
||||||
{name:'剩余BD数',type:'text',code:['bd_backup_count'],placeholder:"请输入剩余BD数",isOpen:true,show:false},
|
|
||||||
{name:'维保等级',type:'select',code:['maintenance_plan'],data:[],placeholder:"请输入维保等级",isOpen:true,show:false},
|
|
||||||
{name:'业务状态',type:'select',code:['business_status'],data:[],placeholder:"请选择业务状态",isOpen:true,show:false},
|
|
||||||
{name:'关键字',type:'text',code:['fault_description'],keyword:true,show:true},
|
|
||||||
],
|
|
||||||
params: {},
|
params: {},
|
||||||
statusList:[],
|
|
||||||
|
|
||||||
countParams:this.$store.state.msg.main_order_count
|
countParams:this.$store.state.msg.main_order_count
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
provide(){
|
||||||
|
return{
|
||||||
|
filterUploadClick:this.filterClick,
|
||||||
|
filterUploadParams:this.filterParams,
|
||||||
|
filterTagClose:this.tagClose,
|
||||||
|
filterModelParams:this.filterModelParams,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
filterModelParams(){
|
||||||
|
return this.filterMap
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 获取新消息
|
// 获取新消息
|
||||||
eventBus.$on('sockBack', this.getWsResult);
|
eventBus.$on('sockBack', this.getWsResult);
|
||||||
@ -160,55 +155,88 @@ export default {
|
|||||||
this.$store.commit('set_list_count_info',res.data.list_count_info.main_order_count);
|
this.$store.commit('set_list_count_info',res.data.list_count_info.main_order_count);
|
||||||
this.countParams = res.data.list_count_info.main_order_count;
|
this.countParams = res.data.list_count_info.main_order_count;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 表格检索开始
|
||||||
|
* */
|
||||||
|
columnBack(val){
|
||||||
|
this.list.column = val;
|
||||||
|
},
|
||||||
|
async filterClick(item) {
|
||||||
|
let {data, params} = item;
|
||||||
|
let filterParams = Object.assign(this.params,params);
|
||||||
|
this.filterMap.data = filterParams;
|
||||||
|
let searchParams = this.$TOOL.objCopy(this.params);
|
||||||
|
searchParams.field = ""
|
||||||
|
if (typeof data.prop === 'string') {
|
||||||
|
searchParams.field = data.prop;
|
||||||
|
} else {
|
||||||
|
searchParams.field = data.prop[0];
|
||||||
|
}
|
||||||
|
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||||
|
await this.getField(data,searchParams);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterParams(params){
|
||||||
|
let filterParams = Object.assign(this.params,params);
|
||||||
|
this.filterMap.data = filterParams;
|
||||||
|
},
|
||||||
|
tagClose(){
|
||||||
|
|
||||||
},
|
},
|
||||||
searchShowClick(){
|
searchShowClick(){
|
||||||
this.searchShow = !this.searchShow;
|
this.searchShow = !this.searchShow;
|
||||||
this.searchList.forEach(item=>{
|
},
|
||||||
if(item.isOpen){
|
getHeaderData(params){
|
||||||
item.show = this.searchShow
|
this.params = params;
|
||||||
}
|
this.filterMap.data = params;
|
||||||
})
|
|
||||||
},
|
},
|
||||||
async getSelectData(item) {
|
async getSelectData(item) {
|
||||||
let {data, params} = item;
|
let {data, params} = item;
|
||||||
this.params = params;
|
this.params = params; // 列表需要的参数
|
||||||
|
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||||
let searchParams = this.$TOOL.objCopy(params);
|
let searchParams = this.$TOOL.objCopy(params);
|
||||||
searchParams.field = ""
|
searchParams.field = ""
|
||||||
if (typeof data.code === 'string') {
|
if (typeof data.prop === 'string') {
|
||||||
searchParams.field = data.code;
|
searchParams.field = data.prop;
|
||||||
} else {
|
} else {
|
||||||
searchParams.field = data.code[0];
|
searchParams.field = data.prop[0];
|
||||||
}
|
}
|
||||||
if (data.type == 'select') {
|
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||||
const res = await this.$API.orders.order.maintenance.field.post(searchParams);
|
await this.getField(data,searchParams)
|
||||||
if (res.code == 200) {
|
}
|
||||||
if (res.data && res.data.length > 0) {
|
},
|
||||||
res.data.forEach(item => {
|
async getField(data,searchParams) {
|
||||||
if(searchParams.field === 'business_status'){
|
const res = await this.$API.orders.order.maintenance.field.post(searchParams);
|
||||||
this.statusList.forEach(em=>{
|
if (res.code == 200) {
|
||||||
if(em.value === item[data.code]){
|
if (res.data && res.data.length > 0) {
|
||||||
item.label = em.label;
|
res.data.forEach(item => {
|
||||||
}
|
if (data.prop === 'business_status') {
|
||||||
})
|
this.setMap.statusList.forEach(em => {
|
||||||
}else{
|
if (em.value === item[data.prop]) {
|
||||||
item.label = item[data.code];
|
item.label = em.label;
|
||||||
}
|
item.value = em.value;
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
this.searchList.forEach(item => {
|
} else {
|
||||||
if (item.code == data.code) {
|
item.label = item[data.prop];
|
||||||
item.data = res.data;
|
item.value = item[data.prop];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.list.column.forEach(item => {
|
||||||
|
if (item.prop == data.prop) {
|
||||||
|
item.data = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/** 表格检索结束 */
|
||||||
|
|
||||||
//添加
|
//添加
|
||||||
add(){
|
add(){
|
||||||
eventBus.$emit('tagClose','/order/create-order');
|
eventBus.$emit('tagClose','/order/create-order');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 批量导入
|
// 批量导入
|
||||||
importFile(){
|
importFile(){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
@ -229,12 +257,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -350,6 +380,7 @@ export default {
|
|||||||
},
|
},
|
||||||
reset(){
|
reset(){
|
||||||
this.params = {};
|
this.params = {};
|
||||||
|
this.filterMap.data = {};
|
||||||
this.$refs.scSearch.reload();
|
this.$refs.scSearch.reload();
|
||||||
this.$refs.table.reload();
|
this.$refs.table.reload();
|
||||||
},
|
},
|
||||||
@ -359,7 +390,7 @@ export default {
|
|||||||
async getStatusList() {
|
async getStatusList() {
|
||||||
const res = await this.$API.orders.order.maintenance.status.post();
|
const res = await this.$API.orders.order.maintenance.status.post();
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.statusList = res.data;
|
this.setMap.statusList = res.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<el-icon><sc-icon-See /></el-icon>
|
<el-icon><sc-icon-See /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-item">
|
<div class="panel-item">
|
||||||
<el-dropdown trigger="click" placement="bottom-start" ref="userDropdown">
|
<el-dropdown trigger="click" placement="bottom-start" popper-class="userDropdownClass" ref="userDropdown">
|
||||||
<div class="user-avatar el-dropdown-link">
|
<div class="user-avatar el-dropdown-link">
|
||||||
<el-avatar :size="22" shape="circle" :src="this.$store.state.global.login_avatar"><span class="userName">{{ userNameF }}</span></el-avatar>
|
<el-avatar :size="22" shape="circle" :src="this.$store.state.global.login_avatar"><span class="userName">{{ userNameF }}</span></el-avatar>
|
||||||
<label class="userName">{{ userName?userName:"匿名" }}</label>
|
<label class="userName">{{ userName?userName:"匿名" }}</label>
|
||||||
@ -304,7 +304,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-popper.is-light>.el-popper__arrow::before{
|
.userDropdownClass .el-popper__arrow::before{
|
||||||
background: #F5F7FA;
|
background: #F5F7FA !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
||||||
<el-button plain type="danger" :disabled="selection.length>0?false:true" :size="size" icon="el-icon-Delete" @click="all_delete"></el-button>
|
<el-button plain type="danger" :disabled="selection.length>0?false:true" :size="size" icon="el-icon-Delete" @click="all_delete"></el-button>
|
||||||
<scImport ref="scImport" :size="size" type="17" title="批量导入物料成本" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="17" title="批量导入物料成本" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -58,6 +58,7 @@ export default {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog:{
|
dialog:{
|
||||||
show:false,
|
show:false,
|
||||||
},
|
},
|
||||||
@ -103,12 +104,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.setup.material.import.post(params);
|
const res = await this.$API.setup.material.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'addBom'" :size="size" icon="el-icon-plus" @click="add">新增BOM</el-button>
|
<el-button type="primary" v-auth="'addBom'" :size="size" icon="el-icon-plus" @click="add">新增BOM</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="42" title="批量导入BOM" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="42" title="批量导入BOM" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'bomImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'bomImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -71,6 +71,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
show: false
|
show: false
|
||||||
@ -171,12 +172,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.setup.bom.import.post(params);
|
const res = await this.$API.setup.bom.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'organizationAdd'" :size="size" icon="el-icon-plus" @click="add">新增公司</el-button>
|
<el-button type="primary" v-auth="'organizationAdd'" :size="size" icon="el-icon-plus" @click="add">新增公司</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="5" title="批量导入公司组织" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="5" title="批量导入公司组织" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -95,6 +95,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
show: false,
|
show: false,
|
||||||
@ -220,12 +221,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.system.company.import.post(params);
|
const res = await this.$API.system.company.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'sparePartsInfoAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件信息</el-button>
|
<el-button type="primary" v-auth="'sparePartsInfoAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件信息</el-button>
|
||||||
<el-button type="danger" v-auth="'sparePartsInfoDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
|
<el-button type="danger" v-auth="'sparePartsInfoDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="31" title="批量导入备件信息" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="31" title="批量导入备件信息" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'sparePartsInfoImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'sparePartsInfoImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -67,6 +67,7 @@ export default {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
setMap:{
|
setMap:{
|
||||||
status:[]
|
status:[]
|
||||||
},
|
},
|
||||||
@ -159,12 +160,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.system.spareInfo.import.post(params);
|
const res = await this.$API.system.spareInfo.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
//编辑
|
//编辑
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" v-auth="'sparePartsAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button>
|
<el-button type="primary" v-auth="'sparePartsAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button>
|
||||||
<el-button type="danger" v-auth="'sparePartsDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
|
<el-button type="danger" v-auth="'sparePartsDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="28" title="批量导入备件" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="28" title="批量导入备件" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'sparePartsImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'sparePartsImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -67,6 +67,7 @@ export default {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
setMap:{
|
setMap:{
|
||||||
status:[]
|
status:[]
|
||||||
},
|
},
|
||||||
@ -161,12 +162,14 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.system.spare.import.post(params);
|
const res = await this.$API.system.spare.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
<el-button type="danger" v-auth="'delUser'" plain :size="size" icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
|
<el-button type="danger" v-auth="'delUser'" plain :size="size" icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
|
||||||
<el-button type="primary" v-auth="'addUserRoles'" plain :size="size" :disabled="selection.length==0" @click="role">分配角色</el-button>
|
<el-button type="primary" v-auth="'addUserRoles'" plain :size="size" :disabled="selection.length==0" @click="role">分配角色</el-button>
|
||||||
<el-button type="primary" plain :size="size" :disabled="selection.length==0" @click="rePwd">密码重置</el-button>
|
<el-button type="primary" plain :size="size" :disabled="selection.length==0" @click="rePwd">密码重置</el-button>
|
||||||
<scImport ref="scImport" :size="size" type="4" title="批量导入用户" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" :httpDisabled="httpDisabled" type="4" title="批量导入用户" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'userImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'userImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -151,6 +151,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
size:'small',
|
size:'small',
|
||||||
|
httpDisabled:false,
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
review: false,
|
review: false,
|
||||||
@ -292,12 +293,14 @@
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
|
this.httpDisabled = true;
|
||||||
const res = await this.$API.system.user.import.post(params);
|
const res = await this.$API.system.user.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importSuccess(){
|
importSuccess(){
|
||||||
|
this.httpDisabled = false;
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user