增加了部分备注
This commit is contained in:
parent
75afed7c0c
commit
0e92cfdcd1
|
|
@ -44,8 +44,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
open(options) {
|
open(options) {
|
||||||
|
// 解构赋值 page 页面组件 title 标题 callback 回调函数 pageMode 模式 add edit select dataId 数据id width 宽度 height 高度 pageOptions 页面参数
|
||||||
|
// pageOptions 用于传递给页面的参数 例如:{id:1,name:'张三'} 页面通过 this.$options.pageOptions 获取
|
||||||
|
// showFooter 是否显示底部按钮
|
||||||
const { page, title, callback, pageMode, dataId,width = 800,height = 600 , pageOptions = {} ,showFooter } = options || {};
|
const { page, title, callback, pageMode, dataId,width = 800,height = 600 , pageOptions = {} ,showFooter } = options || {};
|
||||||
|
|
||||||
this.width = width;
|
this.width = width;
|
||||||
|
|
@ -57,21 +60,30 @@ export default {
|
||||||
this.app = page;
|
this.app = page;
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.showFooter = showFooter;
|
this.showFooter = showFooter;
|
||||||
|
// 设置延迟显示,解决弹窗显示不全的问题
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
}, 10);
|
}, 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 处理回调
|
||||||
handleCallback(e) {
|
handleCallback(e) {
|
||||||
const { callback } = this;
|
const { callback } = this;
|
||||||
|
// 判断是否有回调函数
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
// 执行回调
|
||||||
callback(e);
|
callback(e);
|
||||||
|
// 关闭弹窗
|
||||||
this.$destroy();
|
this.$destroy();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
modalClose() {
|
modalClose() {
|
||||||
this.$destroy();
|
this.$destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 确认事件
|
||||||
confirmEvent(){
|
confirmEvent(){
|
||||||
const { callback } = this;
|
const { callback } = this;
|
||||||
let data = this.$refs.appPage.getConfirmData();
|
let data = this.$refs.appPage.getConfirmData();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import promptComponent from './dialog.vue' // 加载dialog组件
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
// 打开对话框
|
||||||
open: function (args) { // 打开对话框
|
open: function (args) { // 打开对话框
|
||||||
const promptConstructor = Vue.extend(promptComponent); // 创建一个子类
|
const promptConstructor = Vue.extend(promptComponent); // 创建一个子类
|
||||||
let instance = new promptConstructor().$mount(''); // 创建一个实例
|
let instance = new promptConstructor().$mount(''); // 创建一个实例
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
import BASE_URL from '@/services/base/api.js';
|
import BASE_URL from '@/services/base/api.js'; // 接口地址
|
||||||
export default {
|
export default {
|
||||||
name: 'MkGridDataSelector',
|
name: 'MkGridDataSelector',
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -39,6 +39,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 接口地址
|
||||||
actions: {
|
actions: {
|
||||||
getList: `${BASE_URL}/api/web/listdata`
|
getList: `${BASE_URL}/api/web/listdata`
|
||||||
},
|
},
|
||||||
|
|
@ -73,7 +74,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
// 加载数据
|
||||||
this.load()
|
this.load()
|
||||||
|
// 初始化高度
|
||||||
this.heightInit();
|
this.heightInit();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 获取label
|
||||||
getLabel(v) {
|
getLabel(v) {
|
||||||
for (let i = 0; i < this.options.length; i++) {
|
for (let i = 0; i < this.options.length; i++) {
|
||||||
let o = this.options[i];
|
let o = this.options[i];
|
||||||
|
|
@ -60,6 +62,8 @@ export default {
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
load() {
|
load() {
|
||||||
const { row, column } = this.params
|
const { row, column } = this.params
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 切换公司 -->
|
||||||
<vxe-modal v-model="value" @confirm="confirmEvent" width="600" show-footer>
|
<vxe-modal v-model="value" @confirm="confirmEvent" width="600" show-footer>
|
||||||
<template #title>
|
<template #title>
|
||||||
<span>选择公司</span>
|
<span>选择公司</span>
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
export default {
|
export default {
|
||||||
name: "switchCompany",
|
name: "switchCompany",
|
||||||
props: {
|
props: {
|
||||||
value : {
|
value: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
data : {
|
data: {
|
||||||
type: Array
|
type: Array
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -33,9 +33,10 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirmEvent(){
|
// 确认事件
|
||||||
|
confirmEvent() {
|
||||||
let row = this.$refs.xTable.getCurrentRecord();
|
let row = this.$refs.xTable.getCurrentRecord();
|
||||||
this.$emit("confirm",{row});
|
this.$emit("confirm", { row });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 新增 设置 日志 工具条 -->
|
||||||
<div :class="cls">
|
<div :class="cls">
|
||||||
|
|
||||||
<a-tooltip placement="topRight" title="日志" v-if="isShowLog">
|
<a-tooltip placement="topRight" title="日志" v-if="isShowLog">
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,55 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
uploadDefaultImg: "http://zjdaomiimgtest.oss-cn-hangzhou.aliyuncs.com/2022/16709016422295584.png", // 默认图片
|
uploadDefaultImg: "http://zjdaomiimgtest.oss-cn-hangzhou.aliyuncs.com/2022/16709016422295584.png", // 默认图片
|
||||||
|
|
||||||
|
|
||||||
defaults: {
|
// 此处配置的是全局配置,在任何地方都可以使用 this.$mk.config.defaults 来获取配置
|
||||||
|
defaults: { // 默认配置
|
||||||
|
|
||||||
gridOptions: {
|
gridOptions: { // 表格配置
|
||||||
|
// 行配置
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: "id",
|
keyField: "id", // 主键字段
|
||||||
isCurrent: true,
|
isCurrent: true, // 是否高亮当前行
|
||||||
isHover: true
|
isHover: true // 是否高亮鼠标悬浮行
|
||||||
},
|
},
|
||||||
|
// 列配置
|
||||||
columnConfig: {
|
columnConfig: {
|
||||||
resizable: true
|
resizable: true // 是否允许拖动列宽
|
||||||
},
|
},
|
||||||
|
// 排序配置
|
||||||
sortConfig: {
|
sortConfig: {
|
||||||
trigger: 'cell',
|
trigger: 'cell', // 触发排序的方式
|
||||||
remote: true
|
remote: true // 是否远程排序
|
||||||
},
|
},
|
||||||
|
// 分页配置
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 50,
|
pageSize: 50, // 默认每页显示条数
|
||||||
pageSizes: [50, 100, 200, 500, 1000, 5000, 10000, 20000]
|
pageSizes: [50, 100, 200, 500, 1000, 5000, 10000, 20000] // 每页显示条数选项
|
||||||
},
|
},
|
||||||
|
// 工具栏配置
|
||||||
__toolbarConfig: {
|
__toolbarConfig: {
|
||||||
buttons: [
|
buttons: [ // 按钮
|
||||||
],
|
],
|
||||||
refresh: true,
|
refresh: true, // 是否显示刷新按钮
|
||||||
import: false,
|
import: false, // 是否显示导入按钮
|
||||||
export: false,
|
export: false, // 是否显示导出按钮
|
||||||
print: false,
|
print: false, // 是否显示打印按钮
|
||||||
zoom: false,
|
zoom: false, // 是否显示缩放按钮
|
||||||
custom: true
|
custom: true // 是否显示自定义按钮
|
||||||
},
|
},
|
||||||
|
// 复选框配置
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
reserve: true,
|
reserve: true, // 是否保留复选框
|
||||||
highlight: true,
|
highlight: true, // 是否高亮复选框
|
||||||
trigger:'row',
|
trigger:'row', // 触发复选框的方式
|
||||||
range: true
|
range: true // 是否允许复选框范围选择
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
formOptions: { // 表单配置
|
||||||
formOptions: {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { request } from '@/utils/request' // 加载request
|
||||||
import modal from './modal' // 加载modal
|
import modal from './modal' // 加载modal
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
// 提交post请求 ,获取数据
|
||||||
post : function({url, data,loading , config}){ // post请求
|
post : function({url, data,loading , config}){ // post请求
|
||||||
|
|
||||||
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
||||||
|
|
@ -41,6 +42,8 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 获取分页数据
|
||||||
getPagedData: function({url, method = 'post', data,callback, config}){ // 获取分页数据 默认post请求
|
getPagedData: function({url, method = 'post', data,callback, config}){ // 获取分页数据 默认post请求
|
||||||
|
|
||||||
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
// 格式化表单数据
|
||||||
formatFormData: function ({ data, rules }) { // 格式化表单数据
|
formatFormData: function ({ data, rules }) { // 格式化表单数据
|
||||||
|
|
||||||
rules.forEach(rule => { // 循环规则
|
rules.forEach(rule => { // 循环规则
|
||||||
|
|
@ -17,7 +17,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 验证表单数据
|
||||||
validateForm : function ({ form }) { // 验证表单
|
validateForm : function ({ form }) { // 验证表单
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
import BASE_URL from '@/services/base/api.js';
|
import BASE_URL from '@/services/base/api.js';
|
||||||
import PageLayout from '@/layouts/PageLayout'
|
import PageLayout from '@/layouts/PageLayout'
|
||||||
|
|
||||||
let serviceListPage = () => import("../BaseService/list");
|
let serviceListPage = () => import("../BaseService/list"); // 加载服务列表页面
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
@ -79,10 +79,13 @@ export default {
|
||||||
|
|
||||||
// 页面数据变量
|
// 页面数据变量
|
||||||
var pageData = {
|
var pageData = {
|
||||||
|
// 公司类型
|
||||||
companyTypeData: ['日用陶瓷厂', '卫浴工厂', '公司企业', '贸易公司', '其他'],
|
companyTypeData: ['日用陶瓷厂', '卫浴工厂', '公司企业', '贸易公司', '其他'],
|
||||||
|
// 服务列表
|
||||||
config_list: [],
|
config_list: [],
|
||||||
|
// 当前项目名称
|
||||||
currentConfigName: "",
|
currentConfigName: "",
|
||||||
|
// 当前项目ID
|
||||||
currentBeid: 0,
|
currentBeid: 0,
|
||||||
|
|
||||||
uploadDefaultImg: null,
|
uploadDefaultImg: null,
|
||||||
|
|
@ -100,7 +103,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
keyName: 'id',
|
keyName: 'id',
|
||||||
|
// 是否编辑模式
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
// 表单数据
|
||||||
formOptions: {
|
formOptions: {
|
||||||
data: {
|
data: {
|
||||||
"beid": 0,
|
"beid": 0,
|
||||||
|
|
@ -130,10 +135,12 @@ export default {
|
||||||
"staff_count": 0,
|
"staff_count": 0,
|
||||||
"store_count": 0
|
"store_count": 0
|
||||||
},
|
},
|
||||||
|
// 标题宽度
|
||||||
titleWidth: 100,
|
titleWidth: 100,
|
||||||
|
// 标题对齐方式
|
||||||
titleAlign: 'right',
|
titleAlign: 'right',
|
||||||
|
|
||||||
|
// 表单校验规则
|
||||||
rules: {
|
rules: {
|
||||||
title: [
|
title: [
|
||||||
{ required: true, message: '请输入标题' }
|
{ required: true, message: '请输入标题' }
|
||||||
|
|
@ -157,7 +164,7 @@ export default {
|
||||||
{ required: true, message: '请输入登录过期截止时间' }
|
{ required: true, message: '请输入登录过期截止时间' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// 表单项
|
||||||
items: [
|
items: [
|
||||||
{ field: 'title', title: '公司名', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入公司名' } } },
|
{ field: 'title', title: '公司名', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入公司名' } } },
|
||||||
{ field: 'short_title', title: '公司简称', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入公司简称' } } },
|
{ field: 'short_title', title: '公司简称', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入公司简称' } } },
|
||||||
|
|
@ -171,14 +178,10 @@ export default {
|
||||||
{ field: 'appsecret', title: 'AppSecret', span: 24, itemRender: { name: '$input' } },
|
{ field: 'appsecret', title: 'AppSecret', span: 24, itemRender: { name: '$input' } },
|
||||||
{ field: 'token', title: '企业Token', span: 24, itemRender: { name: '$textarea', props: { placeholder: '不用填写' } } },
|
{ field: 'token', title: '企业Token', span: 24, itemRender: { name: '$textarea', props: { placeholder: '不用填写' } } },
|
||||||
{ field: 'access_expire', dataRule: { type: "timestamp" }, title: '登录过期截止时间', span: 24, itemRender: { name: '$input', props: {type:"date", placeholder: '输入登录过期截止时间' } } },
|
{ field: 'access_expire', dataRule: { type: "timestamp" }, title: '登录过期截止时间', span: 24, itemRender: { name: '$input', props: {type:"date", placeholder: '输入登录过期截止时间' } } },
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// 新增模式表单项
|
||||||
addModeItems: [
|
addModeItems: [
|
||||||
|
|
||||||
{ field: 'mobile', dataRule: { type: "integer" }, title: '管理员手机', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入管理员手机号' } } },
|
{ field: 'mobile', dataRule: { type: "integer" }, title: '管理员手机', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入管理员手机号' } } },
|
||||||
{ field: 'password', title: '管理员密码', span: 12, itemRender: { name: '$input', props: { type: "password", placeholder: '请输入管理员密码' } } },
|
{ field: 'password', title: '管理员密码', span: 12, itemRender: { name: '$input', props: { type: "password", placeholder: '请输入管理员密码' } } },
|
||||||
{ field: 'name', title: '管理员名称', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入管理员名称' } } },
|
{ field: 'name', title: '管理员名称', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入管理员名称' } } },
|
||||||
|
|
@ -187,9 +190,13 @@ export default {
|
||||||
|
|
||||||
//服务管理 - 数据区
|
//服务管理 - 数据区
|
||||||
gridServiceOptions: {
|
gridServiceOptions: {
|
||||||
|
// 表格高度
|
||||||
height: '110%',
|
height: '110%',
|
||||||
|
// 表格id
|
||||||
id: 'datagrid_service_1',
|
id: 'datagrid_service_1',
|
||||||
|
|
||||||
|
|
||||||
|
// 数据区
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
||||||
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
||||||
|
|
@ -219,36 +226,49 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 列配置
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'checkbox', width: 50 },
|
{ type: 'checkbox', width: 50 }, // 多选框
|
||||||
{ type: 'seq', width: 50 },
|
{ type: 'seq', width: 50 }, // ID序号
|
||||||
{ field: 'name', sortable: true, title: '服务名' },
|
{ field: 'name', sortable: true, title: '服务名' },
|
||||||
{ field: 'title', sortable: true, title: '标题', showHeaderOverflow: true },
|
{ field: 'title', sortable: true, title: '标题', showHeaderOverflow: true },
|
||||||
{ field: 'port', sortable: true, title: '端口', showHeaderOverflow: true },
|
{ field: 'port', sortable: true, title: '端口', showHeaderOverflow: true },
|
||||||
{ field: 'status', sortable: true, title: '是否启用', slots: { default: 'status' } }
|
{ field: 'status', sortable: true, title: '是否启用', slots: { default: 'status' } }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
// 合并服务数据及配置
|
||||||
pageData.gridServiceOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridServiceOptions);
|
pageData.gridServiceOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridServiceOptions);
|
||||||
|
|
||||||
|
|
||||||
|
// 合并表单数据及配置
|
||||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||||
|
|
||||||
return pageData;
|
return pageData;
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
desc() {
|
desc() {
|
||||||
return this.$t('editPageDesc')
|
return this.$t('editPageDesc')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
|
|
||||||
|
|
||||||
|
created() {
|
||||||
|
// 上传默认图片的地址
|
||||||
this.uploadDefaultImg = this.$mk.config.uploadDefaultImg;
|
this.uploadDefaultImg = this.$mk.config.uploadDefaultImg;
|
||||||
|
|
||||||
|
// 获取路由的id参数
|
||||||
let dataId = this.getDataId();
|
let dataId = this.getDataId();
|
||||||
|
|
||||||
|
// 如果有id参数,说明是编辑模式
|
||||||
if (dataId) {
|
if (dataId) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.get,
|
url: this.actions.get,
|
||||||
loading: "加载中...",
|
loading: "加载中...",
|
||||||
|
|
@ -269,15 +289,17 @@ export default {
|
||||||
|
|
||||||
this.isEdit = true;
|
this.isEdit = true;
|
||||||
} else {
|
} else {
|
||||||
|
// 如果没有id参数,说明是新增模式
|
||||||
this.addModeItems.forEach(item => {
|
this.addModeItems.forEach(item => {
|
||||||
this.formOptions.items.push(item);
|
this.formOptions.items.push(item);
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过接口获取数据
|
||||||
this.$mk.getPagedData({
|
this.$mk.getPagedData({
|
||||||
url: this.actions.configList, data: {
|
url: this.actions.configList, data: {
|
||||||
|
// 提交接口的参数
|
||||||
"page": 0,
|
"page": 0,
|
||||||
"limit": 0,
|
"limit": 0,
|
||||||
"start_time": 0,
|
"start_time": 0,
|
||||||
|
|
@ -287,17 +309,18 @@ export default {
|
||||||
"order_bys": [
|
"order_bys": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).then(r => {
|
}).then(r => { // 成功回调
|
||||||
this.config_list = r.list;
|
this.config_list = r.list;
|
||||||
|
// 更新当前项目名称
|
||||||
this.updateCurrentConfigName();
|
this.updateCurrentConfigName();
|
||||||
|
// 获取项目列表
|
||||||
this.config_list.splice(0, 0, { id: 0, title: "请选择" })
|
this.config_list.splice(0, 0, { id: 0, title: "请选择" })
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 函数
|
// 函数
|
||||||
methods: {
|
methods: {
|
||||||
|
// 更新当前项目名称
|
||||||
updateCurrentConfigName() {
|
updateCurrentConfigName() {
|
||||||
this.config_list.forEach(item => {
|
this.config_list.forEach(item => {
|
||||||
if (item.id == this.currentBeid) {
|
if (item.id == this.currentBeid) {
|
||||||
|
|
@ -329,6 +352,8 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取路由的id参数
|
||||||
getDataId() {
|
getDataId() {
|
||||||
|
|
||||||
let dataId = this.dataId;
|
let dataId = this.dataId;
|
||||||
|
|
@ -337,9 +362,9 @@ export default {
|
||||||
}
|
}
|
||||||
return parseInt(dataId || 0);
|
return parseInt(dataId || 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载服务列表数据
|
||||||
loadDetailData1({ params }) {
|
loadDetailData1({ params }) {
|
||||||
|
|
||||||
|
|
||||||
params.start_time = 0;
|
params.start_time = 0;
|
||||||
params.end_time = 0;
|
params.end_time = 0;
|
||||||
params.beid = this.formOptions.data.beid;
|
params.beid = this.formOptions.data.beid;
|
||||||
|
|
@ -347,123 +372,170 @@ export default {
|
||||||
params.company_id = this.getDataId();
|
params.company_id = this.getDataId();
|
||||||
return this.$mk.getPagedData({ url: this.actions.serviceList, data: params });
|
return this.$mk.getPagedData({ url: this.actions.serviceList, data: params });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 返回
|
||||||
back() {
|
back() {
|
||||||
|
// 如果是新增模式,关闭当前页面
|
||||||
if (!this.isEdit) {
|
if (!this.isEdit) {
|
||||||
this.$closePage({
|
this.$closePage({
|
||||||
closeRoute: "/BaseCompany/BaseCompanyAdd"
|
closeRoute: "/BaseCompany/BaseCompanyAdd"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 如果是编辑模式,关闭当前页面
|
||||||
this.$closePage({
|
this.$closePage({
|
||||||
closeRoute: "/BaseCompany/BaseCompanyUpdate"
|
closeRoute: "/BaseCompany/BaseCompanyUpdate"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 打开列表页面
|
||||||
this.$openPage('/BaseCompany/BaseCompanyList')
|
this.$openPage('/BaseCompany/BaseCompanyList')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 保存
|
||||||
ok() {
|
ok() {
|
||||||
|
|
||||||
let save = () => {
|
let save = () => {
|
||||||
|
|
||||||
|
|
||||||
|
// 如果是新增模式,提交新增接口 如果是编辑模式,提交编辑接口
|
||||||
let action = !this.isEdit ? this.actions.create : this.actions.update;
|
let action = !this.isEdit ? this.actions.create : this.actions.update;
|
||||||
|
// 如果是新增模式,提交的数据中加入id 如果是编辑模式,提交的数据中不加入id
|
||||||
let postdata = !this.isEdit ? Object.assign({ id: this.dataId }, this.formOptions.data) : Object.assign({}, this.formOptions.data);
|
let postdata = !this.isEdit ? Object.assign({ id: this.dataId }, this.formOptions.data) : Object.assign({}, this.formOptions.data);
|
||||||
|
// 如果是编辑模式
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
// postdata = { BaseCompany: postdata }
|
// postdata = { BaseCompany: postdata }
|
||||||
}
|
}
|
||||||
|
// 格式化提交的数据
|
||||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||||
|
|
||||||
|
|
||||||
|
// 提交数据
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: action,
|
url: action,
|
||||||
loading: "保存中...",
|
loading: "保存中...",
|
||||||
data: postdata,
|
data: postdata,
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("保存成功");
|
this.$mk.success("保存成功");
|
||||||
if (!this.isEdit) {
|
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg); // 显示错误信息
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => {
|
|
||||||
|
|
||||||
save();
|
|
||||||
}).catch(count => {
|
// 验证表单
|
||||||
|
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||||
|
save(); // 提交保存
|
||||||
|
}).catch(count => { // 验证失败
|
||||||
this.$mk.error(`存在${count}项错误,请检查`);
|
this.$mk.error(`存在${count}项错误,请检查`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 移除服务
|
||||||
pageDel() {
|
pageDel() {
|
||||||
|
// 获取选中的行
|
||||||
let rows = this.$refs.gridService.getCheckboxRecords();
|
let rows = this.$refs.gridService.getCheckboxRecords();
|
||||||
|
// 数据的id主键
|
||||||
let ids = [];
|
let ids = [];
|
||||||
|
// 遍历选中的行,获取id 主键 赋予到ids数组中
|
||||||
rows.forEach((row) => {
|
rows.forEach((row) => {
|
||||||
ids.push(row[this.keyName]);
|
ids.push(row[this.keyName]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// 如果ids数组为空,提示请选择行
|
||||||
if (!ids.length) {
|
if (!ids.length) {
|
||||||
this.$mk.error("请选择行");
|
this.$mk.error("请选择行");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 提示是否移除服务
|
||||||
this.$mk.confirm('您确定要移除服务吗?').then(type => {
|
this.$mk.confirm('您确定要移除服务吗?').then(type => {
|
||||||
|
// 如果是确定,提交移除服务接口
|
||||||
if (type == 'confirm') {
|
if (type == 'confirm') {
|
||||||
|
// 提交移除服务接口
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.serviceDel,
|
url: this.actions.serviceDel,
|
||||||
loading: "移除服务中...",
|
loading: "移除服务中...",
|
||||||
data: {
|
data: {
|
||||||
ids: ids
|
ids: ids
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("移除服务成功");
|
this.$mk.success("移除服务成功");
|
||||||
this.$refs.gridService.commitProxy('query')
|
this.$refs.gridService.commitProxy('query')
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
pageAdd() {
|
|
||||||
this.$mk.dialog.open({
|
|
||||||
page: serviceListPage,
|
|
||||||
title: "选择要添加的服务",
|
|
||||||
|
|
||||||
|
|
||||||
|
// 添加服务
|
||||||
|
pageAdd() {
|
||||||
|
// 弹出选择服务页面
|
||||||
|
this.$mk.dialog.open({
|
||||||
|
// 加载页面:服务列表
|
||||||
|
page: serviceListPage,
|
||||||
|
// 标题
|
||||||
|
title: "选择要添加的服务",
|
||||||
|
// 是否显示页脚
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
|
// 传递给服务列表页面的参数
|
||||||
pageOptions: {
|
pageOptions: {
|
||||||
|
// 项目id
|
||||||
config_id: this.currentBeid
|
config_id: this.currentBeid
|
||||||
},
|
},
|
||||||
|
// 选择模式
|
||||||
pageMode: "select",
|
pageMode: "select",
|
||||||
|
// 宽度
|
||||||
width: 1000,
|
width: 1000,
|
||||||
|
// 高度
|
||||||
height: 870,
|
height: 870,
|
||||||
|
// 数据主键
|
||||||
dataId: 0,
|
dataId: 0,
|
||||||
callback: ({ data }) => {
|
callback: ({ data }) => { // 选择服务后的回调
|
||||||
|
|
||||||
|
// 如果没有选择服务
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 服务的id数组
|
||||||
let ids = [];
|
let ids = [];
|
||||||
|
// 遍历选择的服务,获取服务的id,赋予到ids数组中
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
ids.push(item.id)
|
ids.push(item.id)
|
||||||
})
|
})
|
||||||
|
// 提交添加服务接口
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.serviceAdd,
|
url: this.actions.serviceAdd,
|
||||||
loading: "添加中...",
|
loading: "添加中...",
|
||||||
data: {
|
data: {
|
||||||
|
// 企业id:获取当前页面的企业路由的id参数
|
||||||
"company_id": this.getDataId(),
|
"company_id": this.getDataId(),
|
||||||
ptyid: 0,
|
ptyid: 0,
|
||||||
|
// 项目id:获取Beid参数
|
||||||
beid: this.formOptions.data.beid,
|
beid: this.formOptions.data.beid,
|
||||||
|
// 服务id数组
|
||||||
"services_id": ids
|
"services_id": ids
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("添加成功");
|
this.$mk.success("添加成功");
|
||||||
|
// 触发 commitProxy 的query方法 刷新服务列表
|
||||||
this.$refs.gridService.commitProxy('query')
|
this.$refs.gridService.commitProxy('query')
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 取消 返回
|
||||||
cancel() {
|
cancel() {
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,14 @@
|
||||||
<!-- 表格区 -->
|
<!-- 表格区 -->
|
||||||
<div class="gridPanel">
|
<div class="gridPanel">
|
||||||
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
||||||
<template #status="{ row }"><!-- 这里是自定义列 -->
|
|
||||||
<!-- 转换 row.status 的值 如果是true显示开,否则显示关-->
|
|
||||||
<a-switch :checked="row.status ? true : false" @change="onSwitch(row, 'status')" />
|
|
||||||
</template>
|
|
||||||
<template #auth_stop_date="{ row }"><!-- 这里是自定义列 -->
|
<template #auth_stop_date="{ row }"><!-- 这里是自定义列 -->
|
||||||
<!-- 转换 row.auth_stop_date 的值 将时间戳转换为日期格式 -->
|
<!-- 转换 row.auth_stop_date 的值 将时间戳转换为日期格式 -->
|
||||||
<span>{{ row.auth_stop_date | formatDateTime(row.auth_stop_date) }}</span>
|
<span>{{ row.auth_stop_date | formatDateTime(row.auth_stop_date) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #status="{ row }"><!-- 这里是自定义列 -->
|
||||||
|
<!-- 转换 row.status 的值 如果是true显示开,否则显示关-->
|
||||||
|
<a-switch :checked="row.status ? 1 : 0" @change="onSwitch(row, 'status')" />
|
||||||
|
</template>
|
||||||
<template #op="{ row }">
|
<template #op="{ row }">
|
||||||
<div class="oplinks">
|
<div class="oplinks">
|
||||||
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
||||||
|
|
@ -61,7 +61,7 @@ import BASE_URL from '@/services/base/api.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BaseConfigList',
|
name: 'BaseConfigList',
|
||||||
i18n: require('./i18n'),
|
i18n: require('./i18n'), // 国际化
|
||||||
props: {
|
props: {
|
||||||
pageMode: {
|
pageMode: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -70,41 +70,50 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
// 页面数据变量
|
// 页面数据
|
||||||
var pageData = {
|
var pageData = { // 页面数据变量
|
||||||
|
|
||||||
keyName: 'id',
|
keyName: 'id', // 主键字段名
|
||||||
actions: {
|
|
||||||
|
|
||||||
|
// 接口动作
|
||||||
|
actions: { // Api 接口地址
|
||||||
getList: `${BASE_URL.BASE_URL}/BaseCompany/v1/list`,
|
getList: `${BASE_URL.BASE_URL}/BaseCompany/v1/list`,
|
||||||
delete: `${BASE_URL.BASE_URL}/BaseCompany/v1/batchDelete`
|
delete: `${BASE_URL.BASE_URL}/BaseCompany/v1/batchDelete`,
|
||||||
|
open: `${BASE_URL.BASE_URL}/BaseCompany/v1/open`,
|
||||||
|
close: `${BASE_URL.BASE_URL}/BaseCompany/v1/close`,
|
||||||
},
|
},
|
||||||
|
|
||||||
start_time: 0,
|
start_time: 0, // 开始时间
|
||||||
end_time: 0,
|
end_time: 0, // 结束时间
|
||||||
|
|
||||||
|
|
||||||
//搜索区
|
//搜索区
|
||||||
searchFormData: {
|
searchFormData: {
|
||||||
title: '',
|
title: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 搜索区配置
|
||||||
searchRules: [
|
searchRules: [
|
||||||
{ key: "title", mode: "like" },
|
{ key: "title", mode: "like" },
|
||||||
{ key: "desc", mode: "like" }
|
{ key: "desc", mode: "like" }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
//搜索区
|
||||||
searchFormItems: [
|
searchFormItems: [
|
||||||
{
|
{
|
||||||
title: '左侧',
|
title: '左侧', // 标题
|
||||||
span: 20,
|
span: 20, // 栅格宽度
|
||||||
children: [
|
children: [ // 子项
|
||||||
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入标题' } } },
|
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入标题' } } },
|
||||||
{ field: 'desc', title: '描述', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入描述' } } },
|
{ field: 'desc', title: '描述', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入描述' } } },
|
||||||
{ span: 8, slots: { default: 'date' } },
|
{ span: 8, slots: { default: 'date' } }, // 自定义列
|
||||||
{
|
{
|
||||||
align: 'right', span: 4, itemRender: {
|
align: 'right', span: 4, itemRender: { // 按钮列
|
||||||
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } },
|
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, // 搜索按钮
|
||||||
{ props: { type: 'reset', content: '重置' } }]
|
{ props: { type: 'reset', content: '重置' } }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -113,13 +122,14 @@ export default {
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//数据区
|
//数据区
|
||||||
gridOptions: {
|
gridOptions: { // 表格配置
|
||||||
height: '100%',
|
height: '100%', // 表格高度 100% 会自动撑满父容器
|
||||||
id: 'datagrid_1',
|
stripe: true, // 启用斑马纹
|
||||||
|
id: 'datagrid_1', // 表格唯一标识
|
||||||
|
|
||||||
proxyConfig: {
|
// 接口获取数据
|
||||||
|
proxyConfig: { // 配置代理
|
||||||
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
||||||
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -148,53 +158,66 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'checkbox', width: 50 },
|
{ type: 'checkbox', width: 50 }, // 多选框
|
||||||
{ type: 'seq', width: 50 },
|
{ type: 'seq', width: 30 }, // 序号
|
||||||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true },
|
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true }, // logo 自定义列
|
||||||
{ field: 'title', sortable: true, title: '公司名称', width: 250 },
|
{ field: 'title', sortable: true, title: '公司名称', width: 250 }, // 公司名称
|
||||||
// 将 auth_stop_date 时间戵转换为日期格式
|
// 将 auth_stop_date 时间戵转换为日期格式
|
||||||
{ field: 'auth_stop_date', slots: { default: 'auth_stop_date' }, width: 120, sortable: true, title: '授权截止日期', showHeaderOverflow: true },
|
{ field: 'auth_stop_date', slots: { default: 'auth_stop_date' }, width: 120, sortable: true, title: '授权截止日期', showHeaderOverflow: true },
|
||||||
{ field: 'token', width: 120, sortable: true, title: 'token', showHeaderOverflow: true },
|
{ field: 'token', width: 120, sortable: true, title: 'token', showHeaderOverflow: true }, // 公司token
|
||||||
{ field: 'is_private_cloud', width: 110, sortable: true, title: '私有云', showHeaderOverflow: true },
|
{ field: 'is_private_cloud', width: 110, sortable: true, title: '私有云', showHeaderOverflow: true }, // 是否私有云
|
||||||
{ field: 'admin_count', width: 110, sortable: true, title: '用户数', showHeaderOverflow: true },
|
{ field: 'admin_count', width: 110, sortable: true, title: '用户数', showHeaderOverflow: true }, // 用户数
|
||||||
|
{ field: 'status', slots: { default: 'status' }, width: 80, sortable: true, title: '状态', showHeaderOverflow: true }, // 状态
|
||||||
|
{ field: 'create_time', width: 160, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
||||||
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并默认配置
|
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并表格数据
|
||||||
|
|
||||||
return pageData;
|
return pageData; // 返回页面数据
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 计算属性
|
||||||
computed: {
|
computed: {
|
||||||
|
// 页面描述
|
||||||
desc() {
|
desc() {
|
||||||
return this.$t('pageDesc')
|
return this.$t('pageDesc')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 创建完成
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(() => { // 在下次 DOM 更新循环结束之后执行延迟回调
|
this.$nextTick(() => { // 在下次 DOM 更新循环结束之后执行延迟回调
|
||||||
// 将表格和工具栏进行关联
|
// 将表格和工具栏进行关联
|
||||||
this.$refs.xGrid.connect(this.$refs.xToolbar)
|
this.$refs.xGrid.connect(this.$refs.xToolbar) // 将表格和工具栏进行关联
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 挂载完成
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
||||||
},
|
},
|
||||||
// 函数
|
// 动作
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 修改日期
|
||||||
onDateChange(date) { // 日期选择器事件
|
onDateChange(date) { // 日期选择器事件
|
||||||
if (date && date.length) { // 如果有值
|
if (date && date.length) { // 如果有值
|
||||||
this.start_time = parseInt(date[0]._d.getTime() / 1000); // 将日期转换为时间戳
|
this.start_time = parseInt(date[0]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
this.end_time = parseInt(date[1]._d.getTime() / 1000); // 将日期转换为时间戳
|
this.end_time = parseInt(date[1]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
} else {
|
} else { // 如果没有值
|
||||||
this.start_time = 0; // 将日期转换为时间戳
|
this.start_time = 0; // 将日期转换为时间戳
|
||||||
this.end_time = 0; // 将日期转换为时间戳
|
this.end_time = 0; // 将日期转换为时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取搜索参数
|
||||||
getSearchParms() { // 获取搜索参数
|
getSearchParms() { // 获取搜索参数
|
||||||
var rules = []; // 定义搜索参数
|
var rules = []; // 定义搜索参数
|
||||||
let findMode = k => { // 查找搜索模式
|
let findMode = k => { // 查找搜索模式
|
||||||
|
|
@ -220,52 +243,46 @@ export default {
|
||||||
}
|
}
|
||||||
return rules; // 返回搜索参数
|
return rules; // 返回搜索参数
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取选中行
|
||||||
getSelectdRow() { // 获取选中行
|
getSelectdRow() { // 获取选中行
|
||||||
let row = this.$refs.xGrid.getCurrentRecord(); // 获取当前行
|
let row = this.$refs.xGrid.getCurrentRecord(); // 获取当前行
|
||||||
if (!row) { // 如果没有选中行
|
if (!row) { // 如果没有选中行
|
||||||
let rows = this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
let rows = this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
if (rows && rows.length) { row = rows[0]; } // 如果有选中行就取第一行
|
if (rows && rows.length) { row = rows[0]; } // 如果有选中行就取第一行
|
||||||
}
|
}
|
||||||
return row;
|
return row; // 返回选中行
|
||||||
},
|
|
||||||
loadData({ params }) { // 加载数据
|
|
||||||
|
|
||||||
params.start_time = this.start_time;
|
|
||||||
params.end_time = this.end_time;
|
|
||||||
|
|
||||||
|
|
||||||
return this.$mk.getPagedData({ url: this.actions.getList, data: params });
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//add / log / setting
|
// 加载数据
|
||||||
toolbarClick(e) { // 工具栏点击事件
|
loadData({ params }) {
|
||||||
if (e.name == "add") {
|
params.start_time = this.start_time; // 开始时间
|
||||||
|
params.end_time = this.end_time; // 结束时间
|
||||||
|
return this.$mk.getPagedData({ url: this.actions.getList, data: params }); // 获取分页数据
|
||||||
|
},
|
||||||
|
|
||||||
this.$openPage("/BaseCompany/BaseCompanyAdd");
|
// 工具栏点击事件 add / log / setting
|
||||||
|
toolbarClick(e) {
|
||||||
|
if (e.name == "add") { // 如果是添加
|
||||||
|
this.$openPage("/BaseCompany/BaseCompanyAdd"); // 打开页面
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
pageEdit(row) { // 编辑
|
// 编辑
|
||||||
|
pageEdit(row) {
|
||||||
if (!row) { // 如果没有选中行
|
if (!row) { // 如果没有选中行
|
||||||
this.$mk.msg("请选择行"); // 提示
|
this.$mk.msg("请选择行"); // 提示
|
||||||
return; // 返回
|
return; // 返回
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]); // 打开页面
|
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]); // 打开页面
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 删除
|
||||||
pageDelete(row) { // 删除
|
pageDelete(row) {
|
||||||
|
|
||||||
|
|
||||||
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
|
let ids = []; // 定义id数组
|
||||||
let ids = [];
|
|
||||||
rows.forEach((row) => { // 遍历选中行
|
rows.forEach((row) => { // 遍历选中行
|
||||||
ids.push(row[this.keyName]); // 添加到数组中
|
ids.push(row[this.keyName]); // 将选择行的id添加到id数组
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!ids.length) { // 如果没有选中行
|
if (!ids.length) { // 如果没有选中行
|
||||||
|
|
@ -273,28 +290,27 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$mk.confirm('您确定要删除吗?').then(type => {
|
this.$mk.confirm('您确定要删除吗?').then(type => { // 确认删除
|
||||||
if (type == 'confirm') {
|
if (type == 'confirm') { // 如果确认删除
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.delete,
|
url: this.actions.delete, // 请求删除数据地址
|
||||||
loading: "删除中...",
|
loading: "删除中...", // 加载提示
|
||||||
data: {
|
data: {
|
||||||
ids: ids
|
ids: ids // 传递id数组
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => { // 成功
|
||||||
this.$mk.success("删除成功");
|
this.$mk.success("删除成功"); // 提示成功
|
||||||
this.onSearch();
|
this.onSearch(); // 重新加载数据
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg); // 提示错误信息
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onSearch() { // 搜索
|
|
||||||
this.$refs.xGrid.commitProxy('query')
|
// 搜索
|
||||||
|
onSearch() {
|
||||||
|
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
</template>
|
</template>
|
||||||
</vxe-form>
|
</vxe-form>
|
||||||
|
|
||||||
|
<!-- 如果是编辑模式,显示服务管理 -->
|
||||||
<a-tabs default-active-key="1" class="formtabs" v-if="isEdit">
|
<a-tabs default-active-key="1" class="formtabs" v-if="isEdit">
|
||||||
<a-tab-pane key="1" tab="服务管理">
|
<a-tab-pane key="1" tab="服务管理">
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ export default {
|
||||||
|
|
||||||
// 页面数据变量
|
// 页面数据变量
|
||||||
var pageData = {
|
var pageData = {
|
||||||
|
// 接口地址
|
||||||
actions: {
|
actions: {
|
||||||
create: `${BASE_URL.BASE_URL}/BaseConfig/v1/create`,
|
create: `${BASE_URL.BASE_URL}/BaseConfig/v1/create`,
|
||||||
update: `${BASE_URL.BASE_URL}/BaseConfig/v1/update`,
|
update: `${BASE_URL.BASE_URL}/BaseConfig/v1/update`,
|
||||||
|
|
@ -81,10 +81,13 @@ export default {
|
||||||
serviceOpen: `${BASE_URL.BASE_URL}/BaseConfig/v1/service/open`,
|
serviceOpen: `${BASE_URL.BASE_URL}/BaseConfig/v1/service/open`,
|
||||||
serviceClose: `${BASE_URL.BASE_URL}/BaseConfig/v1/service/close`
|
serviceClose: `${BASE_URL.BASE_URL}/BaseConfig/v1/service/close`
|
||||||
},
|
},
|
||||||
|
// 上传默认图片
|
||||||
uploadDefaultImg: null,
|
uploadDefaultImg: null,
|
||||||
|
// 主键id名
|
||||||
keyName: 'id',
|
keyName: 'id',
|
||||||
|
// 是否编辑模式
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
// 表单数据
|
||||||
formOptions: {
|
formOptions: {
|
||||||
data: {
|
data: {
|
||||||
"title": "",
|
"title": "",
|
||||||
|
|
@ -106,8 +109,9 @@ export default {
|
||||||
"slogan": "",
|
"slogan": "",
|
||||||
"en_slogan": ""
|
"en_slogan": ""
|
||||||
},
|
},
|
||||||
|
// 表单标题宽度
|
||||||
titleWidth: 100,
|
titleWidth: 100,
|
||||||
|
// 表单标题对齐方式
|
||||||
titleAlign: 'right',
|
titleAlign: 'right',
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -204,19 +208,22 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
// 设置图片默认地址
|
||||||
this.uploadDefaultImg = this.$mk.config.uploadDefaultImg;
|
this.uploadDefaultImg = this.$mk.config.uploadDefaultImg;
|
||||||
|
// 获取页面路由ID
|
||||||
let dataId = this.getDataId();
|
let dataId = this.getDataId();
|
||||||
|
// 如果有ID则为编辑模式 需要加载数据
|
||||||
if (dataId) {
|
if (dataId) {
|
||||||
|
// post请求数据
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.get,
|
url: this.actions.get,
|
||||||
loading: "加载中...",
|
loading: "加载中...",
|
||||||
data: {
|
data: {
|
||||||
id: parseInt(dataId)
|
id: parseInt(dataId)
|
||||||
}
|
}
|
||||||
}).then(a => {
|
}).then(a => { // 成功回调
|
||||||
this.formOptions.data = a.data.BaseConfig;
|
this.formOptions.data = a.data.BaseConfig;
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -226,63 +233,79 @@ export default {
|
||||||
},
|
},
|
||||||
// 函数
|
// 函数
|
||||||
methods: {
|
methods: {
|
||||||
|
// 查询文件列表
|
||||||
selectFile() {
|
selectFile() {
|
||||||
this.$refs.imageInput.click();
|
this.$refs.imageInput.click();
|
||||||
},
|
},
|
||||||
|
// 上传文件
|
||||||
upload() {
|
upload() {
|
||||||
const imgFile = this.$refs.imageInput.files[0]
|
const imgFile = this.$refs.imageInput.files[0] // 获取文件
|
||||||
this.$mk.uploadFile(imgFile, 'png', (url) => {
|
this.$mk.uploadFile(imgFile, 'png', (url) => { // 上传文件
|
||||||
this.formOptions.data.logo = url;
|
this.formOptions.data.logo = url; // 设置图片地址
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 切换服务状态
|
||||||
onSwitch(row) {
|
onSwitch(row) {
|
||||||
row.status = row.status ? 0 : 1;
|
row.status = row.status ? 0 : 1; // 切换状态
|
||||||
|
// post请求数据
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
|
// 通过判断状态来判断是开启还是关闭服务
|
||||||
url: row.status ? this.actions.serviceOpen : this.actions.serviceClose,
|
url: row.status ? this.actions.serviceOpen : this.actions.serviceClose,
|
||||||
|
loading: "加载中...",
|
||||||
data: { id: row.id },
|
data: { id: row.id },
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.msg(row.status ? "开启服务完成" : "停止服务完成");
|
this.$mk.msg(row.status ? "开启服务完成" : "停止服务完成");
|
||||||
this.$emit("callback", { success: true });
|
this.$emit("callback", { success: true });
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 获取页面路由ID
|
||||||
getDataId() {
|
getDataId() {
|
||||||
|
|
||||||
let dataId = this.dataId;
|
let dataId = this.dataId;
|
||||||
|
// 如果有路由ID则使用路由ID
|
||||||
if (this.$route.params.id) {
|
if (this.$route.params.id) {
|
||||||
dataId = this.$route.params.id;
|
dataId = this.$route.params.id;
|
||||||
}
|
}
|
||||||
return parseInt(dataId || 0);
|
return parseInt(dataId || 0); // 返回ID 格式化为数字
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载详情数据
|
||||||
loadDetailData1({ params }) {
|
loadDetailData1({ params }) {
|
||||||
|
params.start_time = 0; // 开始时间
|
||||||
|
params.end_time = 0; // 结束时间
|
||||||
params.start_time = 0;
|
params.beid = this.getDataId(); // 项目ID
|
||||||
params.end_time = 0;
|
// 获取项目的服务列表
|
||||||
params.beid = this.getDataId();
|
|
||||||
|
|
||||||
return this.$mk.getPagedData({ url: this.actions.serviceList, data: params });
|
return this.$mk.getPagedData({ url: this.actions.serviceList, data: params });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 返回
|
||||||
back() {
|
back() {
|
||||||
|
// 如果是新增页面则关闭当前页面
|
||||||
if (!this.isEdit) {
|
if (!this.isEdit) {
|
||||||
this.$closePage({
|
this.$closePage({
|
||||||
closeRoute: "/BaseConfig/BaseConfigAdd"
|
closeRoute: "/BaseConfig/BaseConfigAdd"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 如果是编辑页面则关闭当前页面
|
||||||
this.$closePage({
|
this.$closePage({
|
||||||
closeRoute: "/BaseConfig/BaseConfigUpdate"
|
closeRoute: "/BaseConfig/BaseConfigUpdate"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 打开列表页面
|
||||||
this.$openPage('/BaseConfig/BaseConfigList')
|
this.$openPage('/BaseConfig/BaseConfigList')
|
||||||
},
|
},
|
||||||
ok() {
|
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
ok() {
|
||||||
|
// 保存函数
|
||||||
let save = () => {
|
let save = () => {
|
||||||
|
// 判断是否是编辑模式 如果是编辑模式则使用更新接口 如果是新增模式则使用新增接口
|
||||||
let action = !this.isEdit ? this.actions.create : this.actions.update;
|
let action = !this.isEdit ? this.actions.create : this.actions.update;
|
||||||
|
// 如果是新增模式则需要添加ID 如果是编辑模式则不需要添加ID 如果是编辑模式则需要添加BaseConfig
|
||||||
let postdata = !this.isEdit ? Object.assign({ id: this.dataId }, this.formOptions.data) : Object.assign({}, this.formOptions.data);
|
let postdata = !this.isEdit ? Object.assign({ id: this.dataId }, this.formOptions.data) : Object.assign({}, this.formOptions.data);
|
||||||
|
// 如果是编辑模式则需要添加BaseConfig
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
postdata = { BaseConfig: postdata }
|
postdata = { BaseConfig: postdata }
|
||||||
}
|
}
|
||||||
|
|
@ -290,18 +313,18 @@ export default {
|
||||||
url: action,
|
url: action,
|
||||||
loading: "保存中...",
|
loading: "保存中...",
|
||||||
data: postdata,
|
data: postdata,
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("保存成功");
|
this.$mk.success("保存成功");
|
||||||
if (!this.isEdit) {
|
if (!this.isEdit) {
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 验证表单
|
||||||
this.$refs.xForm.validate((a) => {
|
this.$refs.xForm.validate((a) => {
|
||||||
|
// 如果有错误则提示错误
|
||||||
if (a) {
|
if (a) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (let name in a) {
|
for (let name in a) {
|
||||||
|
|
@ -310,59 +333,82 @@ export default {
|
||||||
}
|
}
|
||||||
this.$mk.error(`存在${count}项错误,请检查`);
|
this.$mk.error(`存在${count}项错误,请检查`);
|
||||||
} else {
|
} else {
|
||||||
|
// 如果没有错误则保存
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 移除服务
|
||||||
pageDel() {
|
pageDel() {
|
||||||
|
// 获取选中的行
|
||||||
let rows = this.$refs.gridService.getCheckboxRecords();
|
let rows = this.$refs.gridService.getCheckboxRecords();
|
||||||
|
// 获取选中行的ID
|
||||||
let ids = [];
|
let ids = [];
|
||||||
|
// 遍历选中行
|
||||||
rows.forEach((row) => {
|
rows.forEach((row) => {
|
||||||
|
// 添加ID
|
||||||
ids.push(row[this.keyName]);
|
ids.push(row[this.keyName]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// 如果没有选中行则提示错误
|
||||||
if (!ids.length) {
|
if (!ids.length) {
|
||||||
this.$mk.error("请选择行");
|
this.$mk.error("请选择行");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 弹出确认框
|
||||||
this.$mk.confirm('您确定要移除服务吗?').then(type => {
|
this.$mk.confirm('您确定要移除服务吗?').then(type => {
|
||||||
|
// 如果点击了确定按钮则执行移除服务
|
||||||
if (type == 'confirm') {
|
if (type == 'confirm') {
|
||||||
|
// 移除服务
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.serviceDel,
|
url: this.actions.serviceDel,
|
||||||
loading: "移除服务中...",
|
loading: "移除服务中...",
|
||||||
data: {
|
data: {
|
||||||
ids: ids
|
ids: ids
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("移除服务成功");
|
this.$mk.success("移除服务成功");
|
||||||
|
// 刷新服务列表
|
||||||
this.$refs.gridService.commitProxy('query')
|
this.$refs.gridService.commitProxy('query')
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 添加服务
|
||||||
pageAdd() {
|
pageAdd() {
|
||||||
|
// 打开服务列表页面
|
||||||
this.$mk.dialog.open({
|
this.$mk.dialog.open({
|
||||||
|
// 加载服务列表页面
|
||||||
page: serviceListPage,
|
page: serviceListPage,
|
||||||
|
// 设置页面标题
|
||||||
title: "选择要添加的服务",
|
title: "选择要添加的服务",
|
||||||
|
// 设置页面模式
|
||||||
pageMode: "select",
|
pageMode: "select",
|
||||||
|
// 设置页面宽度
|
||||||
width: 1000,
|
width: 1000,
|
||||||
|
// 设置页面高度
|
||||||
height: 870,
|
height: 870,
|
||||||
|
// 设置页面ID数据
|
||||||
dataId: 0,
|
dataId: 0,
|
||||||
|
// 设置回调函数
|
||||||
callback: ({ data }) => {
|
callback: ({ data }) => {
|
||||||
|
// 如果没有选中行则提示错误
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 获取选中行的ID
|
||||||
let ids = [];
|
let ids = [];
|
||||||
|
// 遍历选中行
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
ids.push(item.id)
|
ids.push(item.id)
|
||||||
})
|
})
|
||||||
|
// 添加服务
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.serviceAdd,
|
url: this.actions.serviceAdd,
|
||||||
loading: "添加中...",
|
loading: "添加中...",
|
||||||
|
|
@ -370,16 +416,18 @@ export default {
|
||||||
"beid": this.getDataId(),
|
"beid": this.getDataId(),
|
||||||
"service_id": ids
|
"service_id": ids
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => { // 成功回调
|
||||||
this.$mk.success("添加成功");
|
this.$mk.success("添加成功");
|
||||||
|
// 刷新数据
|
||||||
this.$refs.gridService.commitProxy('query')
|
this.$refs.gridService.commitProxy('query')
|
||||||
}).catch((a) => {
|
}).catch((a) => { // 失败回调
|
||||||
this.$mk.error(a.data.msg);
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 取消
|
||||||
cancel() {
|
cancel() {
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ export default {
|
||||||
// 函数
|
// 函数
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 日期选择
|
||||||
onDateChange(date) {
|
onDateChange(date) {
|
||||||
if (date && date.length) {
|
if (date && date.length) {
|
||||||
this.start_time = parseInt(date[0]._d.getTime() / 1000);
|
this.start_time = parseInt(date[0]._d.getTime() / 1000);
|
||||||
|
|
@ -188,6 +188,8 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取搜索条件
|
||||||
getSearchParms() {
|
getSearchParms() {
|
||||||
var rules = [];
|
var rules = [];
|
||||||
let findMode = k => {
|
let findMode = k => {
|
||||||
|
|
@ -204,7 +206,7 @@ export default {
|
||||||
if (mode == "like") {
|
if (mode == "like") {
|
||||||
value = "%" + value + "%";
|
value = "%" + value + "%";
|
||||||
}
|
}
|
||||||
rules.push({
|
rules.push({ // 搜索条件
|
||||||
column: key,
|
column: key,
|
||||||
mode: mode,
|
mode: mode,
|
||||||
value: value
|
value: value
|
||||||
|
|
@ -213,6 +215,8 @@ export default {
|
||||||
}
|
}
|
||||||
return rules;
|
return rules;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取选中行
|
||||||
getSelectdRow() {
|
getSelectdRow() {
|
||||||
let row = this.$refs.xGrid.getCurrentRecord();
|
let row = this.$refs.xGrid.getCurrentRecord();
|
||||||
if (!row) {
|
if (!row) {
|
||||||
|
|
@ -221,6 +225,8 @@ export default {
|
||||||
}
|
}
|
||||||
return row;
|
return row;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
loadData({ params }) {
|
loadData({ params }) {
|
||||||
|
|
||||||
params.start_time = this.start_time;
|
params.start_time = this.start_time;
|
||||||
|
|
@ -233,11 +239,11 @@ export default {
|
||||||
//add / log / setting
|
//add / log / setting
|
||||||
toolbarClick(e) {
|
toolbarClick(e) {
|
||||||
if (e.name == "add") {
|
if (e.name == "add") {
|
||||||
|
|
||||||
this.$openPage("/BaseConfig/BaseConfigAdd");
|
this.$openPage("/BaseConfig/BaseConfigAdd");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 编辑
|
||||||
pageEdit(row) {
|
pageEdit(row) {
|
||||||
|
|
||||||
if (!row) {
|
if (!row) {
|
||||||
|
|
@ -249,6 +255,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 删除
|
||||||
pageDelete(row) {
|
pageDelete(row) {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -490,6 +490,7 @@ export default {
|
||||||
dataId: row.id,
|
dataId: row.id,
|
||||||
callback: ({ success }) => {
|
callback: ({ success }) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
|
// 触发 commitProxy 的query方法 刷新表格
|
||||||
this.$refs.gridPermission.commitProxy('query')
|
this.$refs.gridPermission.commitProxy('query')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue