Commit 38e9e084 authored by 张俊's avatar 张俊

服务编辑

parent 92649244
import "babel-polyfill";
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
import store from "@/store";
store.install(Vuex);
import Vue from 'vue'
import VueResource from "vue-resource";
Vue.use(VueResource);
......
......@@ -156,13 +156,13 @@ export default {
{
prop:'cjms',
label:'场景描述',
minWidth:'20%',
minWidth:'40%',
align:'left',
},
{
prop:'sqsj',
label:'申请调用时间',
minWidth:'150px',
width:'160px',
align:'right',
},
],
......@@ -233,7 +233,7 @@ export default {
}
},
mounted(){
console.log(this.$store.state.role);
},
methods:{
getData() {
......@@ -255,6 +255,7 @@ export default {
.detail_contain{
width: 100%;
padding: 0 20px;
margin-bottom: 20px;
}
.info_contain{
padding: 25px 20px;
......
......@@ -5,14 +5,14 @@
<span>服务编辑</span>
</p>
<div class="info_contain">
<el-form ref="form" :model="form" label-width="0px">
<el-form ref="form" :rules="rules" :model="form" label-width="0px">
<el-form-item>
<p class="formname">服务名称:</p>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item>
<el-form-item prop="desc">
<p class="formname">服务描述:</p>
<el-input v-model="form.desc"></el-input>
<el-input type="textarea" v-model="form.desc"></el-input>
</el-form-item>
<el-form-item>
<p class="formname">服务领域:</p>
......@@ -48,8 +48,8 @@
</el-form-item>
<el-form-item>
<el-button>取消</el-button>
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button type="primary" @click="onSubmit" class="right">保存</el-button>
<el-button class="right">取消</el-button>
</el-form-item>
</el-form>
</div>
......@@ -72,8 +72,14 @@ export default {
origin:'',
code:'',
resource: '',
fileList:''
},
imgList: [],
rules:{
desc:[
{ max: 200, message: '长度小于200个字符', trigger: 'blur' }
]
}
};
},
watch: {},
......@@ -86,6 +92,11 @@ export default {
},
getNewList(val) {
console.log(val);
this.form.fileList = ""
this.form.fileList = url.map((v,k)=>{
return v.url
}).join(';')
console.log(this.form.fileList)
}
}
};
......@@ -96,12 +107,16 @@ export default {
.info_contain .el-input__inner{
background-color: #f7f8f9;
}
.info_contain .el-textarea__inner{
background-color: #f7f8f9;
}
</style>
<style scoped>
.detail_contain {
width: 100%;
padding: 0 20px;
margin-bottom: 20px;
}
.info_contain {
padding: 25px 20px;
......@@ -120,4 +135,8 @@ export default {
.formname{
color: #58617a;
}
.right{
float: right;
margin-left: 20px;
}
</style>
......@@ -185,7 +185,11 @@
<img src="../assets/imgs/home_ic_release.png" alt />&nbsp; 服务注册
</div>
</div>
<table-um :headers="service_head[now_user][now_type]" :url="service_url_arr[now_user][now_type]" :paginationShow="true"></table-um>
<table-um
:headers="service_head[now_user][now_type]"
:url="service_url_arr[now_user][now_type]"
:paginationShow="true"
></table-um>
</div>
</div>
<div class="online_tool" :style="now_user==0?{}:{width:'590px'}">
......@@ -216,9 +220,12 @@
<p>{{item.version}}</p>
</div>
</el-scrollbar>
<table-um :headers="app_head[now_user][now_app]" :url="app_url_arr[now_user][now_app]" :paginationShow="true"></table-um>
<table-um
:headers="app_head[now_user][now_app]"
:url="app_url_arr[now_user][now_app]"
:paginationShow="true"
></table-um>
</div>
</div>
</div>
......@@ -227,7 +234,8 @@
<script>
import uuidv1 from "uuid/v1";
import tableUm from '../components/table-um'
import tableUm from "../components/table-um";
import { getRole } from "../utils/common";
var echarts = require("echarts");
export default {
data() {
......@@ -253,457 +261,454 @@ export default {
label: "应用总数"
}
],
app_url_arr:[
[],
['creat_app','check_app'],
['creat_app','check_app'],
],
app_head:[
app_url_arr: [[], ["creat_app", "check_app"], ["creat_app", "check_app"]],
app_head: [
[],
[
[
{
prop:'yymc',
label:'应用名称',
width:'90px',
align:'left',
prop: "yymc",
label: "应用名称",
width: "90px",
align: "left"
},
{
prop:'yylx',
label:'应用类型',
width:'120px',
align:'center',
prop: "yylx",
label: "应用类型",
width: "120px",
align: "center"
},
{
prop:'yybb',
label:'应用版本',
width:'80px',
align:'center',
prop: "yybb",
label: "应用版本",
width: "80px",
align: "center"
},
{
prop:'yycjsj',
label:'应用创建时间',
width:'160px',
align:'center',
prop: "yycjsj",
label: "应用创建时间",
width: "160px",
align: "center"
},
{
prop:'yybscs',
label:'被部署次数',
width:'100px',
align:'center',
},
prop: "yybscs",
label: "被部署次数",
width: "100px",
align: "center"
}
],
[
{
prop:'yymc',
label:'应用名称',
width:'90px',
align:'left',
prop: "yymc",
label: "应用名称",
width: "90px",
align: "left"
},
{
prop:'yylx',
label:'应用类型',
width:'120px',
align:'center',
prop: "yylx",
label: "应用类型",
width: "120px",
align: "center"
},
{
prop:'yybb',
label:'应用版本',
width:'80px',
align:'center',
prop: "yybb",
label: "应用版本",
width: "80px",
align: "center"
},
{
prop:'yyspsj',
label:'应用审批时间',
width:'160px',
align:'center',
prop: "yyspsj",
label: "应用审批时间",
width: "160px",
align: "center"
},
{
prop:'spzt',
label:'审批状态',
width:'100px',
align:'center',
},
],
prop: "spzt",
label: "审批状态",
width: "100px",
align: "center"
}
]
],
[
[
{
prop:'yymc',
label:'应用名称',
width:'90px',
align:'left',
prop: "yymc",
label: "应用名称",
width: "90px",
align: "left"
},
{
prop:'yylx',
label:'应用类型',
width:'120px',
align:'center',
prop: "yylx",
label: "应用类型",
width: "120px",
align: "center"
},
{
prop:'yybb',
label:'应用版本',
width:'80px',
align:'center',
prop: "yybb",
label: "应用版本",
width: "80px",
align: "center"
},
{
prop:'yycjsj',
label:'应用创建时间',
width:'160px',
align:'center',
prop: "yycjsj",
label: "应用创建时间",
width: "160px",
align: "center"
},
{
prop:'yybscs',
label:'被部署次数',
width:'100px',
align:'center',
},
prop: "yybscs",
label: "被部署次数",
width: "100px",
align: "center"
}
],
[
{
prop:'yymc',
label:'应用名称',
width:'90px',
align:'left',
prop: "yymc",
label: "应用名称",
width: "90px",
align: "left"
},
{
prop:'yylx',
label:'应用类型',
width:'120px',
align:'center',
prop: "yylx",
label: "应用类型",
width: "120px",
align: "center"
},
{
prop:'yybb',
label:'应用版本',
width:'80px',
align:'center',
prop: "yybb",
label: "应用版本",
width: "80px",
align: "center"
},
{
prop:'yyspsj',
label:'应用审批时间',
width:'160px',
align:'center',
prop: "yyspsj",
label: "应用审批时间",
width: "160px",
align: "center"
},
{
prop:'spzt',
label:'审批状态',
width:'100px',
align:'center',
},
],
],
prop: "spzt",
label: "审批状态",
width: "100px",
align: "center"
}
]
]
],
service_url_arr:[
['nor_service_list','nor_apply_service','nor_service_sh','nor_cloud'],
['nor_service_list','nor_service_sh','nor_cloud'],
['nor_service_list','nor_service_sh','nor_cloud_manage'],
service_url_arr: [
[
"nor_service_list",
"nor_apply_service",
"nor_service_sh",
"nor_cloud"
],
["nor_service_list", "nor_service_sh", "nor_cloud"],
["nor_service_list", "nor_service_sh", "nor_cloud_manage"]
],
service_head:[
service_head: [
[
[
{
prop:'fwmc',
label:'服务名称',
width:'250px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "250px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'zcfbsj',
label:'注册发布时间',
width:'200px',
align:'center',
prop: "zcfbsj",
label: "注册发布时间",
width: "200px",
align: "center"
},
{
prop:'bdycs',
label:'被调用次数',
width:'110px',
align:'center',
},
prop: "bdycs",
label: "被调用次数",
width: "110px",
align: "center"
}
],
[
{
prop:'fwmc',
label:'服务名称',
width:'250px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "250px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'sqsj',
label:'申请时间',
width:'200px',
align:'center',
prop: "sqsj",
label: "申请时间",
width: "200px",
align: "center"
},
{
prop:'sqspzt',
label:'申请审批状态',
width:'110px',
align:'center',
},
prop: "sqspzt",
label: "申请审批状态",
width: "110px",
align: "center"
}
],
[
{
prop:'fwmc',
label:'服务名称',
width:'250px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "250px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'spsj',
label:'审批时间',
width:'200px',
align:'center',
prop: "spsj",
label: "审批时间",
width: "200px",
align: "center"
},
{
prop:'spzt',
label:'审批状态',
width:'110px',
align:'center',
},
prop: "spzt",
label: "审批状态",
width: "110px",
align: "center"
}
],
[
{
prop:'gzqy',
label:'工作区域',
width:'150px',
align:'left',
prop: "gzqy",
label: "工作区域",
width: "150px",
align: "left"
},
{
prop:'wlhj',
label:'网络环境',
width:'120px',
align:'center',
prop: "wlhj",
label: "网络环境",
width: "120px",
align: "center"
},
{
prop:'cpu',
label:'CPU(核)',
width:'90px',
align:'center',
prop: "cpu",
label: "CPU(核)",
width: "90px",
align: "center"
},
{
prop:'ncgb',
label:'内存(GB)',
width:'90px',
align:'center',
prop: "ncgb",
label: "内存(GB)",
width: "90px",
align: "center"
},
{
prop:'zyzlgb',
label:'资源总量(GB)',
width:'120px',
align:'center',
prop: "zyzlgb",
label: "资源总量(GB)",
width: "120px",
align: "center"
},
{
prop:'sqzt',
label:'申请状态',
width:'110px',
align:'center',
},
],
prop: "sqzt",
label: "申请状态",
width: "110px",
align: "center"
}
]
],
[
[
{
prop:'fwmc',
label:'服务名称',
width:'140px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "140px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'zcfbsj',
label:'注册发布时间',
width:'180px',
align:'center',
prop: "zcfbsj",
label: "注册发布时间",
width: "180px",
align: "center"
},
{
prop:'bdycs',
label:'被调用次数',
width:'110px',
align:'center',
},
prop: "bdycs",
label: "被调用次数",
width: "110px",
align: "center"
}
],
[
{
prop:'fwmc',
label:'服务名称',
width:'140px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "140px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'spsj',
label:'审批时间',
width:'180px',
align:'center',
prop: "spsj",
label: "审批时间",
width: "180px",
align: "center"
},
{
prop:'spzt',
label:'审批状态',
width:'110px',
align:'center',
},
prop: "spzt",
label: "审批状态",
width: "110px",
align: "center"
}
],
[
{
prop:'gzqy',
label:'工作区域',
width:'100px',
align:'left',
prop: "gzqy",
label: "工作区域",
width: "100px",
align: "left"
},
{
prop:'wlhj',
label:'网络环境',
width:'90px',
align:'center',
prop: "wlhj",
label: "网络环境",
width: "90px",
align: "center"
},
{
prop:'cpu',
label:'CPU(核)',
width:'80px',
align:'center',
prop: "cpu",
label: "CPU(核)",
width: "80px",
align: "center"
},
{
prop:'ncgb',
label:'内存(GB)',
width:'80px',
align:'center',
prop: "ncgb",
label: "内存(GB)",
width: "80px",
align: "center"
},
{
prop:'zyzlgb',
label:'资源总量(GB)',
width:'110px',
align:'center',
prop: "zyzlgb",
label: "资源总量(GB)",
width: "110px",
align: "center"
},
{
prop:'sqzt',
label:'操作',
width:'110px',
align:'center',
type:'Button',
btnList:[
prop: "sqzt",
label: "操作",
width: "110px",
align: "center",
type: "Button",
btnList: [
{
label:'分配',
type:1
label: "分配",
type: 1
},
{
label:'已分配',
type:1
},
label: "已分配",
type: 1
}
]
},
],
}
]
],
[
[
{
prop:'fwmc',
label:'服务名称',
width:'140px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "140px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'zcfbsj',
label:'注册发布时间',
width:'180px',
align:'center',
prop: "zcfbsj",
label: "注册发布时间",
width: "180px",
align: "center"
},
{
prop:'bdycs',
label:'被调用次数',
width:'110px',
align:'center',
},
prop: "bdycs",
label: "被调用次数",
width: "110px",
align: "center"
}
],
[
{
prop:'fwmc',
label:'服务名称',
width:'140px',
align:'left',
prop: "fwmc",
label: "服务名称",
width: "140px",
align: "left"
},
{
prop:'fwlx',
label:'服务类型',
width:'120px',
align:'center',
prop: "fwlx",
label: "服务类型",
width: "120px",
align: "center"
},
{
prop:'spsj',
label:'审批时间',
width:'180px',
align:'center',
prop: "spsj",
label: "审批时间",
width: "180px",
align: "center"
},
{
prop:'spzt',
label:'审批状态',
width:'110px',
align:'center',
},
prop: "spzt",
label: "审批状态",
width: "110px",
align: "center"
}
],
[
{
prop:'sszz',
label:'所属组织',
width:'170px',
align:'left',
prop: "sszz",
label: "所属组织",
width: "170px",
align: "left"
},
{
prop:'cpu',
label:'CPU使用量(核)',
width:'120px',
align:'center',
prop: "cpu",
label: "CPU使用量(核)",
width: "120px",
align: "center"
},
{
prop:'ncgb',
label:'内存使用量(GB)',
width:'130px',
align:'center',
prop: "ncgb",
label: "内存使用量(GB)",
width: "130px",
align: "center"
},
{
prop:'gzqysl',
label:'工作区域数量(个)',
width:'130px',
align:'center',
},
],
],
prop: "gzqysl",
label: "工作区域数量(个)",
width: "130px",
align: "center"
}
]
]
],
fw_value: 0,
menu_arr: [
......@@ -838,12 +843,12 @@ export default {
service_arr: [
["服务列表", "申请服务", "服务审批", "云资源"],
["服务列表", "服务审批", "云资源管理"],
["服务列表", "服务审批", "云资源管理"],
["服务列表", "服务审批", "云资源管理"]
],
apptype_arr: [
["部署的应用", "创新的应用"],
["创新应用", "应用审批"],
["创新应用", "应用审批"],
["创新应用", "应用审批"]
],
app_arr: [
{
......@@ -910,61 +915,63 @@ export default {
]
};
},
components:{
components: {
tableUm
},
mounted() {
if (this.now_user == 0) {
this.init_health(50);
this.init_yy();
} else if (this.now_user == 1) {
this.init_health(50);
this.init_yy();
this.init_fwyy();
} else if (this.now_user == 2) {
this.init_yy();
this.init_fwlx_asy(
[
{
name: "数据服务",
value: 10
},
{
name: "感知服务",
value: 10
},
{
name: "视频服务",
value: 10
},
{
name: "时空服务",
value: 10
},
{
name: "综合服务",
value: 10
}
]
);
this.init_yylx_asy(
[
{
name: "基础工具",
value: 10
},
{
name: "通信应用",
value: 10
},
{
name: "业务应用",
value: 10
this.now_user = this.$store.state.role
getRole().then(data => {
this.now_user = data;
this.$store.commit('rolefun',data)
setTimeout(() => {
if (this.now_user == 0) {
this.init_health(50);
this.init_yy();
} else if (this.now_user == 1) {
this.init_health(50);
this.init_yy();
this.init_fwyy();
} else if (this.now_user == 2) {
this.init_yy();
this.init_fwlx_asy([
{
name: "数据服务",
value: 10
},
{
name: "感知服务",
value: 10
},
{
name: "视频服务",
value: 10
},
{
name: "时空服务",
value: 10
},
{
name: "综合服务",
value: 10
}
]);
this.init_yylx_asy([
{
name: "基础工具",
value: 10
},
{
name: "通信应用",
value: 10
},
{
name: "业务应用",
value: 10
}
]);
}
]
);
}
});
}, 500);
},
methods: {
manage_func(n) {
......@@ -1074,22 +1081,22 @@ export default {
window[this.health] = echarts.init(document.getElementById(this.health));
window[this.health].setOption(options, true);
},
init_fwlx_asy(data){
var options = this.init_circle(data)
init_fwlx_asy(data) {
var options = this.init_circle(data);
window[this.fwlx_asy] = echarts.init(
document.getElementById(this.fwlx_asy)
);
window[this.fwlx_asy].setOption(options, true);
},
init_yylx_asy(data){
var options = this.init_circle(data)
init_yylx_asy(data) {
var options = this.init_circle(data);
window[this.yylx_asy] = echarts.init(
document.getElementById(this.yylx_asy)
);
window[this.yylx_asy].setOption(options, true);
},
init_circle(data) {
var scaleData =data
var scaleData = data;
var rich = {
white: {
color: "#ddd",
......@@ -1111,14 +1118,8 @@ export default {
}
};
var data = [];
var color = [
"#515fe7",
"#36a5ec",
"#da9f2a",
"#23b2a7",
"#d46002",
];
var legendarr = []
var color = ["#515fe7", "#36a5ec", "#da9f2a", "#23b2a7", "#d46002"];
var legendarr = [];
for (var i = 0; i < scaleData.length; i++) {
data.push(
{
......@@ -1139,7 +1140,7 @@ export default {
itemStyle: placeHolderStyle
}
);
legendarr.push(scaleData[i].name)
legendarr.push(scaleData[i].name);
}
var seriesObj = [
{
......@@ -1147,7 +1148,7 @@ export default {
type: "pie",
clockWise: false,
radius: [53, 57],
center: ['51%', '39%'],
center: ["51%", "39%"],
hoverAnimation: false,
itemStyle: {
normal: {
......@@ -1163,42 +1164,40 @@ export default {
}
percent = ((params.value / total) * 100).toFixed(0);
if (params.name !== "") {
return params.name + "\n" + params.value + "";
return params.name + "\n" + params.value + "";
} else {
return "";
}
},
rich: rich
},
}
}
},
data: data
}
];
var options = {
color:color,
color: color,
tooltip: {
show: false
},
legend: {
bottom: -5,
left: 'center',
itemWidth:10,
itemHeight:10,
orient:'horizontal',
data:legendarr,
left: "center",
itemWidth: 10,
itemHeight: 10,
orient: "horizontal",
data: legendarr,
backgroundColor: "#f4f7fc"
},
toolbox: {
show: false,
show: false
},
series: seriesObj
};
return options
return options;
},
init_yy() {
var colors = ["#e56600", "#c9cedd", "#515fe7"];
......
var store = {
install: function(Vuex) {
store.namespace = new Vuex.Store({
state: {
userInfo: null, // 用户信息
ssType: "全部",
ssPrams: {
firstId: "", // int 一级分类 0全部
secondId: "", // int 二级分类 0全部
type: 0, // int 0 附近 1评价
search: "", // string 按名称搜索
fifteen: 0
}, // 设施列表参数 for ssHeader组件
name: "",
//进行相关操作和请求接口时,调用函数同步更改,页面的初始化使用state里面的值进行绑定
selectedFacility: {
//选中的poi,点击地图上的点或者在列表中选中时更新状态
name: "", //poi的名称
id: "", //poi的id
distance: "", //poi离用户的距离
evaluation: "", //poi的评分
evaluation_num: "", //poi的评价次数
address: "", //poi的详细地址
discribe: "", //poi的描述信息
lat: "", //poi的经纬度
lng: "",
type: "" ,//poi的类型
detail_type: "" ,//poi的类型
tertiary_type:[]//停车场的具体类型,地下1,地面2,路边3
},
// selectID:"",
// selectTag: "",
currentPosition: {
lng: 112.546184,
lat: 28.281588
},
mapState: "showAll", //"showAll","showSelectTag","showSelectedFacility",
isPullUp: false//是否上拉,为true时,地图的浮窗将会隐藏
},
mutations: {
updateSstype(state, payload) {
state.ssType = payload;
},
upDateSsParams(state, payload) {
Object.assign(state.ssPrams, payload);
},
change(state, name) {
state.name = name;
sessionStorage.setItem("name", name);
},
updateFullDetail(state, detail) {
Object.assign(state.selectedFacility, detail);
},
updateMapState(state, payload) {
state.mapState = payload;
},
updatecurrentPosition(state, payload) {
state.currentPosition = payload;
},
upDateIsPullUp(state, value) {
state.isPullUp = value;
}
/* updateselectTag(state, payload) {
state.selectTag = payload;
},
updateselectID(state, payload) {
state.selectID = payload;
}, */
}
});
}
};
import Vuex from 'vuex'
import Vue from 'vue'
Vue.use(Vuex);
module.exports = store;
const store = new Vuex.Store({
state: {
role:1,//0:普通用户,1:组织管理员,2:超级管理员
},
modules: {
},
mutations: {
rolefun(state, newValue) {
state.role = newValue;
},
},
});
export default store
\ No newline at end of file
function getRole(){
return new Promise((resolve,reject)=>{
if(true){
resolve(1)
}else{
reject('error')
}
})
}
export{
getRole
}
\ No newline at end of file
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