Browse Source

上传代码联调

master
jiangyuying 5 years ago
parent
commit
318d1a81b7
  1. 3
      epmet-oper-web/.env.development
  2. 16
      epmet-oper-web/public/index.html
  3. 43
      epmet-oper-web/src/js/ajax.js
  4. 34
      epmet-oper-web/src/js/columns/code/commitCode.js
  5. 11
      epmet-oper-web/src/js/columns/code/temp.js
  6. 22
      epmet-oper-web/src/js/columns/customer/customer.js
  7. 36
      epmet-oper-web/src/views/components/CForm.vue
  8. 4
      epmet-oper-web/src/views/components/CTableNoPage.vue
  9. 117
      epmet-oper-web/src/views/modules/code/CommitForm.vue
  10. 168
      epmet-oper-web/src/views/modules/code/CommitList.vue
  11. 95
      epmet-oper-web/src/views/modules/code/SubmitForm.vue
  12. 34
      epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

3
epmet-oper-web/.env.development

@ -1,4 +1,5 @@
NODE_ENV=development
VUE_APP_API_SERVER = http://192.168.1.130:8080/api
# VUE_APP_API_SERVER = http://192.168.1.130:8080/api
VUE_APP_API_SERVER = http://10.10.10.98:8080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev

16
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">
@ -32,23 +33,26 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api';</script>
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> -->
<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';</script> -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> -->
<% } %>
<!-- 集成测试环境 dev -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://epmet-dev.elinkservice.cn:48080/api';</script>
<script>window.SITE_CONFIG['apiURL'] = 'http://epmet-dev.elinkservice.cn:48080/api';</script>
<% } %>
<!-- 验收测试环境 aliyun -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script>
<% } %>
<!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api';</script>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api';</script>
<% } %>
</head>
<body>
<div id="app"></div>
</body>
</html>
</html>

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

