Browse Source

Merge branch 'dev_september' of http://git.elinkit.com.cn:7070/r/epmet-oper into dev_september

preview
jiangyy 5 years ago
parent
commit
b9019b407b
  1. 122
      epmet-oper-web/public/index.html
  2. 35
      epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss
  3. 9
      epmet-oper-web/src/js/ajax.js
  4. 70
      epmet-oper-web/src/js/columns/miniPro/partnerApp.js
  5. 42
      epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue
  6. 120
      epmet-oper-web/src/views/modules/partner/app/edit.vue
  7. 44
      epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue

122
epmet-oper-web/public/index.html

@ -1,69 +1,71 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<!-- 站点配置 -->
<script>
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['storeState'] = {} // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = {
// 内容标签页默认属性对象
name: '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
params: {}, // 参数, 由 this.$route.params 自动赋值
query: {}, // 查询参数, 由 this.$route.query 自动赋值
menuId: '', // 菜单id(用于选中侧边栏菜单,与this.$store.state.sidebarMenuActiveName进行匹配)
title: '', // 标题
isTab: true, // 是否通过tab展示内容?
iframeURL: '' // 是否通过iframe嵌套展示内容? (以http[s]://开头, 自动匹配)
}
window.SITE_CONFIG['menuList'] = [] // 左侧菜单列表(后台返回,未做处理)
window.SITE_CONFIG['dynamicRoutes'] = [] // 动态路由列表
window.SITE_CONFIG['dynamicMenuRoutes'] = [] // 动态(菜单)路由列表
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false // 动态(菜单)路由是否已经添加的状态标示(用于判断是否需要重新拉取数据并进行动态添加操作)
</script>
<!-- 打包命令示例 --> <head>
<!-- npm run build:sit --> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<!-- 站点配置 -->
<script>
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['storeState'] = {} // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = {
// 内容标签页默认属性对象
name: '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
params: {}, // 参数, 由 this.$route.params 自动赋值
query: {}, // 查询参数, 由 this.$route.query 自动赋值
menuId: '', // 菜单id(用于选中侧边栏菜单,与this.$store.state.sidebarMenuActiveName进行匹配)
title: '', // 标题
isTab: true, // 是否通过tab展示内容?
iframeURL: '' // 是否通过iframe嵌套展示内容? (以http[s]://开头, 自动匹配)
}
window.SITE_CONFIG['menuList'] = [] // 左侧菜单列表(后台返回,未做处理)
window.SITE_CONFIG['dynamicRoutes'] = [] // 动态路由列表
window.SITE_CONFIG['dynamicMenuRoutes'] = [] // 动态(菜单)路由列表
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false // 动态(菜单)路由是否已经添加的状态标示(用于判断是否需要重新拉取数据并进行动态添加操作)
</script>
<!-- 开发环境 --> <!-- 打包命令示例 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <!-- npm run build:sit -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.98:8080/api';</script> -->
<!-- <script> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.98:8080/api';</script> -->
<!-- <script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api' window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api'
</script> --> </script> -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> --> <!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> -->
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api' window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api'
// window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
<!-- 集成测试环境 dev --> <!-- 集成测试环境 dev -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = window.SITE_CONFIG['apiURL'] =
'http://epmet-dev.elinkservice.cn:48080/api' 'http://epmet-dev.elinkservice.cn:48080/api'
</script> </script>
<% } %> <% } %>
<!-- 验收测试环境 aliyun --> <!-- 验收测试环境 aliyun -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
</head> </head>
<body>
<div id="app"></div>
</body>
<body>
<div id="app"></div>
</body>
</html> </html>

35
epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss

@ -86,7 +86,7 @@
} }
.mw-show { .mw-show {
padding: 40px 0 100px; padding-top: 40px;
&.z-preview { &.z-preview {
position: fixed; position: fixed;
z-index: 100000; z-index: 100000;
@ -108,7 +108,7 @@
} }
.mw-phone { .mw-phone {
margin: 50px auto; margin: 50px auto;
min-height: 540px; min-height: 540px;
// box-shadow: 0 0 0 8px rgba(#000, 0.1); // box-shadow: 0 0 0 8px rgba(#000, 0.1);
.d-cpt-operate { .d-cpt-operate {
@ -129,7 +129,8 @@
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
width: 375px; width: 375px;
min-height: 500px; height: 560px;
overflow: auto;
background-color: #ffffff; background-color: #ffffff;
background-color: #f7f6f9; background-color: #f7f6f9;
box-shadow: 0 5px 15px 1px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 15px 1px rgba(0, 0, 0, 0.2);
@ -232,16 +233,16 @@
position: absolute; position: absolute;
top: -1000px; top: -1000px;
bottom: -1000px; bottom: -1000px;
right: -50px; right: 0px;
width: 50px; width: 50px;
padding: 5px 0; padding: 5px 0;
height: 200px; height: 200px;
margin: auto 0; margin: auto 0;
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
border-left: 1px solid #bb5; border: 1px solid #bb5;
background-color: #ffffff; background-color: #ffffff;
text-align: center; text-align: center;
z-index: 1000;
&.z-small { &.z-small {
height: 71px; height: 71px;
} }
@ -1138,3 +1139,25 @@
} }
} }
} }
.d-set-banners {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.upload-demos {
display: block;
width: 20px;
height: 20px;
color: #ccc;
text-align: center;
line-height: 18px;
border: 1px dashed #ccc;
overflow: hidden;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
}
}

