|
@@ -7,6 +7,7 @@
|
|
|
<el-input placeholder="请输入查询条件" v-model="keyword">
|
|
|
<el-button slot="append" icon="el-icon-search"></el-button>
|
|
|
</el-input>
|
|
|
+ <el-button type="primary" @click="onAddMenu">加菜单</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<BaseTable :columns="columns" :data="tableData" border style="margin-top: 20px">
|
|
@@ -23,7 +24,7 @@ import { Vue, Component } from 'vue-property-decorator'
|
|
|
import BaseTable from '@/components/BaseTable/index.vue'
|
|
|
import { ElTableColumn } from 'element-ui/types/table-column'
|
|
|
import { elTableAlignLeft } from '@/utils/constant'
|
|
|
-import { fetchProjects, IOrg, IProject, setProjectKey } from '@/api/common'
|
|
|
+import { fetchProjects, IOrg, IProject, setProjectKey, addMenu } from '@/api/common'
|
|
|
|
|
|
interface ITableData extends IProject, Omit<IOrg, 'prjList'> {
|
|
|
orgId: number
|
|
@@ -61,6 +62,37 @@ export default class Project extends Vue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ async onAddMenu() {
|
|
|
+ const data = [
|
|
|
+ { key: 'type', name: '设备类型管理' },
|
|
|
+ { key: 'standard', name: '指标标准管理' },
|
|
|
+ { key: 'device', name: '设备管理' },
|
|
|
+ { key: 'point', name: '监测点管理' },
|
|
|
+ { key: 'team', name: '监测点分组管理' },
|
|
|
+ { key: 'neighbor', name: '监测点上下游管理' }
|
|
|
+ ].map(({ key, name }, index) => {
|
|
|
+ const path = `/spectrum/configuration/${key}`
|
|
|
+ return {
|
|
|
+ sort: 1 + index,
|
|
|
+ name: path,
|
|
|
+ path: path,
|
|
|
+ parentId: 4382,
|
|
|
+ icon: null,
|
|
|
+ type: 'gis',
|
|
|
+ statusFlag: '1',
|
|
|
+ sysId: 52,
|
|
|
+ meta: JSON.stringify({ title: name }),
|
|
|
+ component: path,
|
|
|
+ label: name,
|
|
|
+ widgetid: 'FullPanel',
|
|
|
+ pathId: path,
|
|
|
+ parentPathid: '/spectrum'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const res = await Promise.all(data.map((item) => addMenu(item)))
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+
|
|
|
created() {
|
|
|
this.fetchProject()
|
|
|
}
|