Commit 5b8b7c1d by 前端

修复第一轮测试BUG

1 parent 1a54024b
<!-- 表格+分页 --> <!-- 表格+分页 -->
<template> <template>
<div class="d2-table"> <div class="d2-table">
<el-table <el-table :ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:data="getListApi ? data : tableData" :data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''" :row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading" v-loading="loading"
...@@ -12,26 +11,21 @@ ...@@ -12,26 +11,21 @@
@selection-change="handleSelect" @selection-change="handleSelect"
:tree-props="{ children: 'upgradeGoodsList' }" :tree-props="{ children: 'upgradeGoodsList' }"
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
v-bind="$attrs" v-bind="$attrs">
> <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection" type="selection"
align="center" align="center"
:selectable="selectableFn" :selectable="selectableFn"
width="55" width="55" />
/> <el-table-column v-if="tableParams.singleSelectUniqueKey"
<el-table-column
v-if="tableParams.singleSelectUniqueKey"
align="center" align="center"
width="55" width="55">
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="single-button" :scope="scope.row" /> <slot name="single-button"
:scope="scope.row" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="hasNum"
v-if="hasNum"
align="center" align="center"
width="60px" width="60px"
label="序号" label="序号"
...@@ -45,10 +39,8 @@ ...@@ -45,10 +39,8 @@
1) * 1) *
(pagination.pageSize ? pagination.pageSize : page.pageSize) + (pagination.pageSize ? pagination.pageSize : page.pageSize) +
1 1
" " />
/> <el-table-column v-for="(item, index) in tableParams.tableColumns"
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
:key="index" :key="index"
:label="item.label" :label="item.label"
:prop="item.prop" :prop="item.prop"
...@@ -57,27 +49,22 @@ ...@@ -57,27 +49,22 @@
:align="item.align || 'center'" :align="item.align || 'center'"
:sortable="item.sortable" :sortable="item.sortable"
:render-header="item.renderHeader" :render-header="item.renderHeader"
:show-overflow-tooltip="item.showOverFlow" :show-overflow-tooltip="item.showOverFlow">
>
<template slot="header"> <template slot="header">
<span>{{ item.label }}</span> <span>{{ item.label }}</span>
<table-head-search <table-head-search v-if="item.optionConfig"
v-if="item.optionConfig"
:search-form="headSearchForm" :search-form="headSearchForm"
:option-config="item.optionConfig" :option-config="item.optionConfig"
:base-data="baseData" :base-data="baseData"
@handleTableHeadChange="handleTableHeadChange" @handleTableHeadChange="handleTableHeadChange" />
/>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<slot <slot v-if="item.addHtml"
v-if="item.addHtml"
:name="item.addHtml" :name="item.addHtml"
:scope="scope.row" :scope="scope.row"
:index="scope.$index" :index="scope.$index"
:prop="item.prop" :prop="item.prop"
:width="item.width" :width="item.width" />
/>
<template v-else-if="item.type == 'ownSerialNum'"> <template v-else-if="item.type == 'ownSerialNum'">
<span>{{ <span>{{
scope.row[item.prop] >= 0 scope.row[item.prop] >= 0
...@@ -94,19 +81,16 @@ ...@@ -94,19 +81,16 @@
}}</span> }}</span>
</template> </template>
<template v-else-if="item.tagLabel"> <template v-else-if="item.tagLabel">
<el-tag <el-tag v-if="!item.tagName"
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]" :type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]" v-text="tableParams.tag.label[scope.row[item.prop]]" />
/> <el-tag v-else
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]" :type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]" v-text="tableParams[item.tagName].label[scope.row[item.prop]]" />
/>
</template> </template>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span v-if="item.html" v-html="item.formatter(scope.row)" /> <span v-if="item.html"
v-html="item.formatter(scope.row)" />
<template v-if="!item.html"> <template v-if="!item.html">
<span :class="item.className ? item.className(scope.row) : ''" /> <span :class="item.className ? item.className(scope.row) : ''" />
<span v-text="item.formatter(scope.row)" /> <span v-text="item.formatter(scope.row)" />
...@@ -119,50 +103,49 @@ ...@@ -119,50 +103,49 @@
? scope.row[item.parentProp][item.prop] ? scope.row[item.parentProp][item.prop]
: "" : ""
}}</span> }}</span>
<span v-else>{{ <!-- <span v-else>{{
scope.row[item.prop] != null || scope.row[item.prop] != "" scope.row[item.prop] != null || scope.row[item.prop] != ""
? scope.row[item.prop] ? scope.row[item.prop]
: "-" : "-"
}}</span> }}</span> -->
<span v-else>{{ scope.row[item.prop] || "-" }}</span>
</template> </template>
<template v-else> <template v-else>
<span <span v-text="
v-text="
tableData[scope.$index][item.prop] != null tableData[scope.$index][item.prop] != null
? tableData[scope.$index][item.prop] ? tableData[scope.$index][item.prop]
: '-' : '-'
" " />
/>
</template> </template>
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol" /> <span v-text="item.addSymbol" />
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="tableParams.tableOption"
v-if="tableParams.tableOption"
label="操作" label="操作"
fixed="right" fixed="right"
:align="tableParams.tableOption.align || 'center'" :align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || 'auto'" :width="tableParams.tableOption.width || 'auto'">
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="auth-button" :scope="scope.row" :index="scope.$index" /> <slot name="auth-button"
<slot
name="auth-button-other"
:scope="scope.row" :scope="scope.row"
:index="scope.$index" :index="scope.$index" />
/> <slot name="auth-button-other"
:scope="scope.row"
:index="scope.$index" />
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty" class="emptyBg"> <div slot="empty"
<img class="noDataImg" :src="noDataImg" v-if="noDataImg" /> class="emptyBg">
<img class="noDataImg"
:src="noDataImg"
v-if="noDataImg" />
{{ noDataText }} {{ noDataText }}
</div> </div>
</el-table> </el-table>
<el-pagination <el-pagination v-if="hasPage"
v-if="hasPage"
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -170,8 +153,7 @@ ...@@ -170,8 +153,7 @@
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize" :page-size="page.pageSize"
:total="getListApi ? total : tableTotal" :total="getListApi ? total : tableTotal"
:layout="layout" :layout="layout" />
/>
</div> </div>
</template> </template>
...@@ -206,17 +188,17 @@ export default { ...@@ -206,17 +188,17 @@ export default {
// 搜索条件 // 搜索条件
searchForm: { searchForm: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 表格头部搜索条件 - start // 表格头部搜索条件 - start
headSearchForm: { headSearchForm: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 选项列表Obj // 选项列表Obj
baseData: { baseData: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 表格头部搜索条件 - end // 表格头部搜索条件 - end
// 表格数据-外部传入 // 表格数据-外部传入
...@@ -260,7 +242,7 @@ export default { ...@@ -260,7 +242,7 @@ export default {
// 排序列表对象 // 排序列表对象
sortObj: { sortObj: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
tableParams: { tableParams: {
type: Object, type: Object,
...@@ -318,7 +300,7 @@ export default { ...@@ -318,7 +300,7 @@ export default {
// 合并单元格方法 // 合并单元格方法
arraySpanMethod: { arraySpanMethod: {
type: Function, type: Function,
default: () => {} default: () => { }
}, },
//边框 //边框
border: { border: {
......
...@@ -104,6 +104,9 @@ export default { ...@@ -104,6 +104,9 @@ export default {
}, },
} }
}, },
created() {//默认当前日期
this.searchForm.time = [new Date(), new Date()]
},
computed: { computed: {
...mapState({ ...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList dowloadList: (state) => state.d2admin.user.dowloadList
......
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
prop: 'applyTime', prop: 'applyTime',
width: '150px', width: '150px',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.applyTime ? Util.dateFormate(cellValue.applyTime, 'YYYY-MM-DD HH:mm:ss') : '' return cellValue.applyTime ? Util.dateFormate(cellValue.applyTime, 'YYYY-MM-DD HH:mm:ss') : '-'
} }
}, { }, {
label: '申请状态', label: '申请状态',
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
prop: 'auditTime', prop: 'auditTime',
width: '150px', width: '150px',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.auditTime ? Util.dateFormate(cellValue.auditTime, 'YYYY-MM-DD HH:mm:ss') : '' return cellValue.auditTime ? Util.dateFormate(cellValue.auditTime, 'YYYY-MM-DD HH:mm:ss') : '-'
} }
} }
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!