This commit is contained in:
Air 2025-01-23 11:14:16 +08:00
parent b9a4d448e4
commit 2b00d8cec4
13 changed files with 120 additions and 102 deletions

View File

@ -1,12 +1,12 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
VITE_ENV = 'development'
VITE_WEB_TITLE = '固始电子报'
VITE_WEB_TITLE = '今日固始电子版'
VITE_WEB_EN_TITLE = 'GUSHI-NEWSPAPER'
VITE_LOGIN_TITLE = '固始电子报 管理平台'
VITE_LOGIN_TITLE = '今日固始电子版 管理平台'
VITE_LOGIN_EN_TITLE = 'GuShi Platform'
VITE_WEB_BASE_API = '/api'
# 本地Mock地址
VITE_SERVER = 'http://csdzb.hschool.com.cn/'
VITE_SERVER = 'https://jinrigushi.gushitv.com/'
# 路由模式[哈希模式 AND WEB模式 [hash | history, 这两个模式是固定死的,不能乱改值]
VITE_ROUTER_MODE = hash
# 是否使用全部去除console和debugger

View File

@ -1,12 +1,12 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
VITE_ENV = 'production'
VITE_WEB_TITLE = '固始电子报'
VITE_WEB_TITLE = '今日固始电子版'
VITE_WEB_EN_TITLE = 'GUSHI-NEWSPAPER'
VITE_LOGIN_TITLE = '固始电子报 管理平台'
VITE_LOGIN_TITLE = '今日固始电子版 管理平台'
VITE_LOGIN_EN_TITLE = 'GuShi Platform'
VITE_WEB_BASE_API = ''
# 后端接口地址
VITE_SERVER = 'http://csdzb.hschool.com.cn/'
VITE_SERVER = 'https://jinrigushi.gushitv.com/'
# 路由模式[哈希模式 AND WEB模式 [hash | history, 这两个模式是固定死的,不能乱改值]
VITE_ROUTER_MODE = hash
# 是否使用全部去除console和debugger

View File

