From 96a60ffe20ae5dcd4d94ab4a44b6c26437008f7c Mon Sep 17 00:00:00 2001 From: LCJ-MinYa <1049468118@qq.com> Date: Thu, 15 Jan 2026 16:48:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8B=96=E6=8B=BD=E5=B8=83=E5=B1=80-?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demoHtml/flex/css/list.css | 7 +- demoHtml/flex/js/i18n.js | 22 ++++++ demoHtml/flex/js/index.js | 9 +-- demoHtml/flex/js/list.js | 137 ++++++++++++++++++++++++------------- demoHtml/flex/list.html | 25 +++++-- 5 files changed, 137 insertions(+), 63 deletions(-) diff --git a/demoHtml/flex/css/list.css b/demoHtml/flex/css/list.css index c3d1a0d..a0bdfc7 100644 --- a/demoHtml/flex/css/list.css +++ b/demoHtml/flex/css/list.css @@ -7,14 +7,15 @@ display: flex; flex-wrap: wrap; justify-content: flex-start; - gap: 10px; /* 调整子项内容间距 */ + gap: 30px; /* 调整子项内容间距 */ padding: 20px; width: 100%; overflow-y: scroll; } .list-item { - width: calc(25% - 7.5px); + height: 310px; + width: calc(25% - 23px); background-color: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); @@ -31,7 +32,7 @@ } .list-item-content { - padding: 10px 15px; /* 调整子项内容间距 */ + padding: 5px 15px; /* 调整子项内容间距 */ display: flex; justify-content: space-between; align-items: center; diff --git a/demoHtml/flex/js/i18n.js b/demoHtml/flex/js/i18n.js index 5748f79..757b8d4 100644 --- a/demoHtml/flex/js/i18n.js +++ b/demoHtml/flex/js/i18n.js @@ -1,5 +1,8 @@ var userLangConfig = { 'zh-CN': { + base: { + success: '操作成功', + }, user: { // 图片组件默认名称 image_default_name: '图片', @@ -41,12 +44,23 @@ var userLangConfig = { focused_border_color: '获得焦点时边框颜色', focused_scale: '获得焦点时边框缩放大小', }, + list: { + update_time: '更新时间', + copy: '复制', + delete: '删除', + edit: '编辑', + apply: '应用', + add: '添加', + }, }, en: { colorpicker: { clear: 'clear', confirm: 'confirm', }, + base: { + success: 'action success', + }, user: { // 图片组件默认名称 image_default_name: 'image', @@ -88,5 +102,13 @@ var userLangConfig = { focused_border_color: 'focused border color', focused_scale: 'focused border scale', }, + list: { + update_time: 'update time', + copy: 'copy', + delete: 'delete', + edit: 'edit', + apply: 'apply', + add: 'add', + }, }, }; diff --git a/demoHtml/flex/js/index.js b/demoHtml/flex/js/index.js index bd4c601..072a8e9 100644 --- a/demoHtml/flex/js/index.js +++ b/demoHtml/flex/js/index.js @@ -723,14 +723,15 @@ /** 执行方法 */ $(function () { (async function () { - getImageData(); - getMenuData(); - getComponentData(); - // 国际化 await i18n(); // 获取模版数据 await getTemplateData(); + + getImageData(); + getMenuData(); + getComponentData(); + // 初始化 initGridStack(); init('welcome', welcome); diff --git a/demoHtml/flex/js/list.js b/demoHtml/flex/js/list.js index de0e56a..89537f0 100644 --- a/demoHtml/flex/js/list.js +++ b/demoHtml/flex/js/list.js @@ -1,80 +1,119 @@ (function () { + let locale = 'en'; + // 获取模版列表 var getTemplateList = function () { - // 获取JSON数据 - $.ajax({ - url: 'http://www.dtviptvott.com:20018/template/list', - type: 'GET', - dataType: 'json', - success: function (response) { - console.log('请求成功:', response); - // 处理响应数据 - $('#result').html(JSON.stringify(response, null, 2)); - }, - error: function (xhr, status, error) { - console.log('请求失败:', error); - }, + requestFN({ url: 'list' }, function (data) { + data.forEach(function (item) { + item.content = JSON.parse(item.content); + }); + console.log(data); + renderListItem(data); }); }; - $(function () { - $.getJSON('data.json', function (data) { - var listPanel = $('#list-panel'); - $.each(data, function (index, item) { - var listItem = ` -