diff --git a/.env.shibei_production b/.env.shibei_production new file mode 100644 index 00000000..b227d2fa --- /dev/null +++ b/.env.shibei_production @@ -0,0 +1,4 @@ +NODE_ENV=production +VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api +VUE_APP_NODE_ENV=shibei_prod +VUE_APP_PUBLIC_PATH=epmet-oper \ No newline at end of file diff --git a/package.json b/package.json index 699ce11d..360bbcb1 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build:sit": "vue-cli-service build --mode production.sit", "build:uat": "vue-cli-service build --mode production.uat", "build:prod": "vue-cli-service build --mode production", + "build:shibei_prod": "vue-cli-service build --mode shibei_production", "lint": "vue-cli-service lint", "et": "node_modules/.bin/et", "et:init": "node_modules/.bin/et -i", diff --git a/public/index.html b/public/index.html index 6b33435e..d6bf95af 100644 --- a/public/index.html +++ b/public/index.html @@ -14,7 +14,7 @@ window.SITE_CONFIG = {} window.SITE_CONFIG['version'] = 'v2.0.0' window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>' - window.SITE_CONFIG['apiURL'] = '' // api请求地址 + window.SITE_CONFIG['apiURL'] = '<%= process.env.VUE_APP_API_SERVER %>' // api请求地址 window.SITE_CONFIG['storeState'] = {} // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态) window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象 @@ -36,7 +36,7 @@ - <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> + + <!– 集成测试环境 dev –> <% if (process.env.VUE_APP_NODE_ENV==='prod:sit' ) { %> <% } %> - + <!– 验收测试环境 aliyun –> <% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %> <% } %> - + <!– 生产环境 –> <% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %> - <% } %> + <% } %>--> + +
diff --git a/src/assets/scss/modules/visual/communityManage.scss b/src/assets/scss/modules/visual/communityManage.scss new file mode 100644 index 00000000..9137229d --- /dev/null +++ b/src/assets/scss/modules/visual/communityManage.scss @@ -0,0 +1,66 @@ +.div_search { + display: flex; + + .resi-cell { + display: flex; + align-items: center; + .resi-cell-label { + width: 70px; + box-sizing: border-box; + margin-right: 15px; + text-align: right; + // line-height: 32; + } + + .resi-cell-input { + width: 180px; + } + } +} + +.div_table { + margin-top: 20px; + position: relative; +} +.div_del { + position: absolute; + left: 10px; + bottom: 0; +} +.div_search { + display: flex; + + .resi-cell { + display: flex; + align-items: center; + .resi-cell-label { + width: 70px; + box-sizing: border-box; + margin-right: 15px; + text-align: right; + // line-height: 32; + } + + .resi-cell-input { + width: 180px; + } + } +} + +.div_btn { + display: flex; + margin-top: 20px; + + .btn_upload { + margin-left: 10px; + display: flex; + } +} + +.el-row { + /* margin-bottom: 20px; */ + display: flex; + flex-wrap: wrap; + margin-top: 10px; + margin-right: 50px; +} diff --git a/src/js/dai/request.js b/src/js/dai/request.js index 7d908450..8365bd3e 100644 --- a/src/js/dai/request.js +++ b/src/js/dai/request.js @@ -2,7 +2,6 @@ | 请求接口封装 | ---------------------------------------------------------------*/ import axios from "axios"; - import curry from "dai-js/tools/curry"; import { Message } from "element-ui"; diff --git a/src/js/dai/request2.js b/src/js/dai/request2.js new file mode 100644 index 00000000..8c38025d --- /dev/null +++ b/src/js/dai/request2.js @@ -0,0 +1,90 @@ +/*--------------------------------------------------------------- + | 请求接口封装 | + ---------------------------------------------------------------*/ +import axios from "axios"; +import curry from "dai-js/tools/curry"; +import { Message } from "element-ui"; + +const request = curry( + (method, url, data = {}, headers = {}, progress = () => {}) => { + return new Promise((reslove) => { + let returnIniData = { + httpCode: "", + data: {}, + msg: "", + code: "", + }; + + // 添加服务器端URL + function processUrl(url) { + if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) { + return url; + } + return process.env.VUE_APP_API_SERVER + url; + } + + url = processUrl(url); + + const succFn = (res) => { + // log(`[request成功] ${url}`, data, res); + let retData = { + ...returnIniData, + ...res.data, + httpCode: res.statusCode, + }; + // if(typeof Vue.$afterRequestHook == 'function'){ + // retData = Vue.$afterRequestHook(retData); + // } + if (res.data.code > 8000 && res.data.code < 10000) { + Message.error(res.data.msg); + } + + reslove(retData); + }; + + const failFn = (err) => { + // log(`[request失败] ${url}`, data, err); + + reslove( + Object.assign({}, returnIniData, { + httpCode: "9999", //访问出现意外 + msg: "网络错误", + }) + ); + }; + + if (method.toUpperCase() == "POST") { + axios + .post(url, data, { + headers, + responseType: "json", + // progress, + // credentials: false, + }) + .then(succFn) + .catch(failFn); + } else { + axios + .get(url, { + params: data, + headers, + responseType: "json", + // credentials: true, + }) + .then(succFn) + .catch(failFn); + } + }); + } +); + +export const requestGet = request("get"); + +export const requestPost = request("post"); + +export default { + install(Vue) { + Vue.prototype.$requestGet = requestGet; + Vue.prototype.$requestPost = requestPost; + }, +}; diff --git a/src/router/index.js b/src/router/index.js index fff0862e..f2c75cfa 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -375,7 +375,7 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { for (var i = 0; i < menuList.length; i++) { if (menuList[i].children && menuList[i].children.length >= 1) { temp = temp.concat(menuList[i].children); - continue; + // continue; } // 组装路由 var route = { diff --git a/src/views/main-shuju/main.vue b/src/views/main-shuju/main.vue index e587a366..ae869f5a 100644 --- a/src/views/main-shuju/main.vue +++ b/src/views/main-shuju/main.vue @@ -1,22 +1,18 @@ -