修复路由切换问题
This commit is contained in:
Binary file not shown.
@@ -13,7 +13,7 @@ namespace Yi.Framework.Model.Models
|
|||||||
public partial class MenuEntity
|
public partial class MenuEntity
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||||
public List<MenuEntity> Children { get; set; }
|
public List<MenuEntity>? Children { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public static List<VueRouterModel> RouterBuild(List<MenuEntity> menus)
|
public static List<VueRouterModel> RouterBuild(List<MenuEntity> menus)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Yi.Framework.Model.Models
|
|||||||
/// 操作人员
|
/// 操作人员
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName="OperUser" )]
|
[SugarColumn(ColumnName="OperUser" )]
|
||||||
public string OperUser { get; set; }
|
public string? OperUser { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作Ip
|
/// 操作Ip
|
||||||
///</summary>
|
///</summary>
|
||||||
|
|||||||
@@ -62,12 +62,12 @@ namespace Yi.Framework.Model.Models
|
|||||||
///
|
///
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName="UserName" )]
|
[SugarColumn(ColumnName="UserName" )]
|
||||||
public string UserName { get; set; }
|
public string? UserName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName="Password" )]
|
[SugarColumn(ColumnName="Password" )]
|
||||||
public string Password { get; set; }
|
public string? Password { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
///</summary>
|
///</summary>
|
||||||
|
|||||||
@@ -83,6 +83,108 @@ namespace Yi.Framework.Model.SeedData
|
|||||||
IsDeleted = false
|
IsDeleted = false
|
||||||
};
|
};
|
||||||
Entitys.Add(tool);
|
Entitys.Add(tool);
|
||||||
|
//swagger文档
|
||||||
|
MenuEntity swagger = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "接口文档",
|
||||||
|
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||||
|
Router = "http://localhost:19001",
|
||||||
|
IsShow = true,
|
||||||
|
IsLink = true,
|
||||||
|
MenuIcon = "list",
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = tool.Id,
|
||||||
|
IsDeleted = false,
|
||||||
|
};
|
||||||
|
Entitys.Add(swagger);
|
||||||
|
|
||||||
|
|
||||||
|
//业务功能
|
||||||
|
MenuEntity business = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "业务功能",
|
||||||
|
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||||
|
Router = "/business",
|
||||||
|
IsShow = true,
|
||||||
|
IsLink = false,
|
||||||
|
MenuIcon = "international",
|
||||||
|
OrderNum = 97,
|
||||||
|
ParentId = 0,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(business);
|
||||||
|
//文章管理
|
||||||
|
MenuEntity article = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "文章管理",
|
||||||
|
PermissionCode = "business:article:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||||
|
Router = "article",
|
||||||
|
IsShow = true,
|
||||||
|
IsLink = false,
|
||||||
|
IsCache = true,
|
||||||
|
Component = "business/article/index",
|
||||||
|
MenuIcon = "education",
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = business.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(article);
|
||||||
|
|
||||||
|
MenuEntity articleQuery = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "文章查询",
|
||||||
|
PermissionCode = "business:article:query",
|
||||||
|
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = article.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(articleQuery);
|
||||||
|
|
||||||
|
MenuEntity articleAdd = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "文章新增",
|
||||||
|
PermissionCode = "business:article:add",
|
||||||
|
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = article.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(articleAdd);
|
||||||
|
|
||||||
|
MenuEntity articleEdit = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "文章修改",
|
||||||
|
PermissionCode = "business:article:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = article.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(articleEdit);
|
||||||
|
|
||||||
|
MenuEntity articleRemove = new MenuEntity()
|
||||||
|
{
|
||||||
|
Id = SnowFlakeSingle.Instance.NextId(),
|
||||||
|
MenuName = "文章删除",
|
||||||
|
PermissionCode = "business:article:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = article.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
Entitys.Add(articleRemove);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Yi框架
|
//Yi框架
|
||||||
MenuEntity guide = new MenuEntity()
|
MenuEntity guide = new MenuEntity()
|
||||||
@@ -100,7 +202,6 @@ namespace Yi.Framework.Model.SeedData
|
|||||||
};
|
};
|
||||||
Entitys.Add(guide);
|
Entitys.Add(guide);
|
||||||
|
|
||||||
|
|
||||||
//用户管理
|
//用户管理
|
||||||
MenuEntity user = new MenuEntity()
|
MenuEntity user = new MenuEntity()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -230,7 +230,15 @@ namespace Yi.Framework.WebCore
|
|||||||
public static LoginLogEntity GetLoginLogInfo(this HttpContext context)
|
public static LoginLogEntity GetLoginLogInfo(this HttpContext context)
|
||||||
{
|
{
|
||||||
var ipAddr = context.GetClientIp();
|
var ipAddr = context.GetClientIp();
|
||||||
var location = IpTool.Search(ipAddr);
|
IpInfo location;
|
||||||
|
if (ipAddr == "127.0.0.1")
|
||||||
|
{
|
||||||
|
location = new IpInfo() { Province = "本地", City = "本机" };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
location = IpTool.Search(ipAddr);
|
||||||
|
}
|
||||||
ClientInfo clientInfo = context.GetClientInfo();
|
ClientInfo clientInfo = context.GetClientInfo();
|
||||||
LoginLogEntity entity = new()
|
LoginLogEntity entity = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,291 +1,376 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
<el-form
|
||||||
<el-form-item label="部门名称" prop="deptName">
|
:model="queryParams"
|
||||||
<el-input
|
ref="queryRef"
|
||||||
v-model="queryParams.deptName"
|
:inline="true"
|
||||||
placeholder="请输入部门名称"
|
v-show="showSearch"
|
||||||
clearable
|
label-width="68px"
|
||||||
@keyup.enter="handleQuery"
|
>
|
||||||
/>
|
<el-form-item label="文章标题" prop="title" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
placeholder="请输入文章标题"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="状态" prop="isDeleted">
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
<el-select v-model="queryParams.isDeleted" placeholder="部门状态" clearable>
|
<el-select
|
||||||
<el-option
|
v-model="queryParams.isDeleted"
|
||||||
v-for="dict in sys_normal_disable"
|
placeholder="状态"
|
||||||
:key="dict.value"
|
clearable
|
||||||
:label="dict.label"
|
style="width: 240px"
|
||||||
:value="dict.value"
|
>
|
||||||
/>
|
<el-option
|
||||||
</el-select>
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:dept:add']"
|
v-hasPermi="['business:article:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="info"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="Sort"
|
icon="Edit"
|
||||||
@click="toggleExpandAll"
|
:disabled="single"
|
||||||
>展开/折叠</el-button>
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<el-col :span="1.5">
|
||||||
</el-row>
|
<el-button
|
||||||
|
type="danger"
|
||||||
<el-table
|
plain
|
||||||
v-if="refreshTable"
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['business:article:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="deptList"
|
:data="articleList"
|
||||||
row-key="id"
|
@selection-change="handleSelectionChange"
|
||||||
:default-expand-all="isExpandAll"
|
>
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
>
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
|
||||||
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column prop="isDeleted" label="状态" width="100">
|
label="文章标题"
|
||||||
<template #default="scope">
|
align="center"
|
||||||
<dict-tag :options="sys_normal_disable" :value="scope.row.isDeleted" />
|
prop="title"
|
||||||
</template>
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="文章部分内容"
|
||||||
|
align="left"
|
||||||
|
prop="content"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.content.slice(0,30)}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
<el-table-column
|
||||||
<template #default="scope">
|
label="备注"
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
align="center"
|
||||||
</template>
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
<template #default="scope">
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleOpen(scope.row)"
|
||||||
v-hasPermi="['system:dept:edit']"
|
|
||||||
>修改</el-button>
|
>文章详情</el-button
|
||||||
<el-button
|
>
|
||||||
type="text"
|
|
||||||
icon="Plus"
|
<el-button
|
||||||
@click="handleAdd(scope.row)"
|
type="text"
|
||||||
v-hasPermi="['system:dept:add']"
|
icon="Edit"
|
||||||
>新增</el-button>
|
@click="handleUpdate(scope.row)"
|
||||||
<el-button
|
v-hasPermi="['business:article:edit']"
|
||||||
v-if="scope.row.parentId != 0"
|
>修改</el-button
|
||||||
type="text"
|
>
|
||||||
icon="Delete"
|
<el-button
|
||||||
@click="handleDelete(scope.row)"
|
type="text"
|
||||||
v-hasPermi="['system:dept:remove']"
|
icon="Delete"
|
||||||
>删除</el-button>
|
@click="handleDelete(scope.row)"
|
||||||
</template>
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<pagination
|
||||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
v-show="total > 0"
|
||||||
<el-form ref="deptRef" :model="form" :rules="rules" label-width="80px">
|
:total="total"
|
||||||
<el-row>
|
v-model:page="queryParams.pageNum"
|
||||||
<el-col :span="24" v-if="form.parentId !== 0">
|
v-model:limit="queryParams.pageSize"
|
||||||
<el-form-item label="上级部门" prop="parentId">
|
@pagination="getList"
|
||||||
<el-tree-select
|
/>
|
||||||
v-model="form.parentId"
|
|
||||||
:data="deptOptions"
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
:props="{ value: 'id', label: 'deptName', children: 'children' }"
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="80px">
|
||||||
value-key="id"
|
<el-form-item label="文章标题" prop="title">
|
||||||
placeholder="选择上级部门"
|
<el-input v-model="form.title" placeholder="请输入文章标题" />
|
||||||
check-strictly
|
</el-form-item>
|
||||||
/>
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
</el-form-item>
|
<el-radio-group v-model="form.isDeleted">
|
||||||
</el-col>
|
<el-radio
|
||||||
<el-col :span="12">
|
v-for="dict in sys_normal_disable"
|
||||||
<el-form-item label="部门名称" prop="deptName">
|
:key="dict.value"
|
||||||
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
:label="JSON.parse(dict.value)"
|
||||||
</el-form-item>
|
>{{ dict.label }}</el-radio
|
||||||
</el-col>
|
>
|
||||||
<el-col :span="12">
|
</el-radio-group>
|
||||||
<el-form-item label="显示排序" prop="orderNum">
|
</el-form-item>
|
||||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
<el-form-item label="备注" prop="remark">
|
||||||
</el-form-item>
|
<el-input
|
||||||
</el-col>
|
v-model="form.remark"
|
||||||
<el-col :span="12">
|
type="textarea"
|
||||||
<el-form-item label="负责人" prop="leader">
|
placeholder="请输入内容"
|
||||||
<el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="联系电话" prop="phone">
|
|
||||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="邮箱" prop="email">
|
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="部门状态">
|
|
||||||
<el-radio-group v-model="form.isDeleted">
|
|
||||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="JSON.parse(dict.value)">{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="Dept">
|
|
||||||
import { listDept, getDept, delDept, addDept, updateDept} from "@/api/system/dept";
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
|
||||||
|
|
||||||
const deptList = ref([]);
|
|
||||||
const open = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const title = ref("");
|
|
||||||
const deptOptions = ref([]);
|
|
||||||
const isExpandAll = ref(true);
|
|
||||||
const refreshTable = ref(true);
|
|
||||||
|
|
||||||
const data = reactive({
|
|
||||||
form: {},
|
|
||||||
queryParams: {
|
|
||||||
deptName: undefined,
|
|
||||||
isDeleted: undefined
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
parentId: [{ required: true, message: "上级部门不能为空", trigger: "blur" }],
|
|
||||||
deptName: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
|
|
||||||
orderNum: [{ required: true, message: "显示排序不能为空", trigger: "blur" }],
|
|
||||||
email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
|
|
||||||
phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询部门列表 */
|
|
||||||
function getList() {
|
|
||||||
loading.value = true;
|
|
||||||
listDept(queryParams.value).then(response => {
|
|
||||||
deptList.value = proxy.handleTree(response.data, "id");
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 取消按钮 */
|
|
||||||
function cancel() {
|
|
||||||
open.value = false;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
/** 表单重置 */
|
|
||||||
function reset() {
|
|
||||||
form.value = {
|
|
||||||
id: undefined,
|
|
||||||
parentId: undefined,
|
|
||||||
deptName: undefined,
|
|
||||||
orderNum: 0,
|
|
||||||
leader: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
email: undefined,
|
|
||||||
isDeleted: false
|
|
||||||
};
|
|
||||||
proxy.resetForm("deptRef");
|
|
||||||
}
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
function handleQuery() {
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
function resetQuery() {
|
|
||||||
proxy.resetForm("queryRef");
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
function handleAdd(row) {
|
|
||||||
reset();
|
|
||||||
listDept().then(response => {
|
|
||||||
deptOptions.value = proxy.handleTree(response.data, "id");
|
|
||||||
});
|
|
||||||
if (row != undefined) {
|
|
||||||
form.value.parentId = row.id;
|
|
||||||
}
|
|
||||||
open.value = true;
|
|
||||||
title.value = "添加部门";
|
|
||||||
}
|
|
||||||
/** 展开/折叠操作 */
|
|
||||||
function toggleExpandAll() {
|
|
||||||
refreshTable.value = false;
|
|
||||||
isExpandAll.value = !isExpandAll.value;
|
|
||||||
nextTick(() => {
|
|
||||||
refreshTable.value = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
function handleUpdate(row) {
|
|
||||||
reset();
|
|
||||||
// listDeptExcludeChild(row.id).then(response => {
|
|
||||||
// deptOptions.value = proxy.handleTree(response.data, "id");
|
|
||||||
// });
|
|
||||||
listDept().then(response => {
|
|
||||||
//前端排除自己
|
|
||||||
|
|
||||||
deptOptions.value = proxy.handleTree(response.data.filter(i=>i.id!=row.id), "id");
|
|
||||||
});
|
|
||||||
|
|
||||||
getDept(row.id).then(response => {
|
</template>
|
||||||
form.value = response.data;
|
|
||||||
open.value = true;
|
<script setup>
|
||||||
title.value = "修改部门";
|
import {
|
||||||
});
|
listData,
|
||||||
}
|
getData,
|
||||||
/** 提交按钮 */
|
delData,
|
||||||
function submitForm() {
|
addData,
|
||||||
proxy.$refs["deptRef"].validate(valid => {
|
updateData,
|
||||||
if (valid) {
|
} from "@/api/business/articleApi";
|
||||||
if (form.value.id != undefined) {
|
import { ref } from "@vue/reactivity";
|
||||||
updateDept(form.value).then(response => {
|
import { computed } from "@vue/runtime-core";
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
|
||||||
open.value = false;
|
const { proxy } = getCurrentInstance();
|
||||||
getList();
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
});
|
|
||||||
} else {
|
const articleList = ref([]);
|
||||||
addDept(form.value).then(response => {
|
const open = ref(false);
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
const loading = ref(true);
|
||||||
open.value = false;
|
const showSearch = ref(true);
|
||||||
getList();
|
const ids = ref([]);
|
||||||
});
|
const single = ref(true);
|
||||||
}
|
const multiple = ref(true);
|
||||||
}
|
const total = ref(0);
|
||||||
});
|
const title = ref("");
|
||||||
}
|
const dateRange = ref([]);
|
||||||
/** 删除按钮操作 */
|
const articleDialogVisible=ref(false);
|
||||||
function handleDelete(row) {
|
const articleId=ref("");
|
||||||
proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
|
const data = reactive({
|
||||||
return delDept(row.id);
|
form: {},
|
||||||
}).then(() => {
|
queryParams: {
|
||||||
getList();
|
pageNum: 1,
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
pageSize: 10,
|
||||||
}).catch(() => {});
|
title: undefined,
|
||||||
}
|
isDeleted: undefined,
|
||||||
|
},
|
||||||
getList();
|
rules: {
|
||||||
</script>
|
title: [{ required: true, message: "文章标题不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
articleList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: undefined,
|
||||||
|
title: undefined,
|
||||||
|
isDeleted: false,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加文章";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改文章类型";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除字典编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
/** 打开文章详情 */
|
||||||
|
function handleOpen(row){
|
||||||
|
articleId.value=row.id;
|
||||||
|
articleDialogVisible.value=true;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
|
||||||
|
<div class="app-container">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
ref="queryRef"
|
ref="queryRef"
|
||||||
@@ -247,7 +248,7 @@
|
|||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
381
Yi.Vue3.x.RuoYi/src/views/business/article/index.vue
Normal file
381
Yi.Vue3.x.RuoYi/src/views/business/article/index.vue
Normal file
@@ -0,0 +1,381 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="文章标题" prop="title" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
placeholder="请输入文章标题"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['business:article:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['business:article:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="articleList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="文章标题"
|
||||||
|
align="center"
|
||||||
|
prop="title"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="文章部分内容"
|
||||||
|
align="left"
|
||||||
|
prop="content"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.content.slice(0,30)}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleOpen(scope.row)"
|
||||||
|
|
||||||
|
>文章详情</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="文章标题" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入文章标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/business/articleApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
import { computed } from "@vue/runtime-core";
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const articleList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const articleDialogVisible=ref(false);
|
||||||
|
const articleId=ref("");
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
title: undefined,
|
||||||
|
isDeleted: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
title: [{ required: true, message: "文章标题不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
articleList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: undefined,
|
||||||
|
title: undefined,
|
||||||
|
isDeleted: false,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加文章";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改文章类型";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除字典编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
/** 打开文章详情 */
|
||||||
|
function handleOpen(row){
|
||||||
|
articleId.value=row.id;
|
||||||
|
articleDialogVisible.value=true;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user