diff --git a/src/components/shop-cloud/shop-cloud.vue b/src/components/shop-cloud/shop-cloud.vue index e7a334fc5e8cc4a510f4cd29fa50c960b0ca6f5c..d1aa7698c76ecd6094977976749a39849a810371 100644 --- a/src/components/shop-cloud/shop-cloud.vue +++ b/src/components/shop-cloud/shop-cloud.vue @@ -7,19 +7,19 @@ - +
申请部门:
- +
部门联系人:
- +
联系电话:
@@ -31,205 +31,213 @@ - - - -
基本信息
-
- - -
工作区域名称:
- -
-
- - -
中文名称:
- -
-
- - -
描述信息:
- -
-
- -
工作区域申请规格
-
- - -
CPU:
- - - -
-
-
- - -
内存:
- - - -
GB
-
-
- - -
容器组:
- -
-
-
- - -
数据盘(可选):
- -
-
-
- - -
每块数据盘容量:
- -
GB
-
-
- -
单个容器组规格
-
- -
CPU:
-
- - -
最高
- -
-
-
- - -
默认
- -
-
-
- -
内存:
-
- - -
最高
- -
-
-
- - -
默认
- -
-
-
- -
其他信息
-
- - -
申请时长:
- - - - -
-
- - -
申请文件:
- -
-
-
-
+ + + + + +
基本信息
+
+ + +
工作区域名称:
+ +
+
+ + +
中文名称:
+ +
+
+ + +
描述信息:
+ +
+
+ +
工作区域申请规格
+
+ + +
CPU:
+ + + +
+
+
+ + +
内存:
+ + + +
GB
+
+
+ + +
容器组:
+ +
+
+
+ + +
数据盘(可选):
+ +
+
+
+ + +
每块数据盘容量:
+ +
GB
+
+
+ +
单个容器组规格
+
+ +
CPU:
+
+ + +
最高
+ +
+
+
+ + +
默认
+ +
+
+
+ +
内存:
+
+ + +
最高
+ +
+
+
+ + +
默认
+ +
+
+
+ +
其他信息
+
+ + +
申请时长:
+ + + + +
+
+ + +
申请文件:
+ +
+
+
+
+
+
- +
选择要进行升级的工作区域:
@@ -244,231 +252,239 @@
- - - -
工作区域升级规格
-
- -
当前规格:
-
-
- - {{ item.title }} - {{ item.val + " " + (item.title == "CPU" ? "核" : item.title == "内存" ? "GB" : "个") }} -
-
-
- - -
申请CPU升级至:
- - - -
-
-
- - -
申请内存升级至:
- - - -
GB
-
-
- - -
申请容器组升级至:
- -
-
-
- - -
增加数据盘:
- -
-
-
- - -
每块数据盘容量:
- -
GB
-
-
- -
单个容器组规格设定
-
- -
当前规格:
-
-
- - {{ item.title }} -
- 最高 {{ item.max }} {{ item.title == "CPU" ? "核" : "GB" }} -
- 默认 {{ item.default }} {{ item.title == "CPU" ? "核" : "GB" }} + + + + + +
工作区域升级规格
+
+ +
当前规格:
+
+
+ + {{ item.title }} + {{ item.val + " " + (item.title == "CPU" ? "核" : item.title == "内存" ? "GB" : "个") }} +
-
-
- - -
CPU:
-
- - -
最高
- -
-
-
- - -
默认
- -
-
-
- -
内存:
-
- - -
最高
- -
-
-
- - -
默认
- -
-
-
- -
其他信息
- -
当前规格:
-
-
- - 当前工作区域到期时间 - 2020-05-05 08:00:00 + + + +
申请CPU升级至:
+ + + +
+
+
+ + +
申请内存升级至:
+ + + +
GB
+
+
+ + +
申请容器组升级至:
+ +
+
+
+ + +
增加数据盘:
+ +
+
+
+ + +
每块数据盘容量:
+ +
GB
+
+
+ +
单个容器组规格设定
+
+ +
当前规格:
+
+
+ + {{ item.title }} +
+ 最高 {{ item.max }} {{ item.title == "CPU" ? "核" : "GB" }} +
+ 默认 {{ item.default }} {{ item.title == "CPU" ? "核" : "GB" }} +
+
-
- - - - -
申请续期:
- - - - -
-
- - -
申请文件:
- -
-
- - + + +
CPU:
+
+ + +
最高
+ +
+
+
+ + +
默认
+ +
+
+
+ +
内存:
+
+ + +
最高
+ +
+
+
+ + +
默认
+ +
+
+
+ +
其他信息
+ +
当前规格:
+
+
+ + 当前工作区域到期时间 + 2020-05-05 08:00:00 +
+
+
+
+ + +
申请续期:
+ + + + +
+
+ + +
申请文件:
+ +
+
+ + + +
@@ -611,14 +627,14 @@ export default { description: "", CPUs: "", RAMs: "", - containerGroup: "", - dataDisk: "", - perDataDisk: "", - perCPUs: "", - perCPU: "", - perRAMs: "", - perRAM: "", - appDuration: "", + containerGroup: undefined, + dataDisk: undefined, + perDataDisk: undefined, + perCPUs: undefined, + perCPU: undefined, + perRAMs: undefined, + perRAM: undefined, + appDuration: undefined, durType: "" }, durationOptions: [ @@ -655,14 +671,14 @@ export default { description: "", CPUs: "", RAMs: "", - containerGroup: "", - dataDisk: "", - perDataDisk: "", - perCPUs: "", - perCPU: "", - perRAMs: "", - perRAM: "", - appDuration: "", + containerGroup: undefined, + dataDisk: undefined, + perDataDisk: undefined, + perCPUs: undefined, + perCPU: undefined, + perRAMs: undefined, + perRAM: undefined, + appDuration: undefined, durType: "" }, dialogVisible: false @@ -676,7 +692,7 @@ export default { if (val != "") { this.formShow = true; Object.keys(this.formOld).forEach(item => { - this.formOld[item] = ""; + this.formOld[item] = undefined; }); } else { this.formShow = false; @@ -726,9 +742,6 @@ export default { .form_item { width: calc(100% - 20px); } -.form_block .el-input { - width: 90%; -} .form_item_title { padding: 0 15px; line-height: 40px; diff --git a/src/components/shopping-cart/shopping-cart-com.vue b/src/components/shopping-cart/shopping-cart-com.vue index ca89f194edd75db6df1f6d31f4c6af97ad9fb670..d6114334c69e46b2fc072676cbb82a0a2df92156 100644 --- a/src/components/shopping-cart/shopping-cart-com.vue +++ b/src/components/shopping-cart/shopping-cart-com.vue @@ -73,44 +73,8 @@ export default { props: {}, data: () => ({ checkShopAll: false, - checkList: [false, false, false], - list: [ - { - id: 0, - name: "水路货物周转量情况", - type: "基础数据服务", - creator: "贵州省交通运输厅0", - state: 1, - mapService: 1, - num: 2, - checkedSubscription: false, - specification: 1, - specificationApplication: 2 - }, - { - id: 1, - name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周", - type: "基础数据服务", - creator: "贵州省交通运输厅1", - state: 1, - num: 2, - checkedSubscription: false, - specification: 1, - specificationApplication: 2 - }, - { - id: 2, - name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周", - type: "基础数据服务", - creator: "贵州省交通运输厅2", - state: 1, - mapService: 1, - num: 2, - checkedSubscription: true, - specification: 1, - specificationApplication: 2 - } - ] + checkList: [], + list: [] }), mounted() { this.getList(); @@ -128,8 +92,12 @@ export default { getList() { this.$api.serviceShop.getShoppingCart().then(response => { if (response.data.success == "1") { - console.log(response.data.data) + console.log(response.data.data); this.list = response.data.data; + for (const index in this.list) { + this.checkList.push(false); + } + console.log(this.checkList); } else { console.log(response.data.message); } @@ -141,6 +109,7 @@ export default { changeState(val) { console.log(val); this.$set(this.checkList, val.index, val.state); + console.log(this.checkList); if (this.checkList.indexOf(false) == -1) { this.checkShopAll = true; } else { diff --git a/src/components/table-um.vue b/src/components/table-um.vue index 7a759c80632a64ad19154e0ee0d880bbfaccf02b..c77b58eeb9e80b61965f46cc690a0b245d6b645c 100644 --- a/src/components/table-um.vue +++ b/src/components/table-um.vue @@ -268,21 +268,12 @@ export default { loading: { type: Boolean, default: false }, // 表格数据 headers: { type: Array, default: () => [] }, - // 表格列配置 - // tableData: { type: Array, default: () => [] }, // 是否显示表格复选框 isSelection: { type: Boolean, default: false }, defaultSelections: { type: [Array, Object], default: () => null }, // 是否显示表格索引 isIndex: { type: Boolean, default: false }, indexLabel: { type: String, default: "序号" }, - // 是否显示分页 - // isPagination: { type: Boolean, default: true }, - // // 分页数据 - // pagination: { - // type: Object, - // default: () => ({ pageSize: 10, pageNum: 1, total: 0 }) - // }, searchShow: { type: Boolean, default: false @@ -368,11 +359,14 @@ export default { getSelectBtn: { type: Boolean, default: false + }, + params: { + type: Object, + default: () => {} } }, data() { return { - all_url: "", pagination: { rowsPerPage: 10, page: 1, @@ -424,6 +418,12 @@ export default { this.getDataFromApiSync(); }, deep: true + }, + params: { + handler(val) { + this.getDataFromApiSync(); + }, + deep: true } }, methods: { @@ -479,13 +479,20 @@ export default { let total = newArr.length; resolve({ newArr, total }); } else { - this.all_url = `/static/data.json`; - this.$http - .get(this.all_url) + let query = this.params; + query.Page = this.pagination.page; + query.Size = this.pagination.rowsPerPage; + let arr = this.url.split("."); + let obj = this.$api; + arr.forEach(item => { + obj = obj[item]; + }); + console.log(query); + obj(query) .then(response => { - let newArr = response.data.data[this.url]; + let newArr = response.data.data; // if it is true url, total is response's total - let total = newArr.length; + let total = response.data.total; resolve({ newArr, total }); }) .catch(function(response) { @@ -502,6 +509,7 @@ export default { searchVal() { if (this.times !== null) clearTimeout(this.times); this.times = setTimeout(() => { + this.resetPageNumber(); this.getDataFromApiSync(); }, 500); }, @@ -651,9 +659,9 @@ export default { let newRow = {}; let arr = this.headers; arr.forEach(item => { - newRow[item.prop] = "" - }) - newRow.flag = true //新增标记 + newRow[item.prop] = ""; + }); + newRow.flag = true; //新增标记 newRow.id = parseInt(Math.random() * 100000, 10) + "" + @@ -665,6 +673,7 @@ export default { return this.selectedTabsPage; }, filterChange(filter) { + this.resetPageNumber(); console.log(filter); }, // 上传文件事件 @@ -695,6 +704,10 @@ export default { self.changeUp(arr[i].children, id, input, header); } } + }, + // 重置页码 + resetPageNumber() { + this.pagination.page = 1; } } }; diff --git a/src/pages/authority/menus.vue b/src/pages/authority/menus.vue index 598df6a05e3a1872eccbfed4d64d478a6df1e6d1..c5eaf248bae62f0a093f2321491865fec1b7000f 100644 --- a/src/pages/authority/menus.vue +++ b/src/pages/authority/menus.vue @@ -13,7 +13,7 @@
 下移 -
- +
菜单名称:
- +
菜单访问地址:
- +
菜单组别:
- +
菜单描述:
- +
菜单排序:
- +
创建人:
- +
创建时间:
- +
@@ -107,121 +111,91 @@ export default { data() { var validateMenuName = (rule, value, callback) => { - if (value != this.formContrast.mcHold) { + if (value != this.formContrast.menu_name) { this.reset = true; } + console.log(value); if (value == "") { this.mcHold = false; callback(new Error("请填写菜单名称")); + } else if (value.length > 8) { + this.mcHold = false; + callback(new Error("菜单名称不超过8位")); } else { this.mcHold = true; callback(); } }; var validatePageUrl = (rule, value, callback) => { - if (value != this.formContrast.pageUrl) { + if (value != this.formContrast.visit_url) { this.reset = true; } if (value == "") { this.ymHold = false; - callback(new Error("请填写运行页面")); + callback(new Error("请填写菜单访问地址")); } else { this.ymHold = true; callback(); } }; var validateDescribe = (rule, value, callback) => { - if (value != this.formContrast.describe) { + if (value != this.formContrast.detail) { + this.reset = true; + } + callback(); + }; + var validateTeamName = (rule, value, callback) => { + if (value != this.formContrast.team_name) { + this.reset = true; + } + callback(); + }; + var validateMenuOrder = (rule, value, callback) => { + if (value != this.formContrast.menu_order) { this.reset = true; } callback(); }; return { checkText: "", - treeData: [ - { - id: 1, - label: "一级 2", - children: [ - { - id: 3, - label: "二级 2-1", - children: [ - { - id: 4, - label: "三级 3-1-1", - children: [ - { - id: 5, - label: "三级 3-1-2", - disabled: true - } - ] - }, - { - id: 5, - label: "三级 3-1-2", - disabled: true - } - ] - }, - { - id: 2, - label: "二级 2-2", - disabled: true, - children: [ - { - id: 6, - label: "三级 3-2-1" - }, - { - id: 7, - label: "三级 3-2-2", - disabled: true - } - ] - } - ] - } - ], + treeData: [], defaultProps: { - children: "children", - label: "label" + children: "Child", + label: "menu_name" }, formDetail: { menu_name: "", visit_url: "", team_name: "", detail: "", - sort: "", - creatTime: "" + menu_order: "", + create_user: "", + create_date: "" }, formYs: { menu_name: "", visit_url: "", team_name: "", detail: "", - sort: "", - creatTime: "" + menu_order: "", + create_user: "", + create_date: "" }, formContrast: { menu_name: "", visit_url: "", team_name: "", detail: "", - sort: "", - creatTime: "" + menu_order: "", + create_user: "", + create_date: "" }, rules: { - menuName: [ - { required: true, message: "请填写菜单名称", trigger: "blur" }, - { validator: validateMenuName, trigger: "blur" } - ], - pageUrl: [ - { required: true, message: "请填写运行页面", trigger: "blur" }, - { validator: validatePageUrl, trigger: "blur" } - ], - describe: [{ validator: validateDescribe, trigger: "blur" }] + menu_name: [{ validator: validateMenuName, trigger: "blur" }], + visit_url: [{ validator: validatePageUrl, trigger: "blur" }], + team_name: [{ validator: validateTeamName, trigger: "blur" }], + detail: [{ validator: validateDescribe, trigger: "blur" }], + menu_order: [{ validator: validateMenuOrder, trigger: "blur" }] }, nodeId: "", previousSibling: false, @@ -238,7 +212,7 @@ export default { } }, mounted() { - // this.getTree(); + this.getTree(); }, methods: { checkNode(value, data) { @@ -246,7 +220,7 @@ export default { return data.label.indexOf(value) !== -1; }, nodeClick(data, node) { - this.nodeId = data.id; + this.nodeId = data.menu_id; if (node.previousSibling != undefined) { this.previousSibling = true; } else { @@ -257,7 +231,7 @@ export default { } else { this.nextSibling = false; } - let cid = String(data.id); + let cid = String(data.menu_id); if (cid.indexOf("new") > -1) { this.formDetail = this.formYs; } else { @@ -268,23 +242,31 @@ export default { if (response.data.success == 1) { this.formDetail = response.data.data; this.formContrast = response.data.data; - callback(); } else { this.ruleFormIcon.username = false; - callback(new Error(response.data.errMsg)); + this.message({ + message: response.data.errMsg, + type: "error" + }); } }); } }, appendNode() { - let newChild = { id: "new" + this.newI, label: "新菜单", children: [] }; + let newChild = { + menu_id: "new" + this.newI, + menu_name: "新菜单", + Child: [] + }; this.newI++; - let data = this.nodeData; this.$refs.tree.append(newChild, this.nodeId); - this.$refs.tree.setCurrentKey(newChild.id); - let node = this.$refs.tree.getNode(newChild.id); + this.$refs.tree.setCurrentKey(newChild.menu_id); + let node = this.$refs.tree.getNode(newChild.menu_id); + console.log(node); this.nodeClick(newChild, node); - this.formDetail.sort = node.parent.childNodes.length; + this.formDetail.menu_order = node.parent.childNodes.length; + this.formDetail.menu_name = newChild.menu_name; + this.mcHold = true; }, resetForm() { this.formDetail = this.formContrast; @@ -292,7 +274,7 @@ export default { getTree() { this.$api.authority.getMenuList().then(response => { console.log(response); - this.treeData = response.data.spec; + this.treeData = response.data.data; }); }, saveNode() { @@ -304,13 +286,34 @@ export default { visit_url: this.formDetail.visit_url, team_name: this.formDetail.team_name }; - this.$api.authority.editMenu(query).then(response => { - if (response.data.success == 1) { - this.getTree(); - } else { - console.log(response.data.errMsg); - } - }); + if (this.nodeId.substring(0, 3) == "new") { + let node = this.$refs.tree.getNode(this.nodeId); + console.log(node.parent); + query.parent_id = node.parent.data.menu_id; + this.$api.authority.addMenu(query).then(response => { + if (response.data.success == 1) { + this.message({ + message: "插入菜单成功", + type: "success" + }); + this.getTree(); + } else { + console.log(response.data.errMsg); + } + }); + } else { + this.$api.authority.editMenu(query).then(response => { + if (response.data.success == 1) { + this.message({ + message: "修改菜单成功", + type: "success" + }); + this.getTree(); + } else { + console.log(response.data.errMsg); + } + }); + } }, deleteNode() { let params = { @@ -318,6 +321,10 @@ export default { }; this.$api.authority.delMenu(params).then(response => { if (response.data.success == 1) { + this.message({ + message: "删除菜单成功", + type: "success" + }); this.getTree(); } else { console.log(response.data.errMsg); @@ -334,12 +341,12 @@ export default { let params = { data: [ { - id: node.data.id, - sort: nodeNext.data.sort + id: node.data.menu_id, + sort: nodeNext.data.menu_order }, { - id: nodeNext.data.id, - sort: node.data.sort + id: nodeNext.data.menu_id, + sort: node.data.menu_order } ] }; diff --git a/src/pages/example/example_table.vue b/src/pages/example/example_table.vue index 3fdc42b1920c6609e948026f39b432f892ac71a8..27612f449e0d1e105ec1328c5c869ba8d5a270e1 100644 --- a/src/pages/example/example_table.vue +++ b/src/pages/example/example_table.vue @@ -7,7 +7,7 @@ size="mini" :border="false" :headers="headers" - url="tableData" + url="serviceShop.getServiceShopList" :searchShow="true" :addRowBtn="addRowBtn" :autoAdd="false" @@ -24,6 +24,7 @@ :pageSizeShow="true" :filterList="filterList" cellClassName="cell_width" + :params="params" >

可编辑表格,供服务测试用

带树结构表格,供服务测试用

@@ -118,7 +121,13 @@ export default { ], headers1: [ { label: "服务url", prop: "date", type: "input", align: "left" }, - { label: "服务名称", prop: "ssss", type: "upload", align: "center", uploadKey: "type" }, + { + label: "服务名称", + prop: "ssss", + type: "upload", + align: "center", + uploadKey: "type" + }, { label: "文件类型", prop: "type", @@ -169,7 +178,16 @@ export default { prop: "fwzt", data: ["数据服务", "时空服务", "视频服务", "感知服务", "综合服务"] } - ] + ], + params: { + serviceName: 1, + serviceType1: 1, + serviceType2s: 1, + serviceType3s: 1, + dataDomains: 1, + organizeIds: 1, + orderBy: 1, + } }), components: { cesTable