This commit is contained in:
parent
f00bb5f4a4
commit
a986369529
|
|
@ -161,7 +161,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true }, // logo 自定义列
|
||||
{ field: 'title', sortable: true, title: '公司名称', width: 250 }, // 公司名称
|
||||
// 将 auth_stop_date 时间戵转换为日期格式
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
<div class="split_wrapper">
|
||||
<div class="page-body">
|
||||
<div class="split_wrapper">
|
||||
<div class="left">
|
||||
<div class="treepanel" :style="'height:' + tableHeight + 'px'">
|
||||
<div class="treepanel-header">
|
||||
|
|
@ -15,8 +15,9 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="treepanel-content">
|
||||
<a-tree :replaceFields="{children:'mes_enum', title:'title', key:'key'}" v-if="!treeLoading" show-line :tree-data="treeData" :default-expand-all="true" :block-node="true"
|
||||
@select="onTreeSelect" :default-selected-keys="selectedKeys">
|
||||
<a-tree :replaceFields="{ children: 'mes_enum', title: 'title', key: 'key' }" v-if="!treeLoading" show-line
|
||||
:tree-data="treeData" :default-expand-all="true" :block-node="true" @select="onTreeSelect"
|
||||
:default-selected-keys="selectedKeys">
|
||||
<a-icon slot="switcherIcon" type="down" />
|
||||
</a-tree>
|
||||
</div>
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
</div>
|
||||
<vxe-table border show-overflow keep-source ref="xTable" :height="tableHeight" :data="detailsData"
|
||||
:export-config="{}" :edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false }">
|
||||
<vxe-column width="80">
|
||||
<vxe-column width="100">
|
||||
<template #default="{ row }">
|
||||
<div class="oplinks">
|
||||
<a @click.stop="pageAdd(row)" title="新增">
|
||||
|
|
@ -48,7 +49,7 @@
|
|||
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -83,23 +84,23 @@ export default {
|
|||
// 页面数据变量
|
||||
var pageData = {
|
||||
|
||||
modelName: "",
|
||||
modelName: "", // 模块名称
|
||||
|
||||
actions: {
|
||||
treedata: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/list`,
|
||||
delete: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/batchDelete`,
|
||||
listdata: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`,
|
||||
save: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/batchHandle`,
|
||||
treedata: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/list`, // 树数据
|
||||
delete: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/batchDelete`, // 删除
|
||||
listdata: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`, // 列表数据
|
||||
save: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/batchHandle`, // 保存
|
||||
},
|
||||
tipTimes: 0,
|
||||
detailsData: [
|
||||
tipTimes: 0, // 提示次数
|
||||
detailsData: [ // 详情数据
|
||||
],
|
||||
sourceDetailsData :[
|
||||
sourceDetailsData: [ // 原始详情数据
|
||||
|
||||
],
|
||||
treeData: [],
|
||||
treeLoading: true,
|
||||
deletedDetailsData: [
|
||||
treeData: [], // 树数据
|
||||
treeLoading: true, // 树加载中
|
||||
deletedDetailsData: [ // 删除的详情数据
|
||||
|
||||
],
|
||||
selectedKeys: [],
|
||||
|
|
@ -113,10 +114,10 @@ export default {
|
|||
},
|
||||
created() {
|
||||
|
||||
this.$nextTick(() => {
|
||||
|
||||
this.tableHeight = this.$mk.getWindowSize().height - this.$mk.getOffsetTop(this.$refs.xTable.$el) - 40;
|
||||
this.treeInit();
|
||||
this.$nextTick(() => { // 页面加载完成后
|
||||
// 获取页面数据
|
||||
this.tableHeight = this.$mk.getWindowSize().height - this.$mk.getOffsetTop(this.$refs.xTable.$el) - 40; // 设置表格高度
|
||||
this.treeInit(); // 初始化树
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -126,9 +127,9 @@ export default {
|
|||
methods: {
|
||||
|
||||
|
||||
treeInit() {
|
||||
this.treeLoading = true;
|
||||
this.$mk.post({
|
||||
treeInit() { // 初始化树
|
||||
this.treeLoading = true; // 树加载中
|
||||
this.$mk.post({ // 获取树数据
|
||||
url: this.actions.treedata,
|
||||
loading: "加载中...",
|
||||
data: {
|
||||
|
|
@ -146,12 +147,13 @@ export default {
|
|||
|
||||
let treedata = {
|
||||
title: "全部",
|
||||
titleSys: "系统预置",
|
||||
key: "root"
|
||||
};
|
||||
treedata[childrenFieldName] = r.data.MesEnum;
|
||||
treedata[childrenFieldName] = r.data.MesEnum; // 设置树数据
|
||||
|
||||
|
||||
function formatTreedata(d) {
|
||||
function formatTreedata(d) { // 格式化树数据
|
||||
if (d.id) {
|
||||
d.key = d.id.toString();
|
||||
} else {
|
||||
|
|
@ -171,7 +173,8 @@ export default {
|
|||
});
|
||||
|
||||
},
|
||||
treeAdd() {
|
||||
|
||||
treeAdd() { // 新增树节点
|
||||
this.$mk.dialog.open({
|
||||
page: () => import("./treeEdit"),
|
||||
title: "新增-枚举分类",
|
||||
|
|
@ -181,13 +184,14 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
treeEdit() {
|
||||
|
||||
treeEdit() { // 编辑树节点
|
||||
if (!this.selectedKey || this.selectedKey == "root") {
|
||||
this.$mk.error("请先选择枚举分类");
|
||||
return;
|
||||
}
|
||||
let node = this.findTreeNode(this.selectedKey);
|
||||
|
||||
|
||||
|
||||
this.$mk.dialog.open({
|
||||
page: () => import("./treeEdit"),
|
||||
|
|
@ -198,7 +202,10 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
treeDelete() {
|
||||
|
||||
|
||||
|
||||
treeDelete() { // 删除树节点
|
||||
if (!this.selectedKey || this.selectedKey == "root") {
|
||||
this.$mk.error("请先选择枚举分类");
|
||||
return;
|
||||
|
|
@ -231,7 +238,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getDataId() {
|
||||
getDataId() { // 获取数据id
|
||||
|
||||
let dataId = this.dataId;
|
||||
if (this.$route.params.id) {
|
||||
|
|
@ -240,14 +247,13 @@ export default {
|
|||
|
||||
return dataId;
|
||||
},
|
||||
|
||||
onTreeSelect(selectedKeys) {
|
||||
onTreeSelect(selectedKeys) { // 树选择事件
|
||||
if (selectedKeys && selectedKeys[0]) {
|
||||
this.selectedKey = selectedKeys[0];
|
||||
this.loadData(selectedKeys[0]);
|
||||
}
|
||||
},
|
||||
findTreeNode(key) {
|
||||
findTreeNode(key) { // 查找树节点
|
||||
var find = (items) => {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (items[i].key == key) {
|
||||
|
|
@ -263,7 +269,7 @@ export default {
|
|||
};
|
||||
return find(this.treeData);
|
||||
},
|
||||
getAllChildrenIds(items) {
|
||||
getAllChildrenIds(items) { // 获取所有子节点id
|
||||
let ids = [];
|
||||
let eachItems = (arr) => {
|
||||
arr.forEach(item => {
|
||||
|
|
@ -279,13 +285,13 @@ export default {
|
|||
eachItems(items);
|
||||
return ids;
|
||||
},
|
||||
reloadData() {
|
||||
reloadData() { // 重新加载数据
|
||||
if (this.selectedKey) {
|
||||
this.loadData(this.selectedKey);
|
||||
}
|
||||
|
||||
},
|
||||
loadData(key) {
|
||||
loadData(key) { // 加载数据
|
||||
|
||||
let postLoad = (id) => {
|
||||
this.$mk.post({
|
||||
|
|
@ -309,13 +315,13 @@ export default {
|
|||
useBigInt: true
|
||||
}).then(a => {
|
||||
console.log(a.data.MesEnumValue)
|
||||
this.sourceDetailsData = a.data.MesEnumValue || [];
|
||||
this.sourceDetailsData = a.data.MesEnumValue || [];
|
||||
let ds = [];
|
||||
this.sourceDetailsData.forEach(item=>{
|
||||
this.sourceDetailsData.forEach(item => {
|
||||
ds.push({
|
||||
id : item.id.toString(),
|
||||
code : item.code,
|
||||
name : item.name
|
||||
id: item.id.toString(),
|
||||
code: item.code,
|
||||
name: item.name
|
||||
})
|
||||
});
|
||||
this.deletedDetailsData = [];
|
||||
|
|
@ -334,28 +340,28 @@ export default {
|
|||
|
||||
},
|
||||
|
||||
findSourceInfo(idStr){
|
||||
for(var i =0;i<this.sourceDetailsData.length;i++){
|
||||
findSourceInfo(idStr) { // 查找原始数据
|
||||
for (var i = 0; i < this.sourceDetailsData.length; i++) {
|
||||
let o = this.sourceDetailsData[i];
|
||||
if(o.id.toString() == idStr){
|
||||
if (o.id.toString() == idStr) {
|
||||
return o;
|
||||
}
|
||||
}
|
||||
},
|
||||
ok() {
|
||||
ok() { // 保存
|
||||
|
||||
let save = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
if (!this.selectedKey || this.selectedKey == "root") {
|
||||
this.$mk.error("请先选择枚举分类");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.$refs.xTable.clearEdit();
|
||||
|
||||
|
||||
let node = this.findTreeNode(this.selectedKey);
|
||||
|
||||
let ds = JSON.parse(JSON.stringify(this.detailsData));
|
||||
|
|
@ -366,23 +372,23 @@ export default {
|
|||
deleteList: this.deletedDetailsData
|
||||
};
|
||||
|
||||
ds.forEach(item => {
|
||||
ds.forEach(item => {
|
||||
delete item._X_ROW_KEY;
|
||||
|
||||
item.enum_id = node.id;
|
||||
if (item.id && item.id != "0") {
|
||||
let source = this.findSourceInfo(item.id);
|
||||
let source = this.findSourceInfo(item.id);
|
||||
item.id = source.id;
|
||||
postdata.updateList.push(item);
|
||||
} else {
|
||||
} else {
|
||||
postdata.insertList.push(item);
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$mk.post({
|
||||
url: this.actions.save,
|
||||
loading: "保存中...",
|
||||
data: postdata,
|
||||
useBigInt:true
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
if (a.code == "200") {
|
||||
this.$mk.success("保存成功");
|
||||
|
|
@ -405,10 +411,10 @@ export default {
|
|||
back() {
|
||||
},
|
||||
|
||||
cancel() {
|
||||
cancel() { // 取消
|
||||
this.back();
|
||||
},
|
||||
pageAdd(row) {
|
||||
pageAdd(row) { // 新增
|
||||
|
||||
const $table = this.$refs.xTable
|
||||
const record = {
|
||||
|
|
@ -424,7 +430,7 @@ export default {
|
|||
|
||||
},
|
||||
|
||||
pageDelete(row) {
|
||||
pageDelete(row) { // 删除
|
||||
const $table = this.$refs.xTable;
|
||||
if (row.id) {
|
||||
this.deletedDetailsData.push(row.id)
|
||||
|
|
@ -446,7 +452,7 @@ export default {
|
|||
background: white;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
||||
.toolbarbtns .ant-btn {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default {
|
|||
data: {
|
||||
"name": "",
|
||||
"code": "",
|
||||
enum_id:"0"
|
||||
enum_id: "0"
|
||||
},
|
||||
|
||||
titleWidth: 150,
|
||||
|
|
@ -56,6 +56,11 @@ export default {
|
|||
|
||||
items: [
|
||||
{ field: 'name', title: '名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入名称' } } },
|
||||
// 是否系统内置 type 开为1,关为0
|
||||
{ field: 'type', title: '是否系统内置', span: 24, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } } },
|
||||
|
||||
// 系统内置名称 sys_name
|
||||
{ field: 'sys_name', title: '系统内置名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入系统内置名称' } } },
|
||||
{ field: 'code', title: '编号', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入编号' } } },
|
||||
{ field: 'enum_id', title: '上级分类', span: 24, itemRender: { name: '$select', props: { placeholder: '请输入上级分类', options: [] } } }
|
||||
]
|
||||
|
|
@ -77,10 +82,10 @@ export default {
|
|||
},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
if(a.data.mes_enum.enum_id){
|
||||
a.data.mes_enum.enum_id = a.data.mes_enum.enum_id.toString();
|
||||
}else{
|
||||
a.data.mes_enum.enum_id = "0"
|
||||
if (a.data.mes_enum.enum_id) {
|
||||
a.data.mes_enum.enum_id = a.data.mes_enum.enum_id.toString();
|
||||
} else {
|
||||
a.data.mes_enum.enum_id = "0"
|
||||
}
|
||||
this.formOptions.data = a.data.mes_enum;
|
||||
}).catch((a) => {
|
||||
|
|
@ -92,6 +97,7 @@ export default {
|
|||
// 函数
|
||||
methods: {
|
||||
|
||||
// 加载枚举
|
||||
loadEmuns() {
|
||||
this.$mk.post({
|
||||
url: this.actions.list,
|
||||
|
|
@ -112,15 +118,15 @@ export default {
|
|||
]
|
||||
},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
}).then(a => {
|
||||
|
||||
let options_emuns = [{ value: "0", label: "选择上级分类" }];
|
||||
console.log(a.data.MesEnum)
|
||||
if (a.data.MesEnum) {
|
||||
a.data.MesEnum.forEach(item => {
|
||||
options_emuns.push({ value: item.id.toString(), id:item.id, label: item.name });
|
||||
options_emuns.push({ value: item.id.toString(), id: item.id, label: item.name });
|
||||
});
|
||||
}
|
||||
}
|
||||
this.formOptions.items[2].itemRender.props.options = options_emuns;
|
||||
|
||||
});
|
||||
|
|
@ -129,6 +135,7 @@ export default {
|
|||
loadData() {
|
||||
},
|
||||
|
||||
// 保存
|
||||
ok() {
|
||||
|
||||
let save = () => {
|
||||
|
|
@ -136,11 +143,11 @@ export default {
|
|||
let postdata = Object.assign({ id: this.dataId }, this.formOptions.data);
|
||||
|
||||
let options = this.formOptions.items[2].itemRender.props.options;
|
||||
options.forEach(item=>{
|
||||
if(item.value == postdata.enum_id){
|
||||
options.forEach(item => {
|
||||
if (item.value == postdata.enum_id) {
|
||||
postdata.enum_id = item.id;
|
||||
}
|
||||
});
|
||||
});
|
||||
this.$mk.post({
|
||||
url: action,
|
||||
loading: "保存中...",
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
<a-tabs v-model="tabKey" hide-add>
|
||||
<a-tab-pane key="1" tab="基础信息">
|
||||
|
||||
<!-- 基础信息 Start -->
|
||||
<vxe-form :data="options.formOptions.data" ref="xForm" :title-width="options.formOptions.titleWidth"
|
||||
:title-align="options.formOptions.titleAlign" :rules="options.formOptions.rules"
|
||||
:items="options.formOptions.items" titleColon>
|
||||
<template #sort_id="{}">
|
||||
<template #sort_id="{ }">
|
||||
<vxe-pulldown style="width:100%" ref="pulldownParent" transfer>
|
||||
<template #default>
|
||||
<vxe-input v-model="sortName" suffix-icon="vxe-icon-search" placeholder="选择分类" @keyup="pulldownKeyupEvent"
|
||||
|
|
@ -22,17 +22,18 @@
|
|||
</vxe-pulldown>
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
||||
<!-- 基础信息 End -->
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="料品属性">
|
||||
|
||||
|
||||
|
||||
<a-tab-pane key="2" tab="料品属性">
|
||||
<!-- 料品属性 Start -->
|
||||
<vxe-form :data="options.formOptions2.data" ref="xForm2" :title-width="options.formOptions2.titleWidth"
|
||||
:title-align="options.formOptions2.titleAlign" :rules="options.formOptions2.rules"
|
||||
:items="options.formOptions2.items" titleColon>
|
||||
</vxe-form>
|
||||
|
||||
|
||||
|
||||
<!-- 料品属性 End -->
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
|
|
@ -65,16 +66,16 @@ export default {
|
|||
data() {
|
||||
|
||||
let pageData = {
|
||||
actions: {
|
||||
list: `${BASE_URL.BASE_URL}/MesMaterials/v1/mes/materials/sort/list`,
|
||||
actions: { // Api 接口地址
|
||||
list: `${BASE_URL.BASE_URL}/MesMaterials/v1/mes/materials/sort/list`, // 料品分类列表
|
||||
},
|
||||
tabKey: '1',
|
||||
sortName: '',
|
||||
custom_attribute_value: [],
|
||||
attributes: [],
|
||||
gridParentOptions: {
|
||||
height: 400,
|
||||
id: 'datagrid_router_parent_1',
|
||||
tabKey: '1', // 当前tab页
|
||||
sortName: '', // 分类名称
|
||||
custom_attribute_value: [], // 自定义属性值
|
||||
attributes: [], // 自定义属性
|
||||
gridParentOptions: { // 分类列表
|
||||
height: 400, // 表格高度
|
||||
id: 'datagrid_router_parent_1', // 表格ID
|
||||
|
||||
proxyConfig: {
|
||||
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
||||
|
|
@ -86,7 +87,7 @@ export default {
|
|||
// 接收Promise
|
||||
ajax: {
|
||||
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
||||
query: (options) => {
|
||||
query: (options) => { // 查询事件
|
||||
const { page, sorts } = options;
|
||||
var params = {};
|
||||
params.page = page.currentPage;
|
||||
|
|
@ -101,25 +102,25 @@ export default {
|
|||
})
|
||||
});
|
||||
}
|
||||
return this.loadParentGrid({ params });
|
||||
return this.loadParentGrid({ params }); // 加载数据
|
||||
}
|
||||
}
|
||||
},
|
||||
sortConfig: {
|
||||
sortConfig: { // 排序配置
|
||||
},
|
||||
treeConfig: {
|
||||
transform: true,
|
||||
expandAll: true,
|
||||
rowField: 'id',
|
||||
parentField: 'parent_id'
|
||||
treeConfig: { // 树形结构配置
|
||||
transform: true, // 是否将数据转换为树形结构
|
||||
expandAll: true, // 是否默认展开所有节点
|
||||
rowField: 'id', // 行数据中的唯一字段名
|
||||
parentField: 'parent_id' // 行数据中的父节点字段名
|
||||
},
|
||||
checkboxConfig: {
|
||||
reserve: true,
|
||||
highlight: true
|
||||
checkboxConfig: { // 复选框配置
|
||||
reserve: true, // 保留之前的选中状态
|
||||
highlight: true // 选中行高亮
|
||||
},
|
||||
columns: [
|
||||
{ field: 'name', sortable: true, title: '分类名', showHeaderOverflow: true, treeNode: true },
|
||||
{ field: 'code', sortable: true, title: '编号', showHeaderOverflow: true }
|
||||
{ field: 'name', sortable: true, title: '分类名', showHeaderOverflow: true, treeNode: true }, // 树形结构
|
||||
{ field: 'code', sortable: true, title: '编号', showHeaderOverflow: true } // 编号
|
||||
]
|
||||
},
|
||||
options: {}
|
||||
|
|
@ -130,7 +131,7 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
desc() {
|
||||
desc() { // 描述
|
||||
return this.$t('editPageDesc')
|
||||
}
|
||||
},
|
||||
|
|
@ -138,14 +139,14 @@ export default {
|
|||
|
||||
created() {
|
||||
|
||||
this.optionsInit();
|
||||
this.dataInit();
|
||||
this.optionsInit(); // 初始化页面配置
|
||||
this.dataInit(); // 初始化页面数据
|
||||
|
||||
},
|
||||
// 函数
|
||||
methods: {
|
||||
|
||||
|
||||
// 加载分类列表
|
||||
loadParentGrid({ params }) {
|
||||
|
||||
|
||||
|
|
@ -154,6 +155,8 @@ export default {
|
|||
|
||||
return this.$mk.getPagedData({ url: this.actions.list, data: params });
|
||||
},
|
||||
|
||||
// 初始化页面配置
|
||||
optionsInit() {
|
||||
// 页面数据变量
|
||||
var pageData = {
|
||||
|
|
@ -167,8 +170,8 @@ export default {
|
|||
listPageUrl: "/MesMaterials/MesMaterialsList",
|
||||
|
||||
|
||||
uploadDefaultImg: null,
|
||||
detailDataFieldName: "mes_materials",
|
||||
uploadDefaultImg: null, // 默认图片
|
||||
detailDataFieldName: "mes_materials", // 详情数据字段名
|
||||
|
||||
actions: {
|
||||
// =============================== 接口地址 自动生成 Start ===============================
|
||||
|
|
@ -186,7 +189,7 @@ export default {
|
|||
// =============================== 接口地址 自动生成 End ===============================
|
||||
|
||||
|
||||
productAttribute: `${BASE_URL.BASE_URL}/MesProductCustomAttribute/v1/get/productAttribute`
|
||||
productAttribute: `${BASE_URL.BASE_URL}/MesProductCustomAttribute/v1/get/productAttribute` // 获取产品属性
|
||||
},
|
||||
|
||||
keyName: 'id',
|
||||
|
|
@ -222,150 +225,150 @@ export default {
|
|||
{ title: '分类', span: 12, slots: { default: 'sort_id' } },
|
||||
|
||||
{ field: 'spec', title: '规格型号', span: 12, itemRender: { name: '$input' } },
|
||||
{ field: 'size', title: '尺寸', span: 12, itemRender: { name: '$input' } },
|
||||
{ field: 'size', title: '尺寸', span: 12, itemRender: { name: '$input' } },
|
||||
|
||||
{
|
||||
title: '颜色', span: 12,
|
||||
field: 'color',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams:{
|
||||
search_rules_enum: [
|
||||
{
|
||||
column:"code",
|
||||
mode:"=",
|
||||
value:"3"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
title: '颜色', span: 12,
|
||||
field: 'color',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams: {
|
||||
search_rules_enum: [
|
||||
{
|
||||
column: "sys_name",
|
||||
mode: "=",
|
||||
value: "color"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '花面', span: 12,
|
||||
field: 'face',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams:{
|
||||
search_rules_enum: [
|
||||
{
|
||||
column:"code",
|
||||
mode:"=",
|
||||
value:"4"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '成型方式', span: 12,
|
||||
field: 'molding',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams:{
|
||||
search_rules_enum: [
|
||||
{
|
||||
column:"code",
|
||||
mode:"=",
|
||||
value:"1"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '布产方式', span: 12,
|
||||
field: 'production_type',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams:{
|
||||
search_rules_enum: [
|
||||
{
|
||||
column:"code",
|
||||
mode:"=",
|
||||
value:"2"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
{
|
||||
title: '花面', span: 12,
|
||||
field: 'face',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams: {
|
||||
search_rules_enum: [
|
||||
{
|
||||
column: "sys_name",
|
||||
mode: "=",
|
||||
value: "face"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
title: '成型方式', span: 12,
|
||||
field: 'molding',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams: {
|
||||
search_rules_enum: [
|
||||
{
|
||||
column: "sys_name",
|
||||
mode: "=",
|
||||
value: "molding"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '布产方式', span: 12,
|
||||
field: 'production_type',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams: {
|
||||
search_rules_enum: [
|
||||
{
|
||||
column: "sys_name",
|
||||
mode: "=",
|
||||
value: "production_type"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{ field: 'theoretical_load', title: '理论装车量', span: 12, itemRender: { name: '$input' } },
|
||||
|
||||
|
||||
{
|
||||
title: '土质', span: 12,
|
||||
field: 'soil',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams:{
|
||||
search_rules_enum: [
|
||||
{
|
||||
column:"code",
|
||||
mode:"=",
|
||||
value:"5"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
title: '土质', span: 12,
|
||||
field: 'soil',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesEnumValue',
|
||||
actionParams: {
|
||||
search_rules_enum: [
|
||||
{
|
||||
column: "sys_name",
|
||||
mode: "=",
|
||||
value: "soil"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesEnum/v1/mes/enum/value/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '单位', span: 12,
|
||||
field: 'unit',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesUnit',
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/list`
|
||||
title: '单位', span: 12,
|
||||
field: 'unit',
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "string",
|
||||
valueField: "name",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesUnit',
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
|
@ -412,8 +415,8 @@ export default {
|
|||
this.options = pageData;
|
||||
},
|
||||
|
||||
|
||||
attributeDataInit(){
|
||||
// 自定义属性数据初始化
|
||||
attributeDataInit() {
|
||||
this.$mk.post({
|
||||
url: this.options.actions.productAttribute,
|
||||
loading: "加载中..."
|
||||
|
|
@ -478,13 +481,13 @@ export default {
|
|||
}
|
||||
|
||||
let ov = this.getOldAttributeValue(item.id);
|
||||
if(ov !== null){
|
||||
if (ov !== null) {
|
||||
formData[formItem.field] = ov;
|
||||
}
|
||||
|
||||
this.options.formOptions2.items.push(formItem);
|
||||
})
|
||||
this.options.formOptions2.data = formData;
|
||||
this.options.formOptions2.data = formData;
|
||||
|
||||
|
||||
this.options.formOptions2Done = true;
|
||||
|
|
@ -495,10 +498,11 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
// 初始化页面数据
|
||||
dataInit() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取路由的id参数
|
||||
|
|
@ -543,21 +547,24 @@ export default {
|
|||
this.options.isEdit = true;
|
||||
|
||||
this.$forceUpdate()
|
||||
} else{
|
||||
|
||||
} else {
|
||||
|
||||
this.attributeDataInit();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取旧的属性值
|
||||
getOldAttributeValue(attribute_id) {
|
||||
for(let i =0;i<this.custom_attribute_value.length;i++){
|
||||
if(this.custom_attribute_value[i].attribute_id.toString() == attribute_id.toString()){
|
||||
for (let i = 0; i < this.custom_attribute_value.length; i++) {
|
||||
if (this.custom_attribute_value[i].attribute_id.toString() == attribute_id.toString()) {
|
||||
return this.custom_attribute_value[i].value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
},
|
||||
|
||||
// 获取属性值
|
||||
getAttributeValue(attribute_id) {
|
||||
return this.options.formOptions2.data["attr" + attribute_id.toString()];
|
||||
|
||||
|
|
@ -574,11 +581,13 @@ export default {
|
|||
}
|
||||
return dataId;
|
||||
},
|
||||
|
||||
// 获取路由的id参数
|
||||
getDataId_BigInt() {
|
||||
let dataId = this.getDataId();
|
||||
return this.$mk.toBigInt(dataId);
|
||||
},
|
||||
|
||||
|
||||
// 返回
|
||||
back() {
|
||||
this.isEdit = this.options.isEdit;
|
||||
|
|
@ -656,10 +665,10 @@ export default {
|
|||
delete postdata.update_uid
|
||||
delete postdata.custom_attribute_attribute
|
||||
delete postdata.custom_attribute_category
|
||||
delete postdata.custom_attribute_field
|
||||
delete postdata.custom_attribute_field
|
||||
delete postdata.mes_materials_sort
|
||||
|
||||
|
||||
|
||||
console.log(postdata)
|
||||
// 格式化提交的数据
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.options.formOptions.items });
|
||||
|
|
@ -700,15 +709,22 @@ export default {
|
|||
this.back();
|
||||
},
|
||||
|
||||
// 选择分类
|
||||
pulldownFocusEvent() {
|
||||
this.$refs.pulldownParent.showPanel()
|
||||
},
|
||||
|
||||
// 搜索分类
|
||||
pulldownKeyupEvent() {
|
||||
|
||||
},
|
||||
|
||||
// 点击分类
|
||||
pulldownSuffixClick() {
|
||||
this.$refs.pulldownParent.togglePanel()
|
||||
},
|
||||
|
||||
// 点击分类列表
|
||||
pulldownCellClickEvent({ row }) {
|
||||
|
||||
if (row.children && row.children.length) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ export default {
|
|||
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ export default {
|
|||
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -155,27 +155,27 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
{
|
||||
title: '布产单', span: 5,
|
||||
field: 'production_id',
|
||||
dataRule: {
|
||||
fromField: "production_id"
|
||||
},
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "code",
|
||||
columns: [ // 表格列
|
||||
{ field: 'code', title: '编码' } // 字段名称,字段标题
|
||||
],
|
||||
listdataFieldName: 'MoldProductionOrder',
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/list`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: '布产单', span: 5,
|
||||
// field: 'production_id',
|
||||
// dataRule: {
|
||||
// fromField: "production_id"
|
||||
// },
|
||||
// itemRender: {
|
||||
// name: 'MkFormDataSelector', props: {
|
||||
// params: {
|
||||
// dataType: "object",
|
||||
// valueField: "id",
|
||||
// textField: "code",
|
||||
// columns: [ // 表格列
|
||||
// { field: 'code', title: '编码' } // 字段名称,字段标题
|
||||
// ],
|
||||
// listdataFieldName: 'MoldProductionOrder',
|
||||
// dataUrl: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/list`
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
|
||||
{ field: 'is_send', title: '发料状态', span: 3, itemRender: { name: '$select', props: { options: settings.options_is_send } } },
|
||||
|
|
@ -198,7 +198,7 @@ export default {
|
|||
id: 'datagrid_1', // 表格唯一标识
|
||||
sortConfig: {
|
||||
defaultSort: {
|
||||
field: 'complete_time',
|
||||
field: 'plan_complete_time',
|
||||
order: 'desc'
|
||||
},
|
||||
trigger: 'cell', // 触发排序的方式
|
||||
|
|
@ -216,11 +216,12 @@ export default {
|
|||
{ slots: { default: 'column1' }, title: '查看详情', width: 120 },
|
||||
{ field: 'department_name', title: '部门', sortable: true, width: 140 },
|
||||
{ field: 'process_name', title: '工序名称', sortable: true, width: 100 },
|
||||
{ title: '模具图片', slots: { default: 'column4' }, width: 90 },
|
||||
{ title: '部件图片', slots: { default: 'column4' }, width: 90 },
|
||||
{ field: 'component_name', title: '部件名称', sortable: true, width: 100 },
|
||||
{ field: 'production_code', title: '布产单号', sortable: true, width: 100 },
|
||||
{ field: 'mold_master_name', sortable: true, title: '模具师傅', width: 120 },
|
||||
{ field: 'engineer_name', sortable: true, title: '工程师傅', width: 120 },
|
||||
{ field: 'ask_complete_time', formatter: 'formatDate', width: 130, sortable: true, title: '预计完成时间', showHeaderOverflow: true },
|
||||
{ field: 'plan_complete_time', formatter: 'formatDate', width: 130, sortable: true, title: '预计完成时间', showHeaderOverflow: true },
|
||||
|
||||
{ field: 'status', title: '状态', sortable: true, width: 100 },
|
||||
{ field: 'send_time', formatter: 'formatDate', width: 130, sortable: true, title: '发料日期', showHeaderOverflow: true }, // 创建时间
|
||||
|
|
@ -264,6 +265,7 @@ export default {
|
|||
item.department_name = item.department_detail.name;
|
||||
item.process_name = item.process_detail.name;
|
||||
item.production_code = item.production_detail.code;
|
||||
item.component_name = item.component_detail.name;
|
||||
});
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -232,15 +232,16 @@
|
|||
<span v-else></span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="component_name" title="部件名称" width="110"></vxe-column>
|
||||
<!-- <vxe-column field="production_id" title="布产单id" width="210"></vxe-column> -->
|
||||
<vxe-column field="production_code" title="布产单号" width="110"></vxe-column>
|
||||
<vxe-column field="mold_master_name" align="center" title="模具师傅" width="110"></vxe-column>
|
||||
<vxe-column field="engineer_name" align="center" title="工程师傅" width="110"></vxe-column>
|
||||
<vxe-column field="complete_time" align="center" formatter="formatDate" title="预计完成时间"
|
||||
<vxe-column field="plan_complete_time" align="center" formatter="formatDate" title="预计完成时间"
|
||||
width="160"></vxe-column>
|
||||
<vxe-column field="status" title="状态" align="center" width="100"></vxe-column>
|
||||
<!-- <vxe-column field="is_send" title="发料" width="160"></vxe-column> -->
|
||||
<vxe-column field="send_time" formatter="formatDate" title="发料日期" width="160"></vxe-column>
|
||||
<vxe-column field="send_time" align="center" formatter="formatDate" title="发料日期" width="140"></vxe-column>
|
||||
<vxe-column field="reality_complete_time" formatter="formatDate" title="完工日期" width="160"></vxe-column>
|
||||
<vxe-column field="remark" title="备注" width="160"></vxe-column>
|
||||
</vxe-table>
|
||||
|
|
@ -756,6 +757,7 @@ export default {
|
|||
"company_token": process.env.VUE_APP_COMPANYTOKEN,
|
||||
"search_rules": search_rules,
|
||||
"order_bys": [
|
||||
{ "column": "plan_complete_time", "order": "asc" }
|
||||
],
|
||||
"page": 1,
|
||||
"limit": 200,
|
||||
|
|
@ -772,6 +774,7 @@ export default {
|
|||
item.department_name = item.department_detail.name
|
||||
item.production_code = item.production_detail.code
|
||||
item.process_name = item.process_detail.name
|
||||
item.component_name = item.component_detail.name;
|
||||
})
|
||||
|
||||
// this.detailDataProgress 中将 production_code 等于 "" 的数据删除
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ export default {
|
|||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框+
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ export default {
|
|||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ export default {
|
|||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: '40' }, // 多选框
|
||||
{ type: 'seq', width: 'auto' }, // 序号
|
||||
{ type: 'seq', width: '40' }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -39,6 +39,39 @@ const view = {
|
|||
icon: 'idcard',
|
||||
component: view.blank
|
||||
},
|
||||
|
||||
|
||||
exp403: {
|
||||
authority: '*',
|
||||
name: 'exp403',
|
||||
path: '403',
|
||||
component: () => import('@/pages/base/exception/403')
|
||||
},
|
||||
exp404: {
|
||||
name: 'exp404',
|
||||
path: '404',
|
||||
component: () => import('@/pages/base/exception/404')
|
||||
},
|
||||
exp500: {
|
||||
name: 'exp500',
|
||||
path: '500',
|
||||
component: () => import('@/pages/base/exception/500')
|
||||
},
|
||||
|
||||
|
||||
components: {
|
||||
name: '小组件',
|
||||
icon: 'appstore-o',
|
||||
component: view.page
|
||||
},
|
||||
taskCard: {
|
||||
name: '任务卡片',
|
||||
component: () => import('@/pages/base/components/TaskCard')
|
||||
},
|
||||
palette: {
|
||||
name: '颜色复选框',
|
||||
component: () => import('@/pages/base/components/Palette')
|
||||
},
|
||||
analysis: {
|
||||
name: '分析页',
|
||||
component: () => import('@/pages/dashboard/analysis')
|
||||
|
|
@ -133,6 +166,20 @@ const view = {
|
|||
icon: 'warning',
|
||||
component: view.blank
|
||||
},
|
||||
|
||||
//================================================================================================================================
|
||||
// 以上为自动生成的路由,以下为手动添加的路由
|
||||
//================================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================================================================================
|
||||
// 以下为项目的路由
|
||||
//================================================================================================================================
|
||||
|
||||
TouchMesReporting : {
|
||||
name: '报工',
|
||||
path: '/touch/mesreporting',
|
||||
|
|
@ -154,92 +201,9 @@ const view = {
|
|||
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
||||
},
|
||||
|
||||
exp403: {
|
||||
authority: '*',
|
||||
name: 'exp403',
|
||||
path: '403',
|
||||
component: () => import('@/pages/base/exception/403')
|
||||
},
|
||||
exp404: {
|
||||
name: 'exp404',
|
||||
path: '404',
|
||||
component: () => import('@/pages/base/exception/404')
|
||||
},
|
||||
exp500: {
|
||||
name: 'exp500',
|
||||
path: '500',
|
||||
component: () => import('@/pages/base/exception/500')
|
||||
},
|
||||
components: {
|
||||
name: '小组件',
|
||||
icon: 'appstore-o',
|
||||
component: view.page
|
||||
},
|
||||
taskCard: {
|
||||
name: '任务卡片',
|
||||
component: () => import('@/pages/base/components/TaskCard')
|
||||
},
|
||||
palette: {
|
||||
name: '颜色复选框',
|
||||
component: () => import('@/pages/base/components/Palette')
|
||||
},
|
||||
|
||||
|
||||
//================================================================================================================================
|
||||
// 以上为自动生成的路由,以下为手动添加的路由
|
||||
//================================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================================================================================
|
||||
// 以下为项目的路由
|
||||
//================================================================================================================================
|
||||
|
||||
|
||||
WorkReport:{
|
||||
name: '报工管理',
|
||||
icon: 'idcard',
|
||||
component: view.page,
|
||||
authority: {
|
||||
permission:['']
|
||||
}
|
||||
},
|
||||
WorkReporList:{
|
||||
name: '报工列表',
|
||||
component: () => import('@/pages/base/plan/WorkReporList'),
|
||||
authority: {
|
||||
permission:[''],
|
||||
}
|
||||
},
|
||||
Payroll:{
|
||||
name: '工资管理',
|
||||
icon: 'idcard',
|
||||
component: view.page,
|
||||
authority: {
|
||||
permission: ['Payroll-All'],
|
||||
}
|
||||
},
|
||||
PayrollList:{
|
||||
name: '工资列表',
|
||||
component: () => import('@/pages/base/plan/PayrollList'),
|
||||
authority: {
|
||||
permission:['Payroll-All','Payroll-List'],
|
||||
}
|
||||
|
||||
},
|
||||
PayrollSettings:{
|
||||
name: '工资设置',
|
||||
component: () => import('@/pages/base/plan/PayrollSettings'),
|
||||
authority: {
|
||||
permission:['Payroll-All','Payroll-Settings'],
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
console.log(BaseRouterMap)
|
||||
// console.log(BaseRouterMap)
|
||||
|
||||
export default BaseRouterMap
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
import {hasAuthority} from '@/utils/authority-utils' // 权限判断
|
||||
import {loginIgnore} from '@/router/index' // 不用登录白名单
|
||||
import {checkAuthorization} from '@/utils/request' // 登录校验
|
||||
// 路由守卫
|
||||
|
||||
import { hasAuthority } from '@/utils/authority-utils' // 权限判断
|
||||
import { loginIgnore } from '@/router/index' // 不用登录白名单
|
||||
import { checkAuthorization } from '@/utils/request' // 登录校验
|
||||
import NProgress from 'nprogress' // 进度条
|
||||
|
||||
NProgress.configure({ showSpinner: false }) // 进度条配置 是否显示加载ico
|
||||
|
|
@ -11,7 +13,7 @@ NProgress.configure({ showSpinner: false }) // 进度条配置 是否显示加
|
|||
* @param form
|
||||
* @param next
|
||||
*/
|
||||
const progressStart = (to, from, next) => {
|
||||
const progressStart = (to, from, next) => {
|
||||
// start progress bar
|
||||
// console.log("progressStart进度条开始")
|
||||
if (!NProgress.isStarted()) { // 如果进度条没有开始
|
||||
|
|
@ -29,18 +31,18 @@ const progressStart = (to, from, next) => {
|
|||
*/
|
||||
const loginGuard = (to, from, next, options) => {
|
||||
// console.log("进入loginGuard登录守卫")
|
||||
const {message} = options // 获取message
|
||||
const { message } = options // 获取message
|
||||
// console.log('loginIgnore.includes(to)', loginIgnore.includes(to))
|
||||
// console.log('checkAuthorization():', checkAuthorization())
|
||||
if (!loginIgnore.includes(to) && !checkAuthorization()) { // 如果不是白名单 并且 登录校验失败
|
||||
message.warning('登录已失效,请重新登录')
|
||||
next({path: '/login'}) // 跳转到登录页面
|
||||
next({ path: '/login' }) // 跳转到登录页面
|
||||
} else {
|
||||
// console.log('进入loginGuard登录守卫next()')
|
||||
next() // 如果是白名单,正常跳转
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -52,13 +54,13 @@ const loginGuard = (to, from, next, options) => {
|
|||
*/
|
||||
|
||||
const authorityGuard = (to, from, next, options) => {
|
||||
const {store, message} = options
|
||||
const { store, message } = options
|
||||
const permissions = store.getters['account/permissions'] // 获取权限数据
|
||||
if (to.meta.authority !== undefined){
|
||||
if (to.meta.authority !== undefined) {
|
||||
if (!hasAuthority(to, permissions)) { // 判断是否有权限
|
||||
// 如果没有权限,跳转到403页面
|
||||
message.warning(`对不起,您无权访问页面: ${to.fullPath},请联系管理员`)
|
||||
next({path: '/403'})
|
||||
next({ path: '/403' })
|
||||
// NProgress.done()
|
||||
} else {
|
||||
// console.log('进入authorityGuard权限守卫next()')
|
||||
|
|
@ -77,7 +79,7 @@ const authorityGuard = (to, from, next, options) => {
|
|||
*/
|
||||
const redirectGuard = (to, from, next, options) => {
|
||||
// console.log("进入redirectGuard混合导航模式")
|
||||
const {store} = options // 获取store
|
||||
const { store } = options // 获取store
|
||||
|
||||
|
||||
|
||||
|
|
@ -95,11 +97,11 @@ const redirectGuard = (to, from, next, options) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (store.state.setting.layout === 'mix') { // 如果是混合导航模式
|
||||
console.log("==混合导航模式==")
|
||||
const firstMenu = store.getters['setting/firstMenu'] // 获取第一个菜单
|
||||
|
||||
|
||||
// console.log("store.getters['setting/firstMenu']", store.getters['setting/firstMenu'])
|
||||
if (firstMenu.find(item => item.fullPath === to.fullPath)) { // 如果是第一个菜单列表,
|
||||
store.commit('setting/setActivatedFirst', to.fullPath) // 设置激活的第一个菜单
|
||||
|
|
@ -109,7 +111,7 @@ const redirectGuard = (to, from, next, options) => {
|
|||
const redirect = getFirstChild(subMenu) // 获取第一个子菜单
|
||||
console.log("subMenu.length", subMenu.length)
|
||||
console.log("redirect", redirect)
|
||||
return next({path: redirect.fullPath}) // 重定向到第一个子菜单
|
||||
return next({ path: redirect.fullPath }) // 重定向到第一个子菜单
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -117,7 +119,7 @@ const redirectGuard = (to, from, next, options) => {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
next()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ if (Authorization != null) {
|
|||
}
|
||||
})
|
||||
getRoutesConfig().then(result => { // 获取路由配置
|
||||
console.log("=================result:" + result)
|
||||
// console.log("=================result:" + result)
|
||||
if (result.data.data != null) {
|
||||
const routesConfig = result.data.data;
|
||||
console.log(routesConfig)
|
||||
|
|
@ -111,6 +111,7 @@ const loginIgnore = { // 登录白名单
|
|||
|
||||
// 解决重复点击路由报错的BUG
|
||||
const originalPush = Router.prototype.push // 保存原型对象中的push方法
|
||||
|
||||
Router.prototype.push = function push(location) { // 重写原型对象中的push方法
|
||||
return originalPush.call(this, location).catch((err) => err) // 抛出错误
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,19 +9,19 @@ import BaseAgentRouterMap from '@/router/Middle/Base/BaseAgent/router.map.js'
|
|||
import BaseCompanyRouterMap from '@/router/Middle/Base/BaseCompany/router.map.js'
|
||||
import BasePermissionRouterMap from '@/router/Middle/Base/BasePermission/router.map.js'
|
||||
import BaseAdminRouterMap from '@/router/Middle/Base/BaseAdmin/router.map.js'
|
||||
|
||||
|
||||
import Bathroom from '@/router/Middle/bathroom/router.map.js'
|
||||
import Mes from '@/router/Middle/Mes/router.map.js'
|
||||
import Chatgpt from '@/router/Middle/Chatgpt/router.map.js'
|
||||
import ProvideLoanApply from '@/router/Middle/ProvideLoanApply/router.map.js'
|
||||
import Mold from '@/router/Middle/Mold/router.map.js'
|
||||
|
||||
|
||||
import Bathroom from '@/router/Middle/bathroom/router.map.js'
|
||||
import Mes from '@/router/Middle/Mes/router.map.js'
|
||||
import Chatgpt from '@/router/Middle/Chatgpt/router.map.js'
|
||||
import ProvideLoanApply from '@/router/Middle/ProvideLoanApply/router.map.js'
|
||||
import Mold from '@/router/Middle/Mold/router.map.js'
|
||||
|
||||
import Test from '@/router/Test/router.map.js'
|
||||
|
||||
|
||||
const routerMap = Object.assign({
|
||||
|
||||
|
||||
},
|
||||
BaseRouterMap,
|
||||
AdminUserRouterMap,
|
||||
|
|
@ -41,13 +41,13 @@ const routerMap = Object.assign({
|
|||
Chatgpt,
|
||||
//车贷
|
||||
ProvideLoanApply,
|
||||
|
||||
|
||||
//模具
|
||||
Mold,
|
||||
|
||||
//测试
|
||||
Test
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import routerMap from '@/router/router.map'
|
||||
import { mergeI18nFromRoutes } from '@/utils/i18n'
|
||||
import Router from 'vue-router'
|
||||
import deepMerge from 'deepmerge'
|
||||
import basicOptions from '@/router/async/config.async'
|
||||
import routerMap from '@/router/router.map' // 路由组件注册表
|
||||
import { mergeI18nFromRoutes } from '@/utils/i18n' // 合并路由国际化数据
|
||||
import Router from 'vue-router' // 引入vue-router
|
||||
import deepMerge from 'deepmerge' // 引入deepmerge 深度合并
|
||||
import basicOptions from '@/router/async/config.async' // 引入异步路由配置
|
||||
|
||||
//应用配置 初始化
|
||||
let appOptions = {
|
||||
|
|
@ -193,7 +193,7 @@ function loadRoutes(routesConfig) { // 加载路由
|
|||
//routesConfig = mergeMenus(routesConfig);
|
||||
if (!routesConfig) {
|
||||
var routesconfig = store.getters['account/routesConfig']
|
||||
console.log("=================routesConfig:", routesconfig)
|
||||
// console.log("=================routesConfig:", routesconfig)
|
||||
if (!routesconfig) {
|
||||
return;
|
||||
}else{
|
||||
|
|
@ -224,9 +224,12 @@ function loadRoutes(routesConfig) { // 加载路由
|
|||
|
||||
// 合并路由 生成路由表
|
||||
const finalRoutes = mergeRoutes(basicOptions.routes, routes)
|
||||
|
||||
// 格式化路由
|
||||
formatRoutes(finalRoutes)
|
||||
|
||||
router.options = { ...router.options, routes: finalRoutes } // 路由配置
|
||||
|
||||
router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue