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. 2
      epmet-oper-web/public/index.html
  2. 33
      epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss
  3. 9
      epmet-oper-web/src/js/ajax.js
  4. 8
      epmet-oper-web/src/js/columns/miniPro/partnerApp.js
  5. 42
      epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue
  6. 78
      epmet-oper-web/src/views/modules/partner/app/edit.vue
  7. 44
      epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue

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

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
@ -66,4 +67,5 @@
<body>
<div id="app"></div>
</body>
</html>

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

@ -86,7 +86,7 @@
}
.mw-show {
padding: 40px 0 100px;
padding-top: 40px;
&.z-preview {
position: fixed;
z-index: 100000;
@ -129,7 +129,8 @@
position: relative;
margin: 0 auto;
width: 375px;
min-height: 500px;
height: 560px;
overflow: auto;
background-color: #ffffff;
background-color: #f7f6f9;
box-shadow: 0 5px 15px 1px rgba(0, 0, 0, 0.2);
@ -232,16 +233,16 @@
position: absolute;
top: -1000px;
bottom: -1000px;
right: -50px;
right: 0px;
width: 50px;
padding: 5px 0;
height: 200px;
margin: auto 0;
border-radius: 0 4px 4px 0;
border-left: 1px solid #bb5;
border: 1px solid #bb5;
background-color: #ffffff;
text-align: center;
z-index: 1000;
&.z-small {
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) => {
if (res) {
if (res.status === 200) {
var data = res.data
if (data.sysresultcode === 'success') {
if (data.code == 0) {
//业务成功
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 {
if (typeof cb_err === 'function') cb_err(res)

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

@ -22,6 +22,14 @@ export default [{
block: true,
width: 100
},
{
key: 'customerTypeName',
title: '客户类型',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 100
},
{
key: 'secret',
title: '秘钥',

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">
<span>{{ focusedCpt.configurationDescription }}</span>
</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>
<div class="d-operate">
@ -512,7 +525,8 @@ export default {
lastSavedCptList: [],
focusedCpt: {
tempOnlyId: ''
}
},
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload'
}
},
@ -893,6 +907,32 @@ export default {
if (loading) {
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)
}
}
}
}

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

@ -1,46 +1,46 @@
<template>
<el-dialog
:visible.sync="visible"
<el-dialog :visible.sync="visible"
:title="'编辑外部应用'"
:close-on-click-modal="false"
:before-close="handleClose"
:close-on-press-escape="false"
>
<el-form
:inline="true"
:close-on-press-escape="false">
<el-form :inline="true"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="'120px'"
>
<el-form-item label="应用名称" prop="appName">
<el-input
class="item_width_1"
:label-width="'120px'">
<el-form-item label="应用名称"
prop="appName">
<el-input class="item_width_1"
v-model="dataForm.appName"
placeholder="应用名称"
></el-input>
placeholder="应用名称"></el-input>
</el-form-item>
<el-form-item label="所属客户" prop="customerId">
<el-select
class="item_width_1"
<el-form-item label="所属客户"
prop="customerId">
<div>
<el-radio-group v-model="dataForm.customerType"
@change="onSelectedCustomerTypeChange">
<el-radio label="external">外部客户</el-radio>
<el-radio label="internal">内部客户</el-radio>
</el-radio-group>
</div>
<el-select class="item_width_1"
v-model="dataForm.customerId"
placeholder="请选择"
clearable
>
<el-option
v-for="item in customerList"
clearable>
<el-option v-for="item in customerList"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId"
>
:value="item.customerId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="saveForm()">{{
<el-button type="primary"
@click="saveForm()">{{
$t("confirm")
}}</el-button>
</template>
@ -67,6 +67,7 @@ export default {
appName: "",
customerId: "",
customerName: "",
customerType: "internal",
},
customerList: [
// {
@ -76,7 +77,7 @@ export default {
],
};
},
created() {
mounted () {
this.queryCustomerList();
},
computed: {
@ -101,6 +102,15 @@ export default {
},
methods: {
async queryCustomerList () {
if (this.dataForm.customerType === 'external') {
this.queryExternalCustomerList();
} else {
this.queryInternalCustomerList();
}
},
//
async queryExternalCustomerList () {
debugger
const { data, code, msg } = await requestPost(
requestUrlPrefix + "/commonservice/externalcustomer/list",
{
@ -108,10 +118,29 @@ export default {
pageSize: 1000,
}
);
if (code === 0) {
this.customerList = data.list;
}
},
//
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.visible = true;
@ -119,6 +148,7 @@ export default {
this.$nextTick(() => {
Object.assign(this.dataForm, dataForm);
this.queryCustomerList();
});
},
addRequest () {

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">
<span>{{ focusedCpt.configurationDescription }}</span>
</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>
<div class="d-operate">
@ -519,7 +532,8 @@ export default {
lastSavedCptList: [],
focusedCpt: {
tempOnlyId: ''
}
},
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload'
}
},
@ -820,7 +834,7 @@ export default {
},
//
focusCpt (item) {
console.log('聚焦实例组件')
console.log('聚焦实例组件', item)
if (this.isInPreview) return
if (this.focusedCpt.tempOnlyId === item.tempOnlyId) {
this.cleanFocusCpt()
@ -870,6 +884,32 @@ export default {
//
shiftCptTypeItemUnfold (item) {
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