9
epmet-oper-web/src/js/ajax.js

@ -179,15 +179,16 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data
if (data.sysresultcode === 'success') { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data.data, data.rspMsg) cb_su(data.data, data.msg + ":" + data.internalMsg)
} }
} else if (data.sysresultcode === 'fail') { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data) if (typeof cb_err === 'function') cb_err(data.msg + ":" + data.internalMsg, data.data)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === 'function') cb_err(res)

70
epmet-oper-web/src/js/columns/miniPro/partnerApp.js

@ -1,33 +1,41 @@
export default [{ export default [{
key: 'appId', key: 'appId',
title: '应用id', title: '应用id',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'appName', key: 'appName',
title: '应用名称', title: '应用名称',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'customerName', key: 'customerName',
title: '所属客户', title: '所属客户',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'secret', key: 'customerTypeName',
title: '秘钥', title: '客户类型',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 200 width: 100
}, },
{
key: 'secret',
title: '秘钥',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 200
},
] ]

42
epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue

@ -179,6 +179,19 @@
<img src="@/assets/img/modules/wx-mini/index-set/info.png"> <img src="@/assets/img/modules/wx-mini/index-set/info.png">
<span>{{ focusedCpt.configurationDescription }}</span> <span>{{ focusedCpt.configurationDescription }}</span>
</div> </div>
<div v-if="focusedCpt.componentFrontId === 'resi-functionList-heart-banner'" class="d-set-banners">
<span>Banner图</span>
<el-upload
class="upload-demos"
:show-file-list="false"
:on-success="handleBannerSuccess"
:before-upload="beforeBannerUpload"
:action="uploadUlr"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</el-form> </el-form>
<div class="d-operate"> <div class="d-operate">
@ -512,7 +525,8 @@ export default {
lastSavedCptList: [], lastSavedCptList: [],
focusedCpt: { focusedCpt: {
tempOnlyId: '' tempOnlyId: ''
} },
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload'
} }
}, },
@ -893,6 +907,32 @@ export default {
if (loading) { if (loading) {
loading.close() loading.close()
} }
},
// banner
beforeBannerUpload (file) {
console.log('file', file.size / 1024)
let testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
const imgs = ['png', 'PNG']
const extension = imgs.includes(testmsg)
const isLt2M = file.size / 1024 < 100
if (!extension) {
this.$message.error('上传图片只能是png格式!')
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 100KB!')
}
return extension && isLt2M
},
handleBannerSuccess (res, file) {
console.log('res', res)
console.log('files', file)
if (res.code === 0 && res.msg === 'success') {
this.focusedCpt.configuration = {
url: res.data.url
}
this.focusedCpt.configuration = JSON.stringify(this.focusedCpt.configuration)
}
} }
} }
} }

120
epmet-oper-web/src/views/modules/partner/app/edit.vue

