Commit f2d05d19 authored by 徐一鸣's avatar 徐一鸣

up pages

parent d8e67540
......@@ -14,6 +14,7 @@
<script>
import sideNavBar from "@/components/side-nav-bar";
import { mapState } from "vuex";
export default {
components: {
......@@ -22,6 +23,11 @@ export default {
data: () => ({
navList: [],
}),
computed: {
...mapState({
fwglNav: "fwglNav",
}),
},
watch: {
"$route.fullPath"(path) {
this.initNavList();
......@@ -31,61 +37,10 @@ export default {
initNavList() {
let level = parseInt(this.$route.params.level);
// 普通用户
if (level == 0) {
this.navList = [
{
name: "注册发布的服务",
path: `/fwgl/list/${level}/0`,
},
{
name: "申请的服务",
path: `/fwgl/list/${level}/1`,
},
{
name: "审批的服务",
path: `/fwgl/list/${level}/2`,
},
{
name: "云资源服务",
path: `/fwgl/list/${level}/3`,
},
];
}
// 组织管理员
else if (level == 1) {
this.navList = [
{
name: "组织服务管理",
path: `/fwgl/list/${level}/0`,
},
{
name: "服务审批管理",
path: `/fwgl/list/${level}/1`,
},
{
name: "云资源管理",
path: `/fwgl/list/${level}/2`,
},
];
}
// 超级管理员
else if (level == 2) {
this.navList = [
{
name: "平台服务管理",
path: `/fwgl/list/${level}/0`,
},
{
name: "服务审批管理",
path: `/fwgl/list/${level}/1`,
},
{
name: "云资源管理",
path: `/fwgl/list/${level}/2`,
},
];
}
this.navList = this.fwglNav[level].map((item, index) => ({
name: item,
path: `/fwgl/list/${level}/${index}`,
}));
},
},
mounted() {
......
......@@ -2,14 +2,14 @@
<div class="list_container">
<el-breadcrumb separator="/" class="bread_crumb">
<el-breadcrumb-item>我的服务</el-breadcrumb-item>
<el-breadcrumb-item>{{ $route.params.name }}</el-breadcrumb-item>
<el-breadcrumb-item>{{ pathName }}</el-breadcrumb-item>
</el-breadcrumb>
<div class="table_container">
<ces-table
class="r_yhgl_table"
size="mini"
url="tableData"
:detailsUrl="`/fwgl/servicedetail/${$route.params.level}/`"
:detailsUrl="`/fwgl/servicedetail/${level}/`"
:border="false"
:headers="headers"
:searchShow="true"
......@@ -39,9 +39,12 @@
<script>
import cesTable from "@/components/table-um";
import dialogAction from "@/components/dialog-action";
import { mapState } from "vuex";
export default {
data: () => ({
level: 0, // 用户等级
type: 0, // 访问的页面
headers: [],
url: "",
detailsUrl: "ss/",
......@@ -89,70 +92,22 @@ export default {
},
],
}),
computed: {
...mapState({
fwglNav: "fwglNav",
}),
pathName() {
return this.fwglNav[this.level][this.type];
},
},
components: {
cesTable,
dialogAction,
},
methods: {
deleteItem(item) {
this.confirmOptions.title = "";
this.confirmOptions.message = "是否删除该条服务?";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "";
this.confirmOptions.confirmSubmit = () => {
console.log("deleteItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
editItem(item) {
this.$router.push(
`/fwgl/serviceedit/${this.$route.params.level}/${item.id}`
);
},
soldOutItem(item) {
this.confirmOptions.title = "提示";
this.confirmOptions.message =
"下架此服务会导致用户被迫暂停对服务的调用,下架前需向超级管理员发送通知,超级管理员通过后此服务将会从服务超市中下架。";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "发送通知";
this.confirmOptions.confirmSubmit = () => {
console.log("soldOutItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
soldOutItem2(item) {
this.confirmOptions.title = "提示";
this.confirmOptions.message =
"下架此服务会导致用户被迫暂停对服务的调用";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "确定";
this.confirmOptions.confirmSubmit = () => {
console.log("soldOutItem2 - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
cancelItem(item) {
console.log("cancelItem - " + item.name);
},
examineItem(item) {
console.log("examineItem - " + item.name);
},
detailItem(item) {
console.log("detailItem - " + item.name);
},
allotItem(item) {
console.log("allotItem - " + item.name);
},
confirmSubmit(item) {
console.log(item.name);
},
},
mounted() {
let level = parseInt(this.$route.params.level);
let type = parseInt(this.$route.params.type);
initHeader() {
let level = this.level;
let type = this.type;
// 普通用户 --- 注册发布的服务
if (level == 0 && type == 0) {
......@@ -432,6 +387,66 @@ export default {
throw Error("The page doesn't exist");
}
},
deleteItem(item) {
this.confirmOptions.title = "";
this.confirmOptions.message = "是否删除该条服务?";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "";
this.confirmOptions.confirmSubmit = () => {
console.log("deleteItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
editItem(item) {
this.$router.push(
`/fwgl/serviceedit/${this.$route.params.level}/${item.id}`
);
},
soldOutItem(item) {
this.confirmOptions.title = "提示";
this.confirmOptions.message =
"下架此服务会导致用户被迫暂停对服务的调用,下架前需向超级管理员发送通知,超级管理员通过后此服务将会从服务超市中下架。";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "发送通知";
this.confirmOptions.confirmSubmit = () => {
console.log("soldOutItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
soldOutItem2(item) {
this.confirmOptions.title = "提示";
this.confirmOptions.message = "下架此服务会导致用户被迫暂停对服务的调用";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "确定";
this.confirmOptions.confirmSubmit = () => {
console.log("soldOutItem2 - " + item.name);
this.$refs.myConfirm.hideModel();
};
this.$refs.myConfirm.showModel();
},
cancelItem(item) {
console.log("cancelItem - " + item.name);
},
examineItem(item) {
console.log("examineItem - " + item.name);
},
detailItem(item) {
console.log("detailItem - " + item.name);
},
allotItem(item) {
console.log("allotItem - " + item.name);
},
confirmSubmit(item) {
console.log(item.name);
},
},
created() {
this.level = parseInt(this.$route.params.level);
this.type = parseInt(this.$route.params.type);
this.initHeader();
},
};
</script>
......
import Vuex from 'vuex'
import Vue from 'vue'
import Vuex from "vuex";
import Vue from "vue";
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
role: 1,//0:普通用户,1:组织管理员,2:超级管理员
role: 1, //0:普通用户,1:组织管理员,2:超级管理员
serviceShopMenu: 0, // 服务超市侧边栏
fwglNav: [
["注册发布的服务", "申请的服务", "审批的服务", "云资源服务"], //普通用户
["组织服务管理", "服务审批管理", "云资源管理"], //组织管理员
["平台服务管理", "服务审批管理", "云资源管理"], //超级管理员
], // 服务管理列表,onlyRead
},
modules: {
},
modules: {},
mutations: {
rolefun(state, newValue) {
state.role = newValue;
......@@ -20,4 +23,4 @@ const store = new Vuex.Store({
},
});
export default store
\ No newline at end of file
export default store;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment