|
|
|
@ -0,0 +1,201 @@
|
|
|
|
|
<template>
|
|
|
|
|
<transition appear enter-active-class="animated fadeIn">
|
|
|
|
|
<q-card class="shadow-24">
|
|
|
|
|
<!-- 搜索条件 -->
|
|
|
|
|
<q-card-section>
|
|
|
|
|
<div class="row q-col-gutter-md">
|
|
|
|
|
<!-- 刷新 查询 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-btn-group push glossy>
|
|
|
|
|
<q-btn push label="新增" icon="add" @click="addOrEditForm()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">{{
|
|
|
|
|
'新增一条数据' }}</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-btn push label="刷新" icon="refresh" @click="reFresh()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">清空所有条件并,刷新数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-btn push label="查询" icon="search" @click="getPage()">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">按条件查询数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-btn-group>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 搜索条件 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-input dense label="设备编码" outlined v-model="pagination.data.equipmentCode" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-input dense label="设备名称" outlined v-model="pagination.data.equipmentName" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-select dense outlined v-model="pagination.data.equipmentType" :options="equipmentTypeList"
|
|
|
|
|
emit-value map-options label="设备类型" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-12">
|
|
|
|
|
<q-select dense outlined v-model="pagination.data.activated" :options="activatedList" emit-value
|
|
|
|
|
map-options label="设备启停用" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-card-section style="padding:0 10px 15px 10px;">
|
|
|
|
|
<div class="row q-col-gutter-md">
|
|
|
|
|
<div class="col-xl-12 col-lg-12 col-sm-12">
|
|
|
|
|
<q-table class="my-sticky-header-column-table" :rows="list" row-key="id" separator="cell"
|
|
|
|
|
:loading="loading" :columns="columns" @request="onRequest" v-model:pagination="pagination"
|
|
|
|
|
:table-style="{ height: Screen.height - 190 + 'px' }" flat bordered
|
|
|
|
|
:rows-per-page-options="[20, 30, 40, 50, 100]">
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="tr_hover">
|
|
|
|
|
<q-td style="font-size: 16px;" key="index" :props="props">{{ props.rowIndex + 1
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="equipmentCode" :props="props">{{
|
|
|
|
|
props.row.equipmentCode
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="equipmentName" :props="props">{{
|
|
|
|
|
props.row.equipmentName
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="equipmentType" :props="props">{{
|
|
|
|
|
props.row.equipmentType
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="state" :props="props">{{ helper.getEquipmentState(
|
|
|
|
|
props.row.state)
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="activated" :props="props">{{ props.row.activated
|
|
|
|
|
}}</q-td>
|
|
|
|
|
<q-td style="font-size: 16px;" key="remark" :props="props">{{ props.row.remark }}</q-td>
|
|
|
|
|
<q-td key="action" :props="props" style="width: 100px">
|
|
|
|
|
<q-btn round flat push color="info" icon="edit" @click="addOrEditForm(props.row)">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">编辑这条数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-btn round flat push color="negative" icon="delete"
|
|
|
|
|
@click="openDelDialog(props.row)">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
content-style="font-size: 12px">删除这条数据</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
|
|
|
|
</transition>
|
|
|
|
|
|
|
|
|
|
<!-- 系统参数设置 -->
|
|
|
|
|
<addOrEditDialog ref="addOrEdit" @refresh="getPage" />
|
|
|
|
|
<!-- 删除弹窗 -->
|
|
|
|
|
<customDialog ref="deleteDialogRef" @func="delFunc" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
|
import { Notify, Screen } from 'quasar';
|
|
|
|
|
import { equipmentApi } from '../../api/equipment/equipmentApi';
|
|
|
|
|
import { EquipmentSearchEntity } from '../../api/equipment/model/equipment';
|
|
|
|
|
import { Pagination, cconvert } from 'src/api/class';
|
|
|
|
|
import customDialog from 'src/components/customDialog.vue';
|
|
|
|
|
import addOrEditDialog from 'src/pages/equipment/components/addOrEditDialog.vue'
|
|
|
|
|
import helper from 'src/Utils/helper';
|
|
|
|
|
|
|
|
|
|
//公共
|
|
|
|
|
const equipmentTypeList = ref([
|
|
|
|
|
{ label: 'Ionbond', value: 'Ionbond' },
|
|
|
|
|
{ label: 'Balzers', value: 'Balzers' },
|
|
|
|
|
{ label: 'Cemecon', value: 'Cemecon' },
|
|
|
|
|
])
|
|
|
|
|
const activatedList = ref([
|
|
|
|
|
{ label: '停用', value: '0' },
|
|
|
|
|
{ label: '启用', value: '1' },
|
|
|
|
|
])
|
|
|
|
|
const pagination = ref(new Pagination(new EquipmentSearchEntity()));
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
|
|
|
|
|
const columns = ref([
|
|
|
|
|
{
|
|
|
|
|
name: 'index',
|
|
|
|
|
label: '#',
|
|
|
|
|
field: 'index',
|
|
|
|
|
align: 'center',
|
|
|
|
|
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'equipmentCode',
|
|
|
|
|
align: 'center',
|
|
|
|
|
label: '设备编码',
|
|
|
|
|
field: 'equipmentCode',
|
|
|
|
|
headerClasses: 'text-h4 text-weight-bold',
|
|
|
|
|
headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;',
|
|
|
|
|
},
|
|
|
|
|
{ name: 'equipmentName', align: 'center', label: '设备名称', field: 'equipmentName', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'equipmentType', align: 'center', label: '设备类型', field: 'equipmentType', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'configType', align: 'center', label: '是否系统内置', field: 'configType', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'state', align: 'center', label: '设备状态', field: 'state', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'activated', align: 'center', label: '设备启停用', field: 'activated', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'remark', align: 'center', label: '备注', field: 'remark', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' },
|
|
|
|
|
{ name: 'action', align: 'center', label: '操作', field: 'action', headerStyle: 'background-color: #5186ec;color: white;font-weight: bold;font-size:20px;' }
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const list = ref([]);
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getPage();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const reFresh = () => {
|
|
|
|
|
pagination.value.data = new EquipmentSearchEntity();
|
|
|
|
|
getPage();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onRequest = (props: any) => {
|
|
|
|
|
const { page, rowsPerPage, rowsNumber } = props.pagination;
|
|
|
|
|
pagination.value.page = page;
|
|
|
|
|
pagination.value.rowsPerPage = rowsPerPage != 0 ? rowsPerPage : rowsNumber;
|
|
|
|
|
getPage();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getPage = () => {
|
|
|
|
|
equipmentApi.getPage(pagination.value).then((res: any) => {
|
|
|
|
|
list.value = res.data;
|
|
|
|
|
cconvert(pagination.value, res);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const addOrEdit = ref();
|
|
|
|
|
const addOrEditForm = (row?: any) => {
|
|
|
|
|
addOrEdit.value.clickForm(row);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const deleteDialogRef = ref();
|
|
|
|
|
const openDelDialog = (row: any) => {
|
|
|
|
|
deleteDialogRef.value.open(row);
|
|
|
|
|
}
|
|
|
|
|
const delFunc = (e: any) => {
|
|
|
|
|
equipmentApi.delete(e.id).then(() => {
|
|
|
|
|
getPage();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
/* .tr_hover {
|
|
|
|
|
background: #aaaaaa;
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
.tr_hover:hover {
|
|
|
|
|
background: #e8e8e8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.click-hover {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
color: #1976d2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.click-hover:hover {
|
|
|
|
|
color: #2196f3;
|
|
|
|
|
/* background-color: yellow; */
|
|
|
|
|
}
|
|
|
|
|
</style>
|