|
@ -1,40 +1,52 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="div_main"> |
|
|
<div class="div_main"> |
|
|
<div v-show="true"> |
|
|
<div v-show="true"> |
|
|
<div class="div_search" |
|
|
<div class="div_search" ref="ref_search"> |
|
|
ref="ref_search"> |
|
|
<el-form |
|
|
<el-form :inline="true" |
|
|
:inline="true" |
|
|
ref="ref_searchform" |
|
|
ref="ref_searchform" |
|
|
label-width="100px"> |
|
|
label-width="100px" |
|
|
|
|
|
> |
|
|
<div> |
|
|
<div> |
|
|
<el-form-item v-for="item in searchParams" |
|
|
<el-form-item |
|
|
|
|
|
v-for="item in searchParams" |
|
|
:key="'serach' + item.keyName" |
|
|
:key="'serach' + item.keyName" |
|
|
:label="item.field" |
|
|
:label="item.field" |
|
|
:prop="item.keyName"> |
|
|
:prop="item.keyName" |
|
|
|
|
|
> |
|
|
<template v-if="item.type == 'input'"> |
|
|
<template v-if="item.type == 'input'"> |
|
|
<el-input v-model="item.value" |
|
|
<el-input |
|
|
|
|
|
v-model="item.value" |
|
|
style="width: 240px" |
|
|
style="width: 240px" |
|
|
size="small" |
|
|
size="small" |
|
|
clearable |
|
|
clearable |
|
|
:placeholder="item.placeholder || '请输入'"> |
|
|
:placeholder="item.placeholder || '请输入'" |
|
|
|
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else-if="item.type == 'select'"> |
|
|
<template v-else-if="item.type == 'select'"> |
|
|
<el-select v-model="item.value" |
|
|
<el-select |
|
|
|
|
|
v-model="item.value" |
|
|
:placeholder="item.placeholder || '请选择'" |
|
|
:placeholder="item.placeholder || '请选择'" |
|
|
size="small" |
|
|
size="small" |
|
|
clearable |
|
|
clearable |
|
|
style="width: 240px" |
|
|
style="width: 240px" |
|
|
:multiple="item.multiple || false"> |
|
|
:multiple="item.multiple || false" |
|
|
<el-option v-for="item in item.optionList" |
|
|
> |
|
|
:key="'serach' + item.keyName + item.value" |
|
|
<el-option |
|
|
|
|
|
v-for="item in item.optionList" |
|
|
|
|
|
:key=" |
|
|
|
|
|
'serach' + item.keyName + item.value |
|
|
|
|
|
" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:value="item.value"> |
|
|
:value="item.value" |
|
|
|
|
|
> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else-if="item.type == 'cascader'"> |
|
|
<template v-else-if="item.type == 'cascader'"> |
|
|
<el-cascader v-model="item.value" |
|
|
<el-cascader |
|
|
|
|
|
v-model="item.value" |
|
|
:placeholder="item.placeholder || '请选择'" |
|
|
:placeholder="item.placeholder || '请选择'" |
|
|
:options="item.optionList" |
|
|
:options="item.optionList" |
|
|
:props="item.optionProps" |
|
|
:props="item.optionProps" |
|
@ -42,54 +54,82 @@ |
|
|
size="small" |
|
|
size="small" |
|
|
clearable |
|
|
clearable |
|
|
style="width: 240px" |
|
|
style="width: 240px" |
|
|
@change="(e) => handleChangeCascader(e, item)"> |
|
|
@change=" |
|
|
|
|
|
(e) => handleChangeCascader(e, item) |
|
|
|
|
|
" |
|
|
|
|
|
> |
|
|
</el-cascader> |
|
|
</el-cascader> |
|
|
</template> |
|
|
</template> |
|
|
<template v-if="item.type == 'date-range'"> |
|
|
<template v-if="item.type == 'date-range'"> |
|
|
<el-date-picker v-model="item.supValues[0]" |
|
|
<el-date-picker |
|
|
|
|
|
v-model="item.supValues[0]" |
|
|
type="date" |
|
|
type="date" |
|
|
placeholder="开始时间" |
|
|
placeholder="开始时间" |
|
|
style="width: 150px" |
|
|
style="width: 150px" |
|
|
value-format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
clearable> |
|
|
clearable |
|
|
|
|
|
> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
<span style="display: inline-block; margin: 0 10px">至</span> |
|
|
<span |
|
|
<el-date-picker v-model="item.supValues[1]" |
|
|
style=" |
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
margin: 0 10px; |
|
|
|
|
|
" |
|
|
|
|
|
>至</span |
|
|
|
|
|
> |
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
v-model="item.supValues[1]" |
|
|
type="date" |
|
|
type="date" |
|
|
placeholder="结束时间" |
|
|
placeholder="结束时间" |
|
|
style="width: 150px" |
|
|
style="width: 150px" |
|
|
value-format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
clearable> |
|
|
clearable |
|
|
|
|
|
> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
</template> |
|
|
</template> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-button style="margin-left: 30px; margin-bottom: 20px" |
|
|
<el-button |
|
|
|
|
|
style="margin-left: 30px; margin-bottom: 20px" |
|
|
size="small" |
|
|
size="small" |
|
|
class="diy-button--search" |
|
|
class="diy-button--search" |
|
|
@click="handleSearch">查询</el-button> |
|
|
@click="handleSearch" |
|
|
<el-button style="margin-left: 10px; margin-bottom: 20px" |
|
|
>查询</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
style="margin-left: 10px; margin-bottom: 20px" |
|
|
size="small" |
|
|
size="small" |
|
|
class="diy-button--reset" |
|
|
class="diy-button--reset" |
|
|
@click="resetSearch">重置</el-button> |
|
|
@click="resetSearch" |
|
|
|
|
|
>重置</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="div_table" |
|
|
<div |
|
|
:style="{ height: maxTableHeight + 130 + 'px' }"> |
|
|
class="div_table" |
|
|
|
|
|
:style="{ height: maxTableHeight + 130 + 'px' }" |
|
|
|
|
|
> |
|
|
<div class="div_btn"> |
|
|
<div class="div_btn"> |
|
|
<el-button class="diy-button--add" |
|
|
<el-button |
|
|
|
|
|
class="diy-button--add" |
|
|
v-if="addUrl" |
|
|
v-if="addUrl" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleAdd">新增</el-button> |
|
|
@click="handleAdd" |
|
|
|
|
|
>新增</el-button |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button v-if="mubanUrl" |
|
|
<el-button |
|
|
|
|
|
v-if="mubanUrl" |
|
|
class="btn_upload diy-button--export" |
|
|
class="btn_upload diy-button--export" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleExportModule('room')">下载模板</el-button> |
|
|
@click="handleExportModule('room')" |
|
|
|
|
|
>下载模板</el-button |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-upload :headers="$getElUploadHeaders()" |
|
|
<el-upload |
|
|
|
|
|
:headers="$getElUploadHeaders()" |
|
|
v-if="importUrl" |
|
|
v-if="importUrl" |
|
|
ref="upload" |
|
|
ref="upload" |
|
|
class="upload-btn" |
|
|
class="upload-btn" |
|
@ -100,123 +140,179 @@ |
|
|
:show-file-list="false" |
|
|
:show-file-list="false" |
|
|
:auto-upload="true" |
|
|
:auto-upload="true" |
|
|
:before-upload="beforeExcelUpload" |
|
|
:before-upload="beforeExcelUpload" |
|
|
:http-request="uploadHttpRequest"> |
|
|
:http-request="uploadHttpRequest" |
|
|
<el-button size="small" |
|
|
> |
|
|
class="btn_upload diy-button--delete">导入</el-button> |
|
|
<el-button |
|
|
|
|
|
size="small" |
|
|
|
|
|
class="btn_upload diy-button--delete" |
|
|
|
|
|
>导入</el-button |
|
|
|
|
|
> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
|
|
|
|
|
|
<el-button v-if="exportUrl" |
|
|
<el-button |
|
|
|
|
|
v-if="exportUrl" |
|
|
@click="handleExport" |
|
|
@click="handleExport" |
|
|
class="btn_upload diy-button--reset" |
|
|
class="btn_upload diy-button--reset" |
|
|
size="small">导出</el-button> |
|
|
size="small" |
|
|
<el-button v-if="qrCodeExportUrl" |
|
|
>导出</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
v-if="qrCodeExportUrl" |
|
|
@click="handleExportQrcode" |
|
|
@click="handleExportQrcode" |
|
|
class="btn_upload diy-button--reset" |
|
|
class="btn_upload diy-button--reset" |
|
|
size="small">导出员工登记码</el-button> |
|
|
|
|
|
<el-button v-if="delMultipleUrl" |
|
|
|
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleDeleteMultiple">批量删除</el-button> |
|
|
>导出员工登记码</el-button |
|
|
<slot name="listBtn" |
|
|
> |
|
|
v-bind:multipleSelection="multipleSelection"></slot> |
|
|
<el-button |
|
|
|
|
|
v-if="delMultipleUrl" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="handleDeleteMultiple" |
|
|
|
|
|
>批量删除</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<slot |
|
|
|
|
|
name="listBtn" |
|
|
|
|
|
v-bind:multipleSelection="multipleSelection" |
|
|
|
|
|
></slot> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<el-table ref="ref_table" |
|
|
<el-table |
|
|
|
|
|
ref="ref_table" |
|
|
:data="tableData" |
|
|
:data="tableData" |
|
|
border |
|
|
border |
|
|
:empty-text="loadInfo" |
|
|
:empty-text="loadInfo" |
|
|
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" |
|
|
:header-cell-style="{ |
|
|
|
|
|
background: '#2195FE', |
|
|
|
|
|
color: '#FFFFFF', |
|
|
|
|
|
}" |
|
|
class="table" |
|
|
class="table" |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
:height="maxTableHeight" |
|
|
:height="maxTableHeight" |
|
|
@selection-change="handleSelectionChange"> |
|
|
@selection-change="handleSelectionChange" |
|
|
<template v-for="(item, index) in tableParams" |
|
|
> |
|
|
:prop="item.keyName"> |
|
|
<template |
|
|
<el-table-column v-if="item.type == 'selection'" |
|
|
v-for="(item, index) in tableParams" |
|
|
|
|
|
:prop="item.keyName" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
v-if="item.type == 'selection'" |
|
|
:key="'table-selection' + index" |
|
|
:key="'table-selection' + index" |
|
|
type="selection" |
|
|
type="selection" |
|
|
align="center" |
|
|
align="center" |
|
|
width="50" /> |
|
|
width="50" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-table-column v-if="item.type == 'no'" |
|
|
<el-table-column |
|
|
|
|
|
v-if="item.type == 'no'" |
|
|
:key="'table-no' + item.keyName" |
|
|
:key="'table-no' + item.keyName" |
|
|
:label="item.field" |
|
|
:label="item.field" |
|
|
fixed="left" |
|
|
fixed="left" |
|
|
type="index" |
|
|
type="index" |
|
|
align="center" |
|
|
align="center" |
|
|
width="50" /> |
|
|
width="50" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-table-column v-else-if="item.type == 'text'" |
|
|
<el-table-column |
|
|
|
|
|
v-else-if="item.type == 'text'" |
|
|
:key="'table' + item.keyName" |
|
|
:key="'table' + item.keyName" |
|
|
:prop="item.keyName" |
|
|
:prop="item.keyName" |
|
|
:label="item.field" |
|
|
:label="item.field" |
|
|
align="center" |
|
|
align="center" |
|
|
:width="item.width || ''" |
|
|
:width="item.width || ''" |
|
|
:show-overflow-tooltip="true"> |
|
|
:show-overflow-tooltip="true" |
|
|
|
|
|
> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
<el-table-column v-else-if="item.type == 'array'" |
|
|
<el-table-column |
|
|
|
|
|
v-else-if="item.type == 'array'" |
|
|
:key="'table-array' + item.keyName" |
|
|
:key="'table-array' + item.keyName" |
|
|
:prop="item.keyName" |
|
|
:prop="item.keyName" |
|
|
:label="item.field" |
|
|
:label="item.field" |
|
|
align="center" |
|
|
align="center" |
|
|
:width="item.width || ''" |
|
|
:width="item.width || ''" |
|
|
:show-overflow-tooltip="true"> |
|
|
:show-overflow-tooltip="true" |
|
|
|
|
|
> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ scope.row[item.keyName].join(item.arrayDiv || ",") }} |
|
|
{{ |
|
|
|
|
|
scope.row[item.keyName].join( |
|
|
|
|
|
item.arrayDiv || "," |
|
|
|
|
|
) |
|
|
|
|
|
}} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<el-table-column v-if="operateCol" |
|
|
<el-table-column |
|
|
|
|
|
v-if="operateCol" |
|
|
fixed="right" |
|
|
fixed="right" |
|
|
label="操作" |
|
|
label="操作" |
|
|
align="center" |
|
|
align="center" |
|
|
width="200"> |
|
|
width="200" |
|
|
|
|
|
> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<slot name="listBtnbefore" |
|
|
<slot |
|
|
v-bind:item="scope.row"></slot> |
|
|
name="listBtnbefore" |
|
|
<el-button v-if="infoUrl && infoAuth(scope.row)" |
|
|
v-bind:item="scope.row" |
|
|
|
|
|
></slot> |
|
|
|
|
|
<el-button |
|
|
|
|
|
v-if="infoUrl && infoAuth(scope.row)" |
|
|
@click="handleWatch(scope.row)" |
|
|
@click="handleWatch(scope.row)" |
|
|
type="text" |
|
|
type="text" |
|
|
size="small" |
|
|
size="small" |
|
|
class=".div-table-button--detail">查看</el-button> |
|
|
class=".div-table-button--detail" |
|
|
<el-button v-if="editUrl && editAuth(scope.row)" |
|
|
>查看</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
v-if="editUrl && editAuth(scope.row)" |
|
|
@click="handleEdit(scope.row)" |
|
|
@click="handleEdit(scope.row)" |
|
|
type="text" |
|
|
type="text" |
|
|
size="small" |
|
|
size="small" |
|
|
class="div-table-button--edit">{{ editBtnName(scope.row) }}</el-button> |
|
|
class="div-table-button--edit" |
|
|
<el-popconfirm v-if="delUrl && delAuth(scope.row)" |
|
|
>{{ editBtnName(scope.row) }}</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-popconfirm |
|
|
|
|
|
v-if="delUrl && delAuth(scope.row)" |
|
|
title="删除之后无法回复,确认删除?" |
|
|
title="删除之后无法回复,确认删除?" |
|
|
@onConfirm="handleDelete(scope.row, scope.$index)" |
|
|
@onConfirm=" |
|
|
@confirm="handleDelete(scope.row, scope.$index)"> |
|
|
handleDelete(scope.row, scope.$index) |
|
|
<el-button slot="reference" |
|
|
" |
|
|
|
|
|
@confirm="handleDelete(scope.row, scope.$index)" |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
slot="reference" |
|
|
type="text" |
|
|
type="text" |
|
|
size="small" |
|
|
size="small" |
|
|
style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
|
class="div-table-button--delete">删除</el-button> |
|
|
class="div-table-button--delete" |
|
|
|
|
|
>删除</el-button |
|
|
|
|
|
> |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
|
|
|
|
|
|
<slot name="listBtnSup" |
|
|
<slot |
|
|
v-bind:item="scope.row"></slot> |
|
|
name="listBtnSup" |
|
|
|
|
|
v-bind:item="scope.row" |
|
|
|
|
|
></slot> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<div> |
|
|
<div> |
|
|
<el-pagination @size-change="handleSizeChange" |
|
|
<el-pagination |
|
|
|
|
|
@size-change="handleSizeChange" |
|
|
@current-change="handleCurrentChange" |
|
|
@current-change="handleCurrentChange" |
|
|
:current-page.sync="pageNo" |
|
|
:current-page.sync="pageNo" |
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
:page-size="parseInt(pageSize)" |
|
|
:page-size="parseInt(pageSize)" |
|
|
layout="sizes, prev, pager, next, total" |
|
|
layout="sizes, prev, pager, next, total" |
|
|
:total="total"> |
|
|
:total="total" |
|
|
|
|
|
> |
|
|
</el-pagination> |
|
|
</el-pagination> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 修改弹出框 --> |
|
|
<!-- 修改弹出框 --> |
|
|
<el-dialog v-if="formShow" |
|
|
<el-dialog |
|
|
|
|
|
v-if="formShow" |
|
|
:visible.sync="formShow" |
|
|
:visible.sync="formShow" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-press-escape="false" |
|
|
:close-on-press-escape="false" |
|
@ -224,8 +320,10 @@ |
|
|
:width="editParamsDiv ? '1100px' : '850px'" |
|
|
:width="editParamsDiv ? '1100px' : '850px'" |
|
|
top="5vh" |
|
|
top="5vh" |
|
|
class="dialog-h" |
|
|
class="dialog-h" |
|
|
@closed="handleClose"> |
|
|
@closed="handleClose" |
|
|
<edit-form v-if="formShow" |
|
|
> |
|
|
|
|
|
<edit-form |
|
|
|
|
|
v-if="formShow" |
|
|
ref="editForm" |
|
|
ref="editForm" |
|
|
:idName="idName" |
|
|
:idName="idName" |
|
|
:formId="formId" |
|
|
:formId="formId" |
|
@ -240,18 +338,23 @@ |
|
|
:formBtnFixed="formBtnFixed" |
|
|
:formBtnFixed="formBtnFixed" |
|
|
:editConfig="editConfig" |
|
|
:editConfig="editConfig" |
|
|
@close="handleClose" |
|
|
@close="handleClose" |
|
|
@afterEdit="handleEditSuccess"> |
|
|
@afterEdit="handleEditSuccess" |
|
|
|
|
|
> |
|
|
<template v-slot:bottomSup="{ id, formType, info }"> |
|
|
<template v-slot:bottomSup="{ id, formType, info }"> |
|
|
<slot name="editBottomSup" |
|
|
<slot |
|
|
|
|
|
name="editBottomSup" |
|
|
v-bind:id="id" |
|
|
v-bind:id="id" |
|
|
v-bind:formType="formType" |
|
|
v-bind:formType="formType" |
|
|
v-bind:info="info"></slot> |
|
|
v-bind:info="info" |
|
|
|
|
|
></slot> |
|
|
</template> |
|
|
</template> |
|
|
<template v-slot:operateSup="{ id, formType, info }"> |
|
|
<template v-slot:operateSup="{ id, formType, info }"> |
|
|
<slot name="editOperateSup" |
|
|
<slot |
|
|
|
|
|
name="editOperateSup" |
|
|
v-bind:id="id" |
|
|
v-bind:id="id" |
|
|
v-bind:formType="formType" |
|
|
v-bind:formType="formType" |
|
|
v-bind:info="info"></slot> |
|
|
v-bind:info="info" |
|
|
|
|
|
></slot> |
|
|
</template> |
|
|
</template> |
|
|
</edit-form> |
|
|
</edit-form> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -384,10 +487,10 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
data () { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
loadInfo: '', |
|
|
loadInfo: "", |
|
|
|
|
|
|
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
|
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
|
@ -405,10 +508,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
|
maxTableHeight () { |
|
|
maxTableHeight() { |
|
|
const { ref_search_height } = this; |
|
|
const { ref_search_height } = this; |
|
|
return this.$store.state.inIframe |
|
|
return this.$store.state.inIframe |
|
|
? this.clientHeight - ref_search_height - 265 + this.iframeHeight |
|
|
? this.clientHeight - |
|
|
|
|
|
ref_search_height - |
|
|
|
|
|
265 + |
|
|
|
|
|
this.iframeHeight |
|
|
: this.clientHeight - ref_search_height - 265; |
|
|
: this.clientHeight - ref_search_height - 265; |
|
|
}, |
|
|
}, |
|
|
...mapGetters(["clientHeight", "iframeHeight"]), |
|
|
...mapGetters(["clientHeight", "iframeHeight"]), |
|
@ -416,7 +522,7 @@ export default { |
|
|
|
|
|
|
|
|
watch: {}, |
|
|
watch: {}, |
|
|
|
|
|
|
|
|
async mounted () { |
|
|
async mounted() { |
|
|
console.log(this.$store.state); |
|
|
console.log(this.$store.state); |
|
|
this.user = this.$store.state.user; |
|
|
this.user = this.$store.state.user; |
|
|
|
|
|
|
|
@ -430,24 +536,24 @@ export default { |
|
|
this.computeSearchHeight(); |
|
|
this.computeSearchHeight(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
activated () { |
|
|
activated() { |
|
|
console.log("-------------activated"); |
|
|
console.log("-------------activated"); |
|
|
this.$refs["ref_table"].doLayout(); |
|
|
this.$refs["ref_table"].doLayout(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
handleSelectionChange (val) { |
|
|
handleSelectionChange(val) { |
|
|
console.log(val); |
|
|
console.log(val); |
|
|
this.multipleSelection = val; |
|
|
this.multipleSelection = val; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computeSearchHeight () { |
|
|
computeSearchHeight() { |
|
|
this.ref_search_height = this.$refs["ref_search"].clientHeight; |
|
|
this.ref_search_height = this.$refs["ref_search"].clientHeight; |
|
|
console.log(this.$refs["ref_search"]); |
|
|
console.log(this.$refs["ref_search"]); |
|
|
console.log(this.ref_search_height); |
|
|
console.log(this.ref_search_height); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
iniSearchData () { |
|
|
iniSearchData() { |
|
|
const { searchParams } = this; |
|
|
const { searchParams } = this; |
|
|
searchParams.forEach((item, index) => { |
|
|
searchParams.forEach((item, index) => { |
|
|
if (item.type == "select" || item.type == "cascader") { |
|
|
if (item.type == "select" || item.type == "cascader") { |
|
@ -472,7 +578,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getFmOptions (index, url, params, cookFn) { |
|
|
async getFmOptions(index, url, params, cookFn) { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
...params, |
|
|
...params, |
|
|
}); |
|
|
}); |
|
@ -498,19 +604,19 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleChangeCascader (vals, item) { |
|
|
handleChangeCascader(vals, item) { |
|
|
if (typeof item.handleChangeFn == "function") { |
|
|
if (typeof item.handleChangeFn == "function") { |
|
|
item.handleChangeFn(vals, item); |
|
|
item.handleChangeFn(vals, item); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSearch (val) { |
|
|
handleSearch(val) { |
|
|
this.pageNo = 1; |
|
|
this.pageNo = 1; |
|
|
|
|
|
|
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
beforeExcelUpload (file) { |
|
|
beforeExcelUpload(file) { |
|
|
console.log("file", file); |
|
|
console.log("file", file); |
|
|
const isType = file.type === "application/vnd.ms-excel"; |
|
|
const isType = file.type === "application/vnd.ms-excel"; |
|
|
const isTypeComputer = |
|
|
const isTypeComputer = |
|
@ -528,7 +634,7 @@ export default { |
|
|
return fileType && isLt1M; |
|
|
return fileType && isLt1M; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async uploadHttpRequest (file) { |
|
|
async uploadHttpRequest(file) { |
|
|
let { importUrl: url } = this; |
|
|
let { importUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
|
|
@ -557,7 +663,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleExportModule () { |
|
|
async handleExportModule() { |
|
|
let { mubanUrl: url } = this; |
|
|
let { mubanUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
|
|
@ -571,7 +677,9 @@ export default { |
|
|
// this.download(res.data, title + '.xls') |
|
|
// this.download(res.data, title + '.xls') |
|
|
if (res.headers["content-disposition"]) { |
|
|
if (res.headers["content-disposition"]) { |
|
|
let fileName = window.decodeURI( |
|
|
let fileName = window.decodeURI( |
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
res.headers["content-disposition"] |
|
|
|
|
|
.split(";")[1] |
|
|
|
|
|
.split("=")[1] |
|
|
); |
|
|
); |
|
|
console.log("filename", fileName); |
|
|
console.log("filename", fileName); |
|
|
let blob = new Blob([res.data], { |
|
|
let blob = new Blob([res.data], { |
|
@ -594,7 +702,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleExport () { |
|
|
async handleExport() { |
|
|
const { exportUrl: url } = this; |
|
|
const { exportUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
|
|
@ -612,10 +720,14 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
let fileName = window.decodeURI( |
|
|
let fileName = window.decodeURI( |
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
res.headers["content-disposition"] |
|
|
|
|
|
.split(";")[1] |
|
|
|
|
|
.split("=")[1] |
|
|
); |
|
|
); |
|
|
console.log("filename", fileName); |
|
|
console.log("filename", fileName); |
|
|
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|
|
let blob = new Blob([res.data], { |
|
|
|
|
|
type: "application/vnd.ms-excel", |
|
|
|
|
|
}); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var aLink = document.createElement("a"); |
|
|
var aLink = document.createElement("a"); |
|
|
aLink.style.display = "none"; |
|
|
aLink.style.display = "none"; |
|
@ -631,7 +743,7 @@ export default { |
|
|
return this.$message.error("网络错误"); |
|
|
return this.$message.error("网络错误"); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
async handleExportQrcode () { |
|
|
async handleExportQrcode() { |
|
|
const { qrCodeExportUrl: url } = this; |
|
|
const { qrCodeExportUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
|
|
@ -649,10 +761,14 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
let fileName = window.decodeURI( |
|
|
let fileName = window.decodeURI( |
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
res.headers["content-disposition"] |
|
|
|
|
|
.split(";")[1] |
|
|
|
|
|
.split("=")[1] |
|
|
); |
|
|
); |
|
|
console.log("filename", fileName); |
|
|
console.log("filename", fileName); |
|
|
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|
|
let blob = new Blob([res.data], { |
|
|
|
|
|
type: "application/vnd.ms-excel", |
|
|
|
|
|
}); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var url = window.URL.createObjectURL(blob); |
|
|
var aLink = document.createElement("a"); |
|
|
var aLink = document.createElement("a"); |
|
|
aLink.style.display = "none"; |
|
|
aLink.style.display = "none"; |
|
@ -669,13 +785,13 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleAdd () { |
|
|
handleAdd() { |
|
|
this.formType = "add"; |
|
|
this.formType = "add"; |
|
|
this.formTitle = "新增"; |
|
|
this.formTitle = "新增"; |
|
|
this.formShow = true; |
|
|
this.formShow = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleWatch (row) { |
|
|
handleWatch(row) { |
|
|
const { idName } = this; |
|
|
const { idName } = this; |
|
|
this.formType = "watch"; |
|
|
this.formType = "watch"; |
|
|
this.formId = row[idName]; |
|
|
this.formId = row[idName]; |
|
@ -683,7 +799,7 @@ export default { |
|
|
this.formShow = true; |
|
|
this.formShow = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleEdit (row) { |
|
|
handleEdit(row) { |
|
|
const { idName } = this; |
|
|
const { idName } = this; |
|
|
this.formType = "edit"; |
|
|
this.formType = "edit"; |
|
|
this.formId = row[idName]; |
|
|
this.formId = row[idName]; |
|
@ -691,17 +807,17 @@ export default { |
|
|
this.formShow = true; |
|
|
this.formShow = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleClose () { |
|
|
handleClose() { |
|
|
this.formShow = false; |
|
|
this.formShow = false; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleEditSuccess () { |
|
|
handleEditSuccess() { |
|
|
this.handleClose(); |
|
|
this.handleClose(); |
|
|
// this.getTableData(); |
|
|
// this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleDeleteMultiple () { |
|
|
async handleDeleteMultiple() { |
|
|
let { delMultipleUrl: url } = this; |
|
|
let { delMultipleUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
|
|
@ -719,7 +835,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleDelete (rowData, rowIndex) { |
|
|
async handleDelete(rowData, rowIndex) { |
|
|
console.log(rowData, rowIndex); |
|
|
console.log(rowData, rowIndex); |
|
|
let { delUrl: url } = this; |
|
|
let { delUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
@ -747,7 +863,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computeFmData () { |
|
|
computeFmData() { |
|
|
let fmData = {}; |
|
|
let fmData = {}; |
|
|
this.searchParams.forEach((item) => { |
|
|
this.searchParams.forEach((item) => { |
|
|
fmData[item.keyName] = item.value; |
|
|
fmData[item.keyName] = item.value; |
|
@ -760,47 +876,69 @@ export default { |
|
|
return fmData; |
|
|
return fmData; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
refresh () { |
|
|
refresh() { |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getTableData () { |
|
|
async getTableData() { |
|
|
this.loadInfo = '数据加载中' |
|
|
this.loadInfo = "数据加载中"; |
|
|
const { tableUrl: url } = this; |
|
|
let { tableUrl: url } = this; |
|
|
if (!url) return; |
|
|
if (!url) return; |
|
|
|
|
|
let req = requestPost; |
|
|
|
|
|
if (url.startsWith("【GET】")) { |
|
|
|
|
|
url = url.substr(5); |
|
|
|
|
|
req = requestGet; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const { pageSize, pageNo } = this; |
|
|
const { pageSize, pageNo } = this; |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await req(url, { |
|
|
pageSize, |
|
|
pageSize, |
|
|
pageNo, |
|
|
pageNo, |
|
|
...this.computeFmData(), |
|
|
...this.computeFmData(), |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.total = data.total || 0; |
|
|
let total = 0, |
|
|
this.tableData = data.list ? this.cookTableData(data.list) : []; |
|
|
list = []; |
|
|
|
|
|
if (Array.isArray(data)) { |
|
|
|
|
|
list = data; |
|
|
|
|
|
} else if ((data.total || data.count) && data.list) { |
|
|
|
|
|
list = data.list || []; |
|
|
|
|
|
total = data.total || data.count; |
|
|
|
|
|
} else if (typeof data == "object") { |
|
|
|
|
|
let ks = Object.keys(data); |
|
|
|
|
|
let totalKey = |
|
|
|
|
|
ks.find((k) => k.indexOf("ount") != -1) || |
|
|
|
|
|
ks.find((k) => k.indexOf("otal") != -1); |
|
|
|
|
|
let listKey = ks.find((k) => k.indexOf("ist") != -1); |
|
|
|
|
|
if (totalKey && listKey) { |
|
|
|
|
|
total = data[totalKey]; |
|
|
|
|
|
list = data[listKey] || []; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.total = total; |
|
|
|
|
|
this.tableData = this.cookTableData(list); |
|
|
if (this.tableData.length === 0) { |
|
|
if (this.tableData.length === 0) { |
|
|
this.loadInfo = '暂无数据' |
|
|
this.loadInfo = "暂无数据"; |
|
|
} else { |
|
|
} else { |
|
|
this.loadInfo = '' |
|
|
this.loadInfo = ""; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSizeChange (val) { |
|
|
handleSizeChange(val) { |
|
|
this.pageSize = val; |
|
|
this.pageSize = val; |
|
|
window.localStorage.setItem("pageSize", val); |
|
|
window.localStorage.setItem("pageSize", val); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
handleCurrentChange (val) { |
|
|
handleCurrentChange(val) { |
|
|
this.pageNo = val; |
|
|
this.pageNo = val; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
resetSearch () { |
|
|
resetSearch() { |
|
|
console.log("----------------resetSearch", this.searchParams); |
|
|
console.log("----------------resetSearch", this.searchParams); |
|
|
this.searchParams.forEach((item) => { |
|
|
this.searchParams.forEach((item) => { |
|
|
if (typeof item.value == "string") { |
|
|
if (typeof item.value == "string") { |
|
|