文章管理
This commit is contained in:
parent
6ef17079b9
commit
c8f2245fd3
@ -17,6 +17,15 @@ export function getOmsOrder(id) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订单退款
|
||||||
|
export function refundOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/order/refund',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
// 查询订单手机号密文
|
// 查询订单手机号密文
|
||||||
export function getDecryptPhone(id) {
|
export function getDecryptPhone(id) {
|
||||||
return request({
|
return request({
|
||||||
|
66
src/api/system/article/index.ts
Normal file
66
src/api/system/article/index.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import { PostForm, PostQuery, PostVO } from './types';
|
||||||
|
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询文章列表
|
||||||
|
export function listPost(query: PostQuery): AxiosPromise<PostVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/page',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 查询文章列表tree
|
||||||
|
export function listCategory(query: any): AxiosPromise<PostVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/category/tree',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 查询文章详细
|
||||||
|
export function getPost(postId: string | number): AxiosPromise<PostVO> {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/' + postId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文章选择框列表
|
||||||
|
export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/system/post/optionselect',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
postIds: postIds,
|
||||||
|
deptId: deptId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增文章
|
||||||
|
export function addPost(data: PostForm) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改文章
|
||||||
|
export function updatePost(data: PostForm) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文章
|
||||||
|
export function delPost(postId: string | number | (string | number)[]) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/' + postId,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
28
src/api/system/article/types.ts
Normal file
28
src/api/system/article/types.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
export interface PostVO extends BaseEntity {
|
||||||
|
postId: number | string;
|
||||||
|
deptId: number | string;
|
||||||
|
postCode: string;
|
||||||
|
postName: string;
|
||||||
|
postCategory: string;
|
||||||
|
deptName: string;
|
||||||
|
postSort: number;
|
||||||
|
status: string;
|
||||||
|
remark: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PostForm {
|
||||||
|
id: number | string | undefined;
|
||||||
|
title: number | string | undefined;
|
||||||
|
type: number | string | undefined;
|
||||||
|
sort: number | string | undefined;
|
||||||
|
content: string | undefined;
|
||||||
|
status: number | string | undefined;
|
||||||
|
categoryId: number | string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PostQuery {
|
||||||
|
title: string;
|
||||||
|
current: number;
|
||||||
|
size: number;
|
||||||
|
categoryId: number | string;
|
||||||
|
}
|
59
src/api/system/category/index.ts
Normal file
59
src/api/system/category/index.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import { PostForm, PostQuery, PostVO } from './types';
|
||||||
|
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询文章分类列表
|
||||||
|
export function listPost(query: PostQuery | any): AxiosPromise {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/category/tree',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询文章详细
|
||||||
|
export function getPost(postId: string | number): AxiosPromise<PostVO> {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/category/' + postId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取岗位选择框列表
|
||||||
|
export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/system/post/optionselect',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
postIds: postIds,
|
||||||
|
deptId: deptId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增分类
|
||||||
|
export function addPost(data: PostForm) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/category/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改岗位
|
||||||
|
export function updatePost(data: PostForm) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delPost(postId: string | number | (string | number)[]) {
|
||||||
|
return request({
|
||||||
|
url: '/content/article/category/' + postId,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
36
src/api/system/category/types.ts
Normal file
36
src/api/system/category/types.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
export interface PostVO extends BaseEntity {
|
||||||
|
postId: number | string;
|
||||||
|
deptId: number | string;
|
||||||
|
postCode: string;
|
||||||
|
postName: string;
|
||||||
|
postCategory: string;
|
||||||
|
deptName: string;
|
||||||
|
postSort: number;
|
||||||
|
status: string;
|
||||||
|
remark: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PostForm {
|
||||||
|
id: number | string | undefined;
|
||||||
|
|
||||||
|
name: number | string | undefined;
|
||||||
|
|
||||||
|
level: number | string | undefined;
|
||||||
|
|
||||||
|
parentId: number | string | undefined;
|
||||||
|
|
||||||
|
sort: number | string | undefined;
|
||||||
|
oneName: number | string | undefined;
|
||||||
|
type: number | string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PostQuery {
|
||||||
|
id: number | string;
|
||||||
|
name: string;
|
||||||
|
current: number;
|
||||||
|
size: number;
|
||||||
|
parentId: number | string;
|
||||||
|
sort: number | string;
|
||||||
|
level: number | string;
|
||||||
|
type: number | string;
|
||||||
|
}
|
@ -9,10 +9,10 @@ export function listUmsMember(query, pageReq) {
|
|||||||
params: pageReq
|
params: pageReq
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 查询会员账号钱详细
|
// 查询会员账号钱账单
|
||||||
export function listCurrent(query, pageReq) {
|
export function listCurrent(query, pageReq) {
|
||||||
return request({
|
return request({
|
||||||
url: '/account/detail/current',
|
url: '/ums/account/bill',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: query,
|
data: query,
|
||||||
params: pageReq
|
params: pageReq
|
||||||
|
@ -1,32 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size='small'>
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1"> 月,允许的通配符[, - * /] </el-radio>
|
||||||
月,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="1" :max="11" /> -
|
<el-input-number v-model="cycle01" :min="1" :max="11" /> - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月
|
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="1" :max="11" /> 月开始,每
|
<el-input-number v-model="average01" :min="1" :max="11" /> 月开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="12 - average01 || 0" /> 月月执行一次
|
<el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width: 100%">
|
||||||
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
<el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -44,7 +41,7 @@ export default {
|
|||||||
average02: 1,
|
average02: 1,
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
checkNum: this.check
|
checkNum: this.check
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
name: 'crontab-month',
|
name: 'crontab-month',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
@ -94,14 +91,14 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 计算两个周期值
|
// 计算两个周期值
|
||||||
cycleTotal: function () {
|
cycleTotal: function () {
|
||||||
const cycle01 = this.checkNum(this.cycle01, 1, 11)
|
const cycle01 = this.checkNum(this.cycle01, 1, 11);
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12)
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12);
|
||||||
return cycle01 + '-' + cycle02;
|
return cycle01 + '-' + cycle02;
|
||||||
},
|
},
|
||||||
// 计算平均用到的值
|
// 计算平均用到的值
|
||||||
averageTotal: function () {
|
averageTotal: function () {
|
||||||
const average01 = this.checkNum(this.average01, 1, 11)
|
const average01 = this.checkNum(this.average01, 1, 11);
|
||||||
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0)
|
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0);
|
||||||
return average01 + '/' + average02;
|
return average01 + '/' + average02;
|
||||||
},
|
},
|
||||||
// 计算勾选的checkbox值合集
|
// 计算勾选的checkbox值合集
|
||||||
@ -110,5 +107,5 @@ export default {
|
|||||||
return str == '' ? '*' : str;
|
return str == '' ? '*' : str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
<h3 class="title">{{ title }}</h3>
|
<h3 class="title">{{ title }}</h3>
|
||||||
<lang-select />
|
<lang-select />
|
||||||
</div>
|
</div>
|
||||||
<el-form-item v-if="tenantEnabled" prop="tenantId">
|
<!-- <el-form-item v-if="tenantEnabled" prop="tenantId">
|
||||||
<el-select v-model="loginForm.tenantId" filterable :placeholder="proxy.$t('login.selectPlaceholder')" style="width: 100%">
|
<el-select v-model="loginForm.tenantId" filterable :placeholder="proxy.$t('login.selectPlaceholder')" style="width: 100%">
|
||||||
<el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option>
|
<el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option>
|
||||||
<template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
|
<template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" :placeholder="proxy.$t('login.username')">
|
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" :placeholder="proxy.$t('login.username')">
|
||||||
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
|
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
|
||||||
|
@ -77,30 +77,12 @@
|
|||||||
<div>{{ scope.row.memberPhoneEncrypted }}</div>
|
<div>{{ scope.row.memberPhoneEncrypted }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="买家信息" width="116">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>{{ scope.row.memberUsername }}</div>
|
|
||||||
<div>{{ scope.row.memberPhoneEncrypted }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>-->
|
|
||||||
<el-table-column label="卖家信息" width="116">
|
<el-table-column label="卖家信息" width="116">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.tenantContactName }}</div>
|
<div>{{ scope.row.tenantContactName }}</div>
|
||||||
<div>{{ scope.row.tenantContactPhone }}</div>
|
<div>{{ scope.row.tenantContactPhone }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="代理信息" width="116">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>代理人姓名:{{ scope.row.deliverySn }}</div>
|
|
||||||
<div>代理区域:{{ scope.row.deliverySn }}</div>
|
|
||||||
<div>代理手机号:{{ scope.row.deliverySn }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>-->
|
|
||||||
<!-- <el-table-column label="商品信息">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div>:{{ scope.row.productName }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>-->
|
|
||||||
<el-table-column label="核销码" width="130">
|
<el-table-column label="核销码" width="130">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.code }}
|
{{ scope.row.code }}
|
||||||
@ -228,7 +210,7 @@
|
|||||||
<el-button text size="small" type="primary" @click="goDetail(scope.row)" v-hasPermi="['oms:order:query']">详情 </el-button>
|
<el-button text size="small" type="primary" @click="goDetail(scope.row)" v-hasPermi="['oms:order:query']">详情 </el-button>
|
||||||
<el-button text size="small" type="primary" @click="showLog(scope.row.id)" v-hasPermi="['oms:order:log']">记录 </el-button>
|
<el-button text size="small" type="primary" @click="showLog(scope.row.id)" v-hasPermi="['oms:order:log']">记录 </el-button>
|
||||||
<el-button text size="small" type="primary" @click="handleDelivery(scope.row)">核销 </el-button>
|
<el-button text size="small" type="primary" @click="handleDelivery(scope.row)">核销 </el-button>
|
||||||
<el-button text size="small" type="primary">退款</el-button>
|
<el-button text size="small" type="primary" @click="handleRefund(scope.row)">退款</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -276,6 +258,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 退款弹窗 -->
|
||||||
|
<el-dialog :title="refundObj.title" v-model="refundObj.open" width="500px" append-to-body>
|
||||||
|
<el-form ref="noteForm" :model="refundObj.form" label-width="100px">
|
||||||
|
<el-form-item label="退款原因" prop="reason">
|
||||||
|
<el-input type="textarea" v-model="refundObj.form.reason" controls-position="right" :min="0" :rows="3" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template v-slot:footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleConfirmRefund()"> 确认退款 </el-button>
|
||||||
|
<el-button @click="refundObj.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
<!-- 日志 -->
|
<!-- 日志 -->
|
||||||
<el-dialog :title="logObj.title" v-model="logObj.open" width="500px" append-to-body>
|
<el-dialog :title="logObj.title" v-model="logObj.open" width="500px" append-to-body>
|
||||||
<el-timeline v-if="logObj.logList.length">
|
<el-timeline v-if="logObj.logList.length">
|
||||||
@ -327,7 +323,8 @@ import {
|
|||||||
saveMerchantNote,
|
saveMerchantNote,
|
||||||
updateOmsOrder,
|
updateOmsOrder,
|
||||||
updateReceiverAddress,
|
updateReceiverAddress,
|
||||||
viewLog
|
viewLog,
|
||||||
|
refundOrder
|
||||||
} from '@/api/oms/order';
|
} from '@/api/oms/order';
|
||||||
import AddressSelector from '@/views/components/AddressSelector/index.vue';
|
import AddressSelector from '@/views/components/AddressSelector/index.vue';
|
||||||
import dateUtil, { dateFormat } from '@/utils/DateUtil';
|
import dateUtil, { dateFormat } from '@/utils/DateUtil';
|
||||||
@ -414,10 +411,22 @@ export default {
|
|||||||
title: null,
|
title: null,
|
||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
|
|
||||||
merchantNote: null
|
merchantNote: null
|
||||||
},
|
},
|
||||||
open: false
|
open: false
|
||||||
},
|
},
|
||||||
|
refundObj: {
|
||||||
|
title: null,
|
||||||
|
form: {
|
||||||
|
orderId: null,
|
||||||
|
reason: null
|
||||||
|
},
|
||||||
|
open: false,
|
||||||
|
rules: {
|
||||||
|
reason: [{ required: true, message: '退款金额不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
},
|
||||||
logObj: {
|
logObj: {
|
||||||
title: '日志',
|
title: '日志',
|
||||||
logList: null,
|
logList: null,
|
||||||
@ -466,6 +475,19 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleRefund(row) {
|
||||||
|
this.refundObj.title = '退款';
|
||||||
|
this.refundObj.open = true;
|
||||||
|
this.refundObj.form.orderId = row.id;
|
||||||
|
},
|
||||||
|
async handleConfirmRefund() {
|
||||||
|
const res = await refundOrder(this.refundObj.form);
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$modal.msgSuccess('退款提交');
|
||||||
|
this.getList();
|
||||||
|
this.refundObj.open = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 日期组件设置为今天 */
|
/** 日期组件设置为今天 */
|
||||||
setToday() {
|
setToday() {
|
||||||
const temp = new Date();
|
const temp = new Date();
|
||||||
|
327
src/views/system/article/index.vue
Normal file
327
src/views/system/article/index.vue
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 部门树 -->
|
||||||
|
<el-col :lg="4" :xs="24" style="">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<!-- <el-input v-model="deptName" placeholder="请输入分类名称" prefix-icon="Search" clearable /> -->
|
||||||
|
<el-tree
|
||||||
|
ref="deptTreeRef"
|
||||||
|
class="mt-2"
|
||||||
|
node-key="id"
|
||||||
|
:data="deptOptions"
|
||||||
|
:props="{ label: 'name', children: 'children' } as any"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
highlight-current
|
||||||
|
default-expand-all
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="20" :xs="24">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px">
|
||||||
|
<el-form-item label="文章标题:" prop="postCode">
|
||||||
|
<el-input v-model="queryParams.title" placeholder="请输入文章标题" clearable @keyup.enter="handleQuery" />
|
||||||
|
</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-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['content:article:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-table v-loading="loading" border :data="postList">
|
||||||
|
<el-table-column label="分类名称" align="center" prop="type" />
|
||||||
|
<el-table-column label="文章标题" align="center" prop="title" />
|
||||||
|
<el-table-column label="是否显示" align="center" width="100">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<!-- <el-switch v-model="row.status" active-value="0" inactive-value="1" @change="() => handleStatusChange(row)"> </el-switch> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="排序" align="center" prop="sort" />
|
||||||
|
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tooltip content="修改" placement="top">
|
||||||
|
<el-button v-hasPermi="['content:article:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="删除" placement="top">
|
||||||
|
<el-button v-hasPermi="['content:article:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" v-model:page="queryParams.current" v-model:limit="queryParams.size" :total="total" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 添加或修改岗位对话框 -->
|
||||||
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="1000px" append-to-body>
|
||||||
|
<el-form ref="postFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="文章标题" prop="title" label-width="100px">
|
||||||
|
<el-input style="width: 100%" v-model="form.title" placeholder="请输入文章标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文章分类" prop="categoryId" label-width="100px">
|
||||||
|
<el-cascader
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="form.categoryId"
|
||||||
|
:options="deptOptions"
|
||||||
|
:props="{
|
||||||
|
value: 'id',
|
||||||
|
label: 'name',
|
||||||
|
children: 'children',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false
|
||||||
|
}"
|
||||||
|
placeholder="请选择文章分类"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文章类型" prop="type" label-width="100px">
|
||||||
|
<el-select v-model="form.type" placeholder="请选择文章分类" style="width: 100%">
|
||||||
|
<el-option v-for="item in enterpriseList" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="文章排序" prop="sort" label-width="100px">
|
||||||
|
<el-input v-model="form.sort" placeholder="请输入文章排序" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="文章内容" prop="content" label-width="100px">
|
||||||
|
<Editor ref="editorRef" v-model="form.content" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="文章状态" prop="status">
|
||||||
|
<DictRadio v-model="form.status" radioData="cont_article_status" :show-all="'all'" />
|
||||||
|
</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>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Post" lang="ts">
|
||||||
|
import { listPost, addPost, delPost, getPost, updatePost, listCategory } from '@/api/system/article';
|
||||||
|
import { PostForm, PostQuery, PostVO } from '@/api/system/article/types';
|
||||||
|
import { DeptVO } from '@/api/system/dept/types';
|
||||||
|
import api from '@/api/system/user';
|
||||||
|
import Editor from '@/components/Editor/index.vue';
|
||||||
|
import { getDictionaryByKey } from '@/utils/dict';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
||||||
|
|
||||||
|
const postList = ref<PostVO[]>([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const deptName = ref('');
|
||||||
|
const deptOptions = ref<any[]>([]);
|
||||||
|
const deptTreeRef = ref<ElTreeInstance>();
|
||||||
|
const postFormRef = ref<ElFormInstance>();
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: PostForm = {
|
||||||
|
id: undefined,
|
||||||
|
title: '',
|
||||||
|
type: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
categoryId: undefined,
|
||||||
|
content: '',
|
||||||
|
status: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
const data = reactive<PageData<PostForm, PostQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
title: undefined,
|
||||||
|
categoryId: undefined
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
title: [{ required: true, message: '文章标题不能为空', trigger: 'blur' }],
|
||||||
|
type: [{ required: true, message: '文章类型不能为空', trigger: 'blur' }],
|
||||||
|
categoryId: [{ required: true, message: '文章分类不能为空', trigger: 'blur' }],
|
||||||
|
sort: [{ required: true, message: '文章排序不能为空', trigger: 'blur' }],
|
||||||
|
content: [{ required: true, message: '文章内容不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '文章状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs<PageData<PostForm, PostQuery>>(data);
|
||||||
|
/** 角色状态修改 */
|
||||||
|
const handleStatusChange = async (row: any) => {
|
||||||
|
const text = row.status === '0' ? '启用' : '停用';
|
||||||
|
try {
|
||||||
|
await proxy?.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?');
|
||||||
|
await changeRoleStatus(row.roleId, row.status);
|
||||||
|
proxy?.$modal.msgSuccess(text + '成功');
|
||||||
|
} catch {
|
||||||
|
row.status = row.status === '0' ? '1' : '0';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 通过条件过滤节点 */
|
||||||
|
const filterNode = (value: string, data: any) => {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
};
|
||||||
|
const enterpriseList = ref([]); // 种类
|
||||||
|
const getByKey = async () => {
|
||||||
|
const value1 = await getDictionaryByKey('cont_article_type');
|
||||||
|
console.log(value1);
|
||||||
|
value1.forEach((item: any) => {
|
||||||
|
item.value = Number(item.value);
|
||||||
|
});
|
||||||
|
enterpriseList.value = value1;
|
||||||
|
};
|
||||||
|
/** 根据名称筛选部门树 */
|
||||||
|
watchEffect(
|
||||||
|
() => {
|
||||||
|
deptTreeRef.value?.filter(deptName.value);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(deptName, (val) => {
|
||||||
|
deptTreeRef.value?.filter(val);
|
||||||
|
});
|
||||||
|
const queryTree = ref({
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
id: '',
|
||||||
|
name: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
level: undefined,
|
||||||
|
type: undefined
|
||||||
|
});
|
||||||
|
/** 查询文章分类下拉树结构 */
|
||||||
|
const getTreeSelect = async () => {
|
||||||
|
const res = await listCategory(queryTree.value);
|
||||||
|
deptOptions.value = res.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 节点单击事件 */
|
||||||
|
const handleNodeClick = (data: DeptVO) => {
|
||||||
|
queryParams.value.categoryId = data.id;
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 查询岗位列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listPost(queryParams.value);
|
||||||
|
postList.value = res.data.records;
|
||||||
|
total.value = res.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
postFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
queryParams.value.categoryId = undefined;
|
||||||
|
queryParams.value.title = undefined;
|
||||||
|
queryParams.value.current = 1;
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '添加岗位';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: any) => {
|
||||||
|
reset();
|
||||||
|
getByKey();
|
||||||
|
const postId = row.id;
|
||||||
|
const res = await getPost(postId);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改岗位';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = () => {
|
||||||
|
postFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
form.value.id ? await updatePost(form.value) : await addPost(form.value);
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: any) => {
|
||||||
|
const postIds = row.id;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?');
|
||||||
|
await delPost(postIds);
|
||||||
|
await getList();
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'system/post/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`post_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTreeSelect(); // 初始化部门数据
|
||||||
|
getList();
|
||||||
|
getByKey();
|
||||||
|
});
|
||||||
|
</script>
|
213
src/views/system/category/index.vue
Normal file
213
src/views/system/category/index.vue
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col>
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:post:add']" type="primary" plain icon="Plus" @click="handleAdd">新增一级分类</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-table v-loading="loading" border :data="postList" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" row-key="id">
|
||||||
|
<el-table-column label="分类名称" align="left" prop="name" />
|
||||||
|
<el-table-column label="排序" align="center" prop="sort" />
|
||||||
|
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tooltip content="添加子分类" placement="top" v-if="scope.row.parentId == 0 || scope.row.parentId == '0'">
|
||||||
|
<el-button v-hasPermi="['system:post:add']" link type="primary" icon="Plus" @click="handleAddChild(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="修改" placement="top">
|
||||||
|
<el-button v-hasPermi="['system:post:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="删除" placement="top">
|
||||||
|
<el-button v-hasPermi="['system:post:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 添加或修改岗位对话框 -->
|
||||||
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body>
|
||||||
|
<el-form ref="postFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="上级分类" prop="name">
|
||||||
|
<span v-if="form.parentId">{{ form.oneName }}</span>
|
||||||
|
<span v-else>顶级分类</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="分类名称" prop="name">
|
||||||
|
<el-input v-model="form.name" autocomplete="off" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="level">
|
||||||
|
<el-input v-model="form.sort" autocomplete="off" />
|
||||||
|
</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>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Post" lang="ts">
|
||||||
|
import { listPost, getPost, updatePost, addPost, delPost } from '@/api/system/category';
|
||||||
|
import { PostVO, PostForm, PostQuery } from '@/api/system/category/types';
|
||||||
|
import { DeptVO } from '@/api/system/dept/types';
|
||||||
|
import api from '@/api/system/user';
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
||||||
|
|
||||||
|
const postList = ref<PostVO[]>([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<number | string>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const deptName = ref('');
|
||||||
|
const deptOptions = ref<DeptVO[]>([]);
|
||||||
|
const deptTreeRef = ref<ElTreeInstance>();
|
||||||
|
const postFormRef = ref<ElFormInstance>();
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: PostForm = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
level: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
type: undefined,
|
||||||
|
oneName: undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
const data = reactive<PageData<PostForm, PostQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
id: '',
|
||||||
|
name: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
level: undefined,
|
||||||
|
type: undefined
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
postName: [{ required: true, message: '岗位名称不能为空', trigger: 'blur' }],
|
||||||
|
postCode: [{ required: true, message: '岗位编码不能为空', trigger: 'blur' }],
|
||||||
|
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
|
||||||
|
postSort: [{ required: true, message: '岗位顺序不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs<PageData<PostForm, PostQuery>>(data);
|
||||||
|
|
||||||
|
const handleAddChild = (row: PostForm) => {
|
||||||
|
reset();
|
||||||
|
form.value.parentId = row.id;
|
||||||
|
form.value.oneName = row.name;
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '添加' + row.name + ' 子分类';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 查询文章分类列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listPost(queryParams.value);
|
||||||
|
postList.value = res.data;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
postFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
if (queryParams.value.deptId) {
|
||||||
|
queryParams.value.belongDeptId = undefined;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
queryParams.value.deptId = undefined;
|
||||||
|
deptTreeRef.value?.setCurrentKey(undefined);
|
||||||
|
/** 清空左边部门树选中值 */
|
||||||
|
queryParams.value.belongDeptId = undefined;
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: PostVO[]) => {
|
||||||
|
ids.value = selection.map((item) => item.postId);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '添加分类';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: any) => {
|
||||||
|
const postId = row.id;
|
||||||
|
const res = await getPost(postId);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
console.log(form.value);
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改分类';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = () => {
|
||||||
|
postFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
form.value.id ? await updatePost(form.value) : await addPost(form.value);
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row: any) => {
|
||||||
|
const postIds = row.id;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除岗位编号为"' + row.id + '"的数据项?');
|
||||||
|
await delPost(postIds);
|
||||||
|
await getList();
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
@ -848,6 +848,7 @@ const data = reactive<PageData<TenantForm, TenantQuery>>({
|
|||||||
contactPhone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
|
contactPhone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
|
||||||
contractAttachment: [{ required: true, message: '签约附件不能为空', trigger: 'blur' }],
|
contractAttachment: [{ required: true, message: '签约附件不能为空', trigger: 'blur' }],
|
||||||
attachment: [{ required: true, message: '营业执照附件不能为空', trigger: 'blur' }],
|
attachment: [{ required: true, message: '营业执照附件不能为空', trigger: 'blur' }],
|
||||||
|
signDate: [{ required: true, message: '签约日期不能为空', trigger: 'blur' }],
|
||||||
certificate: [{ required: true, message: '身份证附件不能为空', trigger: 'blur' }],
|
certificate: [{ required: true, message: '身份证附件不能为空', trigger: 'blur' }],
|
||||||
promoteList: [{ required: true, message: '推广附件不能为空', trigger: 'blur' }],
|
promoteList: [{ required: true, message: '推广附件不能为空', trigger: 'blur' }],
|
||||||
packageId: [{ required: true, message: '套餐编号不能为空', trigger: 'blur' }],
|
packageId: [{ required: true, message: '套餐编号不能为空', trigger: 'blur' }],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user