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