优化更新
This commit is contained in:
parent
0e92cfdcd1
commit
26bd72dcaa
|
|
@ -4,6 +4,11 @@ export default {
|
|||
|
||||
uploadDefaultImg: "http://zjdaomiimgtest.oss-cn-hangzhou.aliyuncs.com/2022/16709016422295584.png", // 默认图片
|
||||
|
||||
|
||||
ui :{
|
||||
searchFlex:4,
|
||||
toolbarFlex:1
|
||||
},
|
||||
|
||||
// 此处配置的是全局配置,在任何地方都可以使用 this.$mk.config.defaults 来获取配置
|
||||
defaults: { // 默认配置
|
||||
|
|
|
|||
|
|
@ -51,9 +51,15 @@ VXETable.formats.mixin({
|
|||
return '未审';
|
||||
},
|
||||
formatDateTime({ cellValue }) { // 日期时间格式化
|
||||
if(typeof(cellValue) == "number"){
|
||||
cellValue = new Date(cellValue * 1000);
|
||||
}
|
||||
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:ss:mm')
|
||||
},
|
||||
formatDate({ cellValue }) { // 日期格式化
|
||||
if(typeof(cellValue) == "number"){
|
||||
cellValue = new Date(cellValue * 1000);
|
||||
}
|
||||
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd')
|
||||
},
|
||||
formatNumber({ cellValue }) { // 数字格式化
|
||||
|
|
|
|||
|
|
@ -5,14 +5,25 @@ export default {
|
|||
|
||||
rules.forEach(rule => { // 循环规则
|
||||
if (rule.field in data) { // 如果字段在数据中
|
||||
let value = data[rule.field]; // 获取值
|
||||
let value = data[rule.field]; // 获取值
|
||||
if (rule.dataRule && rule.dataRule.type == "integer") { // 如果是整数
|
||||
data[rule.field] = parseInt(value); // 转换为整数
|
||||
}
|
||||
if (rule.dataRule && rule.dataRule.type == "timestamp") { // 如果是时间戳
|
||||
data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000); // 转换为时间戳
|
||||
}
|
||||
}
|
||||
if (rule.dataRule && rule.dataRule.type == "string") { // 如果是字符串
|
||||
if(data[rule.field] === true){
|
||||
data[rule.field] = "true";
|
||||
}
|
||||
else if(data[rule.field] === false){
|
||||
data[rule.field] = "false";
|
||||
}
|
||||
else if(data[rule.field]){
|
||||
data[rule.field] = data[rule.field] + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
.mk-toolbar .ant-btn {
|
||||
margin-right: 8px;
|
||||
margin-bottom: 12px;
|
||||
|
|
@ -42,4 +43,19 @@
|
|||
}
|
||||
.oplinks a{
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.footerbar-bottom{
|
||||
margin-top: 4px;
|
||||
padding-left: 8px;
|
||||
position:absolute;
|
||||
bottom:15px;
|
||||
right:15px;
|
||||
}
|
||||
.footerbar-bottom .ant-btn{
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.vxe-modal--content{
|
||||
position: relative;
|
||||
}
|
||||
|
|
@ -1,25 +1,24 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
|
||||
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</vxe-form>
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,30 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
|
|
@ -31,6 +36,12 @@
|
|||
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
||||
|
||||
|
||||
|
||||
<template #role="{ row }">
|
||||
<div v-if="row && row.user_role" class="roles">
|
||||
<a-tag v-for="item in row.user_role" :key="row.id + '_' + item.id">{{item.name}}</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #op="{ row }">
|
||||
<div class="oplinks">
|
||||
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
||||
|
|
@ -189,6 +200,7 @@ export default {
|
|||
{ field: 'nickname', sortable: true, title: '昵称', showHeaderOverflow: true },
|
||||
{ field: 'email', sortable: true, title: 'email', showHeaderOverflow: true },
|
||||
{ field: 'mobile', sortable: true, title: '电话', showHeaderOverflow: true },
|
||||
{ title: '角色', slots: { default: 'role' }, width: 150 },
|
||||
{ title: '角色设置', slots: { default: 'op2' }, width: 120 },
|
||||
{ title: '自定义权限设置', slots: { default: 'op3' }, width: 120 },
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
||||
|
|
@ -577,4 +589,7 @@ export default {
|
|||
height: 22px;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
.roles .ant-tag{
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -348,13 +348,14 @@ export default {
|
|||
|
||||
arr.push({
|
||||
id: item.id,
|
||||
desc:item.desc,
|
||||
parentId: "s-" + item.service_id,
|
||||
nodeTitle: item.title,
|
||||
service_id: item.service_id,
|
||||
permission_id: item.id,
|
||||
permission_code: item.permission_code
|
||||
})
|
||||
});
|
||||
});
|
||||
this.permissionData = arr;
|
||||
|
||||
}).catch((a) => {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</vxe-form>
|
||||
|
||||
|
||||
<div>
|
||||
<div class="footerbar-bottom">
|
||||
<a-button type="primary" @click="ok">确定</a-button>
|
||||
<a-button @click="cancel">取消</a-button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,25 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
|
||||
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block',width:120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
</vxe-form>
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
|
|
@ -34,7 +37,7 @@
|
|||
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
||||
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
||||
</div>
|
||||
</template> awS QSE8WQE
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
|
||||
|
|
@ -88,7 +91,7 @@ export default {
|
|||
span: 20,
|
||||
children: [
|
||||
{ field: 'title', title: '代理商名称', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入代理商名称' } } },
|
||||
{ field: 'short_name', title: '代理商简称', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入代理商简称' } } },
|
||||
{ field: 'short_name', title: '简称', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入代理商简称' } } },
|
||||
{ span: 8, slots: { default: 'date' } },
|
||||
{ align: 'right', span: 4, itemRender: { name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } },
|
||||
{ props: { type: 'reset', content: '重置' } }] } }
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
|
||||
|
|
@ -30,13 +31,9 @@
|
|||
<!-- 表格区 -->
|
||||
<div class="gridPanel">
|
||||
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
||||
<template #auth_stop_date="{ row }"><!-- 这里是自定义列 -->
|
||||
<!-- 转换 row.auth_stop_date 的值 将时间戳转换为日期格式 -->
|
||||
<span>{{ row.auth_stop_date | formatDateTime(row.auth_stop_date) }}</span>
|
||||
</template>
|
||||
<template #status="{ row }"><!-- 这里是自定义列 -->
|
||||
<!-- 转换 row.status 的值 如果是true显示开,否则显示关-->
|
||||
<a-switch :checked="row.status ? 1 : 0" @change="onSwitch(row, 'status')" />
|
||||
<a-switch :checked="row.status ? true : false" @change="onSwitch(row, 'status')" />
|
||||
</template>
|
||||
<template #op="{ row }">
|
||||
<div class="oplinks">
|
||||
|
|
@ -81,7 +78,7 @@ export default {
|
|||
getList: `${BASE_URL.BASE_URL}/BaseCompany/v1/list`,
|
||||
delete: `${BASE_URL.BASE_URL}/BaseCompany/v1/batchDelete`,
|
||||
open: `${BASE_URL.BASE_URL}/BaseCompany/v1/open`,
|
||||
close: `${BASE_URL.BASE_URL}/BaseCompany/v1/close`,
|
||||
close: `${BASE_URL.BASE_URL}/BaseCompany/v1/close`
|
||||
},
|
||||
|
||||
start_time: 0, // 开始时间
|
||||
|
|
@ -167,12 +164,12 @@ export default {
|
|||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true }, // logo 自定义列
|
||||
{ field: 'title', sortable: true, title: '公司名称', width: 250 }, // 公司名称
|
||||
// 将 auth_stop_date 时间戵转换为日期格式
|
||||
{ field: 'auth_stop_date', slots: { default: 'auth_stop_date' }, width: 120, sortable: true, title: '授权截止日期', showHeaderOverflow: true },
|
||||
{ field: 'auth_stop_date', formatter: "formatDate", width: 120, sortable: true, title: '授权截止日期', 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: '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 }, // 创建时间
|
||||
{ field: 'create_time', formatter: "formatDate", width: 160, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
||||
]
|
||||
}
|
||||
|
|
@ -206,6 +203,23 @@ export default {
|
|||
// 动作
|
||||
methods: {
|
||||
|
||||
// 切换服务状态
|
||||
onSwitch(row) {
|
||||
row.status = row.status ? 0 : 1; // 切换状态
|
||||
// post请求数据
|
||||
this.$mk.post({
|
||||
// 通过判断状态来判断是开启还是关闭服务
|
||||
url: row.status ? this.actions.open : this.actions.close,
|
||||
loading: "设置中...",
|
||||
data: { company_id: row.id },
|
||||
}).then(() => { // 成功回调
|
||||
this.$mk.msg(row.status ? "启用公司完成" : "停用公司完成");
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 修改日期
|
||||
onDateChange(date) { // 日期选择器事件
|
||||
if (date && date.length) { // 如果有值
|
||||
|
|
@ -255,21 +269,21 @@ export default {
|
|||
},
|
||||
|
||||
// 加载数据
|
||||
loadData({ params }) {
|
||||
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) {
|
||||
toolbarClick(e) {
|
||||
if (e.name == "add") { // 如果是添加
|
||||
this.$openPage("/BaseCompany/BaseCompanyAdd"); // 打开页面
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑
|
||||
pageEdit(row) {
|
||||
pageEdit(row) {
|
||||
if (!row) { // 如果没有选中行
|
||||
this.$mk.msg("请选择行"); // 提示
|
||||
return; // 返回
|
||||
|
|
@ -309,7 +323,7 @@ export default {
|
|||
},
|
||||
|
||||
// 搜索
|
||||
onSearch() {
|
||||
onSearch() {
|
||||
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -315,9 +315,7 @@ export default {
|
|||
data: postdata,
|
||||
}).then(() => { // 成功回调
|
||||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) {
|
||||
this.back();
|
||||
}
|
||||
this.back();
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,27 +1,29 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
|
||||
|
|
@ -39,11 +41,11 @@
|
|||
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<template #logo="{ row }">
|
||||
<img v-if="row.logo" :src="row.logo" style="width: 100px;"/>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
<img v-if="row.logo" :src="row.logo" style="width: 100px;" />
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
|
||||
|
|
@ -54,6 +56,8 @@
|
|||
<script>
|
||||
import BASE_URL from '@/services/base/api.js';
|
||||
|
||||
const projectSettingsPage = () => import("./projectSettings");
|
||||
|
||||
export default {
|
||||
name: 'BaseConfigList',
|
||||
i18n: require('./i18n'),
|
||||
|
|
@ -147,7 +151,7 @@ export default {
|
|||
{ type: 'checkbox', width: 50 },
|
||||
{ type: 'seq', width: 50 },
|
||||
{ field: 'title', sortable: true, title: '标题' },
|
||||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true },
|
||||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true },
|
||||
{ field: 'domain', sortable: true, title: '网址域名', showHeaderOverflow: true },
|
||||
{ field: 'token', sortable: true, title: 'token', showHeaderOverflow: true },
|
||||
{ field: 'desc', sortable: true, title: '描述', showHeaderOverflow: true },
|
||||
|
|
@ -169,7 +173,7 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
// 将表格和工具栏进行关联
|
||||
this.$refs.xGrid.connect(this.$refs.xToolbar)
|
||||
});
|
||||
});
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
|
|
@ -188,7 +192,28 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
|
||||
openProjectSettings() {
|
||||
let row = this.getSelectdRow();
|
||||
if (!row) {
|
||||
this.$mk.msg("请选择行");
|
||||
return;
|
||||
}
|
||||
this.$mk.dialog.open({
|
||||
page: projectSettingsPage,
|
||||
title: "项目配置",
|
||||
pageOptions: {
|
||||
beid: row.id
|
||||
},
|
||||
width: 800,
|
||||
height: 600,
|
||||
dataId: 0,
|
||||
callback: ({ success }) => {
|
||||
if (success) {
|
||||
this.$refs.gridRouter.commitProxy('query')
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取搜索条件
|
||||
getSearchParms() {
|
||||
var rules = [];
|
||||
|
|
@ -241,6 +266,9 @@ export default {
|
|||
if (e.name == "add") {
|
||||
this.$openPage("/BaseConfig/BaseConfigAdd");
|
||||
}
|
||||
if (e.name == "setting") {
|
||||
this.openProjectSettings();
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑
|
||||
|
|
|
|||
|
|
@ -0,0 +1,190 @@
|
|||
<template>
|
||||
<div class="page-body router-edit-page">
|
||||
|
||||
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
</vxe-form>
|
||||
|
||||
|
||||
<div class="footerbar-bottom">
|
||||
<a-button type="primary" @click="ok">确定</a-button>
|
||||
<a-button @click="cancel">取消</a-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BASE_URL from '@/services/base/api.js';
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
pageMode: {
|
||||
type: String,
|
||||
default: "edit"
|
||||
},
|
||||
pageOptions: {
|
||||
type: Object
|
||||
},
|
||||
dataId: {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
// 页面数据变量
|
||||
var pageData = {
|
||||
|
||||
actions: {
|
||||
save: `${BASE_URL.BASE_URL}/BaseConfig/v1/project/settings/update`,
|
||||
get: `${BASE_URL.BASE_URL}/BaseConfig/v1/project/settings`
|
||||
},
|
||||
|
||||
beid: 0,
|
||||
parentName: '',
|
||||
|
||||
formOptions: {
|
||||
data: {
|
||||
},
|
||||
|
||||
titleWidth: 200,
|
||||
titleAlign: 'right',
|
||||
|
||||
rules: {
|
||||
},
|
||||
|
||||
items: [
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||
|
||||
return pageData;
|
||||
},
|
||||
created() {
|
||||
|
||||
this.beid = this.pageOptions.beid;
|
||||
this.$mk.post({
|
||||
url: this.actions.get,
|
||||
loading: "加载中...",
|
||||
data: {
|
||||
beid: this.beid
|
||||
}
|
||||
}).then(a => {
|
||||
|
||||
let items = [];
|
||||
let data = {};
|
||||
let getName = (info) => {
|
||||
for (let name in info) {
|
||||
return name;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
a.data.project_settings.forEach(o => {
|
||||
let name = getName(o.setting);
|
||||
if (!name) return;
|
||||
let item = { field: name, title: o.title, span: 24, itemRender: { name: '$input', props: { placeholder: o.desc } } };
|
||||
|
||||
if (o.type == "bool") {
|
||||
item.itemRender.name = "$switch";
|
||||
item.dataRule = { type: "string" };
|
||||
data[name] = o.setting[name] === "true";
|
||||
}
|
||||
else if (o.type == "integer") {
|
||||
item.itemRender.props.type = "integer";
|
||||
item.dataRule = { type: "integer" };
|
||||
|
||||
data[name] = parseInt(o.setting[name]);
|
||||
}
|
||||
else {
|
||||
data[name] = o.setting[name];
|
||||
}
|
||||
items.push(item);
|
||||
});
|
||||
|
||||
this.formOptions.items = items;
|
||||
this.formOptions.data = data;
|
||||
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.data.msg);
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 函数
|
||||
methods: {
|
||||
|
||||
|
||||
ok() {
|
||||
|
||||
let save = () => {
|
||||
let action = this.actions.save;
|
||||
let postdata = Object.assign({}, this.formOptions.data);
|
||||
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||
|
||||
let saveData = {
|
||||
"beid": this.beid,
|
||||
"setting": [
|
||||
]
|
||||
};
|
||||
for (let name in postdata) {
|
||||
saveData.setting.push({
|
||||
key: name,
|
||||
value: postdata[name]
|
||||
})
|
||||
}
|
||||
|
||||
this.$mk.post({
|
||||
url: action,
|
||||
loading: "保存中...",
|
||||
data: saveData,
|
||||
}).then(() => {
|
||||
this.$mk.success("保存成功");
|
||||
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.data.msg);
|
||||
});
|
||||
};
|
||||
|
||||
this.$refs.xForm.validate((a) => {
|
||||
|
||||
if (a) {
|
||||
let count = 0;
|
||||
for (let name in a) {
|
||||
a[name];
|
||||
count++;
|
||||
}
|
||||
this.$mk.error(`存在${count}项错误,请检查`);
|
||||
} else {
|
||||
save();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.$emit("callback", {});
|
||||
},
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
watch: {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.router-edit-page .vxe-pulldown {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,19 +1,25 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<a-row type="flex">
|
||||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar v-if="pageMode != 'select'" @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar v-if="pageMode != 'select'" @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||
<a-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
||||
<vxe-toolbar ref="xToolbar" custom>
|
||||
<template #buttons>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</vxe-form>
|
||||
|
||||
|
||||
<div>
|
||||
<div class="footerbar-bottom">
|
||||
<a-button type="primary" @click="ok">确定</a-button>
|
||||
<a-button @click="cancel">取消</a-button>
|
||||
</div>
|
||||
|
|
@ -99,15 +99,11 @@ export default {
|
|||
},
|
||||
|
||||
items: [
|
||||
{
|
||||
title: '左侧',
|
||||
children: [
|
||||
{ field: 'router', title: '路由Name', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路由名' } } },
|
||||
{ title: '父级路由', span: 24, slots: { default: 'parent_router' } },
|
||||
{ field: 'name', title: '名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路由标题' } } },
|
||||
{ field: 'path', title: '路径', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路径' } } }
|
||||
]
|
||||
}
|
||||
{ field: 'router', title: '路由Name', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路由名' } } },
|
||||
{ title: '父级路由', span: 24, slots: { default: 'parent_router' } },
|
||||
{ field: 'name', title: '名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路由标题' } } },
|
||||
{ field: 'path', title: '路径', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入路径' } } },
|
||||
{ field: 'sort', dataRule: { type: "integer" }, title: '排序', span: 24, itemRender: { name: '$input', props: { type: "integer", placeholder: '请输入路径' } } }
|
||||
]
|
||||
},
|
||||
|
||||
|
|
@ -157,8 +153,8 @@ export default {
|
|||
reserve: true,
|
||||
highlight: true
|
||||
},
|
||||
columns: [
|
||||
{ field: 'router', treeNode: true, sortable: true, title: '路由名' },
|
||||
columns: [
|
||||
{ field: 'router', treeNode: true, sortable: true, title: '路由名' },
|
||||
{ field: 'name', sortable: true, title: '路由标题', showHeaderOverflow: true },
|
||||
{ field: 'path', sortable: true, title: '路径', showHeaderOverflow: true },
|
||||
{ field: 'parent_router.name', sortable: true, title: '上级路由', showHeaderOverflow: true }
|
||||
|
|
@ -167,7 +163,7 @@ export default {
|
|||
|
||||
};
|
||||
pageData.gridRouterParentOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridRouterParentOptions);
|
||||
pageData.formOptions = Object.assign({},this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||
|
||||
return pageData;
|
||||
},
|
||||
|
|
@ -184,10 +180,10 @@ export default {
|
|||
}
|
||||
}).then(a => {
|
||||
this.formOptions.data = a.data.router;
|
||||
if(this.formOptions.data.parent_router){
|
||||
if (this.formOptions.data.parent_router) {
|
||||
this.parentName = this.formOptions.data.parent_router.name;
|
||||
}
|
||||
|
||||
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.data.msg);
|
||||
});
|
||||
|
|
@ -223,6 +219,8 @@ export default {
|
|||
if (this.pageMode != "add") {
|
||||
//postdata = { BaseService:postdata}
|
||||
}
|
||||
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||
this.$mk.post({
|
||||
url: action,
|
||||
loading: "保存中...",
|
||||
|
|
@ -280,7 +278,7 @@ export default {
|
|||
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.router-edit-page .vxe-pulldown {
|
||||
width: 100%;
|
||||
.router-edit-page .vxe-pulldown {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ const BaseConfigRouterMap = {
|
|||
icon: 'idcard',
|
||||
path: '/BaseConfig/BaseConfigList',
|
||||
component: () => import('@/pages/Middle/Base/BaseConfig/list'),
|
||||
meta:{
|
||||
page:{ cacheAble:false}
|
||||
},
|
||||
authority: {
|
||||
permission:[],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const view = {
|
|||
},
|
||||
workplace: {
|
||||
name: '工作台',
|
||||
path:'/dashboard/workplace',
|
||||
icon: 'idcard',
|
||||
component: () => import('@/pages/dashboard/workplace')
|
||||
},
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ function filterRoutesConfig(routes, permissions) {
|
|||
|
||||
// 判断是否有权限
|
||||
function hasPermission(permissions, route) {
|
||||
if (route.meta && route.meta.authority.permission) {
|
||||
if (route.meta && route.meta.authority && route.meta.authority.permission) {
|
||||
return permissions.some(permission => {
|
||||
return route.meta.authority.permission === '' || route.meta.authority.permission === permission
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue