Merge branch 'master' into net6.0

This commit is contained in:
不做码农 2022-04-16 12:43:23 +08:00
commit 0b4b66f0e1
5 changed files with 50 additions and 43 deletions

View File

@ -10,7 +10,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="文章状态" prop="status"> <el-form-item label="文章状态" prop="status">
<el-select v-model="queryParams.status" size="small" > <el-select v-model="queryParams.status" size="small">
<el-option v-for="item in statusOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option> <el-option v-for="item in statusOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -39,15 +39,17 @@
<el-table-column prop="content" label="文章内容" :show-overflow-tooltip="true"> </el-table-column> <el-table-column prop="content" label="文章内容" :show-overflow-tooltip="true"> </el-table-column>
<el-table-column sortable prop="status" align="center" label="状态" width="90"> <el-table-column sortable prop="status" align="center" label="状态" width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="mini" :type="scope.row.status == '2' ? 'danger' : 'success'" disable-transitions>{{ scope.row.status == '2' ? "草稿":"已发布" }}</el-tag> <el-tag size="mini" :type="scope.row.status == '2' ? 'danger' : 'success'" disable-transitions>{{ scope.row.status == '2' ? "草稿":"已发布" }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间" width="128" :show-overflow-tooltip="true"> </el-table-column> <el-table-column prop="createTime" label="创建时间" width="128" :show-overflow-tooltip="true"> </el-table-column>
<el-table-column label="操作" align="center" width="160"> <el-table-column label="操作" align="center" width="190">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button> --> <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:article:update']">编辑</el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:article:update']">编辑
</el-button>
<el-popconfirm title="确定删除吗?" @onConfirm="handleDelete(scope.row)" style="margin-left:10px"> <el-popconfirm title="确定删除吗?" @onConfirm="handleDelete(scope.row)" style="margin-left:10px">
<el-button slot="reference" size="mini" type="text" icon="el-icon-delete" v-hasPermi="['system:article:delete']">删除</el-button> <el-button slot="reference" size="mini" type="text" icon="el-icon-delete" v-hasPermi="['system:article:delete']">删除</el-button>
</el-popconfirm> </el-popconfirm>
@ -59,10 +61,10 @@
</div> </div>
</template> </template>
<script> <script>
import { listArticle, delArticle } from "@/api/system/article.js"; import { listArticle, delArticle } from '@/api/system/article.js'
export default { export default {
name: "articleindex", name: 'articleindex',
data() { data() {
return { return {
// //
@ -70,10 +72,9 @@ export default {
// //
showSearch: true, showSearch: true,
// //
queryParams: { queryParams: {},
},
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -86,56 +87,62 @@ export default {
total: 0, total: 0,
// //
btnSubmitVisible: true, btnSubmitVisible: true,
}; //
previewUrl: ''
}
}, },
created() { created() {
this.getList(); this.getList()
this.getDicts("sys_article_status").then((response) => { this.getDicts('sys_article_status').then((response) => {
this.statusOptions = response.data; this.statusOptions = response.data
}); })
this.getConfigKey('sys.article.preview.url').then((response) => {
this.previewUrl = response.data
})
}, },
methods: { methods: {
// //
getList() { getList() {
listArticle(this.queryParams).then((res) => { listArticle(this.queryParams).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.dataList = res.data.result; this.dataList = res.data.result
this.total = res.data.totalNum; this.total = res.data.totalNum
} }
}); })
}, },
/** 重置查询操作 */ /** 重置查询操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList(); this.getList()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.$router.replace({ path: "/article/publish" }); this.$router.replace({ path: '/article/publish' })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
delArticle(row.cid).then((res) => { delArticle(row.cid).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.msgSuccess("删除成功"); this.msgSuccess('删除成功')
this.handleQuery(); this.handleQuery()
} }
}); })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ path: "/article/publish", query: { cid: row.cid } }); this.$router.push({ path: '/article/publish', query: { cid: row.cid }})
}, },
// //
handleView(row) { handleView(row) {
this.open = true; var link = `${this.previewUrl}${row.cid}`
this.title = "详情"; window.open(link)
}, },
handleImport() {}, handleImport() {},
handleExport() {}, handleExport() {}
}, }
}; }
</script> </script>

View File

@ -38,11 +38,11 @@ export const constantRoutes = [
component: () => import('@/views/login'), component: () => import('@/views/login'),
hidden: true hidden: true
}, },
{ // {
path: '/register', // path: '/register',
component: () => import('@/views/register'), // component: () => import('@/views/register'),
hidden: true // hidden: true
}, // },
{ {
path: "/:pathMatch(.*)*", path: "/:pathMatch(.*)*",
component: () => import('@/views/error/404'), component: () => import('@/views/error/404'),
@ -80,7 +80,7 @@ export const constantRoutes = [
}]; }];
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(import.meta.env.VITE_APP_ROUTER_PREFIX),
routes: constantRoutes, routes: constantRoutes,
// scrollBehavior(to, from, savedPosition) { // scrollBehavior(to, from, savedPosition) {
// if (savedPosition) { // if (savedPosition) {

View File

@ -3,10 +3,7 @@ import path from 'path'
import createVitePlugins from './vite/plugins' import createVitePlugins from './vite/plugins'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({ export default defineConfig(({ mode, command }) => {
mode,
command
}) => {
const env = loadEnv(mode, process.cwd()) const env = loadEnv(mode, process.cwd())
return { return {
plugins: createVitePlugins(env, command === 'build'), plugins: createVitePlugins(env, command === 'build'),
@ -21,13 +18,14 @@ export default defineConfig(({
// https://cn.vitejs.dev/config/#resolve-extensions // https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
}, },
base: env.VITE_APP_ROUTER_PREFIX,
// 打包配置 // 打包配置
build: { build: {
sourcemap: command === 'build' ? false : true, sourcemap: command === 'build' ? false : true,
target: 'modules', target: 'modules',
outDir: 'dist', //指定输出目录 outDir: 'dist', //指定输出目录
assetsDir: 'assets', //指定静态资源存储目录 assetsDir: 'assets', //指定静态资源存储目录
minify: 'terser' //混淆器terser构建后文件体积更小 minify: 'terser', //混淆器terser构建后文件体积更小
}, },
// vite 相关配置 // vite 相关配置
server: { server: {

View File

@ -679,8 +679,9 @@ insert into sys_config values(1, '主框架页-默认皮肤样式名称', 's
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' ); insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark浅色主题theme-light' ); insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark浅色主题theme-light' );
insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能off、关闭1、动态验证码 2、动态gif泡泡 3、泡泡 4、静态验证码'); insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能off、关闭1、动态验证码 2、动态gif泡泡 3、泡泡 4、静态验证码');
INSERT INTO `sys_config`(`configId`, `configName`, `configKey`, `configValue`, `configType`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (5, '本地文件上传访问域名', 'sys.file.uploadurl', 'http://localhost:8888', 'Y', '', '2022-04-10 10:11:27', '', NULL, NULL); INSERT INTO `sys_config`(`configId`, `configName`, `configKey`, `configValue`, `configType`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (5, '本地文件上传访问域名', 'sys.file.uploadurl', 'http://localhost:8888', 'Y', '', sysdate(), '', NULL, NULL);
INSERT INTO `sys_config`(`configId`, `configName`, `configKey`, `configValue`, `configType`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (6, '开启注册功能', 'sys.account.register', 'true', 'Y', 'admin', '2022-04-14 00:00:00', 'admin', NULL, NULL); INSERT INTO `sys_config`(`configId`, `configName`, `configKey`, `configValue`, `configType`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (6, '开启注册功能', 'sys.account.register', 'true', 'Y', 'admin', sysdate(), 'admin', NULL, NULL);
INSERT INTO `sys_config`(`configId`, `configName`, `configKey`, `configValue`, `configType`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, '文章预览地址', 'sys.article.preview.url', 'http://www.izhaorui.cn/article/details/', 'Y', 'admin', sysdate(), '', NULL, NULL);
-- ---------------------------- -- ----------------------------
-- 18、代码生成业务表 -- 18、代码生成业务表

View File

@ -699,6 +699,7 @@ insert into sys_config values('主框架页-侧边栏主题', 'sys.ind
insert into sys_config values('账号自助-验证码开关', 'sys.account.captchaOnOff', '1', 'Y', 'admin', GETDATE(), '', null, '开启验证码功能off、关闭1、动态验证码 2、动态gif泡泡 3、泡泡 4、静态验证码'); insert into sys_config values('账号自助-验证码开关', 'sys.account.captchaOnOff', '1', 'Y', 'admin', GETDATE(), '', null, '开启验证码功能off、关闭1、动态验证码 2、动态gif泡泡 3、泡泡 4、静态验证码');
INSERT INTO sys_config VALUES('本地文件上传访问域名', 'sys.file.uploadurl', 'http://localhost:8888', 'Y', 'admin', GETDATE(), '', NULL, NULL); INSERT INTO sys_config VALUES('本地文件上传访问域名', 'sys.file.uploadurl', 'http://localhost:8888', 'Y', 'admin', GETDATE(), '', NULL, NULL);
INSERT INTO sys_config VALUES('开启注册功能', 'sys.account.register', 'true', 'Y', 'admin', GETDATE(), '', NULL, NULL); INSERT INTO sys_config VALUES('开启注册功能', 'sys.account.register', 'true', 'Y', 'admin', GETDATE(), '', NULL, NULL);
INSERT INTO sys_config VALUES('文章预览地址', 'sys.article.preview.url', 'http://www.izhaorui.cn/article/details/', 'Y', 'admin', GETDATE(), '', NULL, NULL);
GO GO