2024-03-26 11:18:19 +08:00
|
|
|
|
<!--
|
|
|
|
|
* @name: 页面基本结构组件
|
|
|
|
|
* @author: zhangpengcheng
|
|
|
|
|
* @date: 2022-08-23
|
|
|
|
|
-->
|
|
|
|
|
<!-- style="overflow: auto;" -->
|
|
|
|
|
<template>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div
|
|
|
|
|
class="container"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:style="
|
|
|
|
|
'backgroundColor:' +
|
|
|
|
|
bgColor +
|
|
|
|
|
';paddingBottom:' +
|
|
|
|
|
paddingBottom +
|
|
|
|
|
';height:' +
|
|
|
|
|
bodyHight
|
|
|
|
|
"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<!-- 标题 -->
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div class="title" flex="cross:center" v-if="showTitle">
|
|
|
|
|
<span v-if="!$route.meta.back">{{ title }}</span>
|
|
|
|
|
<span @click="goBack" class="back" v-else
|
|
|
|
|
><i class="el-icon-arrow-left"></i>返回</span
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</div>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<!-- <div class="main":style="'backgroundColor:'+ mainColor " > -->
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div
|
|
|
|
|
class="main"
|
|
|
|
|
:style="{
|
|
|
|
|
height: showTitle ? 'calc(100% - 38px)' : '100%',
|
|
|
|
|
backgroundColor: mainColor,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
<div
|
|
|
|
|
class="pushButton"
|
|
|
|
|
flex="cross:centet main:right cross:center"
|
|
|
|
|
v-if="operateButtonSwitch"
|
|
|
|
|
>
|
|
|
|
|
<div class="operationButton" flex="cross:center">
|
|
|
|
|
<div v-if="defaultButtonSwitch" style="margin-right: 5px">
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in defaultButtonList"
|
|
|
|
|
:type="item.type ? item.type : 'primary'"
|
|
|
|
|
size="small"
|
|
|
|
|
class="iconfont buttonList"
|
|
|
|
|
:icon="item.icon"
|
|
|
|
|
@click="funNewClick(item)"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
{{ item.menuName }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<slot name="btn"></slot>
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in buttonList"
|
|
|
|
|
:type="item.type ? item.type : 'primary'"
|
|
|
|
|
size="small"
|
|
|
|
|
class="iconfont buttonList"
|
|
|
|
|
:icon="item.icon"
|
|
|
|
|
@click="funNewClick(item)"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<span v-if="item.menuName">{{ item.menuName }}</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="fixedButton" style="margin-left: 5px">
|
|
|
|
|
<el-tooltip
|
|
|
|
|
class="item"
|
|
|
|
|
effect="dark"
|
|
|
|
|
:content="item.title"
|
|
|
|
|
placement="top"
|
|
|
|
|
v-for="(item, index) in fixedButtonList"
|
|
|
|
|
:key="index"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
>
|
|
|
|
|
<span>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
:icon="item.icon"
|
|
|
|
|
@click.stop="fixedClick(item)"
|
|
|
|
|
style="margin: 0"
|
|
|
|
|
></el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<!-- 搜索 -->
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div
|
|
|
|
|
v-show="querySwitch"
|
|
|
|
|
style="padding: 5px; background-color: #fff"
|
|
|
|
|
flex="cross:center"
|
|
|
|
|
ref="serchRefs"
|
|
|
|
|
class="searchForTable"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
v-for="(row, indexRow) in searchList"
|
|
|
|
|
class="searchBox"
|
|
|
|
|
:key="indexRow"
|
|
|
|
|
style="margin-right: 5px"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="ruleForm[row.columnNameEN]"
|
|
|
|
|
clearable
|
|
|
|
|
:type="row.type ? row.type : 'text'"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:placeholder="!row.columnNameCN ? '请输入' : row.columnNameCN"
|
|
|
|
|
v-if="row.tag === 'elInput'"
|
|
|
|
|
min="1"
|
|
|
|
|
@keydown.enter.native="handerInputEnter()"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-input>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="ruleForm[row.columnNameEN]"
|
|
|
|
|
v-if="row.tag === 'elDatePicker'"
|
|
|
|
|
:class="{ one: row.type ? 'date' : row.type }"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:value-format="!row.valueFormat ? 'yyyy-MM-dd' : row.valueFormat"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
:type="!row.type ? 'date' : row.type"
|
|
|
|
|
:placeholder="!row.columnNameCN ? '请选择' : row.columnNameCN"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-date-picker>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<el-radio-group
|
|
|
|
|
v-model="ruleForm[row.columnNameEN]"
|
|
|
|
|
v-if="row.tag === 'elRadio'"
|
|
|
|
|
>
|
|
|
|
|
<el-radio-button
|
|
|
|
|
v-for="el in row.options"
|
|
|
|
|
:label="el.value"
|
|
|
|
|
:key="el.value"
|
|
|
|
|
>{{ el.label }}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-radio-button>
|
|
|
|
|
</el-radio-group>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div
|
|
|
|
|
v-if="row.tag === 'elDialog'"
|
|
|
|
|
class="elDialog"
|
|
|
|
|
style="cursor: pointer; height: 32px; ine-height: 32px"
|
|
|
|
|
>
|
|
|
|
|
<p
|
|
|
|
|
:style="{
|
|
|
|
|
color: ruleForm[row.columnNameEN] ? '#000' : '#c0c4cc',
|
|
|
|
|
}"
|
|
|
|
|
style="width: 100%; margin: 0"
|
|
|
|
|
@click="elDialogClick(row, index, indexRow)"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
{{
|
2024-04-02 17:14:13 +08:00
|
|
|
|
ruleForm[row.columnNameEN]
|
|
|
|
|
? ruleForm[row.columnNameEN]
|
|
|
|
|
: row.columnNameCN
|
|
|
|
|
? row.columnNameCN
|
|
|
|
|
: "请点击选择"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}}
|
|
|
|
|
</p>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<i
|
|
|
|
|
class="el-icon-more"
|
|
|
|
|
@click="elDialogClick(row, index, indexRow)"
|
|
|
|
|
v-if="!row.disabled && !ruleForm[row.columnNameEN]"
|
|
|
|
|
></i>
|
|
|
|
|
<i
|
|
|
|
|
class="el-icon-circle-close"
|
|
|
|
|
v-if="!row.disabled && ruleForm[row.columnNameEN]"
|
|
|
|
|
@click="elDialogClear(row)"
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
></i>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</div>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<el-select
|
|
|
|
|
v-model="ruleForm[row.columnNameEN]"
|
|
|
|
|
filterable
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@change="selectChange($event, indexRow)"
|
|
|
|
|
:clearable="row.clearable ? row.clearable : true"
|
|
|
|
|
:placeholder="!row.columnNameCN ? '请选择' : row.columnNameCN"
|
|
|
|
|
v-if="row.tag === 'elSelect'"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(el, elIndex) in row.options"
|
|
|
|
|
:key="!row.optionValue ? el['value'] : el[row.optionValue]"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
:label="!row.optionLabel ? el['label'] : el[row.optionLabel]"
|
2024-04-02 17:14:13 +08:00
|
|
|
|
:value="!row.optionValue ? el['value'] : el[row.optionValue]"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 搜索按钮 -->
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
icon="el-icon-search searchIcon"
|
|
|
|
|
@click="search"
|
|
|
|
|
title="搜索"
|
|
|
|
|
>
|
|
|
|
|
搜索
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-button>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<el-button
|
|
|
|
|
v-if="searchList.length > 1"
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
icon="el-icon-refresh-left searchIcon"
|
|
|
|
|
class="searchIcon"
|
|
|
|
|
@click="refresh"
|
|
|
|
|
title="重置"
|
|
|
|
|
>重置
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-button>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<slot name="searchBtn"></slot>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</div>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<div :style="'height:' + getMainHeight()" class="tableHeight">
|
|
|
|
|
<slot name="main" :tableHeight="tableHeight"></slot>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 主要内容 -->
|
|
|
|
|
<!-- 分页 -->
|
2024-04-02 17:14:13 +08:00
|
|
|
|
<base-page
|
|
|
|
|
v-if="isPage"
|
|
|
|
|
:pageModel.sync="pageModel"
|
|
|
|
|
@onPageChange="onPageChange"
|
|
|
|
|
></base-page>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// import heightTransition from '@/common/js/heightTransition'
|
|
|
|
|
// import customCascader from "@/components/customCascader";
|
|
|
|
|
import { exportDown, wordDown, zipDown } from "@/utils/util.js";
|
|
|
|
|
import basePage from "@/components/base/basePage";
|
|
|
|
|
import { TokenKeys } from "@/utils/variable";
|
|
|
|
|
// import fetch from '../../api/request'
|
|
|
|
|
import { getApiSign } from "@/utils/apiSign";
|
|
|
|
|
// import domainsFuc from '@/api/domains.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
// heightTransition,
|
|
|
|
|
basePage,
|
|
|
|
|
// customCascader
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
// 是否展示标题
|
|
|
|
|
showTitle: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 标题
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 背景颜色
|
|
|
|
|
bgColor: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "#ffffff",
|
|
|
|
|
},
|
|
|
|
|
// 背景颜色
|
|
|
|
|
mainColor: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
// 底部padding
|
|
|
|
|
paddingBottom: {
|
|
|
|
|
type: String,
|
|
|
|
|
// default: '68px'
|
|
|
|
|
},
|
|
|
|
|
// 高度
|
|
|
|
|
bodyHight: {
|
|
|
|
|
type: [Number, String],
|
2024-04-02 17:14:13 +08:00
|
|
|
|
default: "100%",
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// main高度
|
|
|
|
|
mainHight: {
|
|
|
|
|
type: [Number, String, Boolean],
|
|
|
|
|
default: "calc(100% - 38px)",
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 搜索配置
|
2024-04-02 17:14:13 +08:00
|
|
|
|
searchModel: {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return [];
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 按钮配置
|
2024-04-02 17:14:13 +08:00
|
|
|
|
buttonList: {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return [];
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// [{
|
|
|
|
|
// icon: 'el-icon-plus',
|
|
|
|
|
// menuName: '新增'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-edit',
|
|
|
|
|
// menuName: '编辑'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-delete',
|
|
|
|
|
// menuName: '删除',
|
|
|
|
|
// type: 'danger'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-refresh',
|
|
|
|
|
// menuName: '刷新'
|
|
|
|
|
// },]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
defaultButtonList: {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-plus",
|
|
|
|
|
menuName: "新增",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-edit",
|
|
|
|
|
menuName: "编辑",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-delete",
|
|
|
|
|
menuName: "删除",
|
|
|
|
|
type: "danger",
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// icon: 'el-icon-refresh',
|
|
|
|
|
// menuName: '刷新'
|
|
|
|
|
// },
|
|
|
|
|
];
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 是否展示分页
|
|
|
|
|
isPage: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
// 导出接口地址
|
|
|
|
|
exportUrl: {
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
// 导入接口地址
|
|
|
|
|
importUrl: {
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
//单选
|
|
|
|
|
only: {
|
|
|
|
|
default: "",
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// 左侧固定按钮
|
|
|
|
|
fixedButton: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
// 是否显示查询条件
|
|
|
|
|
querySwitch: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
// 搜索列表
|
|
|
|
|
searchList: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return [];
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 操作按钮
|
|
|
|
|
operateButtonSwitch: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
|
|
|
|
// 操作按钮
|
|
|
|
|
defaultButtonSwitch: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
|
|
|
|
// 右侧按钮
|
|
|
|
|
fixedButtonList: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-s-operation",
|
|
|
|
|
title: "筛选",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-printer",
|
|
|
|
|
title: "打印",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: "el-icon-folder",
|
|
|
|
|
title: "导出",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
ruleForm: {},
|
|
|
|
|
onlyUrl: "",
|
|
|
|
|
clientHeight: "",
|
|
|
|
|
// 上传请求头
|
|
|
|
|
uploadHeaders: {},
|
|
|
|
|
// uurl: domainsFuc().domain,
|
|
|
|
|
uurl: "http://www.wldxt.cn:8089/taizhou/daxitong/crm/",
|
|
|
|
|
// 参数
|
|
|
|
|
model: {},
|
|
|
|
|
// 收起/展开搜索
|
|
|
|
|
isSearch: false,
|
|
|
|
|
// 分页数据
|
|
|
|
|
pageModel: {
|
|
|
|
|
total: 0,
|
2024-04-02 17:14:13 +08:00
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20,
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 清除状态
|
|
|
|
|
clearState: 0,
|
|
|
|
|
loading: false,
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// fixedButtonList: [{
|
|
|
|
|
// icon: 'el-icon-s-operation',
|
|
|
|
|
// title: '筛选'
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// icon: 'el-icon-printer',
|
|
|
|
|
// title: '打印'
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// icon: 'el-icon-folder',
|
|
|
|
|
// title: '导出'
|
|
|
|
|
// }
|
|
|
|
|
// ],
|
|
|
|
|
// defaultButtonList: [
|
|
|
|
|
// {
|
|
|
|
|
// icon: 'el-icon-plus',
|
|
|
|
|
// menuName: '新增'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-edit',
|
|
|
|
|
// menuName: '编辑'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-delete',
|
|
|
|
|
// menuName: '删除',
|
|
|
|
|
// type: 'danger'
|
|
|
|
|
// }, {
|
|
|
|
|
// icon: 'el-icon-refresh',
|
|
|
|
|
// menuName: '刷新'
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
tableHeight: "100%",
|
2024-03-26 11:18:19 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
created() {},
|
2024-03-26 11:18:19 +08:00
|
|
|
|
mounted() {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// this.getTableHight()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// window.onresize = () => {
|
|
|
|
|
// this.clientHeight = document.documentElement.clientHeight;
|
|
|
|
|
// },
|
|
|
|
|
// this.importUpload(); //初始化上传
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
// menuJson() {
|
|
|
|
|
// return JSON.parse(localStorage.getItem(TokenKeys.MENU_JSON))
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
getTableHight() {
|
|
|
|
|
let height = "100%";
|
|
|
|
|
let heightReduce = 0;
|
|
|
|
|
if (this.operateButtonSwitch) {
|
|
|
|
|
heightReduce = heightReduce + 53;
|
|
|
|
|
}
|
|
|
|
|
if (this.querySwitch) {
|
|
|
|
|
heightReduce = heightReduce + 47;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (this.isPage) {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
heightReduce = heightReduce + 53;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-04-02 17:14:13 +08:00
|
|
|
|
height = "calc(100% - " + heightReduce + "px)";
|
|
|
|
|
this.tableHeight = height;
|
|
|
|
|
},
|
|
|
|
|
getMainHeight() {
|
|
|
|
|
// operateButtonSwitch 操作开关 querySwitch查询高 度
|
|
|
|
|
let height = "100%";
|
|
|
|
|
let heightReduce = 0;
|
|
|
|
|
if (this.operateButtonSwitch) {
|
|
|
|
|
heightReduce = heightReduce + 56;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-04-02 17:14:13 +08:00
|
|
|
|
if (this.querySwitch) {
|
|
|
|
|
heightReduce = heightReduce + 33;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-04-02 17:14:13 +08:00
|
|
|
|
if (this.isPage) {
|
|
|
|
|
heightReduce = heightReduce + 56;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-04-02 17:14:13 +08:00
|
|
|
|
height = "calc(100% - " + heightReduce + "px)";
|
|
|
|
|
// console.log(height, "height")
|
|
|
|
|
return height;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
pageClear() {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
this.pageModel.page = 1;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// importUpload() {
|
|
|
|
|
// const timestamp = new Date().getTime() + '';
|
|
|
|
|
// const sign = getApiSign(timestamp);
|
|
|
|
|
// this.uploadHeaders['timestamp'] = timestamp;
|
|
|
|
|
// this.uploadHeaders['appKey'] = TokenKeys.APP_KEY;
|
|
|
|
|
// this.uploadHeaders['sign'] = sign;
|
|
|
|
|
// this.uploadHeaders[TokenKeys.ACCESS_TOKEN] = localStorage.getItem(TokenKeys.ACCESS_TOKEN);
|
|
|
|
|
// },
|
|
|
|
|
handleSuccess(res) {
|
|
|
|
|
const { code, msg, data } = res;
|
|
|
|
|
if (code && code == 10000) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$vmNews("上传成功", "success");
|
|
|
|
|
} else {
|
|
|
|
|
this.$vmNews(msg);
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleProgress() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
},
|
|
|
|
|
handleError() {
|
|
|
|
|
this.$vmNews("上传失败", "error");
|
|
|
|
|
},
|
|
|
|
|
// 自定义级联选择器返回值
|
|
|
|
|
getCascader(value, field) {
|
|
|
|
|
this.$set(this.model, field, value);
|
|
|
|
|
},
|
|
|
|
|
// 设置分页total值
|
|
|
|
|
setPageTotal(total) {
|
|
|
|
|
this.$set(this.pageModel, "total", total);
|
|
|
|
|
},
|
|
|
|
|
setPageNum(pageNum) {
|
|
|
|
|
this.$set(this.pageModel, "page", pageNum);
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
//参数propLabel , 值value
|
|
|
|
|
getField(propLabel, value) {
|
|
|
|
|
this.$set(this.ruleForm, propLabel, value);
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 返回
|
|
|
|
|
goBack() {
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
},
|
|
|
|
|
// 按钮点击事件
|
|
|
|
|
funNewClick(item) {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
if (item.menuName == "刷新" || item.btnFunction == "Refresh") {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$tab.refreshPage(this.$route);
|
|
|
|
|
} else {
|
|
|
|
|
this.$emit("onFuncBtn", item);
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// 固定按钮点击事件
|
|
|
|
|
fixedClick(item) {
|
|
|
|
|
this.$emit("onFixedBtn", item);
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 操作按钮点击事件
|
|
|
|
|
funcClick(btnItem) {
|
|
|
|
|
this.$emit("onFuncBtn", btnItem);
|
|
|
|
|
},
|
|
|
|
|
// 导出函数
|
|
|
|
|
eventExport(params) {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// console.log(params, 'params')
|
|
|
|
|
// console.log(this.onlyUrl ? this.onlyUrl : this.exportUrl, 'this.onlyUrl?this.onlyUrl:this.exportUrl')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// return fetch.get(this.onlyUrl ? this.onlyUrl : this.exportUrl, {
|
|
|
|
|
// params,
|
|
|
|
|
// responseType: 'blob'
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
// 设置某个参数的值
|
|
|
|
|
setSomeParam(field, value = null) {
|
|
|
|
|
this.$set(this.model, field, value);
|
|
|
|
|
},
|
|
|
|
|
// 查询、重置事件
|
|
|
|
|
queryEvent(state) {
|
|
|
|
|
this.$emit("onQuery", this.mergeParam(true));
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// 回车搜索
|
|
|
|
|
handerInputEnter() {
|
|
|
|
|
this.$emit("handerInputEnter", this.ruleForm);
|
|
|
|
|
},
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 条件查询-下拉框
|
2024-04-02 17:14:13 +08:00
|
|
|
|
selectChange(event, index, indexItem) {
|
|
|
|
|
if (typeof event == "number" && event < 3) {
|
|
|
|
|
if (Number(event) == 2) {
|
|
|
|
|
event = 0;
|
|
|
|
|
} else {
|
|
|
|
|
event = event - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (event !== "" && event != undefined) {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
this.$emit("onElSelect", event, index, indexItem, this.model);
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 页数或每页条数更改时触发
|
|
|
|
|
onPageChange() {
|
|
|
|
|
this.$emit("pageChange", this.mergeParam());
|
|
|
|
|
},
|
|
|
|
|
// 合并参数
|
|
|
|
|
mergeParam(state) {
|
|
|
|
|
if (state) {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
this.pageModel.page = 1;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
let page = {
|
2024-04-02 17:14:13 +08:00
|
|
|
|
page: this.pageModel.page,
|
|
|
|
|
limit: this.pageModel.limit,
|
2024-03-26 11:18:19 +08:00
|
|
|
|
};
|
|
|
|
|
for (let i in this.model) {
|
|
|
|
|
if (!this.model[i]) {
|
|
|
|
|
this.model[i] = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let search = Object.assign({}, page, this.model);
|
|
|
|
|
return Object.assign({}, page, this.model);
|
|
|
|
|
},
|
|
|
|
|
// 收起展开分页
|
|
|
|
|
showSearch() {
|
|
|
|
|
this.isSearch = !this.isSearch;
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// 查询函数
|
2024-03-26 11:18:19 +08:00
|
|
|
|
search() {
|
|
|
|
|
this.$emit("search", this.ruleForm);
|
|
|
|
|
},
|
2024-04-02 17:14:13 +08:00
|
|
|
|
// 重置函数
|
2024-03-26 11:18:19 +08:00
|
|
|
|
refresh() {
|
|
|
|
|
this.ruleForm = Object.assign({}, "");
|
2024-04-02 17:14:13 +08:00
|
|
|
|
this.search();
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang='scss'>
|
2024-04-02 17:14:13 +08:00
|
|
|
|
.pushButton {
|
|
|
|
|
/* margin: 12px 10px 10px 10px; */
|
|
|
|
|
padding: 10px;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .iconfont {
|
|
|
|
|
font-size: 12px;
|
2024-04-02 17:14:13 +08:00
|
|
|
|
text-align: center;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-02 17:14:13 +08:00
|
|
|
|
::v-deep .el-tooltip {
|
|
|
|
|
padding: 0 3px;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-02 17:14:13 +08:00
|
|
|
|
::v-deep .el-button--mini {
|
|
|
|
|
padding: 6px 8px;
|
|
|
|
|
margin: 5px;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
/* @include boxBase(100%, 48px, $base-color); */
|
|
|
|
|
/* @include fontBase(16px, #fff); */
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-02 17:14:13 +08:00
|
|
|
|
.buttonList + .buttonList {
|
|
|
|
|
margin-left: 5px;
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main {
|
|
|
|
|
/* height: auto !important; */
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
/* padding:0 12px; */
|
|
|
|
|
.search {
|
|
|
|
|
height: auto;
|
|
|
|
|
background: #f5f5f5;
|
|
|
|
|
border: 1px solid #d8d8d8;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
transition: all 0.2s ease-in-out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hide {
|
|
|
|
|
height: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main::-webkit-scrollbar {
|
|
|
|
|
width: 5px;
|
|
|
|
|
/* background-color: #D8D8D8; */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main::-webkit-scrollbar-thumb {
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
width: 5px;
|
|
|
|
|
background: #b4bccc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.w-100 {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mb-12 {
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.back {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|