diff --git a/src/components/DictManager.jsx b/src/components/DictManager.jsx
index 1813634..fc479d0 100644
--- a/src/components/DictManager.jsx
+++ b/src/components/DictManager.jsx
@@ -9,7 +9,7 @@ const DictManager = ({
data,
fields = [
{ name: 'storeValue', label: '存储值', required: true },
- { name: 'typeName', label: '名称', required: true },
+ { name: 'displayName', label: '名称', required: true },
{ name: 'remark', label: '备注', required: false }
],
onAdd,
diff --git a/src/components/SystemSetting/DeviceManagement.tsx b/src/components/SystemSetting/DeviceManagement.tsx
index e120f55..316e390 100644
--- a/src/components/SystemSetting/DeviceManagement.tsx
+++ b/src/components/SystemSetting/DeviceManagement.tsx
@@ -140,7 +140,7 @@ export default function DeviceManagementPage() {
};
return (
-
+
{
const generateQRCode = async () => {
try {
const values = await form.validateFields();
+ console.log(values, "jnjn")
const { model, config, type, country, province } = values;
const ts = Date.now();
const suffix = generateSerialSuffix();
@@ -218,7 +219,9 @@ const SerialNumGenerate = () => {
setSerialNumber(serialNumber);
setQrJson(qrContent);
setQrUrl(url);
- } catch (err) { }
+ } catch (err) {
+ console.error(err)
+ }
};
// 下载
@@ -236,15 +239,16 @@ const SerialNumGenerate = () => {
try {
setLoading(true);
const values = form.getFieldsValue();
+ console.log(values, "oiii", types)
const model = models.find(m => m.displayName === values.model);
const config = configs.find(c => c.displayName === values.config);
- const type = types.find(t => t.displayName === values.type);
+ const type = types.find(t => t.storeValue === values.type);
const data = {
serialNumber,
- modelId: model?.id,
- configId: config?.id,
- typeId: type?.id,
+ modelId: model?.id || 0,
+ configId: config?.id || 0,
+ typeId: type?.id || 0,
qrCode: qrUrl,
qrJson: qrJson
};
@@ -314,6 +318,7 @@ const SerialNumGenerate = () => {
};
// 表格列
+ // 表格列 —— 已修改:全部显示名称,不显示编码
const columns = [
{
title: '序号',
@@ -325,17 +330,30 @@ const SerialNumGenerate = () => {
{
title: '型号',
key: 'model',
- render: (_, r) => parseQrJson(r.qrJson).model || '-'
+ render: (_, r) => {
+ const qrInfo = parseQrJson(r.qrJson);
+ const modelItem = models.find(m => m.storeValue == qrInfo.model);
+ return modelItem?.displayName || qrInfo.model || '-';
+ }
},
{
title: '配置',
key: 'config',
- render: (_, r) => parseQrJson(r.qrJson).config || '-'
+ render: (_, r) => {
+ const qrInfo = parseQrJson(r.qrJson);
+ const configItem = configs.find(c => c.storeValue === qrInfo.config);
+ return configItem?.displayName || qrInfo.config || '-';
+ }
},
{
title: '类型',
key: 'type',
- render: (_, r) => parseQrJson(r.qrJson).type || '-'
+ render: (_, r) => {
+ const qrInfo = parseQrJson(r.qrJson);
+ console.log(types, qrInfo.type)
+ const typeItem = types.find(t => t.storeValue === qrInfo.type);
+ return typeItem?.displayName || qrInfo.type || '-';
+ }
},
{
title: '国家',
@@ -444,17 +462,17 @@ const SerialNumGenerate = () => {
@@ -506,7 +524,7 @@ const SerialNumGenerate = () => {
{/* 数据管理 */}
setManageVisible(false)} footer={} destroyOnClose>
-
+