@ -1,46 +1,46 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible"
:visible.sync="visible" :title="'编辑外部应用'"
:title="'编辑外部应用'" :close-on-click-modal="false"
:close-on-click-modal="false" :before-close="handleClose"
:before-close="handleClose" :close-on-press-escape="false">
:close-on-press-escape="false" <el-form :inline="true"
> :model="dataForm"
<el-form :rules="dataRule"
:inline="true" ref="dataForm"
:model="dataForm" :label-width="'120px'">
:rules="dataRule" <el-form-item label="应用名称"
ref="dataForm" prop="appName">
:label-width="'120px'" <el-input class="item_width_1"
> v-model="dataForm.appName"
<el-form-item label="应用名称" prop="appName"> placeholder="应用名称"></el-input>
<el-input
class="item_width_1"
v-model="dataForm.appName"
placeholder="应用名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属客户" prop="customerId"> <el-form-item label="所属客户"
<el-select prop="customerId">
class="item_width_1" <div>
v-model="dataForm.customerId" <el-radio-group v-model="dataForm.customerType"
placeholder="请选择" @change="onSelectedCustomerTypeChange">
clearable <el-radio label="external">外部客户</el-radio>
> <el-radio label="internal">内部客户</el-radio>
<el-option </el-radio-group>
v-for="item in customerList" </div>
:key="item.customerId" <el-select class="item_width_1"
:label="item.customerName" v-model="dataForm.customerId"
:value="item.customerId" placeholder="请选择"
> clearable>
<el-option v-for="item in customerList"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button> <el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="saveForm()">{{ <el-button type="primary"
@click="saveForm()">{{
$t("confirm") $t("confirm")
}}</el-button> }}</el-button>
</template> </template>
@ -58,7 +58,7 @@ const requestUrlPrefix = isMockEnv ? mockUrlPrefix : "";
let loading; // let loading; //
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
type: "", // A/U type: "", // A/U
@ -67,6 +67,7 @@ export default {
appName: "", appName: "",
customerId: "", customerId: "",
customerName: "", customerName: "",
customerType: "internal",
}, },
customerList: [ customerList: [
// { // {
@ -76,11 +77,11 @@ export default {
], ],
}; };
}, },
created() { mounted () {
this.queryCustomerList(); this.queryCustomerList();
}, },
computed: { computed: {
dataRule() { dataRule () {
return { return {
customerId: [ customerId: [
{ {
@ -100,7 +101,16 @@ export default {
}, },
}, },
methods: { methods: {
async queryCustomerList() { async queryCustomerList () {
if (this.dataForm.customerType === 'external') {
this.queryExternalCustomerList();
} else {
this.queryInternalCustomerList();
}
},
//
async queryExternalCustomerList () {
debugger
const { data, code, msg } = await requestPost( const { data, code, msg } = await requestPost(
requestUrlPrefix + "/commonservice/externalcustomer/list", requestUrlPrefix + "/commonservice/externalcustomer/list",
{ {
@ -108,27 +118,47 @@ export default {
pageSize: 1000, pageSize: 1000,
} }
); );
if (code === 0) { if (code === 0) {
this.customerList = data.list; this.customerList = data.list;
} }
}, },
init(dataForm, type) { //
queryInternalCustomerList () {
window.app.ajax.get(
"/oper/crm/customer/getvalidcustomerlist",
{},
(data, rspMsg) => {
this.customerList = data;
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}
)
},
//
onSelectedCustomerTypeChange (value) {
this.dataForm.customerType = value;
this.queryCustomerList();
},
init (dataForm, type) {
this.type = type; this.type = type;
this.visible = true; this.visible = true;
// this.dataForm=dataForm // this.dataForm=dataForm
this.$nextTick(() => { this.$nextTick(() => {
Object.assign(this.dataForm, dataForm); Object.assign(this.dataForm, dataForm);
this.queryCustomerList();
}); });
}, },
addRequest() { addRequest () {
this.dataForm.domainNameList.push(""); this.dataForm.domainNameList.push("");
}, },
delRequest(index) { delRequest (index) {
this.dataForm.domainNameList.splice(index, 1); this.dataForm.domainNameList.splice(index, 1);
}, },
saveForm() { saveForm () {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
this.$message.error("表单验证失败!"); this.$message.error("表单验证失败!");
@ -159,12 +189,12 @@ export default {
} }
}); });
}, },
handleClose() { handleClose () {
this.visible = false; this.visible = false;
}, },
// //
startLoading() { startLoading () {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: "正在加载……", // text: "正在加载……", //
@ -172,7 +202,7 @@ export default {
}); });
}, },
// //
endLoading() { endLoading () {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close(); loading.close();

44
epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue

@ -188,6 +188,19 @@
<img src="@/assets/img/modules/wx-mini/index-set/info.png"> <img src="@/assets/img/modules/wx-mini/index-set/info.png">
<span>{{ focusedCpt.configurationDescription }}</span> <span>{{ focusedCpt.configurationDescription }}</span>
</div> </div>
<div v-if="focusedCpt.componentFrontId === 'resi-functionList-heart-banner'" class="d-set-banners">
<span>Banner图</span>
<el-upload
class="upload-demos"
:show-file-list="false"
:on-success="handleBannerSuccess"
:before-upload="beforeBannerUpload"
:action="uploadUlr"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</el-form> </el-form>
<div class="d-operate"> <div class="d-operate">
@ -519,7 +532,8 @@ export default {
lastSavedCptList: [], lastSavedCptList: [],
focusedCpt: { focusedCpt: {
tempOnlyId: '' tempOnlyId: ''
} },
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload'
} }
}, },
@ -820,7 +834,7 @@ export default {
}, },
// //
focusCpt (item) { focusCpt (item) {
console.log('聚焦实例组件') console.log('聚焦实例组件', item)
if (this.isInPreview) return if (this.isInPreview) return
if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { if (this.focusedCpt.tempOnlyId === item.tempOnlyId) {
this.cleanFocusCpt() this.cleanFocusCpt()
@ -870,6 +884,32 @@ export default {
// //
shiftCptTypeItemUnfold (item) { shiftCptTypeItemUnfold (item) {
item.isUnfold = !item.isUnfold item.isUnfold = !item.isUnfold
},
// banner
beforeBannerUpload (file) {
console.log('file', file.size / 1024)
let testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
const imgs = ['png', 'PNG']
const extension = imgs.includes(testmsg)
const isLt2M = file.size / 1024 < 100
if (!extension) {
this.$message.error('上传图片只能是png格式!')
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 100KB!')
}
return extension && isLt2M
},
handleBannerSuccess (res, file) {
console.log('res', res)
console.log('files', file)
if (res.code === 0 && res.msg === 'success') {
this.focusedCpt.configuration = {
url: res.data.url
}
this.focusedCpt.configuration = JSON.stringify(this.focusedCpt.configuration)
}
} }
} }
} }

Loading…
Cancel
Save