This commit is contained in:
lb 2023-10-26 17:01:09 +08:00
parent d25261b256
commit 66660bfef7
2 changed files with 41 additions and 43 deletions

View File

@ -1,48 +1,22 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm
v-if="open"
ref="form"
v-model="form"
:has-files="true"
:rows="rows" />
<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" @confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :has-files="true" :rows="rows" />
</base-dialog>
</div>
</template>
@ -96,10 +70,18 @@ export default {
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [
{
type: 'select',
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
selectOptions: [],
filterable: true
},
{
type: 'input',
label: '设备类型',
placeholder: '请输入设备类型名称',
label: '设备',
placeholder: '请输入设备名称',
param: 'name',
},
{
@ -186,9 +168,25 @@ export default {
// },
},
created() {
this.initSearchOptions()
this.getList();
},
methods: {
/** 初始化查询条件 */
async initSearchOptions() {
this.http('/base/core-production-line/listAll', 'get').then(
({ code, data }) => {
if (code == 0) {
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
}
);
},
/** 查询列表 */
getList() {
this.loading = true;
@ -276,7 +274,7 @@ export default {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
.catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
@ -294,7 +292,7 @@ export default {
this.$download.excel(response, '设备类型.xls');
this.exportLoading = false;
})
.catch(() => {});
.catch(() => { });
},
},
};

View File

@ -80,7 +80,7 @@
<el-form-item v-if="form.type !== 3" label="菜单图标">
<el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()">
<IconSelect ref="iconSelect" @selected="selected" />
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
<el-input slot="reference" clearable v-model="form.icon" placeholder="点击选择图标">
<svg-icon v-if="form.icon" slot="prefix" :icon-class="form.icon" class="el-input__icon"
style="height: 32px;width: 16px;"/>
<i v-else slot="prefix" class="el-icon-search el-input__icon" />