@ -32,6 +32,7 @@ enum API {
KNOWLEDGEADD="/api/admin/zsk/add",
KNOWLEDGEUPDATE="/api/admin/zsk/update",
KNOWLEDGEDEL="/api/admin/zsk/del",
GETMP3="/api/admin/scheduled_tasks/generateRecording"
}
export const Login = (data: any) => {
return koi.post(API.LOGIN, data);
@ -108,4 +109,8 @@ export const knowledgeUpdate = (data: any) => {
export const knowledgeDel = (data: any) => {
return koi.post(API.KNOWLEDGEDEL, data);
};
export const getMp3 = (data: any) => {
return koi.post(API.GETMP3, data);
};

View File

@ -103,23 +103,6 @@
"isAffix": "1",
"redirect": ""
},
{
"menuId": 16,
"menuName": "期刊类型",
"enName": "User Manage",
"parentId": 1,
"menuType": "2",
"path": "/paper/type",
"name": "PaperType",
"component": "paper/type/index",
"icon": "Files",
"isHide": "1",
"isLink": "",
"isKeepAlive": "0",
"isFull": "1",
"isAffix": "1",
"redirect": ""
},
{
"menuId": 2,
"menuName": "知识库",

View File

@ -1,12 +1,12 @@
// 全局默认配置项
// 首页地址[默认]
export const HOME_URL: string = "/dist/home/index";
export const HOME_URL: string = "/home/index";
// 跳转子页面静态路由父级节点
export const STATIC_URL: string = "/system/static";
// 登录页地址[默认]
export const LOGIN_URL: string = "/dist/login";
export const LOGIN_URL: string = "/admin";
// pinia仓库前缀
export const PINIA_PREFIX: string = "koi-";

View File

@ -3,7 +3,7 @@
<div id="box">
<div class="koi-top" id="banner"></div>
<div class="koi-bottom">
<div class="koi-text1">固始电子报系统后台</div>
<div class="koi-text1">今日固始电子报 管理后台</div>
<div class="h-20px"></div>
</div>
</div>

View File

@ -40,7 +40,11 @@ import {
// @ts-ignore
import {knowledgeAdd} from "@/api/system/post/index.ts";
import {onBeforeUnmount, ref, shallowRef, onMounted, reactive, nextTick} from 'vue'
import {useRoute, useRouter} from "vue-router";
import useTabsStore from "@/stores/modules/tabs.ts";
const route = useRoute();
const router = useRouter();
const tabsStore = useTabsStore();
const form = reactive({
zsk_explain: '',
zsk_name: '',
@ -57,6 +61,8 @@ const onSubmit = async () => {
try {
await knowledgeAdd(form);
koiNoticeSuccess("添加成功!");
tabsStore.removeTab(route.fullPath);
router.push('/knowledge/list');
} catch (error) {
console.log(error);
koiNoticeError("添加失败,请刷新重试!");

View File

@ -25,13 +25,18 @@
align="center"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="解释"
prop="zsk_explain"
width="300px"
align="center"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="解释" width="180">
<template #default="scope">
<el-popover effect="light" trigger="click" placement="bottom" width="auto">
<template #default>
<div v-html="scope.row.zsk_explain"></div>
</template>
<template #reference>
<el-tag class="cursor-pointer">点击查看</el-tag>
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120" fixed="right">
<template #default="{ row }">
<el-tooltip content="修改" placement="top">

View File

@ -16,7 +16,7 @@
<!-- 备案号-->
<div class="beianhao select-none <md:hidden">
<a class="chroma-text" href="https://beian.miit.gov.cn/" target="_blank"
>{{ $t("login.beianhao") }}豫ICP备123456789号-PC</a
></a
>
</div>
</el-col>
@ -78,7 +78,7 @@
<!-- 备案号-->
<div class="beianhao select-none lg:hidden">
<a class="chroma-text" href="https://beian.miit.gov.cn/" target="_blank"
>{{ $t("login.beianhao") }}豫ICP备123456789号-123</a
></a
>
</div>
</el-col>
@ -139,8 +139,8 @@ interface ILoginUser {
}
const loginForm = reactive<ILoginUser>({
loginName: "admin",
password: "admin888",
loginName: "",
password: "",
});
let loginRules: any = reactive<FormRules<ILoginUser>>({});

View File

@ -13,11 +13,11 @@
style="width: 100%"
></el-date-picker>
</el-form-item>
<el-form-item label="报刊类型">
<el-select v-model="form.type_id" placeholder="选择报刊类型">
<el-option v-for="item in typeList" :label="item.type" :value="item.id"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="报刊类型">-->
<!-- <el-select v-model="form.type_id" placeholder="选择报刊类型">-->
<!-- <el-option v-for="item in typeList" :label="item.type" :value="item.id"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button @click="addBlack" class="mt-2">新增版面</el-button>
</el-form-item>
@ -94,7 +94,7 @@ import {
} from "@/utils/koi.ts";
import useTabsStore from "@/stores/modules/tabs.ts";
import {useRoute, useRouter} from "vue-router";
import { ElLoading } from 'element-plus'
const route = useRoute();
const router = useRouter();
const tabsStore = useTabsStore();
@ -133,7 +133,7 @@ const addSort = () => {
backArr.value.sort((a, b) => a.weight - b.weight);
}
onMounted(() => {
getTypelist();
//getTypelist();
})
const typeList = ref();
const getTypelist = async () => {
@ -146,14 +146,15 @@ const getTypelist = async () => {
}
}
const handleMineSave = async () => {
if (form.datetime == '') {
koiMsgError('请选择报纸日期');
return;
}
if (form.type_id == '' || form.type_id == null) {
koiMsgError('请选择报纸类别');
return;
}
// if (form.type_id == '' || form.type_id == null) {
// koiMsgError('');
// return;
// }
for (let i = 0; i < backArr.value.length; i++) {
if (backArr.value[i].bm_name == '' || backArr.value[i].bm_img == '' || backArr.value[i].bm_pdf == '') {
koiMsgError('请完善版面[' + (i + 1) + ']信息');
@ -161,9 +162,15 @@ const handleMineSave = async () => {
}
}
const data = {date: form, bm: backArr.value};
const loading = ElLoading.service({
lock: true,
text: '保存中...',
background: 'rgba(0, 0, 0, 0.1)',
})
try {
await bmAdd(data);
koiNoticeSuccess("保存成功!");
loading.close();
tabsStore.removeTab(route.fullPath);
router.push('/paper/list');
} catch (error) {

View File

@ -92,6 +92,7 @@ const getNewsInfo = async () => {
form.reporter = res.data.reporter;
form.content = res.data.content;
form.id = res.data.id;
form.bm_id = res.data.bm_id;
form.coordinate = res.data.coordinate;
form.coordinate_show=res.data.coordinate_show;
coordinate.value = res.data.coordinate;
@ -152,7 +153,6 @@ const updateDrawRectanglePath = (x1, y1, x2, y2) => {
const onSubmit = async () => {
form.coordinate = coordinate.value;
form.coordinate_show=coordinateShow.value ;
form.bm_id = id.value;
console.log(form);
try {
const res: any = await newsUpdate(form);

View File

@ -1,42 +1,13 @@
<template>
<div class="koi-flex">
<KoiCard>
<!-- 搜索条件 -->
<el-form v-show="showSearch" :inline="true">
<el-form-item label="菜单名称" prop="menuName">
<el-input
placeholder="请输入菜单名称"
v-model="searchParams.menuName"
clearable
style="width: 240px"
@keyup.enter.native="handleTreeList"
></el-input>
</el-form-item>
<el-form-item label="菜单状态" prop="menuStatus">
<el-select
placeholder="请选择菜单状态"
v-model="searchParams.menuStatus"
clearable
style="width: 240px"
@keyup.enter.native="handleTreeList"
>
<el-option label="启用" value="0"/>
<el-option label="停用" value="1"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="search" plain v-throttle="handleSearch">搜索</el-button>
<el-button type="danger" icon="refresh" plain v-debounce="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<!-- 表格头部按钮 -->
<el-row :gutter="10">
<el-col :span="1.5" v-auth="['system:role:add']">
<el-button type="primary" icon="plus" plain @click="handleAdd()">新增</el-button>
<el-button type="success" icon="microphone" plain @click="Mp3Check()">生成语音文件</el-button>
</el-col>
<!-- @click="handleExpend()" -->
<KoiToolbar v-model:showSearch="showSearch" @refreshTable="handleTableData"></KoiToolbar>
</el-row>
<div class="h-20px"></div>
@ -60,7 +31,7 @@
prop="datetime"
align="left"
:show-overflow-tooltip="true"
width="300px"
width="400px"
>
<template #default="scope">
<el-input @blur="addSort(scope.row)" v-if="scope.row.level==2" :maxlength="2" class="center-input"
@ -69,27 +40,45 @@
<span class="cursor-pointer">{{ scope.row.datetime }}</span>
</template>
</el-table-column>
<el-table-column label="期刊类型" prop="type" width="250px" align="center"></el-table-column>
<el-table-column label="数量" prop="bm_count" width="250px" align="center">
<el-table-column label="状态" prop="status" width="250px" align="center">
<template #default="scope">
<el-tag v-if="scope.row.status==0" type="danger">已隐藏</el-tag>
<el-tag v-if="scope.row.status==1" type="success">显示中</el-tag>
</template>
</el-table-column>
<el-table-column label="数量" prop="bm_count" width="350px" align="center">
<template #default="scope">
<div v-if="scope.row.level==1">版面数量{{ scope.row.bm_count }}</div>
<div v-if="scope.row.level==2">新闻数量{{ scope.row.new_count }}</div>
<div v-if="scope.row.level==3">
<audio v-if="scope.row.mp_url!=null&&scope.row.mp_url!=''" controls :src="'https://jinrigushi.gushitv.com/'+scope.row.mp_url"></audio>
<span v-if="scope.row.mp_url==null||scope.row.mp_url==''">语音生成中...</span>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="350px" fixed="right">
<el-table-column label="操作" align="center" width="450px" fixed="right">
<template #default="{ row }">
<el-button v-if="row.level==1"
<el-button v-if="row.level==1 && row.status==1"
type="primary"
@click="statusUpdate(row,0)"
>隐藏
</el-button>
<el-button v-if="row.level==1 && row.status==0"
type="success"
@click="handleAddDate(row)"
>添加版面
@click="statusUpdate(row,1)"
>显示
</el-button>
<el-button v-if="row.level==1"
type="warning"
@click="handleUpdateDate(row)"
>修改
@click="handleAddDate(row)"
>添加版面
</el-button>
<!-- <el-button v-if="row.level==1"-->
<!-- type="warning"-->
<!-- @click="handleUpdateDate(row)"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button v-if="row.level==1"
type="danger"
@ -161,11 +150,11 @@
style="width: 100%"
></el-date-picker>
</el-form-item>
<el-form-item label="报刊类型">
<el-select v-model="Dateform.type_id" placeholder="选择报刊类型">
<el-option v-for="item in typeList" :label="item.type" :value="item.id"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="报刊类型">-->
<!-- <el-select v-model="Dateform.type_id" placeholder="选择报刊类型">-->
<!-- <el-option v-for="item in typeList" :label="item.type" :value="item.id"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-form>
</el-col>
</el-row>
@ -226,9 +215,10 @@ import {
dateUpdate,
getList,
newsDel,
bmOneAdd
bmOneAdd, getMp3
} from "@/api/system/post/index.ts";
import useTabsStore from "@/stores/modules/tabs.ts";
const tabsStore = useTabsStore();
const router = useRouter();
// Loading
@ -274,6 +264,18 @@ const updateFileList = (d) => {
//console.log(index);
//backArr.value[index].bm_pdf = d.fullurl?d.fullurl:'';
}
const Mp3Check = async (row) => {
//console.log(row);
try {
const res: any = await getMp3('');
koiNoticeSuccess("语音生成成功!");
handleTreeList();
} catch (error) {
console.log(error);
koiNoticeError("数据修改失败,请刷新重试🌻");
}
}
/*PDF上传*/
const getFileList = (d) => {
console.log(d);
@ -309,7 +311,7 @@ const load = async (row, treeNode, resolve) => {
res.data = res.data.map(item => {
return {
...item,
uuid:generateUUID(),
uuid: generateUUID(),
datetime: item.bm_name,
bm_name: undefined //
};
@ -319,7 +321,7 @@ const load = async (row, treeNode, resolve) => {
res.data = res.data.map(item => {
return {
...item,
uuid:generateUUID(),
uuid: generateUUID(),
datetime: item.new_name,
bm_name: undefined //
};
@ -376,7 +378,17 @@ const addSort = async (row) => {
}
}
const statusUpdate = async (row,type) => {
try {
const res: any = await dateUpdate({status:type,id: row.id});
console.log("菜单数据表格数据->", res.data);
koiNoticeSuccess("修改成功!");
handleTreeList();
} catch (error) {
console.log(error);
koiNoticeError("数据查询失败,请刷新重试🌻");
}
}
/*版面修改/添加*/
const handleConfirmBmDo = async () => {
confirmLoading.value = true;
@ -426,7 +438,7 @@ const handleTreeList = async () => {
res.data.data = res.data.data.map(item => {
return {
...item,
uuid:generateUUID(),
uuid: generateUUID(),
};
});

View File

@ -18,7 +18,7 @@ import path from "path";
export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
const env = loadEnv(mode, process.cwd()); // 获取配置文件别名配置
return {
base: '/dist/', // 设置为您的二级目录名称
base: '/admin/', // 设置为您的二级目录名称
plugins: [
vue(),
Unocss(),