@ -101,6 +101,38 @@ axios.interceptors.response.use(
}
)
const post = (url, params, headers) => {
return new Promise((reslove, reject) => {
axios
.post(processUrl(url), params, headers)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err)
})
})
}
export const requestPost = async (url = '', params = {}, headers = {}) => {
const ret = await post(url, params, headers)
console.log(url, ret)
// if (ret.status === 200) {
// var data = res.data
// if (data.code == 0) {
// //业务成功
// if (typeof cb_su === 'function') {
// cb_su(data.data, data.msg)
// }
// } else {
// //业务失败
// if (typeof cb_err === 'function') cb_err(data.msg, data.data)
// }
// } else {
// if (typeof cb_err === 'function') cb_err(res)
// }
}
/*
* 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码
* 2res.data后台自定义的响应体包括
@ -199,6 +231,7 @@ export default {
}
})
},
post (url, data, cb_su, cb_err, headers) {
var h = {}
if (headers && JSON.stringify(headers) != '{}') {
@ -358,10 +391,10 @@ export default {
if (res.status === 200) {
var data = res.data //直接返回blob
if (data) {
if (data.code == 0) {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data, '操作成功')
cb_su(data.data, data.msg)
}
} else {
//业务失败
@ -423,9 +456,9 @@ export default {
var errorMsg = '操作失败'
let requestConfig = {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
},
'Content-Type': 'multipart/form-data'
// Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
}
}
Vue.http

34
epmet-oper-web/src/js/columns/code/commitCode.js

@ -196,23 +196,23 @@ export default {
display: ['formA', 'formU', 'model'],
block: false,
width: 120
},
{
key: 'extJson',
title: '小程序配置',
type: 'textarea',
rule: [{
required: true,
message: '请输入小程序配置',
trigger: 'blur'
}],
option: {
minRows: 5,
maxRows: 8,
rows: 6
},
display: ['formA', 'formU', 'model'],
block: false
}
// {
// key: 'extJson',
// title: '小程序配置',
// type: 'textarea',
// rule: [{
// required: true,
// message: '请输入小程序配置',
// trigger: 'blur'
// }],
// option: {
// minRows: 5,
// maxRows: 8,
// rows: 6
// },
// display: ['formA', 'formU', 'model'],
// block: false
// }
]
}

11
epmet-oper-web/src/js/columns/code/temp.js

@ -1,6 +1,6 @@
export default [
{
key: 'templateId',
key: 'id',
title: '版本ID',
type: 'select',
rule: [{
@ -11,7 +11,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
width: 60
},
{
key: 'userVersion',
@ -25,7 +25,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
width: 60
},
{
key: 'userDesc',
@ -37,7 +37,8 @@ export default [
trigger: 'blur'
}],
display: ['formA', 'formU', 'table', 'model'],
block: true
block: true,
width: 200
},
{
key: 'createTime',
@ -51,6 +52,6 @@ export default [
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
width: 80
}
]

22
epmet-oper-web/src/js/columns/customer/customer.js

@ -13,7 +13,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
width: 100
},
{
key: 'province',
@ -52,7 +52,14 @@ export default [
// },
{
key: 'partybranchnum',
title: '党支部数量',
title: '党支部',
display: ['formA', 'formU', 'table', 'model'],
block: true,
width: 60
},
{
key: 'phone',
title: '注册人电话',
display: ['formA', 'formU', 'table', 'model'],
block: true
},
@ -69,7 +76,8 @@ export default [
} else {
return '未知'
}
}
},
width: 60
},
{
key: 'workAuth',
@ -84,11 +92,12 @@ export default [
} else {
return '未知'
}
}
},
width: 60
},
{
key: 'initState',
title: '初始化状态',
title: '初始化',
display: ['formA', 'formU', 'table', 'model'],
block: true,
format: function (cellValue, index) {
@ -99,6 +108,7 @@ export default [
} else {
return '未知'
}
}
},
width: 80
}
]

36
epmet-oper-web/src/views/components/CForm.vue

@ -452,7 +452,7 @@ export default {
},
defaultNodeKey () {
return function (key, index) {
var keyid = this.columns[index].keyid// key
const keyid = this.columns[index].keyid// key
// alert(this.model[keyid])
/* if (!this.model[keyid]) {
return 0
@ -464,7 +464,7 @@ export default {
//
// imageUrl () {
// return function (key) {
// var picPath = this.model[key]
// const picPath = this.model[key]
// }
// },
},
@ -473,7 +473,7 @@ export default {
},
methods: {
getFile (aaa) {
// var bbb = aaa.target.files[0]
// const bbb = aaa.target.files[0]
},
assign (currentData) {
if (currentData) {
@ -531,29 +531,29 @@ export default {
},
//
handleClear (data, key, formIndex) {
var keyid = this.columns[formIndex].keyid// key
const keyid = this.columns[formIndex].keyid// key
this.model[keyid] = ''
this.model[key] = ''
this.$nextTick(() => {
var ref = 'tree_' + key
const ref = 'tree_' + key
this.$refs[ref][0].loadData(null, 0, [0], false)
})
},
multihandleClear (data, key, formIndex) {
var keyid = this.columns[formIndex].keyid// 获/* */key
const keyid = this.columns[formIndex].keyid// 获/* */key
this.model[keyid] = ''
this.model[key] = ''
// var keyid = this.columns[formIndex].keyid// key
// const keyid = this.columns[formIndex].keyid// key
// this.model[keyid] = ''
// this.model[key] = ''
},
// /
handleOk (data, key, formIndex) {
this.model[key] = data.label//
var keyid = this.columns[formIndex].keyid// key
var id = data.id
var p = /[a-z]/i
const keyid = this.columns[formIndex].keyid// key
const id = data.id
const p = /[a-z]/i
if (p.test(data.id.substring(0, 1))) { //
id = data.id.substring(1)
}
@ -571,7 +571,7 @@ export default {
handleName = handleNameArr.join(',')
handleId = handleIdArr.join(',')
this.model[key] = handleName
var keyid = this.columns[formIndex].keyid
const keyid = this.columns[formIndex].keyid
this.model[keyid] = handleId
},
handleDel (data, key, formIndex) {
@ -586,7 +586,7 @@ export default {
handleName = handleNameArr.join(',')
handleId = handleIdArr.join(',')
this.model[key] = handleName
var keyid = this.columns[formIndex].keyid
const keyid = this.columns[formIndex].keyid
this.model[keyid] = handleId
},
changePass (value) { // true:false:
@ -625,7 +625,7 @@ export default {
//
changeShow (showKeyArray, showIndexArray, showDefault, hideKeyArray, hideIndexArray) {
// debugger
for (var i = 0; i < showIndexArray.length; i++) {
for (const i = 0; i < showIndexArray.length; i++) {
// this.columns[showIndexArray[i]].showFlag = '1'
this.columns[showIndexArray[i]].show = true
if (this.columns[showIndexArray[i]].required) { //
@ -633,7 +633,7 @@ export default {
}
this.model[showKeyArray[i]] = showDefault[i]
}
for (var j = 0; j < hideIndexArray.length; j++) {
for (const j = 0; j < hideIndexArray.length; j++) {
// this.columns[showIndexArray[j]].showFlag = '1'
this.columns[hideIndexArray[j]].show = false
if (this.columns[hideIndexArray[j]].required) { //
@ -654,13 +654,13 @@ export default {
},
//
setDiyParams (key, index) {
var diyName = this.columns[index].diyParams.name
var diyValue = this.model[this.columns[index].diyParams.value]
const diyName = this.columns[index].diyParams.name
const diyValue = this.model[this.columns[index].diyParams.value]
if (diyValue === '' || diyValue === null) {
return {}
}
var paramsStr = '{"' + diyName + '":"' + diyValue + '"}'
var params = JSON.parse(paramsStr)
const paramsStr = '{"' + diyName + '":"' + diyValue + '"}'
const params = JSON.parse(paramsStr)
// alert(JSON.stringify(params))
return params
}

4
epmet-oper-web/src/views/components/CTableNoPage.vue

@ -112,7 +112,6 @@ export default {
}
},
props: {
keyword: {
type: String,
required: true
@ -178,6 +177,7 @@ export default {
this.loadData()
},
loadData () {
this.templateRadio = ''
this.loading = true
Object.keys(this.params).forEach(key => {
if (this.params[key] instanceof Array) {
@ -191,7 +191,7 @@ export default {
this.table.params,
(data, rspMsg) => {
if (data) {
this.tableData = data.list
this.tableData = data
}
this.loading = false
},

117
epmet-oper-web/src/views/modules/code/CommitForm.vue

@ -10,22 +10,24 @@
:option-data="optionData"></c-form>
<el-form :inline="true"
:model="dataForm">
<el-form-item label="版本功能说明"
prop="versionDesc"
label-width="150px"
:model="extJson"
:style="{margin:'0 auto',width:'100%',textAlign:'left'}">
<el-form-item label="小程序配置"
prop="json"
label-width="100px"
style="display:block">
<el-input type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:rows="3"
:autosize="{ minRows:5, maxRows: 8}"
:rows="6"
resize="none"
style="width:300px"
placeholder='请输入版本功能说明'
v-model="dataForm.versionDesc">
placeholder='请输入小程序配置'
v-model="extJson.json">
</el-input>
<el-button type="text"
<el-button type="primary"
style="margin-left:10px"
size="small"
@click="submitCode(scope.row.id)">移除</el-button>
@click="getExtJson">获取配置</el-button>
</el-form-item>
@ -39,7 +41,7 @@
:params="tableParams"
keyword="Temp"
:operations="operations"
@selTemp="selTemp">
@selectRadioRow="selectRadioRow">
</c-table>
</div>
@ -48,6 +50,7 @@
</template>
<script>
/* eslint-disable */
import CTable from '@c/CTableNoPage'
import CForm from '@c/CForm'
import { mapGetters } from 'vuex'
@ -55,8 +58,8 @@ export default {
data () {
return {
tempForm: {
// commitUrl:'/third/code/audit',
commitUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/audit',
commitUrl: '/third/code/upload',
// commitUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/audit',
method: 'A',
dataUrl: [], // //url
data: {
@ -72,10 +75,13 @@ export default {
]
}
},
extJson: {
json: ''
},
//
// tableUrl: '/third/code/templatelist',
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/templatelist',
selTempId: '',
tableUrl: '/third/code/templatelist',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/templatelist',
tableParams: {
type: Object, // table
default () {
@ -84,15 +90,6 @@ export default {
},
//
operations: [
// {
// lable: '', //
// size: 'mini',
// style: 'margin: 0 6px;',
// type: 'text',
// slot: '',
// plain: false,
// methodName: 'selTemp' //
// }
],
//
dialog: {
@ -105,15 +102,6 @@ export default {
CTable, CForm
},
mounted () {
let dataForm = {
customerId: '',
clientType: 'resi'
}
this.$nextTick(() => {
this.$refs['ref_form_temp'].assign(dataForm)
})
this.loadData()
},
computed: {
tableHeight () {
@ -130,23 +118,78 @@ export default {
}
},
methods: {
// eslint-disable-next-line
initData (dataForm) {
console.log(this.optionData);
if (!dataForm) {
dataForm = {
customerId: '',
clientType: 'resi'
}
}
console.log(dataForm)
this.$nextTick(() => {
this.$refs['ref_form_temp'].assign(dataForm)
this.loadData()
})
},
//
loadData () {
this.$nextTick(() => {
this.$refs.table.loadData() //
})
},
//
selTemp () {
//
getExtJson () {
const _data = this.$refs['ref_form_temp'].model
if (_data.customerId === '') {
this.$message.warning('请选择客户')
return false
}
const url = '/third/code/getextjson'
const param = {
customerId: _data.customerId,
clientType: _data.clientType
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.extJson.json = data
// this.$message.success('')
// eslint-disable-next-line
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
},
selectRadioRow (row) {
this.selTempId = row.id
},
resetData () {
this.selTempId = ''
this.extJson.json = ''
this.$refs['ref_form_temp'].resetForm()
},
commitCode () {
this.$refs['ref_form_temp'].validate((valid) => {
if (valid) {
if (this.extJson.json === '') {
this.$message.warning('请获取配置')
return
}
if (this.selTempId === '') {
this.$message.warning('请选择模板')
return
}
//
let _data = this.$refs['ref_form_temp'].model
_data.extJson = this.extJson.json
_data.templateId = this.selTempId
console.log(_data)
window.app.ajax.post(this.tempForm.commitUrl, _data,
(data, rspMsg) => {
this.$message.success('提交审核成功')
this.$message.success('上传成功')
this.$emit('commitConfirm')
},
(rspMsg, data) => {

168
epmet-oper-web/src/views/modules/code/CommitList.vue

@ -10,10 +10,10 @@
<el-form-item>
<el-select v-model="tableParams.customerId"
placeholder="客户">
<el-option v-for="item in form.data['client']"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId">
<el-option v-for="item in form.data['customerId']"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
@ -63,7 +63,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="commitCode()">上传代码</el-button>
@click="commitCodeDiaShow('')">上传代码</el-button>
</el-form-item>
</el-form>
@ -84,25 +84,26 @@
-
</div>
</el-card>
<c-dialog :title="commitDia.title"
<c-dialog :title="'上传代码'"
:visible="commitDia.visible"
:showConfirm="false"
@ok="commitCode"
@cancel="commitDiaCancel">
<commit-form ref="ref_commit_form"
:optionData="optionData"
@commitConfirm="commitConfirm"></commit-form>
</c-dialog>
<c-dialog :title="submitDia.title"
<c-dialog :title="'提交审核'"
:visible="submitDia.visible"
:dialogHeight="1.1"
@cancel="submitDiaCancel">
<submit-form ref="ref_submit_form"
:codeId="selCodeId"
:feedbackShow="feedbackShow"></submit-form>
</c-dialog>
<c-dialog :showFooter="false"
:title="operDia.title"
:title="'操作历史'"
:visible="operDia.visible"
@cancel="operDiaCancel">
<oper-history ref="ref_oper_history"></oper-history>
@ -110,9 +111,14 @@
<c-dialog :showFooter="false"
:title="'二维码'"
:visible="operDia.visible"
@cancel="operDiaCancel">
<oper-history ref="ref_oper_history"></oper-history>
:width="40"
:visible="qrCodeDia.visible"
@cancel="qrCodeDiaCancel">
<div style="text-align:center">
<el-image style="width: 300px; height: 300px"
:src="src"></el-image>
<div class="el-upload__tip">请用微信扫描二维码</div>
</div>
</c-dialog>
</div>
</template>
@ -128,6 +134,7 @@ export default {
data () {
return {
loading: false,
selCodeId: '', // id
//
tableParams: {
customerId: '', //
@ -137,8 +144,8 @@ export default {
submitDate: '' //
},
//
// tableUrl: '/third/code/uploadlist',
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist',
tableUrl: '/third/code/uploadlist',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist',
//
operations: [
{
@ -239,21 +246,23 @@ export default {
],
//
commitDia: {
title: '',
visible: false
},
optionData: Object,
//
feedbackShow: false,
submitDia: {
title: '',
visible: false
},
//
operDia: {
title: '',
visible: false
},
//
qrCodeDia: {
visible: false
},
src: '',
//
form: {
dataUrl: [], // //url
@ -310,26 +319,17 @@ export default {
CDialog, SubmitForm, CommitForm, OperHistory, CTable
},
activated () {
let params = this.$route.params
//
if (params.showCommit) {
this.commitCodeDiaShow(params.customerId)
}
this.$nextTick(() => {
this.$refs.table.doLayout() //
})
},
mounted () {
let params = this.$route.params
//
if (params.showCommit) {
this.commitDia.title = '上传代码'
this.commitDia.visible = true
let dataForm = {
clientType: '工作端',
client: params.name
}
this.$nextTick(() => {
this.$refs['ref_commit_form'].initData(dataForm)
})
}
this.renderSelData()
this.loadData()
},
@ -346,24 +346,33 @@ export default {
this.$refs.table.loadData() //
})
},
//
commitCode (id) {
this.form.data['customerId'] = this.form.data['client']
//
commitCodeDiaShow (customerId) {
// this.form.data['customerId'] = this.form.data['client']
this.optionData = this.form.data
this.commitDia.title = '上传代码'
this.commitDia.visible = true
this.$nextTick(() => {
let dataForm = {
clientType: 'resi',
customerId: customerId
}
this.$refs['ref_commit_form'].initData(dataForm)
})
},
//
async commitCode () {
//
await this.$refs['ref_commit_form'].commitCode()
},
//
submitCode (row) {
this.selCodeId = row.id
// if (row.status === 'audit_failed') {
this.feedbackShow = true
// }
this.submitDia.title = '提交审核'
this.submitDia.visible = true
},
submitDiaCancel () {
this.submitDia.title = ''
this.submitDia.visible = false
},
//
@ -371,8 +380,23 @@ export default {
},
//
showQRCode (id) {
showQRCode (row) {
this.qrCodeDia.visible = true
const url = '/third/code/qrcode'
const param = {
codeId: row.id
}
window.app.ajax.exportFilePost(url, param,
(data, rspMsg) => {
if (data) {
// eslint-disable-next-line
// debugger
this.src = window.URL.createObjectURL(data.qrcode)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'image/jpeg' } })
},
//
issueCode (id) {
@ -384,7 +408,6 @@ export default {
},
//
operHistory (id) {
this.operDia.title = '操作历史'
this.operDia.visible = true
},
//
@ -393,37 +416,50 @@ export default {
this.loadData()
},
commitDiaCancel () {
this.commitDia.title = ''
this.$refs['ref_commit_form'].resetData()
this.commitDia.visible = false
},
operDiaCancel () {
this.operDia.title = ''
this.operDia.visible = false
},
renderSelData () { // //
this.form.dataUrl = []
this.form.dataUrl.push({ //
key: 'client', // bean.jskey
url: '/oper/crm/customer/getvalidcustomerlist',
params: {}
})
window.app.ajax.all( //
this.form.dataUrl,
data => {
data.forEach((oneData, index) => { //
var key = this.form.dataUrl[index].key
this.form.data[key] = oneData
})
qrCodeDiaCancel () {
this.qrCodeDia.visible = false
},
async renderSelData () { // //
const customerUrl = '/third/pacustomer/registerbyauth'
// const customerUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerbyauth'
const param = {
initState: 1,
resiAuth: 1,
workAuth: 1
}
this.form.data['client'].forEach((oneData, index) => { //
oneData.value = oneData.customerId
oneData.label = oneData.customerName
})
this.$forceUpdate()
}
)
}
await window.app.ajax.post(customerUrl, param,
(data, rspMsg) => {
if (data) {
let customerList = []
data.forEach(element => {
let oneObj = {
value: element.customerId,
label: element.customerName
}
customerList.push(oneObj)
})
this.form.data.customerId = customerList
this.$forceUpdate()
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}
}
}
</script>
<style>
.el-upload__tip {
color: rgb(155, 155, 155);
}
</style>

95
epmet-oper-web/src/views/modules/code/SubmitForm.vue

@ -165,9 +165,9 @@
align="center"
width="80">
<template slot-scope="scope">
<el-button type="text"
<!-- <el-button type="text"
size="small"
@click="submitCode(scope.row.id)">移除</el-button>
@click="submitCode(scope.row.id)">移除</el-button> -->
</template>
</el-table-column>
@ -192,6 +192,7 @@ export default {
data () {
return {
loading: false,
// codeId: '', // codeId
dataForm: {
versionDesc: '', //
previewInfo: { //
@ -271,13 +272,11 @@ export default {
},
//
uploadVedio: function (params) {
// eslint-disable-next-line
debugger
let self = this
let file = params.file
let fileType = file.type
let isVideo = fileType.indexOf('video') !== -1
let fileUrl = self.$refs.upload.uploadFiles[0].url
// let fileUrl = self.$refs.upload.uploadFiles[0].url
let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
@ -306,25 +305,24 @@ export default {
self.$refs.upload.uploadFiles = []
return
}
let videoDiv = document.createElement('video')
videoDiv.src = fileUrl
self.upload_name = 'file_video[]'
self.uploadFile(file, fileType)
// let videoDiv = document.createElement('video')
// videoDiv.src = fileUrl
videoDiv.onloadeddata = function (event) {
//
self.upload_url = '你的视频上传URL'
self.upload_name = 'file_video[]'
self.uploadFile(file, isVideo, videoDiv)
}
// videoDiv.onloadeddata = function (event) {
// //
// self.upload_name = 'file_video[]'
// self.uploadFile(file, fileType, isVideo, videoDiv)
// }
},
//
uploadPic: function (params) {
// eslint-disable-next-line
debugger
console.log(this.codeId)
let self = this
let file = params.file
let fileType = file.type
let isImage = fileType.indexOf('image') !== -1
let fileUrl = self.$refs.upload.uploadFiles[0].url
let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
@ -343,43 +341,26 @@ export default {
self.$refs.upload.uploadFiles = []
return
}
let img = new Image()
img.src = fileUrl
img.onload = function () {
//
self.upload_url = '你的图片上传URL'
self.upload_name = 'file_img[]'
self.uploadFile(file, '', '')
}
self.upload_name = 'file_img[]'
self.uploadFile(file, fileType)
},
uploadFile: function (file, isVideo, videoDiv) {
let self = this
uploadFile: function (file, fileType) {
// const uploadUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/mediaupload'
const uploadUrl = '/third/code/mediaupload'
let formData = new FormData()
formData.append(self.upload_name, file)
// axios.post(self.upload_url, formData, { headers: { 'Content-Type': 'multipart/form-data' } })
// .then(function (res) {
// if (res.result === '0000') {
// self.ad_url = res.data[0]
// // video
// if (isVideo) {
// let liItem = document.getElementsByClassName('el-upload-list__item')[0]
// videoDiv.style.width = '278px'
// videoDiv.style.height = '415px'
// liItem.prepend(videoDiv)
// }
// return
// }
// this.$message({
// message: '',
// type: 'error'
// })
// self.$refs.upload.uploadFiles = []
// })
// .catch(function (err) {
// console.error(err)
// })
// // eslint-disable-next-line
// debugger
formData.append('type', fileType)
formData.append('media', file)
formData.append('codeId', this.codeId)
window.app.ajax.post(uploadUrl, formData,
(data, rspMsg) => {
this.$message.success(rspMsg)
this.beforeClose()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
},
//
commitCode (id) {
@ -390,24 +371,20 @@ export default {
submitCode (id) {
},
//
submitRecall (id) {
},
//
submitFailReason (id) {
},
handleCancel () {
this.dialog.title = ''
this.dialog.visible = false
}
},
props: {
feedbackShow: {
type: Boolean,
default: false
},
codeId: {
type: String,
required: true
}
}
}

34
epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

@ -18,14 +18,15 @@
</el-form-item>
</el-form>
<c-table column-type="index"
<c-table column-type=""
ref="table"
:url="tableUrl"
:params="tableParams"
keyword="RegisterInfo"
:operations="operations"
:tableHeight="tableHeight"
@commitCode="commitCode">
@commitCode="commitCode"
@init="init">
</c-table>
</div>
@ -64,7 +65,7 @@ export default {
plain: false,
methodName: 'init', //
isShow: function (row) {
if (row.initState === 0) {
if (row.initState === 0 && row.resiAuth === 1 && row.workAuth === 1) {
return true
} else {
return false
@ -80,7 +81,7 @@ export default {
plain: false,
methodName: 'commitCode', //
isShow: function (row) {
if (row.resiAuth === 1 && row.workAuth === 1) {
if (row.initState === 1) {
return true
} else {
return false
@ -137,8 +138,10 @@ export default {
resi: '未授权',
work: '已授权'
}
]
],
//
initUrl: '/oper/crm/customer/init'
}
},
components: {
@ -164,17 +167,28 @@ export default {
this.$refs.table.loadData()
},
//
init (id) {
init (row) {
const param = {
customerId: row.customerId
}
window.app.ajax.post(this.initUrl, param,
(data, rspMsg) => {
this.$message.success('初始化成功')
this.loadData()
// eslint-disable-next-line
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
},
//
commitCode (id) {
commitCode (row) {
this.$router.push({
'name': 'code-CommitList',
'params': {
showCommit: true,
id: '1',
name: '市北区政府'
customerId: row.customerId,
name: row.agencyName
}
})
}

Loading…
Cancel
Save