Commit f4bcfba6 authored by 仇晓婷's avatar 仇晓婷

yangsshi

parent 006fbe8a
@import "./custom.less"; @import "./custom.less";
@import "./iview-reset.less"; @import "./iview-reset.less";
html body { html body {
min-width: 1240px; min-width: 1240px;
color: @body-color; color: @body-color;
...@@ -879,7 +880,7 @@ textarea::-webkit-input-placeholder { ...@@ -879,7 +880,7 @@ textarea::-webkit-input-placeholder {
display: none; display: none;
} }
// 纵横树的样式 // 树的样式
.zh-tree { .zh-tree {
// position: relative; // position: relative;
display: block; display: block;
...@@ -888,8 +889,8 @@ textarea::-webkit-input-placeholder { ...@@ -888,8 +889,8 @@ textarea::-webkit-input-placeholder {
transform: translateX(0); transform: translateX(0);
transition: all .2s; transition: all .2s;
box-sizing: border-box; box-sizing: border-box;
border: #E4E6ED solid 1px; border: @left-boder-color solid 1px;
background: #fff; background: @left-tree-bg;
padding: 0px 10px 20px 10px; padding: 0px 10px 20px 10px;
margin-top: 10px; margin-top: 10px;
...@@ -899,7 +900,7 @@ textarea::-webkit-input-placeholder { ...@@ -899,7 +900,7 @@ textarea::-webkit-input-placeholder {
line-height: 45px; line-height: 45px;
text-align: left; text-align: left;
font-weight: 600; font-weight: 600;
border-bottom: #e4e6ed solid 1px; border-bottom: @left-tree-header-boder-color solid 1px;
} }
.zh-box { .zh-box {
...@@ -925,9 +926,9 @@ textarea::-webkit-input-placeholder { ...@@ -925,9 +926,9 @@ textarea::-webkit-input-placeholder {
box-sizing: border-box; box-sizing: border-box;
transition: all .2s; transition: all .2s;
background: #fff; background: @right-bg;
// border-radius:3px; // border-radius:3px;
padding: 0px 10px 10px 0px; padding: 10px;
margin-top: 10px; margin-top: 10px;
// box-shadow: 0 0 5px rgba(0, 0, 0, .15); // box-shadow: 0 0 5px rgba(0, 0, 0, .15);
} }
...@@ -1038,12 +1039,12 @@ textarea::-webkit-input-placeholder { ...@@ -1038,12 +1039,12 @@ textarea::-webkit-input-placeholder {
} }
.divIco:hover { .divIco:hover {
background: #F5F6FA; background: @right-icon-color-hover;
} }
.icoListInfo { .icoListInfo {
font-weight: bold; font-weight: bold;
color: #515A6E; color: @right-icon-color;
font-size: 24px; font-size: 24px;
} }
...@@ -1397,7 +1398,7 @@ html [type=button] { ...@@ -1397,7 +1398,7 @@ html [type=button] {
} }
.content { .content {
background: white; background: @layout-content-bg-color;
padding: 0 0 0 10px; padding: 0 0 0 10px;
//position: absolute; //position: absolute;
left: 250px; left: 250px;
...@@ -1462,9 +1463,9 @@ html [type=button] { ...@@ -1462,9 +1463,9 @@ html [type=button] {
} }
.menu_side { .menu_side {
background: #fff !important; // background: #fff !important;
margin: 5px 0 0 0 !important; margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important; // border: 1px solid #dcdee2 !important;
} }
.show_menu { .show_menu {
......
//定义变量 //定义变量
//@import './themes/deepBlank.less'; //@import './themes/deepBlank.less';
// @import './themes/green.less'; // @import './themes/green.less';
@import './themes/default.less'; @import './themes/default.less';
...@@ -95,35 +95,6 @@ ...@@ -95,35 +95,6 @@
background-color: @primary-color; background-color: @primary-color;
} }
.ivu-page-item-active {
background-color: @primary-color;
color: white;
}
.ivu-page-item-active:hover {
background-color: @primary-color;
// background-color: #d7e8fb;
a {
color: white !important;
}
}
.ivu-page-item-active>a {
color: white
}
.ivu-page-item-active>a:hover {
color: white
}
.ivu-page li:hover {
color: white
}
.ivu-page-item-active:hover a {
color: #fff;
}
.ivu-input-search { .ivu-input-search {
cursor: pointer; cursor: pointer;
...@@ -231,26 +202,6 @@ ...@@ -231,26 +202,6 @@
background-color: @primary-color; background-color: @primary-color;
} }
//鼠标经过table hover及选择行后的背景色
.ivu-table-row-hover td {
background: #EFF8F7 !important;
}
.ivu-table-row-highlight td {
background-color: #EFF8F7 !important;
}
.ivu-dropdown-rel:hover {
.ivu-btn-text {
background-color: @primary-color;
}
}
//表格字体颜色
.ivu-table {
color: @table-color !important;
}
//校验不通过下面提示红色小字 //校验不通过下面提示红色小字
.ivu-form-item-error-tip { .ivu-form-item-error-tip {
...@@ -451,6 +402,10 @@ ...@@ -451,6 +402,10 @@
.ivu-tree-title { .ivu-tree-title {
color: @tree-title-color !important; color: @tree-title-color !important;
span {
color: @tree-title-color !important;
}
} }
.ivu-btn-group>.ivu-btn { .ivu-btn-group>.ivu-btn {
...@@ -458,3 +413,130 @@ ...@@ -458,3 +413,130 @@
opacity: 0.8; opacity: 0.8;
background: @group-btn-bg-color; background: @group-btn-bg-color;
} }
.ivu-layout {
height: 100%;
background: @layout-content-bg-color !important;
}
//分页
.ivu-page-item-active {
background-color: @page-active-bg !important;
color: white;
}
.ivu-page-item-active:hover {
background-color: @page-active-color-hover;
// background-color: #d7e8fb;
a {
color: white !important;
}
}
.ivu-page-item-active>a {
color: white
}
.ivu-page-item-active>a:hover {
color: white
}
.ivu-page li:hover {
color: white
}
.ivu-page-item-active:hover a {
color: #fff;
}
.ivu-page-prev,
.ivu-page-next {
background: @page-bg !important;
}
.ivu-page-item {
background: @page-bg !important;
}
.ivu-page.mini .ivu-page-options-elevator input {
background: @page-bg;
border: 1px solid @page-bg;
color: @page-color;
opacity: 0.7;
}
.ivu-select-selected-value {
color: @page-color;
opacity: 0.7;
}
//表格
.ivu-table-header thead tr th {
background: @table-header-bg !important; //f5f6fa
border: 1px solid @table-header-border !important;
}
.ivu-table-body {
background-color: @table-body-bg;
}
.ivu-table td {
background-color: @table-body-bg !important;
}
.tableCommon tr td {
background-color: @tableCommon-bg;
border: 1px solid @tableCommon-boder !important;
}
.ivu-table:before {
//表格下边框线
background-color: @table-boder !important;
}
.ivu-table-border:after {
//表格右边框线
background-color: @table-boder !important;
}
.ivu-table-wrapper-with-border {
//表格上,左边框线
// border: 1px solid @table-boder !important;
}
//鼠标经过table hover及选择行后的背景色
.ivu-table-row-hover td {
background: @table-row-hover !important;
}
.ivu-table-row-highlight td {
background-color: @table-row-hover !important;
}
.ivu-dropdown-rel:hover {
.ivu-btn-text {
background-color: @primary-color;
}
}
//表格字体颜色
.ivu-table {
color: @table-color !important;
}
// e8eaec
// EFF8F7
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
//表单的颜色 //表单的颜色
@form-color: #fff; @form-color: #fff;
@form-footer-color: #fff; @form-footer-color: #fff;
...@@ -72,7 +73,34 @@ ...@@ -72,7 +73,34 @@
//左侧列表 //左侧列表
@left-tree-bg: #2F2F57; @left-tree-bg: #2F2F57;
@left-tree-header-bg-color: #2F2F57; @left-tree-header-bg-color: #2F2F57;
@left-tree-header-boder-color: #106FFE;
@left-tree-header-color: #fff; @left-tree-header-color: #fff;
@tree-title-color: #fff; @tree-title-color: #fff;
@group-btn-bg-color:#2F2F57; @group-btn-bg-color: #2F2F57;
@group-btn-color:#F5F6FA; @group-btn-color: #F5F6FA;
\ No newline at end of file @left-boder-color: #2F2F57;
//右侧
@right-header-bg: #2F2F57;
@right-bg: #2F2F57;
@right-icon-color: #fff;
@right-icon-color-hover: #106FFE;
//分页
@page-active-bg: #222341;
@page-active-color-hover: #fff;
@page-bg: #222341;
@page-color:#fff;
//表格
@table-header-bg:#106FFE;
@table-header-border:#106FFE;
@table-body-bg:#222341;
@tableCommon-bg:#222341;
@tableCommon-boder:#222341;
@table-boder:#222341;
@table-row-hover:#2F2F57;
\ No newline at end of file
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
@layout-header: #515A6E; @layout-header: #515A6E;
@layout-tabs: #f5f7f9; @layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E; @layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff; @layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff; @tabs-bg-tag: #fff;
//bady颜色 //bady颜色
@layout-content-bg-color: #fff; @layout-content-bg-color: #fff;
@card-bg: #fff; @card-bg: #fff;
@body-color: #515a6e; @body-color: #515a6e;
@border-color: #dcdfe6; @border-color: #dcdfe6;
...@@ -58,9 +59,9 @@ ...@@ -58,9 +59,9 @@
//表单的颜色 //表单的颜色
@form-color: #515a6e; @form-color: #515a6e;
@form-footer-color: #fff; @form-footer-color: #fff;
@form-divider-boder-color:#e8eaec; @form-divider-boder-color: #e8eaec;
@input-bg-color:#fff; @input-bg-color: #fff;
@input-boder-color:#dcdee2; @input-boder-color: #dcdee2;
...@@ -71,9 +72,34 @@ ...@@ -71,9 +72,34 @@
//左侧列表 //左侧列表
@left-tree-bg:#fff; @left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa; @left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e; @left-tree-header-color: #515a6e;
@tree-title-color:#515a6e; @tree-title-color: #515a6e;
@group-btn-bg-color:#fff; @group-btn-bg-color: #fff;
@group-btn-color:#515a6e; @group-btn-color: #515a6e;
\ No newline at end of file @left-boder-color: #dcdee2;
//右侧
@right-header-bg: #fff;
@right-bg: #fff;
@right-icon-color: #515A6E;
@right-icon-color-hover: #F5F6FA;
//分页
@page-active-bg: #fff;
@page-active-color-hover: #515A6E;
@page-bg: #fff;
@page-color: #515A6E;
//表格
@table-header-bg: #e8eaec;
@table-header-border: #e8eaec;
@table-body-bg: #fff;
@tableCommon-bg: #fff;
@tableCommon-boder: #fff;
@table-boder: #e8eaec;
@table-row-hover: #EFF8F7;
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@layout-header: #515A6E; @layout-header: #515A6E;
@layout-tabs: #f5f7f9; @layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E; @layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff; @layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff; @tabs-bg-tag: #fff;
//bady颜色 //bady颜色
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
//表单的颜色 //表单的颜色
@form-color: #515a6e; @form-color: #515a6e;
@form-footer-color: #fff; @form-footer-color: #fff;
@form-divider-boder-color:#e8eaec; @form-divider-boder-color: #e8eaec;
@input-bg-color:#fff; @input-bg-color: #fff;
@input-boder-color:#dcdee2; @input-boder-color: #dcdee2;
...@@ -70,9 +70,35 @@ ...@@ -70,9 +70,35 @@
//左侧列表 //左侧列表
@left-tree-bg:#fff; @left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa; @left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e; @left-tree-header-color: #515a6e;
@tree-title-color:#515a6e; @tree-title-color: #515a6e;
@group-btn-bg-color:#fff; @group-btn-bg-color: #fff;
@group-btn-color:#515a6e; @group-btn-color: #515a6e;
\ No newline at end of file @left-boder-color: #dcdee2;
//右侧
@right-header-bg: #fff;
@right-bg: #fff;
@right-icon-color: #515A6E;
@right-icon-color-hover: #F5F6FA;
//分页
@page-active-bg: #fff;
@page-active-color-hover: #515A6E;
@page-bg: #fff;
@page-color: #515A6E;
//表格
@table-header-bg: #e8eaec;
@table-header-border: #e8eaec;
@table-body-bg: #fff;
@tableCommon-bg: #fff;
@tableCommon-boder: #fff;
@table-boder: #e8eaec;
@table-row-hover: #EFF8F7;
<template> <template>
<Table <Table
:loading="loading" :loading="loading"
border
highlight-row highlight-row
ref="table" ref="table"
:columns="tcolumn" :columns="tcolumn"
......
<template> <template>
<div class="table-content"> <div class="table-content">
<div class="table-tools" v-if="tool"> <div class="table-tools" v-if="tool">
<div class="table-search"> <div class="table-search">
<slot name="easySearch" v-if="easy"> <slot name="easySearch" v-if="easy">
<Form inline> <Form inline>
<FormItem> <FormItem>
<Input search enter-button :placeholder="placeholder" @on-search="easySearch" v-width="300" v-model="keys" /> <Input
</FormItem> search
<FormItem> enter-button
<Button v-if="high" @click="modalSearch=true" type="text"> :placeholder="placeholder"
<Icon type="md-search" />高级 @on-search="easySearch"
</Button> v-width="300"
</FormItem> v-model="keys"
</Form> />
</slot> </FormItem>
</div> <FormItem>
<Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级
</Button>
</FormItem>
</Form>
</slot>
</div>
<div class="searchBack"> <div class="searchBack">
<slot name="searchBack"></slot> <slot name="searchBack"></slot>
</div> </div>
<div class="btns"> <div class="btns">
<slot name="buttons"></slot> <slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length>0"> <Button @click="export2Excel" v-if="exportTitle.length>0">导出</Button>
导出 <Button v-if="set&&type=='table'" @click="config=!config">
</Button> <Icon type="md-build" title="列设置" />
<Button v-if="set&&type=='table'" @click="config=!config"> </Button>
<Icon type="md-build" title="列设置" /> </div>
</Button>
</div>
</div> </div>
<div class="table-main" ref="main"> <div class="table-main" ref="main">
<Row v-if="type=='card'" :gutter="40"> <Row v-if="type=='card'" :gutter="40">
<Col :span="span" v-for="(row,i) in list" :key="i"> <Col :span="span" v-for="(row,i) in list" :key="i">
<slot name="card" :row="row"> <slot name="card" :row="row">
<span>{{row.id}}</span> <span>{{row.id}}</span>
</slot> </slot>
</Col> </Col>
</Row> </Row>
<Table v-else :border="border" :columns="columnsNow" :data="list" :height="tableHeight" :draggable="draggable" ref="table" class="tableCommon" @on-expand="expand" @on-drag-drop="onDragDrop" @on-selection-change="selectionChange" @on-select="onSelect" @on-select-all="allChange" :row-key="rowKey"></Table> <Table
v-else
:border="border"
:columns="columnsNow"
:data="list"
:height="tableHeight"
:draggable="draggable"
ref="table"
class="tableCommon"
@on-expand="expand"
@on-drag-drop="onDragDrop"
@on-selection-change="selectionChange"
@on-select="onSelect"
@on-select-all="allChange"
:row-key="rowKey"
stripe
></Table>
</div> </div>
<div class="table-footer"> <div class="table-footer">
<slot name="footer"></slot> <slot name="footer"></slot>
<Page v-if="page" :total="search.total" :current="search.page" class="fr" show-total size="small" show-elevator show-sizer :page-size="search.pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" /> <Page
v-if="page"
:total="search.total"
:current="search.page"
class="fr"
show-total
size="small"
show-elevator
show-sizer
:page-size="search.pageSize"
:page-size-opts="pageSizeOpts"
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div> </div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search"> <Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<slot name="searchForm"></slot> <slot name="searchForm"></slot>
<div slot="footer"> <div slot="footer">
<Button @click="modalSearch=false" style="margin-left:20px;">取消</Button> <Button @click="modalSearch=false" style="margin-left:20px;">取消</Button>
<Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button> <Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button>
</div> </div>
</Modal> </Modal>
<Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false"> <Drawer
<div slot="header"> title="列设置"
列设置 v-if="set"
<a @click="undoConfig" class="ml50"> v-model="config"
<Icon type="md-refresh" title="恢复初始设置" /> :scrollable="true"
</a> placement="left"
</div> :mask="false"
<ul class="table-columns"> >
<li v-for="(li,index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }"> <div slot="header">
<label @click="columnChange(li,index)" :class="{dis:li.hide}"> 列设置
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" /> <a @click="undoConfig" class="ml50">
<span>{{li.title}}</span> <Icon type="md-refresh" title="恢复初始设置" />
</label> </a>
<Icon type="ios-move" class="move" size="18" /> </div>
</li> <ul class="table-columns">
</ul> <li
v-for="(li,index) in columnsCur"
:key="index"
v-dragging="{ item: li, list: columnsCur, group: 'li' }"
>
<label @click="columnChange(li,index)" :class="{dis:li.hide}">
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" />
<span>{{li.title}}</span>
</label>
<Icon type="ios-move" class="move" size="18" />
</li>
</ul>
</Drawer> </Drawer>
<FooterToolbar v-if="batch" v-show="footerToolbar" class="ftball"> <FooterToolbar v-if="batch" v-show="footerToolbar" class="ftball">
<div class="tip">已选{{selectItems.length}}</div> <div class="tip">已选{{selectItems.length}}</div>
<slot name="batch"></slot> <slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button> <Button @click="cancelBatch">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "DataGrid", name: "DataGrid",
data() { data() {
return {
keys: "",
selectItems: [],
footerToolbar: false,
modalSearch: false,
search: {
pageIndex: 1,
pageSize: 20,
conditions: [],
},
searchConditions: this.search,
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
firstY: 0,
config: false,
list: [],
columnsCur: [],
configLoad: false,
userConfig: null, //用户页面配置信息。,
// userId: 1
userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
};
},
props: {
border: {
//是否显示边框
type: Boolean,
default: true,
},
batch: {
//是否批量操作
type: Boolean,
default: true,
},
format: {
type: Function,
default: null,
},
initsearch: {
type: Function,
default: null,
},
lazy: {
//懒加载设置,设置为真时候,默认不加载数据。
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "请输入关键字",
},
height: {
type: Number,
default: 0,
},
tool: {
//是否显示工具栏
type: Boolean,
default: true,
},
easy: {
//是否显示简单搜索
type: Boolean,
default: true,
},
high: {
//是否显示高级搜索
type: Boolean,
default: true,
},
draggable: {
//是否可以拖拽
type: Boolean,
default: false,
},
set: {
//是否显示列设置
type: Boolean,
default: true,
},
page: {
//是否分页
type: Boolean,
default: true,
},
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
action: {
//接口地址
type: String,
default: "",
},
conditions: {
//查询条件
type: Object,
default: function () {
return { return {
keys: "", keys: {
selectItems: [], op: "name",
footerToolbar: false, value: "",
modalSearch: false, default: true,
search: { },
pageIndex: 1,
pageSize: 20,
conditions: [],
},
searchConditions: this.search,
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
firstY: 0,
config: false,
list: [],
columnsCur: [],
configLoad: false,
userConfig: null, //用户页面配置信息。,
// userId: 1
userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
}; };
},
}, },
props: { type: {
border: { type: String,
//是否显示边框 default: "table",
type: Boolean, validator: function (value) {
default: true, // 这个值必须匹配下列字符串中的一个
}, return ["table", "card", "list"].indexOf(value) !== -1;
batch: { },
//是否批量操作 },
type: Boolean, span: {
default: true, //栅格数
}, type: Number,
format: { default: 24,
type: Function,
default: null,
},
initsearch: {
type: Function,
default: null,
},
lazy: {
//懒加载设置,设置为真时候,默认不加载数据。
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "请输入关键字",
},
height: {
type: Number,
default: 0,
},
tool: {
//是否显示工具栏
type: Boolean,
default: true,
},
easy: {
//是否显示简单搜索
type: Boolean,
default: true,
},
high: {
//是否显示高级搜索
type: Boolean,
default: true,
},
draggable: {
//是否可以拖拽
type: Boolean,
default: false,
},
set: {
//是否显示列设置
type: Boolean,
default: true,
},
page: {
//是否分页
type: Boolean,
default: true,
},
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
action: {
//接口地址
type: String,
default: "",
},
conditions: {
//查询条件
type: Object,
default: function () {
return {
keys: {
op: "name",
value: "",
default: true
},
};
},
},
type: {
type: String,
default: "table",
validator: function (value) {
// 这个值必须匹配下列字符串中的一个
return ["table", "card", "list"].indexOf(value) !== -1;
},
},
span: {
//栅格数
type: Number,
default: 24,
},
//table控件children子数据控制功能
rowKey: {
type: [String, Number],
},
gutter: {
//间距
type: Number,
default: 40,
},
exportTitle: {
type: String,
default: "",
}
}, },
created() { //table控件children子数据控制功能
this.columns.forEach((u) => { rowKey: {
if (!u.hide) { type: [String, Number],
u.hide = false; },
gutter: {
//间距
type: Number,
default: 40,
},
exportTitle: {
type: String,
default: "",
},
},
created() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
},
mounted() {
if (this.data && this.data.length > 0) {
this.list = this.data;
return;
}
this.keys = "";
this.intY();
if (this.lazy == true) {
return;
}
if (this.userId > 0 && this.set) {
this.loadUserConfig();
} else {
this.easySearch();
}
if (this.height === 0) {
this.$nextTick(() => {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 200;
}
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
if (this.$refs.main && this.$refs.main.offsetHeight) {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 150;
}
} }
})();
};
});
} else {
this.tableHeight = this.height;
}
//注册拖拽事件。
this.$dragging.$on("dragend", (e) => {
this.saveUserconfig();
});
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
this.getRoutingHeaderData();
},
methods: {
//数据加载
load() {
if (this.action) {
//条件初始化处理。
if (this.initsearch) {
this.initsearch(this.search);
}
this.$api.post(this.action, this.search).then((r) => {
if (this.format) {
this.list = this.format(r.result.items);
} else {
this.list = r.result.items;
}
this.search.total = r.result.totalCount || r.result.count;
}); });
this.columnsCur = this.$u.clone(this.columns); }
}, },
mounted() { columnInit() {
if (this.data && this.data.length > 0) { if (this.userConfig) {
this.list = this.data; var curColumns = [];
return; var config = JSON.parse(this.userConfig.content);
} if (config.length == this.columnsCur.length) {
this.keys = ""; config.map((u) => {
this.intY(); var item = this.columnsCur.filter((c) => {
if (this.lazy == true) { return c.key == u.key;
return; });
if (item[0]) {
item[0].hide = u.hide;
curColumns.push(item[0]);
}
});
this.columnsCur = curColumns;
} }
if (this.userId > 0 && this.set) { }
this.loadUserConfig(); },
} else { loadUserConfig() {
var query = {
conditions: [
{
fieldName: "creatorUserId",
fieldValue: this.userId,
conditionalType: "Equal",
},
{
fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) {
if (r.result.length == 1) {
this.userConfig = r.result[0];
this.columnInit();
}
if (!this.configLoad) {
this.easySearch(); this.easySearch();
}
this.configLoad = true;
} }
if (this.height === 0) { });
this.$nextTick(() => { },
this.tableHeight = this.$refs.main.offsetHeight; saveUserconfig() {
if (this.tableHeight < 300) { let url = `${window.systemUrl}/config/update`;
this.tableHeight = var content = [];
window.screen.availHeight - this.$refs.main.offsetTop - 200; this.columnsCur.map((u) => {
} content.push({
window.onresize = () => { key: u.key,
///浏览器窗口大小变化 hide: u.hide,
return (() => { });
if (this.$refs.main && this.$refs.main.offsetHeight) { });
this.tableHeight = this.$refs.main.offsetHeight; if (!this.userConfig) {
if (this.tableHeight < 300) { url = `${window.systemUrl}/config/create`;
this.tableHeight = var data = {
window.screen.availHeight - this.$refs.main.offsetTop - 150; page: window.location.pathname,
} component: "Grid",
} key: this.$u.guid(),
})(); content: JSON.stringify(content),
}; };
}); this.$api.post(url, data).then((r) => {
} else { this.loadUserConfig();
this.tableHeight = this.height;
}
//注册拖拽事件。
this.$dragging.$on("dragend", (e) => {
this.saveUserconfig();
}); });
//物料加载类型数据 } else {
this.getTreeData(); this.userConfig.content = JSON.stringify(content);
this.getcodeRuleData(); this.$api.post(url, this.userConfig);
this.getRoutingHeaderData(); }
}, },
methods: { //展开
//数据加载 expand(row, status) {
load() { this.$emit("on-expand", row, status);
if (this.action) { },
//条件初始化处理。 //拖拽
if (this.initsearch) { onDragDrop(a, b) {
this.initsearch(this.search); this.$emit("on-drag-drop", a, b);
},
easySearch() {
if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys;
}
this.reload(this.conditions);
},
undoConfig() {
//列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig();
},
complexSearch() {
var search = this.$refs.search.$children.filter((u) => {
return u.condition;
});
if (search) {
var conditions = search[0].condition;
this.reload(conditions);
}
},
reload(conditions) {
var where = [];
this.searchConditions = conditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range" && Array.isArray(v)) {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
} }
this.$api.post(this.action, this.search).then((r) => { });
if (this.format) { v = times.join(",");
this.list = this.format(r.result.items); } else if (op.indexOf("In") > -1 && Array.isArray(v)) {
} else { v = v.join(",");
this.list = r.result.items;
}
this.search.total = r.result.totalCount || r.result.count;
});
} }
}, if (!this.$u.isNull(v)) {
columnInit() { where.push({
if (this.userConfig) { fieldName: u,
var curColumns = []; fieldValue: v,
var config = JSON.parse(this.userConfig.content); conditionalType: op,
if (config.length == this.columnsCur.length) { });
config.map((u) => {
var item = this.columnsCur.filter((c) => {
return c.key == u.key;
});
if (item[0]) {
item[0].hide = u.hide;
curColumns.push(item[0]);
}
});
this.columnsCur = curColumns;
}
} }
}, }
loadUserConfig() { });
var query = { }
conditions: [{ this.search.pageIndex = 1;
fieldName: "creatorUserId", this.search.conditions = where;
fieldValue: this.userId, this.load();
conditionalType: "Equal", },
}, pageChange(page) {
{ this.search.page = page;
fieldName: "component", this.search.pageIndex = page;
fieldValue: "Grid", this.load();
conditionalType: "Equal", },
}, pageSizeChange(size) {
{ this.search.pageSize = size;
fieldName: "page", this.search.pageIndex = 1;
fieldValue: window.location.pathname, this.load();
conditionalType: "Equal", },
}, columnChange(item, i) {
], item.hide = !item.hide;
pageSize: 1, this.$set(this.columnsCur, item, i);
}; this.saveUserconfig();
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => { },
if (r.success) { selectionChange(items) {
if (r.result.length == 1) { this.$emit("on-selection-change", items);
this.userConfig = r.result[0]; this.selectItems = items;
this.columnInit(); this.footerToolbar = items.length > 0;
} },
if (!this.configLoad) { onSelect(rows, row) {
this.easySearch(); this.$emit("on-change", rows, row);
} },
this.configLoad = true; allChange(items) {
this.$emit("all-change", items);
},
intY() {
if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
}
},
selectAll(status) {
this.$refs.table.selectAll(status);
},
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//导出excel
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.searchConditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
} }
}); });
}, v = times.join(",");
saveUserconfig() { } else if (op.indexOf("In") > -1 && Array.isArray(v)) {
let url = `${window.systemUrl}/config/update`; v = v.join(",");
var content = [];
this.columnsCur.map((u) => {
content.push({
key: u.key,
hide: u.hide,
});
});
if (!this.userConfig) {
url = `${window.systemUrl}/config/create`;
var data = {
page: window.location.pathname,
component: "Grid",
key: this.$u.guid(),
content: JSON.stringify(content),
};
this.$api.post(url, data).then((r) => {
this.loadUserConfig();
});
} else {
this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig);
} }
}, if (!this.$u.isNull(v)) {
//展开 where.push({
expand(row, status) { fieldName: u,
this.$emit("on-expand", row, status); fieldValue: v,
}, conditionalType: op,
//拖拽 });
onDragDrop(a, b) {
this.$emit("on-drag-drop", a, b);
},
easySearch() {
if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys;
} }
this.reload(this.conditions); }
}, });
undoConfig() { }
//列设置恢复初始化 let searchs = {
this.columnsCur = this.$u.clone(this.columns); pageIndex: 1,
this.saveUserconfig(); conditions: where,
}, pageSize: 1000,
complexSearch() { };
var search = this.$refs.search.$children.filter((u) => { this.$api.post(this.action, searchs).then((r) => {
return u.condition; let list = [];
}); list = r.result.items;
if (search) { const tHeader = []; // 设置Excel的表格第一行的标题
var conditions = search[0].condition; const filterVal = []; //list里对象的属性
this.reload(conditions); var tempCol = [];
var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if (
(el.hide && el.import) ||
(!el.hide &&
el.key != "action" &&
el.type != "selection" &&
el.key != "ico")
) {
if (el.code) {
tempCol.push({
key: el.key,
code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code
} }
}, if (el.materialKey) {
reload(conditions) { tempCol1.push({
var where = []; key: el.key,
this.searchConditions = conditions code: el.materialKey,
if (conditions) { }); //临时存放物料管理大类和子类列表
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range" && Array.isArray(v)) {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
} }
this.search.pageIndex = 1; if (el.techKey) {
this.search.conditions = where; tempCol2.push({
this.load(); key: el.key,
}, code: el.techKey,
pageChange(page) { }); //临时存放工艺规程相关转换
this.search.page = page;
this.search.pageIndex = page;
this.load();
},
pageSizeChange(size) {
this.search.pageSize = size;
this.search.pageIndex = 1;
this.load();
},
columnChange(item, i) {
item.hide = !item.hide;
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit("on-selection-change", items);
this.selectItems = items;
this.footerToolbar = items.length > 0;
},
onSelect(rows, row) {
this.$emit("on-change", rows, row);
},
allChange(items) {
this.$emit("all-change", items);
},
intY() {
if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
} }
},
selectAll(status) {
this.$refs.table.selectAll(status);
},
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//导出excel tHeader.push(el.title);
export2Excel() { filterVal.push(el.key);
//当前显示数据 }
var where = []; });
var conditions = this.searchConditions; list.forEach((e) => {
if (conditions) { //给导出数据增加数据字典对应的name
Object.keys(conditions).forEach((u) => { tempCol.forEach((ele) => {
let v = conditions[u].value; e[ele.key] = this.$u.dirName(
let op = conditions[u].op; this.$store.getters.dictionaryByKey(ele.code),
if (!this.$u.isNull(v)) { e[ele.key]
if (op == "Range") { );
let times = []; });
v.map((u) => { //导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
if (!this.$u.isNull(u)) { tempCol1.forEach((elcol1) => {
times.push(this.$u.toTime(u)); if (elcol1.code == 1) {
} e[elcol1.key] = this.getType1(e[elcol1.key]);
}); } else if (elcol1.code == 2) {
v = times.join(","); e[elcol1.key] = this.getType2(e[elcol1.key]);
} else if (op.indexOf("In") > -1 && Array.isArray(v)) { } else if (elcol1.code == 3) {
v = v.join(","); e[elcol1.key] = this.getType3(e[elcol1.key]);
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
} }
let searchs = { });
pageIndex: 1, //导出工艺规程相关转换表头信息
conditions: where, tempCol2.forEach((elcol2) => {
pageSize: 1000 if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]);
} }
this.$api.post(this.action, searchs).then((r) => { });
let list = [] });
list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
if (el.code) {
tempCol.push({
key: el.key,
code: el.code
}); //临时存放code数据字典的字段及对应的数据字典code
}
if (el.materialKey) {
tempCol1.push({
key: el.key,
code: el.materialKey
}); //临时存放物料管理大类和子类列表
}
if (el.techKey) {
tempCol2.push({
key: el.key,
code: el.techKey
}); //临时存放工艺规程相关转换
}
tHeader.push(el.title);
filterVal.push(el.key);
}
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key])
} else if (elcol1.code == 2) {
e[elcol1.key] = this.getType2(e[elcol1.key])
} else if (elcol1.code == 3) {
e[elcol1.key] = this.getType3(e[elcol1.key])
}
});
//导出工艺规程相关转换表头信息
tempCol2.forEach((elcol2) => {
if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key])
}
});
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束 //获取导出数据结束
this.$u.outExcel(this.exportTitle + this.$u.outExcel(
"(" + nowDate + ")", this.exportTitle + "(" + nowDate + ")",
tHeader, tHeader,
filterVal, filterVal,
list list
); );
}); });
}, },
//物料大类和子类的解析start //物料大类和子类的解析start
getTreeData() { getTreeData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/category/list`, data).then((r) => { this.$api.post(`${material}/category/list`, data).then((r) => {
this.treeData = r.result this.treeData = r.result;
}); });
}, },
getType1(val) { getType1(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let rootName = "" let rootName = "";
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId == 0 && ele.id == val) { if (ele.upId == 0 && ele.id == val) {
rootName = ele.name rootName = ele.name;
} }
}) });
return rootName return rootName;
}, },
getType2(val) { getType2(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let childrenName = "" let childrenName = "";
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId > 0 && ele.id == val) { if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name childrenName = ele.name;
} }
}) });
return childrenName return childrenName;
}, },
//获取编码名称 //获取编码名称
getcodeRuleData() { getcodeRuleData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/coderule/paged`, data).then((r) => { this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) { if (r.success) {
this.codeRuleData = r.result.items || [] this.codeRuleData = r.result.items || [];
} }
}); });
}, },
getType3(val) { getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData) let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleName = "" let codeRuleName = "";
codeRuleDataList.forEach(ele => { codeRuleDataList.forEach((ele) => {
if (ele.id == val) { if (ele.id == val) {
codeRuleName = ele.name codeRuleName = ele.name;
} }
}) });
return codeRuleName return codeRuleName;
}, },
//物料大类和子类的解析end //物料大类和子类的解析end
//工艺规程的解析start //工艺规程的解析start
//获取工艺规程名称 //获取工艺规程名称
getRoutingHeaderData() { getRoutingHeaderData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => { this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => {
if (r.success) { if (r.success) {
this.routingHeaderData = r.result || [] this.routingHeaderData = r.result || [];
} }
}); });
}, },
getRoutingHeaderName(val) { getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData) let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "" let routingHeaderName = "";
routingHeaderDataList.forEach(ele => { routingHeaderDataList.forEach((ele) => {
if (ele.id == val) { if (ele.id == val) {
routingHeaderName = ele.name routingHeaderName = ele.name;
} }
}) });
return routingHeaderName return routingHeaderName;
}, },
//工艺规程的解析end //工艺规程的解析end
}, },
computed: { computed: {
columnsNow() { columnsNow() {
var cols = this.columnsCur.filter((u) => { var cols = this.columnsCur.filter((u) => {
if (u.code) { if (u.code) {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key; let values = u.key;
let type = "text"; let type = "text";
if (u.category) { if (u.category) {
type = u.category; type = u.category;
} }
return h("state", { return h("state", {
props: { props: {
code: u.code, code: u.code,
type: type, type: type,
value: params.row[values] + "", value: params.row[values] + "",
}, },
});
};
}
if (u.type == "user") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("User", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
let values = u.key;
return h("DTSpan", {
props: {
type: u.type,
value: params.row[values],
},
});
};
}
return !u.hide;
}); });
return cols; };
}, }
}, if (u.type == "user") {
watch: { u.render = (h, params) => {
"data"() { let values = u.key;
this.list = this.data; if (params.row[values]) {
}, return h("User", {
height() { props: {
this.tableHeight = this.height; value: params.row[values],
}, },
"columns"() { });
this.columns.forEach((u) => { }
if (!u.hide) { };
u.hide = false; }
} if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
let values = u.key;
return h("DTSpan", {
props: {
type: u.type,
value: params.row[values],
},
}); });
this.columnsCur = this.$u.clone(this.columns); };
}, }
return !u.hide;
});
return cols;
},
},
watch: {
data() {
this.list = this.data;
},
height() {
this.tableHeight = this.height;
},
columns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
}, },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.tip { .tip {
display: inline; display: inline;
} }
form { form {
display: inline-block; display: inline-block;
.ivu-form-item { .ivu-form-item {
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
}
} }
}
.table-main { .table-main {
width: 100%; width: 100%;
text-align: left; text-align: left;
padding: 0; padding: 0;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
flex-grow: 1; flex-grow: 1;
tr td .ivu-table-cell { tr td .ivu-table-cell {
padding: 0 5px; padding: 0 5px;
}
overflow-x: hidden;
} }
.table-tools { overflow-x: hidden;
display: flex; }
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns { .table-tools {
min-width: 200px; display: flex;
text-align: right; line-height: 50px;
} background: @right-header-bg;
.table-search {
flex-grow: 1;
} }
.table-footer { .btns {
line-height: 45px; min-width: 200px;
text-align: right;
} }
}
.ivu-footer-toolbar { .table-footer {
text-align: left; line-height: 45px;
background: rgba(0, 0, 0, 0.7); }
color: #fff;
} .ivu-footer-toolbar {
text-align: left;
background: rgba(0, 0, 0, 0.7);
color: #fff;
}
} }
.table-columns { .table-columns {
max-height: calc(100% - 50px); max-height: calc(100% - 50px);
overflow: auto; overflow: auto;
li { li {
list-style: none; list-style: none;
line-height: 40px; line-height: 40px;
cursor: move; cursor: move;
border-bottom: 1px dotted #249e91; border-bottom: 1px dotted #249e91;
color: #249e91; color: #249e91;
span { span {
cursor: pointer; cursor: pointer;
} }
.mr10 { .mr10 {
cursor: pointer; cursor: pointer;
} }
.move { .move {
float: right; float: right;
margin: 10px 10px 0 0; margin: 10px 10px 0 0;
cursor: move; cursor: move;
} }
.dis { .dis {
color: #aaa; color: #aaa;
}
} }
}
} }
.searchBack { .searchBack {
display: inline; display: inline;
margin-left: 20px; margin-left: 20px;
button { button {
margin-left: 10px; margin-left: 10px;
} }
a { a {
margin-left: 20px; margin-left: 20px;
color: #2680eb; color: #2680eb;
} }
a:hover { a:hover {
color: #249e91; color: #249e91;
} }
} }
</style> </style>
...@@ -475,6 +475,7 @@ export default { ...@@ -475,6 +475,7 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "../../assets/css/custom.less";
//position: relative; //position: relative;
// height: 100%; // height: 100%;
.tableCommon { .tableCommon {
...@@ -497,6 +498,7 @@ export default { ...@@ -497,6 +498,7 @@ export default {
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
<template> <template>
<Modal v-model="ImportModal" :title="modalTitles" fullscreen footer-hide @on-cancel="cancelModal"> <Modal v-model="ImportModal" :title="modalTitles" fullscreen footer-hide @on-cancel="cancelModal">
<div class="table-content"> <div class="table-content">
<div class="table-tools">
<div class="table-tools"> <div class="table-search">
<div class="table-search"> <Form inline>
<Form inline> <FormItem>
<FormItem> <div style="height:34px;overflow: hidden;padding:0;width:120px">
<div style="height:34px;overflow: hidden;padding:0;width:120px"> <Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList"> <Button icon="ios-cloud-upload-outline">上传文件</Button>
<Button icon="ios-cloud-upload-outline">上传文件</Button> </Upload>
</Upload> </div>
</div> </FormItem>
</FormItem> <FormItem>
<FormItem> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> </FormItem>
</FormItem> </Form>
</div>
</Form> <div class="btns">
</div> <Form inline>
<div class="btns"> <FormItem>
<Form inline> <RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<FormItem> <Tooltip content="文件数据">
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small"> <Radio label="0">
<Tooltip content="文件数据"> <Icon type="ios-list-box-outline" />
<Radio label="0"> </Radio>
<Icon type="ios-list-box-outline" /> </Tooltip>
</Radio> <Tooltip content="粘贴Excel数据">
</Tooltip> <Radio label="1">
<Tooltip content="粘贴Excel数据"> <Icon type="ios-copy" />
<Radio label="1"> </Radio>
<Icon type="ios-copy" /> </Tooltip>
</Radio> </RadioGroup>
</Tooltip> </FormItem>
</RadioGroup> </Form>
</FormItem>
</Form>
</div>
</div> </div>
<div class="table-main" ref="main"> </div>
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table> <div class="table-main" ref="main">
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" /> <Table
:border="true"
:columns="columnsImport"
:data="excelData"
:height="tdHeightExcel"
:no-data-text="noDataText"
ref="table"
class="tableCommon"
v-if="tableImport"
></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> </Modal>
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
</Modal>
</div> </div>
</Modal> </Modal>
</template> </template>
<script> <script>
import XLSX from "xlsx"; import XLSX from "xlsx";
import { import { Switch } from "view-design";
Switch
} from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
tabVal: 0, tabVal: 0,
infoModal: false, infoModal: false,
entity: {}, entity: {},
downUrl: fileUrlDown, downUrl: fileUrlDown,
fileUrlPath: "", fileUrlPath: "",
disabled: false, disabled: false,
detailExcel: null, detailExcel: null,
tableImport: true, tableImport: true,
tdHeightExcel: "", tdHeightExcel: "",
excelData: [], excelData: [],
excelDataBack: [], //临时存储原始数据 excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"], formatList: ["xlsx"],
columnsImport: [], columnsImport: [],
departArr: [], //部门list departArr: [], //部门list
sheetNames: [], //excel的表明 sheetNames: [], //excel的表明
workBook: {}, workBook: {},
openDatas: [], openDatas: [],
dataType: 0, dataType: 0,
//new //new
colsIm: [], colsIm: [],
dataIm: [], dataIm: [],
excelType: '0', excelType: "0",
btnIm: true, btnIm: true,
titleInfo: '', titleInfo: "",
noDataText: '暂无数据', noDataText: "暂无数据",
imBtn: true, imBtn: true,
columnsIm: this.columns, columnsIm: this.columns,
ImportModal: this.open, ImportModal: this.open,
batchImportUrl: '', batchImportUrl: "",
modalTitles: '导入', modalTitles: "导入",
}; };
},
props: {
eid: Number,
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
}, },
props: { columns: {
eid: Number, //要显示的字段
data: { type: Array,
// 当作table使用,直接显示数据 default: [],
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
open: {
type: Boolean,
default: false
},
modalTitle: {
type: String,
default: ""
}
}, },
created() { open: {
this.tdHeightExcel = window.innerHeight - 180; type: Boolean,
//导出对列表头进行预加载start default: false,
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
//导出对列表头进行预加载end
}, },
mounted() { modalTitle: {
//if (this.eid > 0) { type: String,
// this.load(this.eid); default: "",
//}
this.modalTitles = "导入到【" + this.modalTitle + "】"
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
}, },
methods: { },
//重新处理colum created() {
loadColum(columns) { this.tdHeightExcel = window.innerHeight - 180;
let tempCol = this.$u.clone(columns); //导出对列表头进行预加载start
tempCol.forEach((ele, index) => { this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") { this.departArr = r.result.items;
ele.hide = true; });
}
});
this.colsIm = tempCol;
this.colsIm.unshift({
type: 'index',
width: 80,
align: 'right',
title: '序号'
}, {
key: "ico",
title: " ",
align: "center",
width: 60,
render: (h, params) => {
return h("div", {
class: ""
}, [
h(params.row.ico ? "op" : "", {
attrs: {
icon: "ios-alert",
type: "icon",
title: "数据不合法",
color: "#ff9900"
}
}),
]);
},
})
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack)
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData)
}
let arrTitleUse = []; ////使用数据字典的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//对列表里的部门及数据字典项进行处理
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
arrTitleUse.forEach((elem) => { //导出对列表头进行预加载end
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { },
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 mounted() {
eles[elem.key] = this.$u.dirCode( //if (this.eid > 0) {
this.$store.getters.dictionaryByKey(elem.code), // this.load(this.eid);
eles[elem.key] //}
); this.modalTitles = "导入到【" + this.modalTitle + "】";
} window.onresize = () => {
}); ///浏览器窗口大小变化
return (() => {
}) window.screenHeight = window.innerHeight;
this.dataIm = useData; this.tdHeightExcel = window.screenHeight - 180;
let tempData = this.$u.clone(this.dataIm); })();
this.$emit("on-get-data", tempData) };
},
methods: {
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.forEach((ele, index) => {
if (
ele.key == "action" ||
ele.type == "selection" ||
ele.key == "ico"
) {
ele.hide = true;
}
});
this.colsIm = tempCol;
this.colsIm.unshift(
{
type: "index",
width: 80,
align: "right",
title: "序号",
}, },
{
key: "ico",
title: " ",
align: "center",
width: 60,
render: (h, params) => {
return h(
"div",
{
class: "",
},
[
h(params.row.ico ? "op" : "", {
attrs: {
icon: "ios-alert",
type: "icon",
title: "数据不合法",
color: "#ff9900",
},
}),
]
);
},
}
);
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack);
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData);
}
let arrTitleUse = []; ////使用数据字典的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//导入excel文件 //对列表里的部门及数据字典项进行处理
useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[
(eles.departmentTitle && eles.departmentTitle != "") ||
(eles.departmentName && eles.departmentName != ""),
] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if (
(eles.departmentTitle && eles.departmentTitle == e.name) ||
(eles.departmentName && eles.departmentName == e.name)
) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") &&
(!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
async beforeUpload(file) { arrTitleUse.forEach((elem) => {
//初始化 if (
this.sheetNames = []; eles[elem.key] &&
this.workBook = {}; eles[elem.key] != "" &&
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表 eles[elem.key] != null
//上传成功后的读取到excel信息 ) {
this.workBook = await this.$u.readXLSX(file); //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
this.sheetNames = this.workBook.SheetNames; //execel里的表明 eles[elem.key] = this.$u.dirCode(
this.btnIm = false; this.$store.getters.dictionaryByKey(elem.code),
this.dealSheet(0); //默认显示第一个表 eles[elem.key]
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
); );
}
});
});
this.dataIm = useData;
let tempData = this.$u.clone(this.dataIm);
this.$emit("on-get-data", tempData);
},
var lines = csv.split("\n"); //第一行标题 //导入excel文件
var headers = lines[0].split(",");
var headersNow = [];
headersNow.push({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
headers.forEach((elHead) => {
let headObj = {};
headObj.title = elHead;
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0)
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val
this.dealSheet(val);
}, async beforeUpload(file) {
handleClose() { //初始化
this.$emit("on-close"); this.sheetNames = [];
}, this.workBook = {};
cancelExcel() { this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
this.excelData = []; //上传成功后的读取到excel信息
this.excelDataBack = []; this.workBook = await this.$u.readXLSX(file);
this.$refs.uploadfile.clearFiles(); this.sheetNames = this.workBook.SheetNames; //execel里的表明
let parms = { this.btnIm = false;
status: 1, this.dealSheet(0); //默认显示第一个表
id: this.eid return false;
} },
//导入中心列表数据状态更新 //对上传的excel表信息进行处理,不对表头进行处理
this.$emit("on-close"); dealSheet(index) {
}, this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
//打开导入数据格式化后的窗口 var lines = csv.split("\n"); //第一行标题
openInfoModal() { var headers = lines[0].split(",");
if ((this.excelType == '0' && this.excelData.length > 0) || (this.excelType == '1' && this.$refs.comExcel.excelData.length > 0)) { var headersNow = [];
this.imBtn = true; headersNow.push({
this.loadColum(this.columnsIm); type: "index",
this.titleInfo = "批量导入"; width: 80,
this.infoModal = true; align: "right",
} else { title: "序号",
this.imBtn = false; });
this.$Message.error("没有可导入的数据!") headers.forEach((elHead) => {
} let headObj = {};
}, headObj.title = elHead;
//确定导入按钮操作 headObj.key = elHead;
importOk() { headersNow.push(headObj);
let imData = []; });
let imDataError = [] this.columnsImport = headersNow;
this.dataIm.forEach(ele => { var result = [];
if (!ele.ico) { for (var i = 1; i < lines.length - 1; i++) {
imData.push(ele) var obj = {};
} else { var currentline = lines[i].split(",");
imDataError.push(ele) for (var j = 0; j < headers.length; j++) {
} obj[headers[j]] = currentline[j];
}) }
this.$api.post(this.batchImportUrl, { result.push(obj);
list: imData }
}).then((r) => { this.excelData = result;
if (r.success) { this.excelDataBack = result;
this.$Message.success("批量导入成功" + imData.length + "条数据") this.changeExcel(0);
this.dataIm = imDataError },
this.$emit("on-ok") //切换sheet表重新加载
} else { sheetClick(val) {
this.$Message.error("批量导入失败") this.tabVal = val;
} this.dealSheet(val);
}).catch(err => { },
this.$Message.error("数据异常!"); handleClose() {
});; this.$emit("on-close");
}, },
//切换列表和excel按钮 cancelExcel() {
changeExcel(val) { this.excelData = [];
if (val == 1) { this.excelDataBack = [];
this.tableImport = false this.$refs.uploadfile.clearFiles();
this.detailExcel = () => import("./detailExcel"); let parms = {
this.excelType = '1'; status: 1,
this.btnIm = true id: this.eid,
} else { };
this.detailExcel = null; //导入中心列表数据状态更新
this.tableImport = true; this.$emit("on-close");
this.excelType = '0'; },
if (this.excelData.length > 0) {
this.btnIm = false
} else {
this.btnIm = true
}
}
}, //打开导入数据格式化后的窗口
datalength(val) { openInfoModal() {
if (val > 0) { if (
this.btnIm = false (this.excelType == "0" && this.excelData.length > 0) ||
} (this.excelType == "1" && this.$refs.comExcel.excelData.length > 0)
}, ) {
cancelModal() { this.imBtn = true;
this.$emit('on-cancel') this.loadColum(this.columnsIm);
}, this.titleInfo = "批量导入";
//主页面里第二次处理数据 this.infoModal = true;
deelData(url, columns, formatList) { } else {
this.dataIm = formatList this.imBtn = false;
this.batchImportUrl = url this.$Message.error("没有可导入的数据!");
}, }
l(key) {
key = "user" + "." + key;
return this.$t(key);
},
}, },
watch: { //确定导入按钮操作
"columns"() { importOk() {
this.columns.forEach((u) => { let imData = [];
if (!u.hide) { let imDataError = [];
u.hide = false; this.dataIm.forEach((ele) => {
} if (!ele.ico) {
}); imData.push(ele);
this.colsIm = this.$u.clone(this.columns); } else {
this.columnsIm = this.$u.clone(this.columns) imDataError.push(ele);
}, }
open(v) { });
this.ImportModal = v this.$api
}, .post(this.batchImportUrl, {
modalTitle(v) { list: imData,
this.modalTitles = "导入到【" + v + "】" })
}, .then((r) => {
if (r.success) {
this.$Message.success("批量导入成功" + imData.length + "条数据");
this.dataIm = imDataError;
this.$emit("on-ok");
} else {
this.$Message.error("批量导入失败");
}
})
.catch((err) => {
this.$Message.error("数据异常!");
});
},
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false;
this.detailExcel = () => import("./detailExcel");
this.excelType = "1";
this.btnIm = true;
} else {
this.detailExcel = null;
this.tableImport = true;
this.excelType = "0";
if (this.excelData.length > 0) {
this.btnIm = false;
} else {
this.btnIm = true;
}
}
},
datalength(val) {
if (val > 0) {
this.btnIm = false;
}
}, },
cancelModal() {
this.$emit("on-cancel");
},
//主页面里第二次处理数据
deelData(url, columns, formatList) {
this.dataIm = formatList;
this.batchImportUrl = url;
},
l(key) {
key = "user" + "." + key;
return this.$t(key);
},
},
watch: {
columns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.colsIm = this.$u.clone(this.columns);
this.columnsIm = this.$u.clone(this.columns);
},
open(v) {
this.ImportModal = v;
},
modalTitle(v) {
this.modalTitles = "导入到【" + v + "】";
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.tip { .tip {
display: inline; display: inline;
} }
form { form {
display: inline-block; display: inline-block;
.ivu-form-item { .ivu-form-item {
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
}
} }
}
.table-main { .table-main {
width: 100%; width: 100%;
text-align: left; text-align: left;
padding: 0; padding: 0;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
flex-grow: 1; flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden; tr td .ivu-table-cell {
padding: 0 5px;
} }
.table-tools { overflow-x: hidden;
display: flex; }
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns { .table-tools {
min-width: 200px; display: flex;
text-align: right; line-height: 50px;
} background: @right-header-bg;
.table-search {
flex-grow: 1;
} }
.btns {
min-width: 200px;
text-align: right;
}
}
} }
</style> </style>
...@@ -135,23 +135,23 @@ ...@@ -135,23 +135,23 @@
</div> </div>
</template> </template>
<script> <script>
import TableExpand from './expand' import TableExpand from "./expand";
export default { export default {
name: 'treeGrid', name: "treeGrid",
components: { TableExpand }, components: { TableExpand },
props: { props: {
columns: Array, columns: Array,
items: { items: {
type: Array, type: Array,
default() { default() {
return [] return [];
} },
}, },
iconName: false iconName: false,
}, },
data() { data() {
return { return {
color: '#19be6b', color: "#19be6b",
initItems: [], // 处理后数据数组 initItems: [], // 处理后数据数组
cloneColumns: [], // 处理后的表头数据 cloneColumns: [], // 处理后的表头数据
checkGroup: [], // 复选框数组 checkGroup: [], // 复选框数组
...@@ -159,116 +159,116 @@ export default { ...@@ -159,116 +159,116 @@ export default {
screenWidth: document.body.clientWidth, // 自适应宽 screenWidth: document.body.clientWidth, // 自适应宽
tdsWidth: 0, // td总宽 tdsWidth: 0, // td总宽
timer: false, // 控制监听时长 timer: false, // 控制监听时长
dataLength: 0 // 树形数据长度 dataLength: 0, // 树形数据长度
} };
}, },
computed: { computed: {
tableWidth() { tableWidth() {
return this.tdsWidth > this.screenWidth && this.screenWidth > 0 return this.tdsWidth > this.screenWidth && this.screenWidth > 0
? `${this.screenWidth}px` ? `${this.screenWidth}px`
: '100%' : "100%";
} },
}, },
watch: { watch: {
screenWidth(val) { screenWidth(val) {
if (!this.timer) { if (!this.timer) {
this.screenWidth = val this.screenWidth = val;
this.timer = true this.timer = true;
setTimeout(() => { setTimeout(() => {
this.timer = false this.timer = false;
}, 400) }, 400);
} }
}, },
items() { items() {
if (this.items) { if (this.items) {
this.initItems = [] this.initItems = [];
this.dataLength = this.Length(this.items) this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null) this.initData(this.deepCopy(this.items), 1, null);
this.checkGroup = this.renderCheck(this.items) this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) { if (this.checkGroup.length == this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
} }
}, },
columns: { columns: {
handler() { handler() {
this.cloneColumns = this.makeColumns() this.cloneColumns = this.makeColumns();
}, },
deep: true deep: true,
}, },
checkGroup(data) { checkGroup(data) {
this.checkAllGroupChange(data) this.checkAllGroupChange(data);
} },
}, },
mounted() { mounted() {
if (this.items) { if (this.items) {
this.dataLength = this.Length(this.items) this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null) this.initData(this.deepCopy(this.items), 1, null);
this.cloneColumns = this.makeColumns() this.cloneColumns = this.makeColumns();
this.checkGroup = this.renderCheck(this.items) this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) { if (this.checkGroup.length == this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
} }
// 绑定onresize事件 监听屏幕变化设置宽 // 绑定onresize事件 监听屏幕变化设置宽
this.$nextTick(() => { this.$nextTick(() => {
this.screenWidth = document.body.clientWidth this.screenWidth = document.body.clientWidth;
}) });
window.onresize = () => window.onresize = () =>
(() => { (() => {
window.screenWidth = document.body.clientWidth window.screenWidth = document.body.clientWidth;
this.screenWidth = window.screenWidth this.screenWidth = window.screenWidth;
})() })();
}, },
methods: { methods: {
// 有无多选框折叠位置优化 // 有无多选框折叠位置优化
iconRow() { iconRow() {
for (let i = 0, len = this.columns.length; i < len; i++) { for (let i = 0, len = this.columns.length; i < len; i++) {
if (this.columns[i].type == 'selection') { if (this.columns[i].type == "selection") {
return 1 return 1;
} }
} }
return 0 return 0;
}, },
// 设置td宽度,td的align // 设置td宽度,td的align
tdStyle(column) { tdStyle(column) {
const style = {} const style = {};
if (column.align) { if (column.align) {
style['text-align'] = column.align style["text-align"] = column.align;
} }
if (column.width) { if (column.width) {
style['width'] = `${column.width}px` style["width"] = `${column.width}px`;
} }
return style return style;
}, },
// 排序事件 // 排序事件
handleSort(index, type) { handleSort(index, type) {
this.cloneColumns.forEach((col) => (col._sortType = 'normal')) this.cloneColumns.forEach((col) => (col._sortType = "normal"));
if (this.cloneColumns[index]._sortType === type) { if (this.cloneColumns[index]._sortType === type) {
this.cloneColumns[index]._sortType = 'normal' this.cloneColumns[index]._sortType = "normal";
} else { } else {
this.cloneColumns[index]._sortType = type this.cloneColumns[index]._sortType = type;
} }
this.$emit( this.$emit(
'on-sort-change', "on-sort-change",
this.cloneColumns[index].key, this.cloneColumns[index].key,
this.cloneColumns[index]._sortType this.cloneColumns[index]._sortType
) );
}, },
// 点击某一行事件 // 点击某一行事件
RowClick(data, event, index, text) { RowClick(data, event, index, text) {
// this.iconName = true; // this.iconName = true;
const result = this.makeData(data) const result = this.makeData(data);
this.$emit('on-row-click', result, event, index, text) this.$emit("on-row-click", result, event, index, text);
}, },
//点击图标 //点击图标
RowClickIcon(event, index, text) { RowClickIcon(event, index, text) {
this.$emit('on-icon-click', event, index, text) this.$emit("on-icon-click", event, index, text);
}, },
//修改排序 //修改排序
updataOrderNum(data, event, index, text) { updataOrderNum(data, event, index, text) {
...@@ -276,9 +276,9 @@ export default { ...@@ -276,9 +276,9 @@ export default {
// console.log(event.orderNum + "nnnnnnnn"); // console.log(event.orderNum + "nnnnnnnn");
var data = { var data = {
id: event.id, id: event.id,
orderNum: event.orderNum orderNum: event.orderNum,
} };
this.updata(data) this.updata(data);
}, },
//修改颜色 //修改颜色
updataColor(data, event, index, text) { updataColor(data, event, index, text) {
...@@ -286,144 +286,144 @@ export default { ...@@ -286,144 +286,144 @@ export default {
//console.log(event.color + "nnnnnnnn"); //console.log(event.color + "nnnnnnnn");
var data = { var data = {
id: event.id, id: event.id,
color: event.color color: event.color,
} };
this.updata(data) this.updata(data);
}, },
//修改单个字段 //修改单个字段
updata(data) { updata(data) {
this.$http.dic this.$http.dic
.dicUpdate(data) .dicUpdate(data)
.then((res) => { .then((res) => {
this.$Message.success(res.msg) this.$Message.success(res.msg);
this.$parent.getInfo() this.$parent.getInfo();
}) })
.catch((error) => { .catch((error) => {
this.$Message.error(error.msg) this.$Message.error(error.msg);
}) });
}, },
// 点击事件 返回数据处理 // 点击事件 返回数据处理
makeData(data) { makeData(data) {
const t = this.type(data) const t = this.type(data);
let o let o;
if (t === 'array') { if (t === "array") {
o = [] o = [];
} else if (t === 'object') { } else if (t === "object") {
o = {} o = {};
} else { } else {
return data return data;
} }
if (t === 'array') { if (t === "array") {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
o.push(this.makeData(data[i])) o.push(this.makeData(data[i]));
} }
} else if (t === 'object') { } else if (t === "object") {
for (const i in data) { for (const i in data) {
if ( if (
i != 'spaceHtml' && i != "spaceHtml" &&
i != 'parent' && i != "parent" &&
i != 'level' && i != "level" &&
i != 'expanded' && i != "expanded" &&
i != 'isShow' && i != "isShow" &&
i != 'load' i != "load"
) { ) {
o[i] = this.makeData(data[i]) o[i] = this.makeData(data[i]);
} }
} }
} }
return o return o;
}, },
// 处理表头数据 // 处理表头数据
makeColumns() { makeColumns() {
const columns = this.deepCopy(this.columns) const columns = this.deepCopy(this.columns);
this.tdsWidth = 0 this.tdsWidth = 0;
columns.forEach((column, index) => { columns.forEach((column, index) => {
column._index = index column._index = index;
column._width = column.width ? column.width : '' column._width = column.width ? column.width : "";
column._sortType = 'normal' column._sortType = "normal";
this.tdsWidth += column.width ? parseFloat(column.width) : 0 this.tdsWidth += column.width ? parseFloat(column.width) : 0;
}) });
return columns return columns;
}, },
// 数据处理 增加自定义属性监听 // 数据处理 增加自定义属性监听
initData(items, level, parent) { initData(items, level, parent) {
// this.initItems = [] // this.initItems = []
let spaceHtml = '' let spaceHtml = "";
for (let i = 1; i < level; i++) { for (let i = 1; i < level; i++) {
spaceHtml += spaceHtml +=
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class='ms-tree-space'></i>" "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class='ms-tree-space'></i>";
} }
items.forEach((item, index) => { items.forEach((item, index) => {
item = Object.assign({}, item, { item = Object.assign({}, item, {
parent, parent,
level, level,
spaceHtml spaceHtml,
}) });
if (typeof item.expanded === 'undefined') { if (typeof item.expanded === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
expanded: true expanded: true,
}) });
} }
if (typeof item.show === 'undefined') { if (typeof item.show === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
isShow: true isShow: true,
}) });
} }
if (typeof item.isChecked === 'undefined') { if (typeof item.isChecked === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
isChecked: false isChecked: false,
}) });
} }
item = Object.assign({}, item, { item = Object.assign({}, item, {
load: !!item.expanded load: !!item.expanded,
}) });
this.initItems.push(item) this.initItems.push(item);
if (item.children && item.expanded) { if (item.children && item.expanded) {
this.initData(item.children, level + 1, item) this.initData(item.children, level + 1, item);
} }
items.splice(index, 1, item) items.splice(index, 1, item);
}) });
}, },
// 隐藏显示 // 隐藏显示
show(item) { show(item) {
return ( return (
item.level == 1 || (item.parent && item.parent.expanded && item.isShow) item.level == 1 || (item.parent && item.parent.expanded && item.isShow)
) );
}, },
toggle(index, item) { toggle(index, item) {
const level = item.level + 1 const level = item.level + 1;
let spaceHtml = '' let spaceHtml = "";
for (let i = 1; i < level; i++) { for (let i = 1; i < level; i++) {
spaceHtml += "<i class='ms-tree-space'></i>" spaceHtml += "<i class='ms-tree-space'></i>";
} }
if (item.children) { if (item.children) {
if (item.expanded) { if (item.expanded) {
item.expanded = !item.expanded item.expanded = !item.expanded;
this.close(index, item) this.close(index, item);
} else { } else {
item.expanded = !item.expanded item.expanded = !item.expanded;
if (item.load) { if (item.load) {
this.open(index, item) this.open(index, item);
} else { } else {
item.load = true item.load = true;
item.children.forEach((child, childIndex) => { item.children.forEach((child, childIndex) => {
this.initItems.splice(index + childIndex + 1, 0, child) this.initItems.splice(index + childIndex + 1, 0, child);
// 设置监听属性 // 设置监听属性
this.$set(this.initItems[index + childIndex + 1], 'parent', item) this.$set(this.initItems[index + childIndex + 1], "parent", item);
this.$set(this.initItems[index + childIndex + 1], 'level', level) this.$set(this.initItems[index + childIndex + 1], "level", level);
this.$set( this.$set(
this.initItems[index + childIndex + 1], this.initItems[index + childIndex + 1],
'spaceHtml', "spaceHtml",
spaceHtml spaceHtml
) );
this.$set(this.initItems[index + childIndex + 1], 'isShow', true) this.$set(this.initItems[index + childIndex + 1], "isShow", true);
this.$set( this.$set(
this.initItems[index + childIndex + 1], this.initItems[index + childIndex + 1],
'expanded', "expanded",
false false
) );
}) });
} }
} }
} }
...@@ -431,42 +431,42 @@ export default { ...@@ -431,42 +431,42 @@ export default {
open(index, item) { open(index, item) {
if (item.children) { if (item.children) {
item.children.forEach((child, childIndex) => { item.children.forEach((child, childIndex) => {
child.isShow = true child.isShow = true;
if (child.children && child.expanded) { if (child.children && child.expanded) {
this.open(index + childIndex + 1, child) this.open(index + childIndex + 1, child);
} }
}) });
} }
}, },
close(index, item) { close(index, item) {
if (item.children) { if (item.children) {
item.children.forEach((child, childIndex) => { item.children.forEach((child, childIndex) => {
child.isShow = false child.isShow = false;
child.expanded = false child.expanded = false;
if (child.children) { if (child.children) {
this.close(index + childIndex + 1, child) this.close(index + childIndex + 1, child);
} }
}) });
} }
}, },
// 点击check勾选框,判断是否有children节点 如果有就一并勾选 // 点击check勾选框,判断是否有children节点 如果有就一并勾选
handleCheckClick(data, event, index) { handleCheckClick(data, event, index) {
data.isChecked = !data.isChecked data.isChecked = !data.isChecked;
const arr = data.children const arr = data.children;
if (arr) { if (arr) {
if (data.isChecked) { if (data.isChecked) {
this.checkGroup.push(data.id) this.checkGroup.push(data.id);
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
this.checkGroup.push(arr[i].id) this.checkGroup.push(arr[i].id);
} }
} else { } else {
for (let i = 0; i < this.checkGroup.length; i++) { for (let i = 0; i < this.checkGroup.length; i++) {
if (this.checkGroup[i] == data.id) { if (this.checkGroup[i] == data.id) {
this.checkGroup.splice(i, 1) this.checkGroup.splice(i, 1);
} }
for (let j = 0; j < arr.length; j++) { for (let j = 0; j < arr.length; j++) {
if (this.checkGroup[i] == arr[j].id) { if (this.checkGroup[i] == arr[j].id) {
this.checkGroup.splice(i, 1) this.checkGroup.splice(i, 1);
} }
} }
} }
...@@ -475,136 +475,138 @@ export default { ...@@ -475,136 +475,138 @@ export default {
}, },
// checkbox 全选 选择事件 // checkbox 全选 选择事件
handleCheckAll() { handleCheckAll() {
this.checks = !this.checks this.checks = !this.checks;
if (this.checks) { if (this.checks) {
this.checkGroup = this.getArray( this.checkGroup = this.getArray(
this.checkGroup.concat(this.All(this.items)) this.checkGroup.concat(this.All(this.items))
) );
} else { } else {
this.checkGroup = [] this.checkGroup = [];
} }
// this.$emit('on-selection-change', this.checkGroup) // this.$emit('on-selection-change', this.checkGroup)
}, },
// 数组去重 // 数组去重
getArray(a) { getArray(a) {
const hash = {} const hash = {};
const len = a.length const len = a.length;
const result = [] const result = [];
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (!hash[a[i]]) { if (!hash[a[i]]) {
hash[a[i]] = true hash[a[i]] = true;
result.push(a[i]) result.push(a[i]);
} }
} }
return result return result;
}, },
checkAllGroupChange(data) { checkAllGroupChange(data) {
if (this.dataLength > 0 && data.length === this.dataLength) { if (this.dataLength > 0 && data.length === this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
this.$emit('on-selection-change', this.checkGroup) this.$emit("on-selection-change", this.checkGroup);
}, },
All(data) { All(data) {
let arr = [] let arr = [];
data.forEach((item) => { data.forEach((item) => {
arr.push(item.id) arr.push(item.id);
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
arr = arr.concat(this.All(item.children)) arr = arr.concat(this.All(item.children));
} }
}) });
return arr return arr;
}, },
// 返回树形数据长度 // 返回树形数据长度
Length(data) { Length(data) {
let { length } = data let { length } = data;
data.forEach((child) => { data.forEach((child) => {
if (child.children) { if (child.children) {
length += this.Length(child.children) length += this.Length(child.children);
} }
}) });
return length return length;
}, },
// 返回表头 // 返回表头
renderHeader(column, $index) { renderHeader(column, $index) {
if ('renderHeader' in this.columns[$index]) { if ("renderHeader" in this.columns[$index]) {
return this.columns[$index].renderHeader(column, $index) return this.columns[$index].renderHeader(column, $index);
} }
return column.title || '#' return column.title || "#";
}, },
// 返回内容 // 返回内容
renderBody(row, column, index) { renderBody(row, column, index) {
return row[column.key] return row[column.key];
}, },
// 默认选中 // 默认选中
renderCheck(data) { renderCheck(data) {
let arr = [] let arr = [];
data.forEach((item) => { data.forEach((item) => {
if (item._checked) { if (item._checked) {
arr.push(item.id) arr.push(item.id);
} }
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
arr = arr.concat(this.renderCheck(item.children)) arr = arr.concat(this.renderCheck(item.children));
} }
}) });
return arr return arr;
}, },
// 深度拷贝函数 // 深度拷贝函数
deepCopy(data) { deepCopy(data) {
const t = this.type(data) const t = this.type(data);
let o let o;
let i let i;
let ni let ni;
if (t === 'array') { if (t === "array") {
o = [] o = [];
} else if (t === 'object') { } else if (t === "object") {
o = {} o = {};
} else { } else {
return data return data;
} }
if (t === 'array') { if (t === "array") {
for (i = 0, ni = data.length; i < ni; i++) { for (i = 0, ni = data.length; i < ni; i++) {
o.push(this.deepCopy(data[i])) o.push(this.deepCopy(data[i]));
} }
return o return o;
} }
if (t === 'object') { if (t === "object") {
for (i in data) { for (i in data) {
o[i] = this.deepCopy(data[i]) o[i] = this.deepCopy(data[i]);
} }
return o return o;
} }
}, },
type(obj) { type(obj) {
const { toString } = Object.prototype const { toString } = Object.prototype;
const map = { const map = {
'[object Boolean]': 'boolean', "[object Boolean]": "boolean",
'[object Number]': 'number', "[object Number]": "number",
'[object String]': 'string', "[object String]": "string",
'[object Function]': 'function', "[object Function]": "function",
'[object Array]': 'array', "[object Array]": "array",
'[object Date]': 'date', "[object Date]": "date",
'[object RegExp]': 'regExp', "[object RegExp]": "regExp",
'[object Undefined]': 'undefined', "[object Undefined]": "undefined",
'[object Null]': 'null', "[object Null]": "null",
'[object Object]': 'object' "[object Object]": "object",
} };
return map[toString.call(obj)] return map[toString.call(obj)];
} },
}, },
beforeDestroy() { beforeDestroy() {
window.onresize = null window.onresize = null;
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.treeTbale { .treeTbale {
overflow: 0 auto; overflow: 0 auto;
width: 100% !important; width: 100% !important;
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
...@@ -619,14 +621,14 @@ export default { ...@@ -619,14 +621,14 @@ export default {
} }
} }
.icon-set { .icon-set {
font-size: 17px; font-size: 17px;
margin-left: 5px; margin-left: 5px;
display: inline-block; display: inline-block;
} }
.icon-set .ivu-icon { .icon-set .ivu-icon {
cursor: pointer; cursor: pointer;
} }
table { table {
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
......
@import "../../../assets/css/custom.less";
.results { .results {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
h4 { h4 {
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
border-bottom: 1px solid #e4e6ed; border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px; margin-bottom: 15px;
padding-left: 10px; padding-left: 10px;
...@@ -64,15 +65,16 @@ ...@@ -64,15 +65,16 @@
.ivu-layout-content { .ivu-layout-content {
margin-left: 5px; margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
overflow: auto; overflow: auto;
position: relative; position: relative;
.i-row { .i-row {
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
border-bottom: 1px solid #e4e6ed; border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px; margin-bottom: 15px;
padding-left: 10px; padding-left: 10px;
...@@ -102,7 +104,7 @@ position: relative; ...@@ -102,7 +104,7 @@ position: relative;
.btn { .btn {
position: absolute; position: absolute;
top:7px; top: 7px;
right: 15px; right: 15px;
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<a class="row_more fr" @click="toivew">更多</a> <a class="row_more fr" @click="toivew">更多</a>
</p> </p>
<div class="row_card_body"> <div class="row_card_body">
<Table border :columns="columns1" :data="data1"></Table> <Table :columns="columns1" :data="data1"></Table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="4" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="4" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="5" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="5" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="14" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="14" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="10" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="10" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="6" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="6" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</Col> </Col>
<Col :span="16"> <Col :span="16">
<div class="table-b"> <div class="table-b">
<Table border :columns="columns1" :data="data1" height="260"></Table> <Table :columns="columns1" :data="data1" height="260"></Table>
</div> </div>
</Col> </Col>
</Row> </Row>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
<div class="table"> <div class="table">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table> <Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Page <Page
:total="datatotal" :total="datatotal"
:current="pageindex" :current="pageindex"
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table stripe ref="table" border :columns="column1" :data="data1" class="tableCommon"> <Table stripe ref="table" :columns="column1" :data="data1" class="tableCommon">
<template slot-scope="{ row,index }" slot="title"> <template slot-scope="{ row,index }" slot="title">
<state code="plan.dispatch.pauseCause" type="text" :value="row.pausecause_id"></state> <state code="plan.dispatch.pauseCause" type="text" :value="row.pausecause_id"></state>
</template> </template>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/> />
</div> </div>
<div class="table"> <div class="table">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table> <Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/> />
</div> </div>
<div > <div >
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table> <Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<Button type="primary" :disabled="ishavzj" @click="SendCheckRecord()" class="title_btn ml10">送检记录</Button> <Button type="primary" :disabled="ishavzj" @click="SendCheckRecord()" class="title_btn ml10">送检记录</Button>
</div> </div>
<div class="table01"> <div class="table01">
<Table ref="table" border class="tableCommon" :height="taHeight" :columns="recordcolumn" :data="recorddata"> <Table ref="table" class="tableCommon" :height="taHeight" :columns="recordcolumn" :data="recorddata">
<template slot-scope="{ row,index }" slot="selffillin"> <template slot-scope="{ row,index }" slot="selffillin">
<template v-if="row.selfchecklist.fillinstatus==0||productobj.productstatus==4"> <template v-if="row.selfchecklist.fillinstatus==0||productobj.productstatus==4">
<Checkbox <Checkbox
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button> <Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button>
</div> </div>
<div class="table01"> <div class="table01">
<Table stripe ref="table" border :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon"> <Table stripe ref="table" :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon">
<template slot-scope="{ row,index }" slot="hg"> <template slot-scope="{ row,index }" slot="hg">
<template v-if="row.status==0"> <template v-if="row.status==0">
<template v-if="row.productstatus1==0"> <template v-if="row.productstatus1==0">
......
<template> <template>
<div class="new_box"> <div class="new_box">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table> <Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Page <Page
:total="datatotal" :total="datatotal"
:current="pageindex" :current="pageindex"
......
<template> <template>
<div class="table-contentProcess"> <div class="table-contentProcess">
<div class="table-tools"> <div class="table-tools">
<div class="table-search"> <div class="table-search">
<Form inline> <Form inline>
<FormItem> <FormItem>
<span>导入到</span> <span>导入到</span>
</FormItem> </FormItem>
<FormItem> <FormItem>
<dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary> <dictionary
</FormItem> code="import.im.page"
<FormItem> style="width:160px"
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> @on-change="pageChange"
</FormItem> v-model="pageType"
<FormItem> ></dictionary>
<div style="height:34px;overflow: hidden;padding:0"> </FormItem>
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList"> <FormItem>
<Button icon="ios-cloud-upload-outline" @click="resetParms">重新上传</Button> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</Upload> </FormItem>
</div> <FormItem>
</FormItem> <div style="height:34px;overflow: hidden;padding:0">
</Form> <Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
</div> <Button icon="ios-cloud-upload-outline" @click="resetParms">重新上传</Button>
<div class="btns"> </Upload>
<Form inline> </div>
<FormItem> </FormItem>
<Tooltip content="下载文件"> </Form>
<a @click="downFile" tooltip="1111"> </div>
<Icon type="md-download" />{{entity.file}} <div class="btns">
</a> <Form inline>
</Tooltip> <FormItem>
</FormItem> <Tooltip content="下载文件">
<FormItem> <a @click="downFile" tooltip="1111">
<Tooltip content="预览文件"> <Icon type="md-download" />
<a class="ml10 mr10" @click="resetTable"> {{entity.file}}
<Icon type="md-eye" />预览 </a>
</a> </Tooltip>
</Tooltip> </FormItem>
</FormItem> <FormItem>
<FormItem> <Tooltip content="预览文件">
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small"> <a class="ml10 mr10" @click="resetTable">
<Tooltip content="文件数据"> <Icon type="md-eye" />预览
<Radio label="0"> </a>
<Icon type="ios-list-box-outline" /> </Tooltip>
</Radio> </FormItem>
</Tooltip> <FormItem>
<Tooltip content="粘贴Excel数据"> <RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Radio label="1"> <Tooltip content="文件数据">
<Icon type="ios-copy" /> <Radio label="0">
</Radio> <Icon type="ios-list-box-outline" />
</Tooltip> </Radio>
</RadioGroup> </Tooltip>
</FormItem> <Tooltip content="粘贴Excel数据">
</Form> <Radio label="1">
</div> <Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
</div> </div>
<div class="table-main" ref="main"> <div class="table-main" ref="main">
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table> <Table
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" /> :border="true"
:columns="columnsImport"
:data="excelData"
:height="tdHeightExcel"
:no-data-text="noDataText"
ref="table"
class="tableCommon"
v-if="tableImport"
></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> <FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline> <Form inline>
<FormItem> <FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick"> <Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane> <TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs> </Tabs>
</FormItem> </FormItem>
</Form> </Form>
</FooterToolbar> </FooterToolbar>
<Modal v-model="infoModal" :title="titleInfo" fullscreen> <Modal v-model="infoModal" :title="titleInfo" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid> <DataGrid
<div slot="footer"> :tool="false"
<Button @click="infoModal=false">关闭</Button> :page="false"
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button> :columns="colsIm"
</div> :data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import BaseColums from "./baseColums"; import BaseColums from "./baseColums";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { import { Switch } from "view-design";
Switch
} from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
pageType: undefined, pageType: undefined,
tabVal: 0, tabVal: 0,
infoModal: false, infoModal: false,
entity: {}, entity: {},
downUrl: fileUrlDown, downUrl: fileUrlDown,
fileUrlPath: "", fileUrlPath: "",
disabled: false, disabled: false,
detailExcel: null, detailExcel: null,
tableImport: true, tableImport: true,
tdHeightExcel: "", tdHeightExcel: "",
excelData: [], excelData: [],
excelDataBack: [], //临时存储原始数据 excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"], formatList: ["xlsx"],
columnsImport: [], columnsImport: [],
departArr: [], //部门list departArr: [], //部门list
sheetNames: [], //excel的表明 sheetNames: [], //excel的表明
workBook: {}, workBook: {},
openDatas: [], openDatas: [],
dataType: 0, dataType: 0,
//new //new
colsIm: [], colsIm: [],
dataIm: [], dataIm: [],
excelType: '0', excelType: "0",
btnIm: true, btnIm: true,
listLength: 0, listLength: 0,
titleInfo: '', titleInfo: "",
noDataText: '暂无数据', noDataText: "暂无数据",
imBtn: true, imBtn: true,
//物料管理 //物料管理
treeData: [], //物料管理左侧类别树 treeData: [], //物料管理左侧类别树
codeRuleData: [], //物料编码等信息 codeRuleData: [], //物料编码等信息
routingHeaderData: [], //工艺规程列表信息 routingHeaderData: [], //工艺规程列表信息
}; };
}, },
props: { props: {
eid: Number, eid: Number,
}, },
created() { created() {
this.tdHeightExcel = window.innerHeight - 180; this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start //导出对列表头进行预加载start
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => { this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items; this.departArr = r.result.items;
}); });
//导出对列表头进行预加载end
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
//获取工艺规程信息
this.getRoutingHeaderData();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result || {};
});
this.dataType = 0;
this.sheetNames = [];
this.excelData = [];
this.excelDataBack = [];
Api.openExcel({
id: v,
}).then((res) => {
if (res.success) {
this.openDatas = res.result || [];
this.dealOpenTable(0);
//获取excel sheetname
if (res.result.length > 0) {
res.result.forEach((el) => {
this.sheetNames.push(el.title);
});
}
}
}).catch(e => {
this.noDataText = "文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!"
})
}, //导出对列表头进行预加载end
//加载原文件列表 },
dealOpenTable(val) { mounted() {
this.excelData = this.openDatas[val].dataTable; if (this.eid > 0) {
this.excelDataBack = this.openDatas[val].dataTable; this.load(this.eid);
this.listLength = this.excelData.length }
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题 //物料加载类型数据
this.columnsImport = []; this.getTreeData();
var headersNow = []; this.getcodeRuleData();
headersNow.push({ //获取工艺规程信息
type: 'index', this.getRoutingHeaderData();
width: 80, window.onresize = () => {
align: 'right', ///浏览器窗口大小变化
title: '序号' return (() => {
}) window.screenHeight = window.innerHeight;
tempCos.forEach((el) => { this.tdHeightExcel = window.screenHeight - 180;
let headObj = {}; })();
headObj.title = el; };
headObj.key = el; },
headersNow.push(headObj); methods: {
}); load(v) {
this.columnsImport = headersNow; Api.get({
}, id: v,
//重新处理colum }).then((r) => {
loadColum(columns) { this.entity = r.result || {};
let tempCol = this.$u.clone(columns); });
tempCol.unshift({ this.dataType = 0;
type: 'index', this.sheetNames = [];
width: 80, this.excelData = [];
align: 'right', this.excelDataBack = [];
title: '序号'
})
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.colsIm = tempCol;
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack)
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData)
}
let arrTitleUse = []; //使用数据字典的字段
let arrTitleUse1 = []; //使用物料编码的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
if (elCode.materialKey) { //临时存放物料管理大类和子类列表
arrTitleUse1.push({
key: elCode.key,
code: elCode.materialKey
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//对列表里的部门及数据字典项进行处理
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
}
});
})
this.dataIm = useData;
},
//下载原excel文件
downFile() {
let truePath = this.entity.path;
if (truePath.length > 2) {
if (
truePath.substring(0, 7).toLowerCase() == "http://" ||
truePath.substring(0, 8).toLowerCase() == "https://"
) {
window.open(truePath, "_blank");
} else {
this.fileUrlPath = this.downUrl + this.entity.path;
window.open(this.fileUrlPath, "_blank");
}
}
},
//导入excel文件
//打开传时初始化
resetParms() {
this.pageType = undefined;
this.tdHeightExcel = window.innerHeight - 180;
},
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
var lines = csv.split("\n"); //第一行标题 Api.openExcel({
var headers = lines[0].split(","); id: v,
var headersNow = []; })
headersNow.push({ .then((res) => {
type: 'index', if (res.success) {
width: 80, this.openDatas = res.result || [];
align: 'right', this.dealOpenTable(0);
title: '序号' //获取excel sheetname
}) if (res.result.length > 0) {
headers.forEach((elHead) => { res.result.forEach((el) => {
let headObj = {}; this.sheetNames.push(el.title);
headObj.title = elHead; });
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0)
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val
if (this.dataType == 0) {
this.dealOpenTable(val);
} else {
this.dealSheet(val);
}
if (this.pageType != undefined) {
this.pageChange(this.pageType)
}
},
//选择导入的模块 0:用户管理
pageChange(val) {
this.btnIm = false
if (val == undefined) {
this.btnIm = true
} else {
this.btnIm = false
} }
}
})
.catch((e) => {
this.noDataText =
"文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!";
});
},
//加载原文件列表
dealOpenTable(val) {
this.excelData = this.openDatas[val].dataTable;
this.excelDataBack = this.openDatas[val].dataTable;
this.listLength = this.excelData.length;
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题
this.columnsImport = [];
var headersNow = [];
headersNow.push({
type: "index",
width: 80,
align: "right",
title: "序号",
});
tempCos.forEach((el) => {
let headObj = {};
headObj.title = el;
headObj.key = el;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
},
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.unshift({
type: "index",
width: 80,
align: "right",
title: "序号",
});
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.colsIm = tempCol;
}, //处理原始数据和表头进行对应
handleClose() { let temCol = this.$u.clone(this.colsIm); //原始数据表头
this.$emit("on-close"); let temColPage = this.$u.clone(columns); //需要显示的页面的表头
}, //let temData = this.$u.clone(this.excelDataBack); //原始数据
cancelExcel() { let temData = []; //原始数据
this.excelData = []; if (this.excelType == "0") {
this.excelDataBack = []; temData = this.$u.clone(this.excelDataBack);
this.$refs.uploadfile.clearFiles(); } else {
let parms = { temData = this.$u.clone(this.$refs.comExcel.excelData);
status: 1, }
id: this.eid let arrTitleUse = []; //使用数据字典的字段
} let arrTitleUse1 = []; //使用物料编码的字段
//导入中心列表数据状态更新 temColPage.forEach((elCode) => {
Api.updateimportstatus(parms).then(res => { if (elCode.code) {
if (res.success) { arrTitleUse.push({
this.$emit("on-ok"); key: elCode.key,
} code: elCode.code,
}) });
this.$emit("on-close"); }
}, if (elCode.materialKey) {
//临时存放物料管理大类和子类列表
arrTitleUse1.push({
key: elCode.key,
code: elCode.materialKey,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//重新加载excel //对列表里的部门及数据字典项进行处理
resetTable() { useData.forEach((eles) => {
this.pageType = undefined; //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
this.load(this.eid); if (
this.tdHeightExcel = window.innerHeight - 180; [
if (this.excelType == 1) { (eles.departmentTitle && eles.departmentTitle != "") ||
this.changeExcel(0) (eles.departmentName && eles.departmentName != ""),
} ] &&
}, (!eles.departmentId || eles.departmentId == "")
//打开导入数据格式化后的窗口 ) {
openInfoModal() { this.departArr.forEach((e) => {
if (this.excelData.length > 0 && this.pageType != undefined) { if (
this.imBtn = true; (eles.departmentTitle && eles.departmentTitle == e.name) ||
switch (this.pageType) { (eles.departmentName && eles.departmentName == e.name)
case 0: ) {
this.loadColum(BaseColums.columns0()); eles.departmentId = e.id;
break;
case 1:
this.loadColum(BaseColums.columns1());
break;
case 2:
this.loadColum(BaseColums.columns2());
break;
case 3:
this.loadColum(BaseColums.columns3());
break;
case 4:
this.loadColum(BaseColums.columns4());
break;
case 5:
this.loadColum(BaseColums.columns5());
break;
case 6:
this.loadColum(BaseColums.columns6());
break;
default:
this.loadColum(BaseColums.columns0());
}
this.titleInfo = "批量导入到 【" + this.$u.dirName(
this.$store.getters.dictionaryByKey("import.im.page"),
this.pageType
) + "】 模块"
this.infoModal = true
} else {
this.imBtn = true;
if (this.excelData.length == 0) {
this.$Message.error("表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!")
} else if (this.pageType == undefined) {
this.$Message.error("请选择需要批量导入到的模块!")
}
} }
}, });
//导入按钮操作 } else if (
importOk() { //如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
switch (this.pageType) { eles.departmentId &&
case 0: eles.departmentId + "" != "" &&
this.importUser(); (!eles.departmentTitle || eles.departmentTitle == "") &&
break; (!eles.departmentName || eles.departmentName == "")
case 2: ) {
this.importResource(); this.departArr.forEach((e) => {
break; if (eles.departmentId && eles.departmentId == e.id) {
case 3: eles.departmentTitle = e.name;
this.importMateriel(); eles.departmentName = e.name;
break;
case 4:
this.importRountingHeader();
break;
case 5:
this.importRountingBom();
break;
case 6:
this.importProductMix();
break;
default:
//this.loadColum(this.columns1);
} }
}, });
//批量导入用户 }
importUser() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
userName: ele.userName,
cardNo: ele.cardNo,
gender: ele.gender,
birthday: ele.birthday,
degreeId: ele.degreeId,
departmentId: ele.departmentId,
status: ele.status,
phone: ele.phone,
email: ele.email,
licensedToWork: ele.licensedToWork,
positionId: ele.positionId,
titleId: ele.titleId,
departmentTitle: ele.departmentTitle,
};
if (ele.userName && ele.userName != '' && ele.cardNo && ele.cardNo != '' && ele.departmentId && ele.departmentId != '' && ele.phone && ele.phone != '') {
tempList.push(obj);
}
}); arrTitleUse.forEach((elem) => {
if (tempList.length == 0) { if (
this.$Message.error("所有导入的数据均不合法!"); eles[elem.key] &&
} else { eles[elem.key] != "" &&
let parms = { eles[elem.key] != null
list: tempList, ) {
}; //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
let url = `${systemUrl}/userimportservice/import` eles[elem.key] = this.$u.dirCode(
this.$api.post(url, parms).then((res) => { this.$store.getters.dictionaryByKey(elem.code),
if (res.success) { eles[elem.key]
this.$Message.success("成功批量导入用户管理成功模块 " + tempList.length + " 条数据"); );
this.imBtn = false; }
this.cancelExcel(); });
} else { });
this.$Message.error("批量导入用户管理失败!"); this.dataIm = useData;
} },
}); //下载原excel文件
} downFile() {
let truePath = this.entity.path;
if (truePath.length > 2) {
if (
truePath.substring(0, 7).toLowerCase() == "http://" ||
truePath.substring(0, 8).toLowerCase() == "https://"
) {
window.open(truePath, "_blank");
} else {
this.fileUrlPath = this.downUrl + this.entity.path;
window.open(this.fileUrlPath, "_blank");
}
}
},
//导入excel文件
//打开传时初始化
resetParms() {
this.pageType = undefined;
this.tdHeightExcel = window.innerHeight - 180;
},
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
}, var lines = csv.split("\n"); //第一行标题
//批量插入制造资源 var headers = lines[0].split(",");
importResource() { var headersNow = [];
let tempData = this.$u.clone(this.dataIm); headersNow.push({
let tempList = []; type: "index",
tempData.forEach((ele) => { width: 80,
let obj = { align: "right",
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "", title: "序号",
resourceCode: ele.resourceCode ? ele.resourceCode : "", });
code: ele.code ? ele.code : "", headers.forEach((elHead) => {
totalNum: ele.totalNum ? ele.totalNum : 0, let headObj = {};
storeTitle: ele.storeTitle ? ele.storeTitle : "", headObj.title = elHead;
storeId: ele.storeId ? ele.storeId : null, headObj.key = elHead;
state: 1, headersNow.push(headObj);
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0, });
json: {}, this.columnsImport = headersNow;
}; var result = [];
if (ele.nameOfResource && for (var i = 1; i < lines.length - 1; i++) {
ele.nameOfResource != "" && var obj = {};
ele.code && var currentline = lines[i].split(",");
ele.code != "" && for (var j = 0; j < headers.length; j++) {
ele.resourceCode && obj[headers[j]] = currentline[j];
ele.resourceCode != "") { }
tempList.push(obj); result.push(obj);
} }
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0);
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val;
if (this.dataType == 0) {
this.dealOpenTable(val);
} else {
this.dealSheet(val);
}
if (this.pageType != undefined) {
this.pageChange(this.pageType);
}
},
//选择导入的模块 0:用户管理
pageChange(val) {
this.btnIm = false;
if (val == undefined) {
this.btnIm = true;
} else {
this.btnIm = false;
}
},
handleClose() {
this.$emit("on-close");
},
cancelExcel() {
this.excelData = [];
this.excelDataBack = [];
this.$refs.uploadfile.clearFiles();
let parms = {
status: 1,
id: this.eid,
};
//导入中心列表数据状态更新
Api.updateimportstatus(parms).then((res) => {
if (res.success) {
this.$emit("on-ok");
}
});
this.$emit("on-close");
},
}); //重新加载excel
if (tempList.length == 0) { resetTable() {
this.$Message.error("所有导入的数据均不合法!"); this.pageType = undefined;
this.load(this.eid);
this.tdHeightExcel = window.innerHeight - 180;
if (this.excelType == 1) {
this.changeExcel(0);
}
},
//打开导入数据格式化后的窗口
openInfoModal() {
if (this.excelData.length > 0 && this.pageType != undefined) {
this.imBtn = true;
switch (this.pageType) {
case 0:
this.loadColum(BaseColums.columns0());
break;
case 1:
this.loadColum(BaseColums.columns1());
break;
case 2:
this.loadColum(BaseColums.columns2());
break;
case 3:
this.loadColum(BaseColums.columns3());
break;
case 4:
this.loadColum(BaseColums.columns4());
break;
case 5:
this.loadColum(BaseColums.columns5());
break;
case 6:
this.loadColum(BaseColums.columns6());
break;
default:
this.loadColum(BaseColums.columns0());
}
this.titleInfo =
"批量导入到 【" +
this.$u.dirName(
this.$store.getters.dictionaryByKey("import.im.page"),
this.pageType
) +
"】 模块";
this.infoModal = true;
} else {
this.imBtn = true;
if (this.excelData.length == 0) {
this.$Message.error(
"表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!"
);
} else if (this.pageType == undefined) {
this.$Message.error("请选择需要批量导入到的模块!");
}
}
},
//导入按钮操作
importOk() {
switch (this.pageType) {
case 0:
this.importUser();
break;
case 2:
this.importResource();
break;
case 3:
this.importMateriel();
break;
case 4:
this.importRountingHeader();
break;
case 5:
this.importRountingBom();
break;
case 6:
this.importProductMix();
break;
default:
//this.loadColum(this.columns1);
}
},
//批量导入用户
importUser() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
userName: ele.userName,
cardNo: ele.cardNo,
gender: ele.gender,
birthday: ele.birthday,
degreeId: ele.degreeId,
departmentId: ele.departmentId,
status: ele.status,
phone: ele.phone,
email: ele.email,
licensedToWork: ele.licensedToWork,
positionId: ele.positionId,
titleId: ele.titleId,
departmentTitle: ele.departmentTitle,
};
if (
ele.userName &&
ele.userName != "" &&
ele.cardNo &&
ele.cardNo != "" &&
ele.departmentId &&
ele.departmentId != "" &&
ele.phone &&
ele.phone != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${systemUrl}/userimportservice/import`;
this.$api.post(url, parms).then((res) => {
if (res.success) {
this.$Message.success(
"成功批量导入用户管理成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入用户管理失败!");
}
});
}
},
//批量插入制造资源
importResource() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.storeId : null,
state: 1,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {},
};
if (
ele.nameOfResource &&
ele.nameOfResource != "" &&
ele.code &&
ele.code != "" &&
ele.resourceCode &&
ele.resourceCode != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${resourceUrl}/resourceimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入制造资源成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else { } else {
let parms = { this.$Message.error("批量导入失败");
list: tempList,
};
let url = `${resourceUrl}/resourceimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入制造资源成功模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
} }
}, })
//插入物料管理start .catch((err) => {
importMateriel() { this.$Message.error("数据异常!");
let tempData = this.$u.clone(this.dataIm); });
let tempList = []; }
tempData.forEach((ele) => { },
let obj = { //插入物料管理start
name: ele.name ? ele.name : '', importMateriel() {
version: ele.version ? Number(ele.version) : '', let tempData = this.$u.clone(this.dataIm);
drawing: ele.drawing ? ele.drawing : '', let tempList = [];
description: ele.description ? ele.description : "", tempData.forEach((ele) => {
code: 0, let obj = {
status: ele.status ? Number(ele.status) : '', name: ele.name ? ele.name : "",
customProperties: {}, version: ele.version ? Number(ele.version) : "",
categoryId: this.getType2(ele.categoryId) ? this.getType2(ele.categoryId) : 1, //左侧树点击的id drawing: ele.drawing ? ele.drawing : "",
rootCategoryId: this.getType1(ele.rootCategoryId) ? this.getType1(ele.rootCategoryId) : 1, //左侧树点击的数据的最顶层id description: ele.description ? ele.description : "",
codeRuleId: this.getType3(ele.codeRuleId) ? this.getType3(ele.codeRuleId) : 1, //类别编码名称 code: 0,
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1 //类别codeType status: ele.status ? Number(ele.status) : "",
}; customProperties: {},
if (ele.codeRuleId && this.getType3(ele.codeRuleId) != "" && ele.codeRuleType && ele.codeRuleType != "" && ele.codeRuleType != null && ele.rootCategoryId && this.getType1(ele.rootCategoryId) != "" && ele.name && ele.name != "") { categoryId: this.getType2(ele.categoryId)
tempList.push(obj); ? this.getType2(ele.categoryId)
} : 1, //左侧树点击的id
rootCategoryId: this.getType1(ele.rootCategoryId)
}); ? this.getType1(ele.rootCategoryId)
if (tempList.length == 0) { : 1, //左侧树点击的数据的最顶层id
this.$Message.error("所有导入的数据均不合法!"); codeRuleId: this.getType3(ele.codeRuleId)
? this.getType3(ele.codeRuleId)
: 1, //类别编码名称
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1, //类别codeType
};
if (
ele.codeRuleId &&
this.getType3(ele.codeRuleId) != "" &&
ele.codeRuleType &&
ele.codeRuleType != "" &&
ele.codeRuleType != null &&
ele.rootCategoryId &&
this.getType1(ele.rootCategoryId) != "" &&
ele.name &&
ele.name != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${material}/materialimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入物料管理模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else { } else {
let parms = { this.$Message.error("批量导入失败");
list: tempList,
};
let url = `${material}/materialimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入物料管理模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
}
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: []
};
this.$api.post(`${material}/category/list`, data).then((r) => {
if (r.success) {
this.treeData = r.result || []
}
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData)
let rootId = ""
if (val && val != "" && val != null) {
tempTreeList.forEach(ele => {
if (ele.upId == 0 && ele.name == val) {
rootId = ele.id
}
})
}
return rootId
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData)
let childrenId = ""
if (val && val != "" && val != null) {
tempTreeList.forEach(ele => {
if (ele.upId > 0 && ele.name == val) {
childrenId = ele.id
}
})
}
return childrenId
},
//物料大类和子类的解析end
//获取编码名称等start
getcodeRuleData() {
let data = {
conditions: []
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || []
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData)
let codeRuleId = ""
if (val && val != "" && val != null) {
codeRuleDataList.forEach(ele => {
if (ele.name == val) {
codeRuleId = ele.id
}
})
} }
return codeRuleId })
}, .catch((err) => {
//获取编码名称等end this.$Message.error("数据异常!");
//插入物料管理end });
//插入工艺规程 及工艺相关start }
importRountingHeader() { },
let tempData = this.$u.clone(this.dataIm); //物料大类和子类的解析start
let tempList = []; getTreeData() {
tempData.forEach((ele) => { let data = {
let obj = { conditions: [],
classId: null, };
unicode: "", this.$api.post(`${material}/category/list`, data).then((r) => {
name: ele.name ? ele.name : '', if (r.success) {
code: ele.code ? ele.code : '', this.treeData = r.result || [];
productId: ele.productId ? ele.productId : '', //? }
productName: ele.productName ? ele.productName : "", //? });
productBomId: ele.productBomId ? ele.productBomId : "", //? },
drawingNo: ele.drawingNo ? ele.drawingNo : "", //? getType1(val) {
version: "", let tempTreeList = this.$u.clone(this.treeData);
versionid: ele.versionid ? ele.versionid : "", let rootId = "";
author: null, if (val && val != "" && val != null) {
departmentId: ele.departmentId ? ele.departmentId : null, //? tempTreeList.forEach((ele) => {
departmentName: ele.departmentName ? ele.departmentName : "", //? if (ele.upId == 0 && ele.name == val) {
isMain: 1, rootId = ele.id;
upId: null, }
upDetailId: null, });
routingType: ele.routingType ? ele.routingType : null, }
status: 0, return rootId;
approvalStatus: 4, //? },
remark: "", getType2(val) {
approvalStatusRemark: "", let tempTreeList = this.$u.clone(this.treeData);
auditUserId1: "", let childrenId = "";
auditUserId2: "", if (val && val != "" && val != null) {
platesnum: null, tempTreeList.forEach((ele) => {
versionnotes: "", if (ele.upId > 0 && ele.name == val) {
isSendPpm: 1, childrenId = ele.id;
fileId: "", }
phase: ele.phase ? ele.phase : null, });
isEffect: ele.isEffect ? ele.isEffect : 1 }
}; return childrenId;
if (ele.name && ele.name != '') { },
tempList.push(obj); //物料大类和子类的解析end
} //获取编码名称等start
getcodeRuleData() {
}); let data = {
if (tempList.length == 0) { conditions: [],
this.$Message.error("所有导入的数据均不合法!"); };
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || [];
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleId = "";
if (val && val != "" && val != null) {
codeRuleDataList.forEach((ele) => {
if (ele.name == val) {
codeRuleId = ele.id;
}
});
}
return codeRuleId;
},
//获取编码名称等end
//插入物料管理end
//插入工艺规程 及工艺相关start
importRountingHeader() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
classId: null,
unicode: "",
name: ele.name ? ele.name : "",
code: ele.code ? ele.code : "",
productId: ele.productId ? ele.productId : "", //?
productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
version: "",
versionid: ele.versionid ? ele.versionid : "",
author: null,
departmentId: ele.departmentId ? ele.departmentId : null, //?
departmentName: ele.departmentName ? ele.departmentName : "", //?
isMain: 1,
upId: null,
upDetailId: null,
routingType: ele.routingType ? ele.routingType : null,
status: 0,
approvalStatus: 4, //?
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
versionnotes: "",
isSendPpm: 1,
fileId: "",
phase: ele.phase ? ele.phase : null,
isEffect: ele.isEffect ? ele.isEffect : 1,
};
if (ele.name && ele.name != "") {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}routingheaderimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入工艺规程模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else { } else {
let parms = { this.$Message.error("批量导入失败");
list: tempList,
};
let url = `${technologyUrl}routingheaderimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入工艺规程模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
} }
})
}, .catch((err) => {
//导入工艺bom this.$Message.error("数据异常!");
importRountingBom() { });
let tempData = this.$u.clone(this.dataIm); }
let tempList = []; },
tempData.forEach((ele) => { //导入工艺bom
let obj = { importRountingBom() {
routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)), let tempData = this.$u.clone(this.dataIm);
routingDetailId: ele.routingDetailId ? Number(ele.routingDetailId) : null, let tempList = [];
routingDetailNo: ele.routingDetailNo ? Number(ele.routingDetailNo) : null, tempData.forEach((ele) => {
routingDetailName: ele.routingDetailName ? ele.routingDetailName : '', let obj = {
routingStepId: 0, routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)),
quantity: ele.quantity ? Number(ele.quantity) : 0, routingDetailId: ele.routingDetailId
materialId: ele.materialId ? ele.materialId : '', ? Number(ele.routingDetailId)
materialType: ele.materialType ? Number(ele.materialType) : '', : null,
materialNumber: ele.materialNumber ? ele.materialNumber : '', routingDetailNo: ele.routingDetailNo
nameMaterial: ele.nameMaterial ? ele.nameMaterial : '', ? Number(ele.routingDetailNo)
brand: ele.brand ? ele.brand : '', : null,
specifications: ele.specifications ? ele.specifications : '', routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
xhgg: ele.xhgg ? ele.xhgg : '', routingStepId: 0,
texture: ele.texture ? ele.texture : '', quantity: ele.quantity ? Number(ele.quantity) : 0,
procurementStandards: ele.procurementStandards ? ele.procurementStandards : '', materialId: ele.materialId ? ele.materialId : "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : '', materialType: ele.materialType ? Number(ele.materialType) : "",
state: null, materialNumber: ele.materialNumber ? ele.materialNumber : "",
extend: "", nameMaterial: ele.nameMaterial ? ele.nameMaterial : "",
remark: "", brand: ele.brand ? ele.brand : "",
drawNum: ele.drawNum ? ele.drawNum : '' specifications: ele.specifications ? ele.specifications : "",
}; xhgg: ele.xhgg ? ele.xhgg : "",
if (ele.routingDetailId && ele.routingDetailId != null) { texture: ele.texture ? ele.texture : "",
tempList.push(obj); procurementStandards: ele.procurementStandards
} ? ele.procurementStandards
: "",
}); qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
if (tempList.length == 0) { state: null,
this.$Message.error("所有导入的数据均不合法!"); extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : "",
};
if (ele.routingDetailId && ele.routingDetailId != null) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入工艺Bom模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else { } else {
let parms = { this.$Message.error("批量导入失败");
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入工艺Bom模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
} }
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
//获取工艺规程列表
getRoutingHeaderData() {
let url = `${technologyUrl}routingheader/list`;
let data = {
conditions: [],
};
}, this.$api.post(url, data).then((r) => {
//获取工艺规程列表 if (r.success) {
getRoutingHeaderData() { this.routingHeaderData = r.result || [];
let url = `${technologyUrl}routingheader/list`; }
let data = { });
conditions: [] },
}; //根据工艺规程ID获得name
getRoutingHeaderId(val) {
this.$api.post(url, data).then((r) => { let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
if (r.success) { let routingHeaderId = 0;
this.routingHeaderData = r.result || [] routingHeaderDataList.forEach((ele) => {
} if (ele.name == val) {
}); routingHeaderId = ele.id;
}, }
//根据工艺规程ID获得name });
getRoutingHeaderId(val) { return routingHeaderId;
let routingHeaderDataList = this.$u.clone(this.routingHeaderData) },
let routingHeaderId = 0 //插入工艺规程 及工艺相关end
routingHeaderDataList.forEach(ele => { //插入产品管理start
if (ele.name == val) { importProductMix() {
routingHeaderId = ele.id let tempData = this.$u.clone(this.dataIm);
} let tempList = [];
}) tempData.forEach((ele) => {
return routingHeaderId let obj = {
}, mmcode: ele.mmcode ? ele.mmcode : "",
//插入工艺规程 及工艺相关end drawingNo: ele.drawingNo ? ele.drawingNo : "",
//插入产品管理start name: ele.name ? ele.name : "",
importProductMix() { type: ele.type ? ele.type : 1,
let tempData = this.$u.clone(this.dataIm); madeCompany: ele.madeCompany ? ele.madeCompany : null,
let tempList = []; madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "",
tempData.forEach((ele) => { version: ele.version ? ele.version : 0,
let obj = { productUrl: "",
mmcode: ele.mmcode ? ele.mmcode : '', productUrlList: "",
drawingNo: ele.drawingNo ? ele.drawingNo : '', levelId: ele.levelId ? ele.levelId : null,
name: ele.name ? ele.name : '', levelTitle: ele.levelTitle ? ele.levelTitle : "",
type: ele.type ? ele.type : 1, materialId: ele.materialId ? ele.materialId : "",
madeCompany: ele.madeCompany ? ele.madeCompany : null, };
madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "", if (ele.name && ele.name != "") {
version: ele.version ? ele.version : 0, tempList.push(obj);
productUrl: "", }
productUrlList: "", });
levelId: ele.levelId ? ele.levelId : null, if (tempList.length == 0) {
levelTitle: ele.levelTitle ? ele.levelTitle : "", this.$Message.error("所有导入的数据均不合法!");
materialId: ele.materialId ? ele.materialId : "", } else {
}; let parms = {
if (ele.name && ele.name != '') { list: tempList,
tempList.push(obj); };
} let url = `${technologyUrl}productinfoimportservice/import`;
this.$api
}); .post(url, parms)
if (tempList.length == 0) { .then((r) => {
this.$Message.error("所有导入的数据均不合法!"); if (r.success) {
} else { this.$Message.success(
let parms = { "成功批量导入产品管理模块 " + tempList.length + " 条数据"
list: tempList, );
}; this.imBtn = false;
let url = `${technologyUrl}productinfoimportservice/import`; this.cancelExcel();
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入产品管理模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
}
},
//插入产品管理end
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false
this.detailExcel = () => import("./detailExcel");
this.pageType = undefined
this.excelType = '1';
} else { } else {
this.detailExcel = null; this.$Message.error("批量导入失败");
this.tableImport = true;
this.pageType = undefined
this.excelType = '0';
this.listLength = this.excelData.length;
} }
})
}, .catch((err) => {
datalength(val) { this.$Message.error("数据异常!");
this.listLength = val });
}, }
}, },
watch: { //插入产品管理end
eid(v) { //切换列表和excel按钮
if (v != 0) { changeExcel(val) {
this.load(v); if (val == 1) {
} this.tableImport = false;
}, this.detailExcel = () => import("./detailExcel");
this.pageType = undefined;
this.excelType = "1";
} else {
this.detailExcel = null;
this.tableImport = true;
this.pageType = undefined;
this.excelType = "0";
this.listLength = this.excelData.length;
}
},
datalength(val) {
this.listLength = val;
}, },
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less";
.table-contentProcess { .table-contentProcess {
position: relative; position: relative;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.tip { .tip {
display: inline; display: inline;
} }
form { form {
display: inline-block; display: inline-block;
.ivu-form-item { .ivu-form-item {
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
}
} }
}
.table-main { .table-main {
width: 100%; width: 100%;
text-align: left; text-align: left;
padding: 0; padding: 0;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
flex-grow: 1; flex-grow: 1;
tr td .ivu-table-cell { tr td .ivu-table-cell {
padding: 0 5px; padding: 0 5px;
}
overflow-x: hidden;
} }
.table-tools { overflow-x: hidden;
display: flex; }
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns { .table-tools {
min-width: 200px; display: flex;
text-align: right; line-height: 50px;
} background: @right-header-bg;
.table-search {
flex-grow: 1;
} }
.table-footer { .btns {
line-height: 45px; min-width: 200px;
background: #f5f5f5; text-align: right;
} }
}
.ivu-footer-toolbar { .table-footer {
text-align: left; line-height: 45px;
background: #f5f5f5;
}
// background: #f5f5f5; .ivu-footer-toolbar {
.ivu-footer-toolbar-right { text-align: left;
float: left;
} // background: #f5f5f5;
.ivu-footer-toolbar-right {
float: left;
} }
}
} }
</style> </style>
<template> <template>
<div class="content"> <div class="content">
<TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" /> <TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" />
<DataGrid border :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :page="false" :set="false"> <DataGrid :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :page="false" :set="false">
<template slot="easySearch"> <template slot="easySearch">
<Form inline> <Form inline>
<FormItem> <FormItem>
......
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
.full { .full {
margin-top: 0; margin-top: 0;
.content { .content {
margin-top: 10px; margin-top: 6px;
.ivu-icon-ios-add:before { .ivu-icon-ios-add:before {
content: "\f341"; content: "\f341";
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>扩展属性</h4> <h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList"> <Table :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input <Input
......
...@@ -379,7 +379,7 @@ export default { ...@@ -379,7 +379,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh; height: 87vh;
...@@ -452,7 +452,7 @@ export default { ...@@ -452,7 +452,7 @@ export default {
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
</div> </div>
<div v-show="showTable"> <div v-show="showTable">
<Table border :columns="columns" :data="data1" :height="820"></Table> <Table :columns="columns" :data="data1" :height="820"></Table>
<!-- <DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750" :conditions="easySearch"></DataGrid> --> <!-- <DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750" :conditions="easySearch"></DataGrid> -->
</div> </div>
</Content> </Content>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''" class="content">
<MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" /> <MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content> </Content>
</Layout> </Layout>
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
<template> <template>
<div style="width:100%;margin:0 auto"> <div style="width:100%;margin:0 auto">
<Table border :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table> <Table :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table>
<div style="width100%;margin:40px auto"> <div style="width100%;margin:40px auto">
<Row> <Row>
<Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" /> <Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" />
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300"> <Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300"> <Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300"> <Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -431,6 +431,7 @@ export default { ...@@ -431,6 +431,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
// @import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
// height: 100%; // height: 100%;
...@@ -454,6 +455,7 @@ export default { ...@@ -454,6 +455,7 @@ export default {
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
// background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
...@@ -21,12 +21,15 @@ ...@@ -21,12 +21,15 @@
</div> </div>
</div> </div>
<Table <Table
:border="border" :columns="columnsNow" :border="border"
:data="list" :height="tableHeight" :columns="columnsNow"
ref="table" class="tableCommon" :data="list"
:height="tableHeight"
ref="table"
class="tableCommon"
@on-expand="expand" @on-expand="expand"
@on-selection-change="selectionChange"> @on-selection-change="selectionChange"
</Table> ></Table>
<div class="table-footer"> <div class="table-footer">
<div> <div>
<slot name="footer"></slot> <slot name="footer"></slot>
...@@ -61,11 +64,12 @@ ...@@ -61,11 +64,12 @@
placement="left" placement="left"
:mask="false" :mask="false"
> >
<div slot="header"> <div slot="header">
列设置 列设置
<a @click="undoConfig" class="ml50"> <a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置"/></a> <Icon type="md-refresh" title="恢复初始设置" />
</div> </a>
</div>
<ul class="table-columns"> <ul class="table-columns">
<li <li
v-for="(li,index) in columnsCur" v-for="(li,index) in columnsCur"
...@@ -87,12 +91,12 @@ ...@@ -87,12 +91,12 @@
export default { export default {
data() { data() {
return { return {
keys: '', keys: "",
modalSearch: false, modalSearch: false,
search: { search: {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
conditions: [] conditions: [],
}, },
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
tableHeight: 0, tableHeight: 0,
...@@ -100,325 +104,337 @@ export default { ...@@ -100,325 +104,337 @@ export default {
config: false, config: false,
list: [], list: [],
columnsCur: [], columnsCur: [],
configLoad:false, configLoad: false,
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
userId: this.$store.state.userInfo.userId userId: this.$store.state.userInfo.userId,
} };
}, },
props: { props: {
datalist:{ datalist: {
type: Array, type: Array,
default:[] default: [],
}, },
total:{ total: {
type: Number, type: Number,
default:0 default: 0,
}, },
border: { border: {
//是否显示边框 //是否显示边框
type: Boolean, type: Boolean,
default: true default: true,
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '请输入关键字' default: "请输入关键字",
}, },
height: { height: {
type: Number, type: Number,
default: 0 default: 0,
}, },
tool: { tool: {
//是否显示工具栏 //是否显示工具栏
type: Boolean, type: Boolean,
default: true default: true,
}, },
easy: { easy: {
//是否显示简单搜索 //是否显示简单搜索
type: Boolean, type: Boolean,
default: true default: true,
}, },
high: { high: {
//是否显示高级搜索 //是否显示高级搜索
type: Boolean, type: Boolean,
default: true default: true,
}, },
set: { set: {
//是否显示列设置 //是否显示列设置
type: Boolean, type: Boolean,
default: true default: true,
}, },
page: { page: {
//是否分页 //是否分页
type: Boolean, type: Boolean,
default: true default: true,
}, },
data: { data: {
// 当作table使用,直接显示数据 // 当作table使用,直接显示数据
type: Array, type: Array,
default: function() { default: function () {
return [] return [];
} },
}, },
columns: { columns: {
//要显示的字段 //要显示的字段
type: Array, type: Array,
default: [] default: [],
}, },
action: { action: {
//接口地址 //接口地址
type: String, type: String,
default: '' default: "",
}, },
conditions: { conditions: {
//查询条件 //查询条件
type: Object, type: Object,
default: function() { default: function () {
return { return {
keys: { op: 'name', value: '', default: true } keys: { op: "name", value: "", default: true },
} };
} },
} },
}, },
created() { created() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
if (!u.hide) { if (!u.hide) {
u.hide = false u.hide = false;
} }
}) });
this.columnsCur = this.$u.clone(this.columns) this.columnsCur = this.$u.clone(this.columns);
console.warn(this.columnsCur) console.warn(this.columnsCur);
}, },
mounted() { mounted() {
this.keys = '' this.keys = "";
this.intY() this.intY();
this.loadUserConfig(); this.loadUserConfig();
if (this.height === 0) { if (this.height === 0) {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - this.firstY - 60 this.tableHeight = window.screenHeight - this.firstY - 60;
})() })();
} };
} else { } else {
this.tableHeight = this.height this.tableHeight = this.height;
} }
//注册拖拽事件。 //注册拖拽事件。
this.$dragging.$on('dragend', (e) => { this.$dragging.$on("dragend", (e) => {
// console.log("dragend",e); // console.log("dragend",e);
this.saveUserconfig() this.saveUserconfig();
}) });
}, },
methods: { methods: {
//数据加载 //数据加载
load() { load() {
if (this.height == 0) { if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60 this.tableHeight = window.innerHeight - this.firstY - 60;
} }
if (this.action) { if (this.action) {
this.$api.post(this.action, this.search).then((r) => { this.$api.post(this.action, this.search).then((r) => {
this.list = r.result.items this.list = r.result.items;
this.search.total = r.result.totalCount this.search.total = r.result.totalCount;
}) });
}else{ } else {
this.list = this.datalist this.list = this.datalist;
this.search.total = this.total this.search.total = this.total;
} }
}, },
columnInit(){ columnInit() {
if(this.userConfig){ if (this.userConfig) {
var curColumns=[]; var curColumns = [];
var config=JSON.parse(this.userConfig.content); var config = JSON.parse(this.userConfig.content);
// console.warn("2:列比对",config) // console.warn("2:列比对",config)
if(config.length==this.columnsCur.length){ if (config.length == this.columnsCur.length) {
config.map(u=>{ config.map((u) => {
var item=this.columnsCur.filter(c=>{ var item = this.columnsCur.filter((c) => {
return c.key==u.key; return c.key == u.key;
}); });
if(item[0]){ if (item[0]) {
item[0].hide=u.hide; item[0].hide = u.hide;
curColumns.push(item[0]); curColumns.push(item[0]);
} }
}); });
// console.warn("3:初始化列") // console.warn("3:初始化列")
this.columnsCur=curColumns; this.columnsCur = curColumns;
} }
} }
}, },
loadUserConfig() { loadUserConfig() {
var query = { var query = {
conditions: [ conditions: [
{fieldName:"creatorUserId",fieldValue:this.userId,conditionalType: "Equal"}, {
{fieldName:"component",fieldValue:"Grid",conditionalType: "Equal"}, fieldName: "creatorUserId",
{fieldName:"page",fieldValue:window.location.pathname,conditionalType: "Equal"} fieldValue: this.userId,
] conditionalType: "Equal",
, },
pageSize: 1 {
} fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => { this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) { if (r.success) {
if (r.result.length == 1) { if (r.result.length == 1) {
this.userConfig = r.result[0] this.userConfig = r.result[0];
// console.warn("1:加载用户配置") // console.warn("1:加载用户配置")
this.columnInit(); this.columnInit();
} }
if(!this.configLoad){ if (!this.configLoad) {
this.easySearch(); this.easySearch();
} }
this.configLoad=true; this.configLoad = true;
} }
}) });
}, },
saveUserconfig() { saveUserconfig() {
let url = `${window.systemUrl}/config/update`; let url = `${window.systemUrl}/config/update`;
var content=[]; var content = [];
this.columnsCur.map(u=>{ this.columnsCur.map((u) => {
content.push({ content.push({
key:u.key, key: u.key,
hide:u.hide hide: u.hide,
}) });
}) });
if (!this.userConfig) { if (!this.userConfig) {
url = `${window.systemUrl}/config/create` url = `${window.systemUrl}/config/create`;
var data = { var data = {
page: window.location.pathname, page: window.location.pathname,
component: 'Grid', component: "Grid",
key: this.$u.guid(), key: this.$u.guid(),
content: JSON.stringify(content) content: JSON.stringify(content),
} };
this.$api.post(url,data).then(r=>{ this.$api.post(url, data).then((r) => {
this.loadUserConfig() this.loadUserConfig();
}); });
}else{ } else {
this.userConfig.content=JSON.stringify(content); this.userConfig.content = JSON.stringify(content);
this.$api.post(url,this.userConfig) this.$api.post(url, this.userConfig);
} }
}, },
//展开 //展开
expand(row, status) { expand(row, status) {
this.$emit('on-expand', row, status) this.$emit("on-expand", row, status);
}, },
easySearch() { easySearch() {
if (this.conditions && this.conditions.keys.default) { if (this.conditions && this.conditions.keys.default) {
//判断没有传入条件的用默认的查询 //判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys this.conditions.keys.value = this.keys;
} }
this.reload(this.conditions) this.reload(this.conditions);
}, },
undoConfig(){ undoConfig() {
//列设置恢复初始化 //列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns); this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig(); this.saveUserconfig();
}, },
complexSearch() { complexSearch() {
var search = this.$refs.search.$children.filter((u) => { var search = this.$refs.search.$children.filter((u) => {
return u.condition return u.condition;
}) });
if (search) { if (search) {
var conditions = search[0].condition var conditions = search[0].condition;
this.reload(conditions) this.reload(conditions);
} }
}, },
reload(conditions) { reload(conditions) {
var where = [] var where = [];
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value let v = conditions[u].value;
let op = conditions[u].op let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == 'Range') { if (op == "Range") {
let times = [] let times = [];
v.map((u) => { v.map((u) => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u)) times.push(this.$u.toTime(u));
} }
}) });
v = times.join(',') v = times.join(",");
} else if (op.indexOf('In') > -1) { } else if (op.indexOf("In") > -1) {
v = v.join(',') v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
where.push({ where.push({
fieldName: u, fieldName: u,
fieldValue: v, fieldValue: v,
conditionalType: op conditionalType: op,
}) });
} }
} }
}) });
} }
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.search.conditions = where this.search.conditions = where;
this.load() this.load();
}, },
pageChange(page) { pageChange(page) {
this.search.page = page this.search.page = page;
this.search.pageIndex = page this.search.pageIndex = page;
this.load() this.load();
}, },
pageSizeChange(size) { pageSizeChange(size) {
this.search.pageSize = size this.search.pageSize = size;
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.load() this.load();
}, },
columnChange(item, i) { columnChange(item, i) {
item.hide = !item.hide; item.hide = !item.hide;
this.$set(this.columnsCur,item,i); this.$set(this.columnsCur, item, i);
this.saveUserconfig(); this.saveUserconfig();
}, },
selectionChange(items) { selectionChange(items) {
this.$emit('on-selection-change', items) this.$emit("on-selection-change", items);
}, },
intY() { intY() {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
} },
}, },
computed: { computed: {
columnsNow() { columnsNow() {
var cols = this.columnsCur.filter((u) => { var cols = this.columnsCur.filter((u) => {
if (u.code) { if (u.code) {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('state', { return h("state", {
props: { props: {
code: u.code, code: u.code,
type: 'text', type: "text",
value: params.row[values] + '' value: params.row[values] + "",
} },
}) });
} };
} }
if (u.type == 'user') { if (u.type == "user") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('User', { return h("User", {
props: { props: {
value: params.row[values] value: params.row[values],
} },
}) });
} };
} }
if (u.type == 'date' || u.type == 'dateTime') { if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('DTSpan', { return h("DTSpan", {
props: { props: {
type: u.type, type: u.type,
value: params.row[values] value: params.row[values],
} },
}) });
} };
} }
return !u.hide return !u.hide;
}) });
return cols return cols;
} },
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
// height: 100%; // height: 100%;
...@@ -436,12 +452,13 @@ export default { ...@@ -436,12 +452,13 @@ export default {
font-size: 14px; font-size: 14px;
padding: 0 2px; padding: 0 2px;
} }
.tableCommon tr td .ivu-table-cell { .tableCommon tr td .ivu-table-cell {
padding:0 5px; padding: 0 5px;
} }
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<div class="ml10"> <div class="ml10">
<Tabs v-model="currTab" @on-click="clickTab"> <Tabs v-model="currTab" @on-click="clickTab">
<TabPane label="五二九纵" name="name1"> <TabPane label="五二九纵" name="name1">
<Table border highlight-row ref="table1" :columns="column1" :data="data1"></Table> <Table highlight-row ref="table1" :columns="column1" :data="data1"></Table>
</TabPane> </TabPane>
<TabPane label="五二九横" name="name2">五二九横</TabPane> <TabPane label="五二九横" name="name2">五二九横</TabPane>
<TabPane label="五二九预" name="name3">五二九预</TabPane> <TabPane label="五二九预" name="name3">五二九预</TabPane>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <div class="table-boxs">
<Table border :columns="columns" :data="data" size="small"></Table> <Table :columns="columns" :data="data" size="small"></Table>
</div> </div>
<div class="shenpi"> <div class="shenpi">
<label>审批人:</label> <label>审批人:</label>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</Row> </Row>
</Form> </Form>
<div class="kuang-boxi"> <div class="kuang-boxi">
<Table border :columns="columns" :data="gmData" size="small"> <Table :columns="columns" :data="gmData" size="small">
<template slot-scope="{ row, index }" slot="slot1"> <template slot-scope="{ row, index }" slot="slot1">
<InputNumber v-model="row.materialWeight" :min="0" @on-blur="show1(row,index)" /> <InputNumber v-model="row.materialWeight" :min="0" @on-blur="show1(row,index)" />
</template> </template>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <div class="table-boxs">
<Table border :columns="columns" :data="childData.result" size="small"></Table> <Table :columns="columns" :data="childData.result" size="small"></Table>
</div> </div>
<div class="zong-ji"> <div class="zong-ji">
<div class="xiao-ji">总计</div> <div class="xiao-ji">总计</div>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</Row> </Row>
</Form> </Form>
<div class="kuang-boxi"> <div class="kuang-boxi">
<Table border :columns="columns" :data="gmData" size="small"> <Table :columns="columns" :data="gmData" size="small">
<template slot-scope="{ row, index }" slot="slot1"> <template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.materialWeight" placeholder="请输入" @on-blur="show1(row, index)" /> <Input v-model="row.materialWeight" placeholder="请输入" @on-blur="show1(row, index)" />
</template> </template>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <div class="table-boxs">
<Table border :columns="columns" :data="childData.result" size="small"></Table> <Table :columns="columns" :data="childData.result" size="small"></Table>
</div> </div>
<div class="zong-ji"> <div class="zong-ji">
<div class="xiao-ji">总计</div> <div class="xiao-ji">总计</div>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
footer-hide footer-hide
> >
<div class="kuang-boxi"> <div class="kuang-boxi">
<Table border :columns="columns" :data="data" size="small"> <Table :columns="columns" :data="data" size="small">
<template slot-scope="{ row, index }" slot="slot1"> <template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.name9" placeholder="请输入" @on-change="showPrinting(row,index)" /> <Input v-model="row.name9" placeholder="请输入" @on-change="showPrinting(row,index)" />
</template> </template>
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
import GenerateQuotation from "../components/generateQuotation.vue"; //生成报价单弹框 import GenerateQuotation from "../components/generateQuotation.vue"; //生成报价单弹框
export default { export default {
components: { components: {
GenerateQuotation GenerateQuotation,
}, },
name: "", name: "",
props: { props: {
bjData: Array bjData: Array,
}, },
data() { data() {
return { return {
...@@ -76,13 +76,13 @@ export default { ...@@ -76,13 +76,13 @@ export default {
title: "序号", title: "序号",
type: "index", type: "index",
width: 50, width: 50,
align: "center" align: "center",
}, },
{ {
title: "订单编号", title: "订单编号",
key: "name", key: "name",
align: "center", align: "center",
minWidth: 120 minWidth: 120,
}, },
// { // {
// title: '图号', // title: '图号',
...@@ -94,41 +94,41 @@ export default { ...@@ -94,41 +94,41 @@ export default {
title: "产品名称", title: "产品名称",
key: "name2", key: "name2",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "规格", title: "规格",
key: "name4", key: "name4",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "材料牌号", title: "材料牌号",
key: "name5", key: "name5",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot6" slot: "slot6",
}, },
{ {
title: "材料重量", title: "材料重量",
key: "name6", key: "name6",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot7" slot: "slot7",
}, },
{ {
title: "材料单价", title: "材料单价",
key: "name7", key: "name7",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot8" slot: "slot8",
}, },
{ {
title: "材料费/件(元)", title: "材料费/件(元)",
key: "name8", key: "name8",
align: "center", align: "center",
minWidth: 70 minWidth: 70,
}, },
{ {
title: "3D打印费", title: "3D打印费",
...@@ -146,19 +146,19 @@ export default { ...@@ -146,19 +146,19 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "1600", value: "1600",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "后处理费", title: "后处理费",
...@@ -176,19 +176,19 @@ export default { ...@@ -176,19 +176,19 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "200", value: "200",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "线切割费", title: "线切割费",
...@@ -206,25 +206,25 @@ export default { ...@@ -206,25 +206,25 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "100", value: "100",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "加工费单价", title: "加工费单价",
key: "name12", key: "name12",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
}, },
{ {
...@@ -232,39 +232,39 @@ export default { ...@@ -232,39 +232,39 @@ export default {
key: "name13", key: "name13",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot4" slot: "slot4",
}, },
{ {
title: "单价", title: "单价",
key: "name14", key: "name14",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
}, },
{ {
title: "数量", title: "数量",
key: "name3", key: "name3",
align: "center", align: "center",
minWidth: 70 minWidth: 70,
}, },
{ {
title: "热处理", title: "热处理",
key: "name15", key: "name15",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot5" slot: "slot5",
}, },
{ {
title: "合计", title: "合计",
key: "name16", key: "name16",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "调度", title: "调度",
key: "name17", key: "name17",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
} },
], ],
data: [ data: [
{ {
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
}, },
{ {
name: "a1233", name: "a1233",
...@@ -305,7 +305,7 @@ export default { ...@@ -305,7 +305,7 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
}, },
{ {
name: "a1233", name: "a1233",
...@@ -325,9 +325,9 @@ export default { ...@@ -325,9 +325,9 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
} },
] ],
}; };
}, },
mounted() {}, mounted() {},
...@@ -369,10 +369,10 @@ export default { ...@@ -369,10 +369,10 @@ export default {
return (row.name16 = return (row.name16 =
parseInt(row.name14) * parseInt(row.name3) + parseInt(row.name15)); //合计=单价*数量+热处理 parseInt(row.name14) * parseInt(row.name3) + parseInt(row.name15)); //合计=单价*数量+热处理
}, },
cancel() { cancel() {
this.$emit('update') this.$emit("update");
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> <Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<StoreTree @on-hide="onHide" @on-select="productSearch" /> <StoreTree @on-hide="onHide" @on-select="productSearch" />
</Sider> </Sider>
<Icon type="icon iconfont icondaochu" size="24" /> <!-- <Icon type="icon iconfont icondaochu" size="24" /> -->
<div v-if="!showMenu" class="show_menu"> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开"> <a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
...@@ -621,8 +621,7 @@ export default { ...@@ -621,8 +621,7 @@ export default {
margin-top: 0; margin-top: 0;
.content { .content {
margin-top: 10px; margin-top: 6px;
padding-top: 10px;
.ivu-icon-ios-add:before { .ivu-icon-ios-add:before {
content: "\f341"; content: "\f341";
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -227,8 +227,9 @@ export default { ...@@ -227,8 +227,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -157,8 +157,9 @@ export default { ...@@ -157,8 +157,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -139,8 +139,9 @@ export default { ...@@ -139,8 +139,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -226,8 +226,9 @@ export default { ...@@ -226,8 +226,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -238,11 +238,12 @@ export default { ...@@ -238,11 +238,12 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.product-mix { .product-mix {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
padding-top: 3px; padding-top: 3px;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -250,7 +251,7 @@ export default { ...@@ -250,7 +251,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -301,6 +301,7 @@ export default { ...@@ -301,6 +301,7 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.set { .set {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
padding-top: 3px; padding-top: 3px;
...@@ -309,8 +310,9 @@ export default { ...@@ -309,8 +310,9 @@ export default {
width: 100%; width: 100%;
// display: flex; // display: flex;
// display: -webkit-flex; // display: -webkit-flex;
background: @layout-content-bg-color;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -318,7 +320,7 @@ export default { ...@@ -318,7 +320,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
.menu_side{ @import "../../assets/css/custom.less";
background: #fff;
margin: 5px 0 0 0; .menu_side {
border: 1px solid #dcdee2 background: @left-tree-bg;
margin: 5px 0 0 0;
border: 1px solid @left-boder-color;
} }
.side_tree{
background: #ffffff; .side_tree {
width: 300px; background: #ffffff;
border: 1px solid #ddd; width: 300px;
.tree_tit{ border: 1px solid #ddd;
background: #F5F6FA;
height: 50px; .tree_tit {
line-height: 50px; background: #F5F6FA;
font-size: 14px; height: 50px;
color: #515A6E; line-height: 50px;
.menu_play{ font-size: 14px;
width: 30px; color: #515A6E;
height: 50px;
line-height: 50px; .menu_play {
text-align: center; width: 30px;
color: #646464; height: 50px;
} line-height: 50px;
text-align: center;
color: #646464;
} }
.tree_left{ }
padding: 8px 15px;
.ivu-tree{ .tree_left {
// height: ; padding: 8px 15px;
}
.ivu-tree {
// height: ;
} }
}
} }
.show_menu{
.show_menu {
width: 30px;
height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px; width: 30px;
height: 30px; height: 30px;
position: fixed; line-height: 34px;
top: 100px; font-size: 14px;
left: 0; text-align: center;
z-index: 9; color: #515A6E;
.menu_play{ border-top-right-radius: 5px;
width: 30px; border-bottom-right-radius: 5px;
height: 30px; background: #ffffff;
line-height: 34px; box-shadow: #ccc 2px 2px 4px 1px;
font-size: 14px; }
text-align: center;
color: #515A6E; .menu_play:hover {
border-top-right-radius: 5px; background-color: #2d8cf0;
border-bottom-right-radius: 5px; color: white;
background: #ffffff; }
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover{
background-color: #2d8cf0;
color: white;
}
} }
.tech_body{
margin: 5px 5px 5px 20px; .tech_body {
padding: 2px 18px; margin: 5px 5px 5px 20px;
box-shadow: #98929294 2px 1px 5px 1px; padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
} }
.tech_body02{
margin: 5px; .tech_body02 {
padding: 2px 18px; margin: 5px;
box-shadow: #98929294 2px 1px 5px 1px; padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
} }
.product-layout .i-layout-content { .product-layout .i-layout-content {
padding: 4px 10px!important; padding: 4px 10px !important;
} }
.setdetail_body{ .setdetail_body {
// padding: 0 20px;
.ivu-layout-header{ // padding: 0 20px;
height: 0; .ivu-layout-header {
height: 0;
}
.ivu-menu-horizontal {
height: 40px;
line-height: 40px;
.ivu-menu-item {
width: 115px;
text-align: center;
} }
.ivu-menu-horizontal{
height: 40px; a.ivu-menu-item-active::before {
line-height: 40px; content: "";
.ivu-menu-item{ display: block;
width: 115px; border-width: 5px 6px 0;
text-align: center; border-style: solid;
} border-color: #2d8cf0 transparent transparent;
a.ivu-menu-item-active::before{ width: 0;
content: ""; height: 0;
display: block; position: absolute;
border-width: 5px 6px 0; bottom: -6px;
border-style: solid; left: 43%;
border-color: #2d8cf0 transparent transparent; }
width: 0;
height: 0; a.ivu-menu-item-active::after {
position: absolute; content: "";
bottom: -6px; display: block;
left: 43%; border-width: 4px 4px 0;
} border-style: solid;
a.ivu-menu-item-active::after{ border-color: #fff transparent transparent;
content: ""; width: 0;
display: block; height: 0;
border-width: 4px 4px 0; position: absolute;
border-style: solid; bottom: -4px;
border-color: #fff transparent transparent; left: 44%;
width: 0;
height: 0;
position: absolute;
bottom: -4px;
left: 44%;
}
} }
}
} }
.lay100 { .lay100 {
height: calc(100vh - 105px); height: calc(100vh - 105px);
background-color: #F5F6FA; background-color: #F5F6FA;
.con{
padding: 5px 5px 0px 10px; .con {
.h100{ padding: 5px 5px 0px 10px;
overflow-y: auto;
} .h100 {
overflow-y: auto;
} }
}
} }
\ No newline at end of file
@import "../../../assets/css/custom.less";
.ivu-layout-sider{ .ivu-layout-sider{
width: 240px!important; width: 240px!important;
max-width: 240px!important; max-width: 240px!important;
flex: 0 0 240px!important; flex: 0 0 240px!important;
} }
.ivu-layout,.ivu-layout-sider{ .ivu-layout,.ivu-layout-sider{
background: #fff; background: @layout-content-bg-color;
} }
.ivu-menu-vertical.ivu-menu-light:after { .ivu-menu-vertical.ivu-menu-light:after {
display: none; display: none;
......
...@@ -1085,9 +1085,9 @@ html [type=button] { ...@@ -1085,9 +1085,9 @@ html [type=button] {
box-shadow: #c7c7c7 1px 2px 7px 3px; box-shadow: #c7c7c7 1px 2px 7px 3px;
} }
.menu_side { .menu_side {
background: #fff !important; /* background: #fff !important; */
margin: 5px 0 0 0 !important; margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important; /* border: 1px solid #dcdee2 !important; */
} }
.show_menu { .show_menu {
width: 30px; width: 30px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment