V1.2.0已发布的测试版

This commit is contained in:
2025-08-08 17:15:09 +08:00
parent 9153dff407
commit e50db2f719
45 changed files with 310 additions and 157 deletions

View File

@@ -27,6 +27,7 @@ export const backendSystem_zh = {
editContent:"修改广播内容",
dialogTitle:"新增广播内容",
pleaseInputContent:"请输入广播内容",
pleaseInputContent2:"请输入内容",
newlineInvalid:"广播内容输入换行符无效",
onlineUserNum:"在线数量",
offlineUserNum:"离线数量",
@@ -148,6 +149,7 @@ export const backendSystem_zh = {
contentReset:"内容已重置",
selectCurrency:"选择币种",
pleaseSelectCurrency2:"添加挖矿教程,请选择币种",
pleaseInputTitle:"请输入标题",
}
}
@@ -303,6 +305,9 @@ export const backendSystem_en = {
contentReset:"Content has been reset",
selectCurrency:"Select Currency",
pleaseSelectCurrency2:"Please select a currency when adding mining tutorials",
pleaseInputContent2:"Please input content",
pleaseInputTitle:"Please input title",
}
}

View File

@@ -50,7 +50,7 @@
<section class="menu">
<ul>
{{activeCoin }}
<li
:class="{ active: activeCoin == item.coin }"
@@ -61,7 +61,7 @@
<img :src="item.titleUrl" alt="coin" />
<span>
{{ item.title }}
{{ item.coin }}
</span>
</li>
<!-- <li
@@ -835,7 +835,7 @@ export default {
:deep(p) {
text-align: justify !important;
text-justify: inter-ideograph !important;
text-indent: 2em !important;
text-indent: 0 !important;
line-height: 2 !important;
margin: 0.8em 0 !important;
word-break: break-all;

View File

@@ -60,6 +60,7 @@ export default{
* 获取具体文档内容
*/
async fetchDocumentsInfo(params){
this.setLoading('loading', true);
try {
const res = await findDataInfo(params)
@@ -74,6 +75,7 @@ export default{
console.error('获取文档内容失败:', error)
this.info = ""
}
this.setLoading('loading', false);
},

View File

@@ -1,5 +1,5 @@
<template>
<div class="ServiceTerms">
<div class="ServiceTerms" v-loading="loading">

View File

@@ -15,7 +15,7 @@ export default {
childType:3,//1服务条款、2费率、3API文档 childType
},
navContent: {},
documentLoading: false,
documentLoading: true,
documentContent: '',
documentError: '',
navList:[],
@@ -30,6 +30,7 @@ export default {
async getDocumentsList(params) {
try {
const res = await documentsList(params)
this.setLoading('documentLoading', true);
if (res && res.code === 200) {
this.navList = res.rows

View File

@@ -35,16 +35,9 @@ export default {
},
mounted() {
this.fetchProblemsList(this.listParams)
if (this.$route.query.id) {
this.DetailsParams.id = this.$route.query.id
}else if(this.problems.length > 0){
this.DetailsParams.id = this.problems[0].id;
}
console.log(this.DetailsParams.id,"this.DetailsPara发发发麻烦你ms.id");
this.fetchProblemDetails(this.DetailsParams)
},
methods: {
@@ -53,11 +46,14 @@ export default {
const res = await documentsList(params)
if(res && res.code === 200){
this.problems = res.rows;
if (!this.$route.query.id) {
this.DetailsParams.id = this.problems[0].id;
}
// this.DetailsParams.id = this.problems[0].id;
// this.fetchProblemDetails(this.DetailsParams)
if (this.$route.query.id) {
this.DetailsParams.id = this.$route.query.id
}else if(this.problems.length > 0){
this.DetailsParams.id = this.problems[0].id;
}
this.fetchProblemDetails(this.DetailsParams)
}
this.setLoading('problemLoading', false);
},

View File

@@ -35,6 +35,9 @@
<el-button type="success" icon="el-icon-document" @click="handleSave">
{{ $t("backendSystem.saveDocument") || "保存文档" }}
</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleReset">
{{ $t("backendSystem.reset") || "重置" }}
</el-button>
<el-button
type="warning"
icon="el-icon-upload2"
@@ -42,9 +45,7 @@
>
{{ $t("backendSystem.publishDocument") || "发布文档" }}
</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleReset">
{{ $t("backendSystem.reset") || "重置" }}
</el-button>
</div>
</div>
@@ -70,9 +71,11 @@
"
@input="handleAutoSave"
size="medium"
maxlength="30"
show-word-limit
/>
</div>
<div class="config-item">
<label class="required">{{
$t("backendSystem.documentType") || "文档类型"
@@ -81,7 +84,7 @@
:options="TypeList"
v-model="typeArray"
@change="handleAutoSaveType(typeArray)"
clearable
:placeholder="
$t('backendSystem.pleaseSelectDocumentType') || '请选择文档类型'
"
@@ -108,6 +111,7 @@
"
@input="handleAutoSave"
size="medium"
/>
</div>
@@ -122,6 +126,8 @@
"
@input="handleAutoSave"
size="medium"
maxlength="50"
show-word-limit
/>
</div>
</div>
@@ -169,7 +175,7 @@
<span>{{ $t("backendSystem.richTextEditor") || "富文本编辑器" }}</span>
</div>
<div class="editor-container">
<div ref="editor" style="height: 600px"></div>
<div ref="editor" ></div>
</div>
</div>
@@ -393,7 +399,7 @@ export default Vue.extend({
onCreated(editor) {
this.editor = editor;
console.log("编辑器已初始化", this.editor);
// 编辑器创建后,如果有恢复的内容,设置到编辑器中
if (this.addParams.content) {
this.$nextTick(() => {
@@ -403,7 +409,26 @@ export default Vue.extend({
},
handelAddDocument() {
if (!this.addParams.type || this.addParams.type == "0") {
// 强制同步编辑器内容
if (this.editor) {
this.addParams.content = this.editor.txt.html();
}
console.log(this.addParams.content, "this.addParams.content");
if (!this.addParams.content) {
this.$message({
message:
this.$t("backendSystem.pleaseInputContent2") ||
"请输入内容",
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
console.log(this.addParams.type,this.typeArray, "this.addParams.type");
if (!this.addParams.type ) {
this.$message({
message:
this.$t("backendSystem.pleaseSelectDocumentType") ||
@@ -415,6 +440,27 @@ export default Vue.extend({
return;
}
if (this.addParams.type == `0` && (!this.addParams.childType || this.addParams.childType == `0`) ) {
this.$message({
message: this.$t('backendSystem.pleaseInputType') || '请填写文档类型',
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
if (!this.addParams.title) {
this.$message({
message:
this.$t("backendSystem.pleaseInputTitle") ||
"请输入标题",
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
if (this.addParams.type == "1" && !this.screenCurrency) {
this.$message({
@@ -437,6 +483,8 @@ export default Vue.extend({
}
);
}
this.addParams.coin = this.screenCurrency
console.log(this.addParams.content, "this.addParams.content");
@@ -483,6 +531,9 @@ export default Vue.extend({
this.handleAutoSave();
},
handleAutoSaveType(type) {
if (type.length == 0) return;
console.log(`走这里了嘛`,type);
try {
let item = this.TypeList.find((item) => item.value === type[0]);
if (item.articleUrl) {
@@ -520,13 +571,7 @@ export default Vue.extend({
this.saveToLocalStorage();
}, 1500); // 减少到1.5秒,提高响应速度
if (this.addParams.type == "2") {
//常见问题
this.addParams.articleUrl = `commonProblem`;
} else if (this.addParams.type == "3") {
//公告中心
this.addParams.articleUrl = `announcementDetails`;
}
},
saveToLocalStorage() {
@@ -568,7 +613,8 @@ export default Vue.extend({
const savedData = localStorage.getItem(LOCAL_STORAGE_KEY);
if (savedData) {
const data = JSON.parse(savedData);
console.log(data, "data");
// 检查数据是否过期7天
const isExpired =
Date.now() - (data.lastModified || 0) > 7 * 24 * 60 * 60 * 1000;
@@ -581,16 +627,21 @@ export default Vue.extend({
// 使用 $nextTick 确保 DOM 更新后再设置内容
this.$nextTick(() => {
this.addParams.title = data.title || "";
this.addParams.content = data.content || "";
this.addParams.type = data.type || "1";
this.addParams.imageUrl = data.imageUrl || "";
this.lastSaveTime = data.timestamp || "";
// 如果编辑器已经创建,直接设置内容
if (this.editor) {
this.editor.txt.html(data.content || "");
if (data.type !== `0`) {
this.addParams.title = data.title || "";
this.addParams.content = data.content || "";
this.addParams.type = data.type || "1";
this.addParams.imageUrl = data.imageUrl || "";
this.lastSaveTime = data.timestamp || "";
console.log(data.type,this.typeArray, "data.type");
// 如果编辑器已经创建,直接设置内容
if (this.editor) {
this.editor.txt.html(data.content || "");
}
}
});
}
} catch (error) {
@@ -905,7 +956,7 @@ export default Vue.extend({
/* 设置编辑器高度 */
::v-deep .editor-container .w-e-text-container {
height: 600px !important;
// height: 600px !important;
min-height: 600px !important;
z-index: 1 !important;
position: relative;

View File

@@ -29,7 +29,16 @@ export default{
// 确保type字段为字符串类型以便与TypeList中的value匹配
this.addParams.type = String(this.addParams.type)
this.addParams.childType = String(this.addParams.childType)
this.typeArray = [this.addParams.type]
if (this.modifyData.childType && this.modifyData.childType !== `0`) {
this.typeArray = [this.addParams.type,this.modifyData.childType]
}else{
this.typeArray = [this.modifyData.type]
}
// 标记已从后台获取数据,避免被本地存储覆盖
this.hasBackendData = true
this.screenCurrency = this.addParams.coin

View File

@@ -1,42 +1,44 @@
<template>
<div class="editor-page" v-loading="addLoading" :class="{ 'no-scroll': addLoading }">
<h2 style="margin-bottom: 20px;">{{ $t('backendSystem.modifyDocument') || '修改文档' }}</h2>
<!-- 页面头部 -->
<div class="page-header">
<div class="header-left">
<div class="title-section">
<i class="el-icon-edit-outline title-icon"></i>
<h1 class="page-title">{{ $t('backendSystem.wangeditor') || 'wangeditor 富文本文档编辑器' }}</h1>
<section class="header-section">
<h2 style="margin-bottom: 20px;">{{ $t('backendSystem.modifyDocument') || '修改文档' }}</h2>
<!-- 页面头部 -->
<div class="page-header">
<div class="header-left">
<div class="title-section">
<i class="el-icon-edit-outline title-icon"></i>
<h1 class="page-title">{{ $t('backendSystem.wangeditor') || 'wangeditor 富文本文档编辑器' }}</h1>
</div>
</div>
<div class="header-actions">
<el-button
type="primary"
icon="el-icon-link"
@click="handleInsertAnchor"
>
{{ $t('backendSystem.insertAnchor') || '插入锚点' }}
</el-button>
<el-button type="info" icon="el-icon-view" @click="handlePreview">
{{ $t('backendSystem.previewDocument') || '预览文档' }}
</el-button>
<el-button type="success" icon="el-icon-document" @click="handleSave">
{{ $t('backendSystem.saveDocument') || '保存文档' }}
</el-button>
<el-button
type="warning"
icon="el-icon-upload2"
@click="handelAddDocument"
>
{{ $t('backendSystem.modifyDocument') || '修改文档' }}
</el-button>
</div>
</div>
</div>
<div class="header-actions">
<el-button
type="primary"
icon="el-icon-link"
@click="handleInsertAnchor"
>
{{ $t('backendSystem.insertAnchor') || '插入锚点' }}
</el-button>
<el-button type="info" icon="el-icon-view" @click="handlePreview">
{{ $t('backendSystem.previewDocument') || '预览文档' }}
</el-button>
<el-button type="success" icon="el-icon-document" @click="handleSave">
{{ $t('backendSystem.saveDocument') || '保存文档' }}
</el-button>
<el-button
type="warning"
icon="el-icon-upload2"
@click="handelAddDocument"
>
{{ $t('backendSystem.modifyDocument') || '修改文档' }}
</el-button>
</div>
</div>
</section>
<!-- 文档配置区域 -->
<section class="content-section">
<div class="config-section">
<div class="section-header">
<i class="el-icon-setting"></i>
@@ -52,10 +54,13 @@
:placeholder="$t('backendSystem.pleaseInputDocumentTitle') || '请输入文档标题'"
@input="handleAutoSave"
size="medium"
maxlength="30"
show-word-limit
/>
</div>
<div class="config-item">
<label class="required">{{ $t('backendSystem.documentType') || '文档类型' }}</label>
<el-cascader
:options="TypeList"
@@ -92,6 +97,8 @@
:placeholder="$t('backendSystem.pleaseInputAccessAddress') || '请输入访问地址'"
@input="handleAutoSave"
size="medium"
maxlength="50"
show-word-limit
/>
</div>
</div>
@@ -138,11 +145,11 @@
<span>{{ $t('backendSystem.richTextEditor') || '富文本编辑器' }}</span>
</div>
<div class="editor-container">
<div ref="editor" style="height: 600px"></div>
<div ref="editor" ></div>
</div>
</div>
</section>
@@ -364,8 +371,24 @@ export default Vue.extend({
handelAddDocument() {
// 强制同步编辑器内容
if (this.editor) {
this.addParams.content = this.editor.txt.html();
}
console.log(this.addParams.content, "this.addParams.content");
if (!this.addParams.content.trim()) {
this.$message({
message:
this.$t("backendSystem.pleaseInputContent2") ||
"请输入内容",
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
if (!this.addParams.type || this.addParams.type == "0") {
if (!this.addParams.type) {
this.$message({
message: this.$t('backendSystem.pleaseInputType') || '请填写文档类型',
type: "warning",
@@ -375,7 +398,33 @@ export default Vue.extend({
return;
}
console.log(this.screenCurrency, "this.screenCurrency",this.addParams.type);
console.log(this.addParams.type,this.addParams.childType, "this.addP就发货很符合arams.type");
if (this.addParams.type == `0` && (!this.addParams.childType || this.addParams.childType == `0`) ) {
this.$message({
message: this.$t('backendSystem.pleaseInputType') || '请填写文档类型',
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
if (!this.addParams.title) {
this.$message({
message:
this.$t("backendSystem.pleaseInputTitle") ||
"请输入标题",
type: "warning",
duration: 4000,
showClose: true,
});
return;
}
if (this.addParams.type == "1" && !this.screenCurrency) {
this.$message({
@@ -446,13 +495,22 @@ export default Vue.extend({
this.handleAutoSave();
},
handleAutoSaveType(type) {
try {
if (type.length == 0) return;
console.log(`走这里了嘛`,type);
let item = this.TypeList.find((item) => item.value === type[0]);
console.log(item, type,"item");
if (item.articleUrl) {
this.addParams.articleUrl = item.articleUrl;
} else {
} else if (item.children && item.children.length > 0) {
let childItem = item.children.find((child) => child.value === type[1]);
this.addParams.articleUrl = childItem.articleUrl;
}else{
this.addParams.articleUrl = "";
}
this.addParams.type = type[0];
this.addParams.childType = type[1];
} catch (error) {
@@ -469,6 +527,11 @@ export default Vue.extend({
this.autoSaveTimer = setTimeout(() => {
this.saveToLocalStorage();
}, 1500); // 减少到1.5秒,提高响应速度
},
handleAutoSave() {
@@ -483,13 +546,13 @@ export default Vue.extend({
this.saveToLocalStorage();
}, 1500); // 减少到1.5秒,提高响应速度
if (this.addParams.type == "2") {
//常见问题
this.addParams.articleUrl = `commonProblem`;
} else if (this.addParams.type == "3") {
//公告中心
this.addParams.articleUrl = `announcementDetails`;
}
// if (this.addParams.type == "2") {
// //常见问题
// this.addParams.articleUrl = `commonProblem`;
// } else if (this.addParams.type == "3") {
// //公告中心
// this.addParams.articleUrl = `announcementDetails`;
// }
},
saveToLocalStorage() {
@@ -542,7 +605,10 @@ export default Vue.extend({
// 使用 $nextTick 确保 DOM 更新后再设置内容
this.$nextTick(() => {
this.addParams.title = data.title || "";
if (data.type !== `0`) {
this.addParams.title = data.title || "";
this.addParams.content = data.content || "";
this.addParams.type = data.type || "1";
this.addParams.imageUrl = data.imageUrl || "";
@@ -552,6 +618,8 @@ export default Vue.extend({
if (this.editor) {
this.editor.txt.html(data.content || "");
}
}
});
}
} catch (error) {
@@ -676,13 +744,16 @@ export default Vue.extend({
.editor-page {
width: 100%;
margin: 0 auto;
padding: 20px;
padding: 10px;
background: #f8f9fa;
min-height: 60vh;
overflow-y: auto;
// overflow-y: auto;
}
/* 页面头部样式 */
.page-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@@ -744,7 +815,12 @@ export default Vue.extend({
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.content-section{
width: 100%;
height: 80%;
overflow-y: auto;
padding: 10px;
}
/* 配置区域样式 */
.config-section {
background: white;
@@ -825,7 +901,7 @@ export default Vue.extend({
/* 设置编辑器高度 */
::v-deep .editor-container .w-e-text-container {
height: 600px !important;
// height: 600px !important;
min-height: 600px !important;
z-index: 1 !important;
position: relative;

View File

@@ -149,22 +149,22 @@ export default Vue.extend({
previewVisible: false, // 新增:控制预览对话框的显示
currentTime: '', // 新增:记录预览时间
TypeList:[
{
value:"1",
label:"服务条款"
},
{
value:"2",
label:"api文档"
},
{
value:"3",
label:"挖矿教程"
},
{
value:"0",
label:"其他"
}
// {
// value:"1",
// label:"服务条款"
// },
// {
// value:"2",
// label:"api文档"
// },
// {
// value:"3",
// label:"挖矿教程"
// },
// {
// value:"0",
// label:"其他"
// }
],
}

View File

@@ -26,41 +26,41 @@ export default{
],
/** 活动数据 */
activities: [
{
id: 1,
type: '最新公告',
title: 'LKY将停减税',
author: '文章ID1星期 主发布',
comments: '0'
},
{
id: 2,
type: '最新公告',
title: 'PFP将停减税',
author: '文章ID1星期 11发布',
comments: '0'
},
{
id: 3,
type: '最新公告',
title: 'ETC+ZIL停研发综合日获得',
author: '文章ID1星期 15发布',
comments: '0'
},
{
id: 4,
type: '最新公告',
title: '预计2023年06月19日SCC收益分配说明',
author: '文章ID1星期 18发布',
comments: '0'
},
{
id: 5,
type: '其他',
title: '关于临时(信为网站、备案管理、矿池编码)',
author: '文章ID1星期 19发布',
comments: '0'
}
// {
// id: 1,
// type: '最新公告',
// title: 'LKY将停减税',
// author: '文章ID1星期 主发布',
// comments: '0'
// },
// {
// id: 2,
// type: '最新公告',
// title: 'PFP将停减税',
// author: '文章ID1星期 11发布',
// comments: '0'
// },
// {
// id: 3,
// type: '最新公告',
// title: 'ETC+ZIL停研发综合日获得',
// author: '文章ID1星期 15发布',
// comments: '0'
// },
// {
// id: 4,
// type: '最新公告',
// title: '预计2023年06月19日SCC收益分配说明',
// author: '文章ID1星期 18发布',
// comments: '0'
// },
// {
// id: 5,
// type: '其他',
// title: '关于临时(信为网站、备案管理、矿池编码)',
// author: '文章ID1星期 19发布',
// comments: '0'
// }
],
activeParams:{
type:"3",//公告中心

View File

@@ -146,7 +146,7 @@
<span>{{ handelTime(scope.row.createDate ) }}</span>
</template>
</el-table-column> -->
<el-table-column prop="shouldOutDate" :label="$t('backendSystem.shouldOutDate')" width="180" show-overflow-tooltip >
<el-table-column prop="shouldOutDate" :label="$t('backendSystem.shouldOutDate')" width="180" :resizable="false" show-overflow-tooltip >
<template slot-scope="scope">
<span>{{ handelTime(scope.row.shouldOutDate ) }}</span>
</template>
@@ -154,13 +154,13 @@
<!-- <el-table-column prop="coin" :label="$t('backendSystem.coin2')" width="100" show-overflow-tooltip>
</el-table-column> -->
<el-table-column prop="allocationAmount" :label="$t('backendSystem.allocationAmount')" width="200" show-overflow-tooltip/>
<el-table-column prop="transferAmount" :label="$t('backendSystem.transferAmount')" width="200" show-overflow-tooltip/>
<el-table-column prop="allocationAmount" :label="$t('backendSystem.allocationAmount')" :resizable="false" width="200" show-overflow-tooltip/>
<el-table-column prop="transferAmount" :label="$t('backendSystem.transferAmount')" :resizable="false" width="200" show-overflow-tooltip/>
<!-- <el-table-column prop="user" :label="$t('backendSystem.minerUser2')" width="180" show-overflow-tooltip/> -->
<el-table-column prop="address" :label="$t('backendSystem.address')" show-overflow-tooltip />
<el-table-column prop="address" :label="$t('backendSystem.address')" :resizable="false" show-overflow-tooltip />
<el-table-column prop="maxHeight" :label="$t('backendSystem.maxHeight')" width="180" show-overflow-tooltip />
<el-table-column prop="maxHeight" :label="$t('backendSystem.maxHeight')" :resizable="false" width="180" show-overflow-tooltip />