feat: 打印机模块
This commit is contained in:
@@ -798,8 +798,6 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
|
||||
if (isRestart) {
|
||||
pagination.currentPage = 1;
|
||||
}
|
||||
console.log(props, 'debug1')
|
||||
console.log(props.contentConfig, 'debug2')
|
||||
props.contentConfig
|
||||
.indexAction(
|
||||
showPagination
|
||||
|
||||
@@ -14,7 +14,9 @@ const modalConfig: IModalConfig<addRequest> = {
|
||||
labelWidth: 100,
|
||||
},
|
||||
formAction: function (data) {
|
||||
return printerApi.add(data);
|
||||
let obj = { ...data }
|
||||
obj.printType = data.printType.join(',')
|
||||
return printerApi.add(obj);
|
||||
},
|
||||
beforeSubmit(data) {
|
||||
console.log("提交之前处理", data);
|
||||
@@ -54,6 +56,7 @@ const modalConfig: IModalConfig<addRequest> = {
|
||||
{
|
||||
label: "ip地址",
|
||||
prop: "address",
|
||||
rules: [{ required: true, message: "请输入ip地址", trigger: "blur" }],
|
||||
type: "input",
|
||||
attrs: {
|
||||
placeholder: "请输入ip地址",
|
||||
|
||||
@@ -41,10 +41,11 @@ const contentConfig: IContentConfig<getListRequest> = {
|
||||
],
|
||||
cols: [
|
||||
// { type: "selection", width: 50, align: "center" },
|
||||
{ label: "设备名称", align: "center", prop: "id", show: false },
|
||||
{ label: "设备号", align: "center", prop: "username" },
|
||||
{ label: "品牌", align: "center", prop: "avatar", templet: "image" },
|
||||
{ label: "打印类型", align: "center", prop: "deptName" },
|
||||
{ label: "设备名称", align: "center", prop: "name" },
|
||||
// { label: "设备号", align: "center", prop: "username" },
|
||||
{ label: "品牌", align: "center", prop: "contentType", slotName: "contentType", templet: "custom", },
|
||||
// { label: "品牌", align: "center", prop: "avatar", templet: "image" },
|
||||
{ label: "打印类型", align: "center", prop: "subType", slotName: "subType", templet: "custom", },
|
||||
{
|
||||
label: "状态",
|
||||
align: "center",
|
||||
|
||||
@@ -14,7 +14,9 @@ const modalConfig: IModalConfig<editRequest> = {
|
||||
labelWidth: 100,
|
||||
},
|
||||
formAction: function (data) {
|
||||
return printerApi.edit(data);
|
||||
let obj = { ...data }
|
||||
obj.printType = data.printType.join(',')
|
||||
return printerApi.edit(obj);
|
||||
},
|
||||
beforeSubmit(data) {
|
||||
console.log("提交之前处理", data);
|
||||
@@ -54,6 +56,7 @@ const modalConfig: IModalConfig<editRequest> = {
|
||||
{
|
||||
label: "ip地址",
|
||||
prop: "address",
|
||||
rules: [{ required: true, message: "请输入ip地址", trigger: "blur" }],
|
||||
type: "input",
|
||||
attrs: {
|
||||
placeholder: "请输入ip地址",
|
||||
|
||||
@@ -2,40 +2,30 @@
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #contentType="scope">
|
||||
{{ scope.row.contentType == 'yxyPrinter' ? "云想印" : "飞鹅" }}
|
||||
</template>
|
||||
<template #subType="scope">
|
||||
{{ scope.row.subType == 'label' ? "标签" : "小票" }}
|
||||
</template>
|
||||
<template #gender="scope">
|
||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||
</template>
|
||||
<template #mobile="scope">
|
||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||
<copy-button
|
||||
v-if="scope.row[scope.prop]"
|
||||
:text="scope.row[scope.prop]"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
@@ -47,11 +37,7 @@
|
||||
</page-modal>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
>
|
||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||
<template #gender="scope">
|
||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||
</template>
|
||||
@@ -60,7 +46,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import UserAPI from "@/api/system/user";
|
||||
import UserAPI from "@/api/account/printer";
|
||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
import addModalConfig from "./config/add";
|
||||
@@ -92,7 +78,10 @@ async function handleEditClick(row: IObject) {
|
||||
editModalRef.value?.handleDisabled(false);
|
||||
editModalRef.value?.setModalVisible();
|
||||
// 根据id获取数据进行填充
|
||||
const data = await UserAPI.getFormData(row.id);
|
||||
let data = await UserAPI.get(row.id);
|
||||
data.printType = data.printType.split(',');
|
||||
data.classifyPrint = data.classifyPrint * 1;
|
||||
|
||||
editModalRef.value?.setFormData(data);
|
||||
}
|
||||
// 其他工具栏
|
||||
|
||||
Reference in New Issue
Block a user